Commit: 3fcc5520fde9373e9f4e97f002fb2a33bd859960
Author: Campbell Barton
Date:   Wed Dec 24 14:51:35 2014 +1100
Branches: blender-v2.73-release
https://developer.blender.org/rB3fcc5520fde9373e9f4e97f002fb2a33bd859960

Fix rna paint update callbacks assuming meshes

===================================================================

M       source/blender/makesrna/intern/rna_sculpt_paint.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c 
b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 0463250..8e83543 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -304,22 +304,27 @@ static void rna_ImaPaint_viewport_update(Main 
*UNUSED(bmain), Scene *UNUSED(scen
 static void rna_ImaPaint_mode_update(Main *UNUSED(bmain), Scene *scene, 
PointerRNA *UNUSED(ptr))
 {
        Object *ob = OBACT;
-       
-       /* of course we need to invalidate here */
-       BKE_texpaint_slots_refresh_object(scene, ob);
 
-       /* we assume that changing the current mode will invalidate the uv 
layers so we need to refresh display */
-       GPU_drawobject_free(ob->derivedFinal);
-       BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
-       WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
+       if (ob && ob->type == OB_MESH) {
+               /* of course we need to invalidate here */
+               BKE_texpaint_slots_refresh_object(scene, ob);
+
+               /* we assume that changing the current mode will invalidate the 
uv layers so we need to refresh display */
+               GPU_drawobject_free(ob->derivedFinal);
+               BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, 
NULL);
+               WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
+       }
 }
 
 static void rna_ImaPaint_stencil_update(Main *UNUSED(bmain), Scene *scene, 
PointerRNA *UNUSED(ptr))
 {
-       Object *ob = OBACT;     
-       GPU_drawobject_free(ob->derivedFinal);
-       BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
-       WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
+       Object *ob = OBACT;
+
+       if (ob && ob->type == OB_MESH) {
+               GPU_drawobject_free(ob->derivedFinal);
+               BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, 
NULL);
+               WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
+       }
 }
 
 static void rna_ImaPaint_canvas_update(Main *bmain, Scene *scene, PointerRNA 
*UNUSED(ptr))

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to