diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-01-23 09:56:44 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-01-23 09:56:44 +0400 |
commit | 2d8637946b047a8a9cc3fb6fe6d146b9961f92a6 (patch) | |
tree | ff566a91ca6c45d67b310fec8c990b801a7f0ba2 /source/blender/editors/object | |
parent | 089cf12435dfbc4b934a73b73ecd617b27ac678d (diff) |
rigidbody: Add rigid body simulation
Add operators to add/remove rigid body world and objects.
Add UI scripts.
The rigid body simulation works on scene level and overrides the
position/orientation of rigid bodies when active.
It does not deform meshes or generate data so there is no modifier.
Usage:
* Add rigid body world in the scene tab
* Create a group
* Add objects to the group
* Assign group to the rigid body world
* Play animation
For convenience the rigid body tools operators in the tools panel of the 3d view
will add a world, group and add objects to the group automatically so you only have
to press one button to add/remove rigid bodies to the simulation.
Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 897aeb74482..b7ac93c5996 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1697,7 +1697,11 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base BLI_addhead(&scene->base, basen); /* addhead: prevent eternal loop */ basen->object = obn; - if (basen->flag & OB_FROMGROUP) { + /* 1) duplis should end up in same group as the original + * 2) Rigid Body sim participants MUST always be part of a group... + */ + // XXX: is 2) really a good measure here? + if ((basen->flag & OB_FROMGROUP) || ob->rigidbody_object) { Group *group; for (group = bmain->group.first; group; group = group->id.next) { if (object_in_group(ob, group)) |