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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-08-26 12:39:56 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-09-17 20:21:39 +0300
commit627132496d18c09a79899a23e3b964da2b9ad080 (patch)
treede47cdc5c4e6b2cc674e7b8729cef979c3dc9f71 /source/blender
parentb248ec97769fa654a3ee8bb2a643046b79e7c030 (diff)
Fix T80131: Rigid Body World Field Weights dont have a proper RNA path
(e.g. cannot be animated) An RNA path is mandatory for RNA_path_from_ID_to_property, and for EffectorWeights, this has to be provided using RNA_def_struct_path_func (since this struct is shared across ParticleSettings, Modifiers and Rigid Body World). Without this, the animation system cannot work and e.g. keyframes cannot be inserted. The case for Rigid Body World in rna_EffectorWeight_path was missing, now added. Rigid Body World Field Weights are capable of being animated, tested with file from T80131 (e.g. gravity, wind). Maniphest Tasks: T80131 Differential Revision: https://developer.blender.org/D8713
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 4c22890887a..2c740533dcd 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -26,6 +26,7 @@
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_pointcache_types.h"
+#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "RNA_define.h"
@@ -777,7 +778,18 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
}
}
else {
- Object *ob = (Object *)ptr->owner_id;
+ ID *id = ptr->owner_id;
+
+ if (id && GS(id->name) == ID_SCE) {
+ const Scene *scene = (Scene *)id;
+ const RigidBodyWorld *rbw = scene->rigidbody_world;
+
+ if (rbw->effector_weights == ew) {
+ return BLI_strdup("rigidbody_world.effector_weights");
+ }
+ }
+
+ Object *ob = (Object *)id;
ModifierData *md;
/* check softbody modifier */