[Bf-blender-cvs] [5a6f9fd] master: Fix T42239, missing redraw notifier when switching collision shapes.

Lukas Tönne noreply at git.blender.org
Wed Oct 15 11:41:06 CEST 2014


Commit: 5a6f9fd84dc2f2526b088122a514205b03f689c3
Author: Lukas Tönne
Date:   Wed Oct 15 11:36:06 2014 +0200
Branches: master
https://developer.blender.org/rB5a6f9fd84dc2f2526b088122a514205b03f689c3

Fix T42239, missing redraw notifier when switching collision shapes.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c
index 78cd8d4..86a8b16 100644
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -94,6 +94,8 @@ static EnumPropertyItem rigidbody_mesh_source_items[] = {
 #include "BKE_depsgraph.h"
 #include "BKE_rigidbody.h"
 
+#include "WM_api.h"
+
 #define RB_FLAG_SET(dest, value, flag) { \
 	if (value) \
 		dest |= flag; \
@@ -151,6 +153,15 @@ static void rna_RigidBodyOb_reset(Main *UNUSED(bmain), Scene *scene, PointerRNA
 	BKE_rigidbody_cache_reset(rbw);
 }
 
+static void rna_RigidBodyOb_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	Object *ob = ptr->id.data;
+	
+	rna_RigidBodyOb_reset(bmain, scene, ptr);
+	
+	WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
+}
+
 static void rna_RigidBodyOb_shape_reset(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
 {
 	RigidBodyWorld *rbw = scene->rigidbody_world;
@@ -797,7 +808,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
 	RNA_def_property_enum_funcs(prop, NULL, "rna_RigidBodyOb_shape_set", NULL);
 	RNA_def_property_ui_text(prop, "Collision Shape", "Collision Shape of object in Rigid Body Simulations");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_update");
 	
 	prop = RNA_def_property(srna, "kinematic", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_KINEMATIC);




More information about the Bf-blender-cvs mailing list