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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-12-10 17:01:32 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-12-10 17:10:29 +0300
commit7f98ba4725f992e7f982ed4f0f7e910790380de3 (patch)
tree8dd0cc2da5e362749c766c83091131757a7adaba /source/blender/blenkernel/BKE_rigidbody.h
parent073a011f91a52cf1648b2d76606f0f2fff412098 (diff)
Proper fix for rigidbody collections's objects missing rb data.
We cannot let those data be generated on-the-fly in RBW evaluation anymore, since those would be added to CoW eval object and never ported back to orig objects. We *could* get orig objects in eval code, of course, but as in constratints, this is not really threadsafe and future proof, depsgraph evaluation should really write back to orig data as little as possible. So instead, add code to ensure required data is generated to objects when their collection is added to rigidbody world. Note that we *may* want to clean that up once collection is no more used by RB? On the other hand, people might want to keep those data around to be able to switch between different setups easily... So think it's OK to keep them at least for now.
Diffstat (limited to 'source/blender/blenkernel/BKE_rigidbody.h')
-rw-r--r--source/blender/blenkernel/BKE_rigidbody.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_rigidbody.h b/source/blender/blenkernel/BKE_rigidbody.h
index 1fa8106d63b..4d652326a14 100644
--- a/source/blender/blenkernel/BKE_rigidbody.h
+++ b/source/blender/blenkernel/BKE_rigidbody.h
@@ -66,6 +66,10 @@ struct RigidBodyWorld *BKE_rigidbody_create_world(struct Scene *scene);
struct RigidBodyOb *BKE_rigidbody_create_object(struct Scene *scene, struct Object *ob, short type);
struct RigidBodyCon *BKE_rigidbody_create_constraint(struct Scene *scene, struct Object *ob, short type);
+/* Ensure newly set collections' objects all have required data. */
+void BKE_rigidbody_objects_collection_validate(struct Scene *scene, struct RigidBodyWorld *rbw);
+void BKE_rigidbody_constraints_collection_validate(struct Scene *scene, struct RigidBodyWorld *rbw);
+
/* copy */
struct RigidBodyWorld *BKE_rigidbody_world_copy(struct RigidBodyWorld *rbw, const int flag);
void BKE_rigidbody_world_groups_relink(struct RigidBodyWorld *rbw);