[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54407] trunk/blender/source/blender/ editors/physics/rigidbody_object.c: rigidbody: Add missing updates for rigidbody operators

Sergej Reich sergej.reich at googlemail.com
Sat Feb 9 11:04:29 CET 2013


Revision: 54407
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54407
Author:   sergof
Date:     2013-02-09 10:04:29 +0000 (Sat, 09 Feb 2013)
Log Message:
-----------
rigidbody: Add missing updates for rigidbody operators

Fixes cache not being invalidated when using change collision shape and
calculate mass operators.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/physics/rigidbody_object.c

Modified: trunk/blender/source/blender/editors/physics/rigidbody_object.c
===================================================================
--- trunk/blender/source/blender/editors/physics/rigidbody_object.c	2013-02-09 10:04:27 UTC (rev 54406)
+++ trunk/blender/source/blender/editors/physics/rigidbody_object.c	2013-02-09 10:04:29 UTC (rev 54407)
@@ -338,12 +338,14 @@
 			/* use RNA-system to change the property and perform all necessary changes */
 			RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr);
 			RNA_enum_set(&ptr, "collision_shape", shape);
+
+			DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 		}
 	}
 	CTX_DATA_END;
 
 	/* send updates */
-	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); // XXX: wrong notifiers for now, but these also do the job...
+	WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
 
 	/* done */
 	return OPERATOR_FINISHED;
@@ -584,12 +586,14 @@
 			/* use RNA-system to change the property and perform all necessary changes */
 			RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr);
 			RNA_float_set(&ptr, "mass", mass);
+
+			DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 		}
 	}
 	CTX_DATA_END;
 
 	/* send updates */
-	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); // XXX: wrong notifiers for now, but these also do the job...
+	WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
 
 	/* done */
 	return OPERATOR_FINISHED;




More information about the Bf-blender-cvs mailing list