[Bf-blender-cvs] [627132496d1] master: Fix T80131: Rigid Body World Field Weights dont have a proper RNA path (e.g. cannot be animated)

Philipp Oeser noreply at git.blender.org
Thu Sep 17 19:28:56 CEST 2020


Commit: 627132496d18c09a79899a23e3b964da2b9ad080
Author: Philipp Oeser
Date:   Wed Aug 26 11:39:56 2020 +0200
Branches: master
https://developer.blender.org/rB627132496d18c09a79899a23e3b964da2b9ad080

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

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

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

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

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 */



More information about the Bf-blender-cvs mailing list