added back scene/object update function, its needed for multipaint switching.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 18 Sep 2011 03:29:17 +0000 (03:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 18 Sep 2011 03:29:17 +0000 (03:29 +0000)
source/blender/makesrna/intern/rna_scene.c

index 3e7b169..b176b30 100644 (file)
@@ -1044,6 +1044,22 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
        }
 }
 
+/* Jason */
+
+/* note: without this, when Multi-Paint is activated/deactivated, the colors
+ * will not change right away when multiple bones are selected, this function
+ * is not for general use and only for the few cases where changing scene
+ * settings and NOT for general purpose updates, possibly this should be
+ * given its own notifier. */
+static void rna_Scene_update_active_object_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+       Object *ob= OBACT;
+       if(ob) {
+               DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+               WM_main_add_notifier(NC_OBJECT|ND_DRAW, &ob->id);
+       }
+}
+
 #else
 
 static void rna_def_transform_orientation(BlenderRNA *brna)
@@ -1124,10 +1140,10 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 
        prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1);
-       RNA_def_property_ui_text(prop, "WPaint Multi-Paint", 
-               "Paint across all selected bones while "
-                "weight painting");
-       RNA_def_property_update(prop, NC_GEOM|ND_DATA, 0);
+       RNA_def_property_ui_text(prop, "WPaint Multi-Paint",
+                                "Paint across all selected bones while "
+                                "weight painting");
+       RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
 
        prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "vpaint");