Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_rigidbody.c')
-rw-r--r--source/blender/makesrna/intern/rna_rigidbody.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c
index 325c4e3caa9..264b0da8e0a 100644
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -35,6 +35,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "DEG_depsgraph_build.h"
+
#include "WM_types.h"
/* roles of objects in RigidBody Sims */
@@ -218,6 +220,7 @@ static void rna_RigidBodyOb_shape_update(Main *bmain, Scene *scene, PointerRNA *
Object *ob = (Object *)ptr->owner_id;
rna_RigidBodyOb_reset(bmain, scene, ptr);
+ DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
@@ -233,6 +236,16 @@ static void rna_RigidBodyOb_shape_reset(Main *UNUSED(bmain), Scene *scene, Point
}
}
+static void rna_RigidBodyOb_mesh_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Object *ob = (Object *)ptr->owner_id;
+
+ rna_RigidBodyOb_reset(bmain, scene, ptr);
+ DEG_relations_tag_update(bmain);
+
+ WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
+}
+
static char *rna_RigidBodyOb_path(PointerRNA *UNUSED(ptr))
{
/* NOTE: this hardcoded path should work as long as only Objects have this */
@@ -1026,7 +1039,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Mesh Source", "Source of the mesh used to create collision shape");
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_mesh_source_update");
/* booleans */
prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);