Fix T42239, missing redraw notifier when switching collision shapes.

This commit is contained in:
Lukas Tönne 2014-10-15 11:36:06 +02:00
parent 6d3757a3ce
commit 5a6f9fd84d
Notes: blender-bot 2023-02-14 10:48:33 +01:00
Referenced by issue #42239, Rigid body: Collision shape issues
1 changed files with 12 additions and 1 deletions

View File

@ -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);