1
$\begingroup$

I am using Animation Nodes' Object Instancer to duplicate an object with Rigid body settings. A far as I can tell, the physics settings are being duplicated on the cloned objects, but the physics engine is not recognizing the clones i.e. their outline is not green and the clones do not interact. Thanks.

$\endgroup$
7
  • $\begingroup$ did you try to enable the "Copy Full Object" checkbox? $\endgroup$ Jul 7, 2016 at 12:41
  • $\begingroup$ Yes I have enabled that setting.Rigid body settings (animated, etc.) are being cloned, but the engine ignores it (and its outline is not green). I can toggle Rigid Body off and on, and the clone object works as expected. $\endgroup$ Jul 7, 2016 at 12:43
  • 1
    $\begingroup$ ok, I just tested it. The problem is that the instances are not in the group named "RigidBodyWorld". You can use a loop and the Object Group Operations node to link all instances to the group. I created a todo on github to make this easier in the future: github.com/JacquesLucke/animation_nodes/issues/574 $\endgroup$ Jul 7, 2016 at 12:52
  • $\begingroup$ I added the Object Group Op. node and tied to RigidBody... group. When I examine the cloned object, it is a member of that group. Also, the cloned object's outline is green. Sadly, the physics engine ignores the clones until I manually toggle Rigid Body as before. BTW I am using AN to stack N cubes and running a sphere though the stack. $\endgroup$ Jul 7, 2016 at 13:04
  • $\begingroup$ Did you disable Auto Execution when you start the simulation? Otherwise AN resets the location of the objects all the time. $\endgroup$ Jul 7, 2016 at 13:08

1 Answer 1

4
$\begingroup$

Kudos to Jacques Lucke for actually providing the solution in the comments above.

There are two conditions for an object to be considered in rigid body simulations:

A) Settings

The object has to include the actual settings for physics, accessible in the Physics tab of the Property area.

If you use Animation Nodes' Object Instancer to duplicate an object which already is set up for rigid body physics, then these settings will only be duplicated if Copy Full Object is selected.

copy full object

B) Group

Blender does only simulate objects which are in a special group called Rigid Body World. Enabling rigid body physics on an object in Blender's native interface does automatically create such a group, assign it to the scene (visible in the Scene tab of the Properties area) and add the object to that group.

Duplicating an object with Animation Nodes however does not copy that group information. Instanced objects have to be manually added, e.g. with the Object Group Operation node.

To add all instances of an object:

  • Press Shift+A in the Node Editor and select Subprograms > Loop to add a Loop Input node
  • Click on New Iterator and type Object List Enter
  • Press Shift+A again to add the Object > Group Operations node.
  • In this node, click on the empty field of the first input node and choose the Rigid Body World group, named RigidBodyWorld by default.
    (If this group doesn't exist yet then you have to assign physics to some object first.)
  • Connect the Object output of the Loop Input node with the matching input socket of the Object Group Operations node.
  • (The Linked checkbox has to be enabled to add the objects to the group, but it should be by default.)

loop and group operations

  • Press Shift+A again, select Subprograms > Invoke Subprogram > My Loop (or however you might have called it) to actually use the loop.
  • Connect the Objects output socket of your existing Object Instancer node with the Object List input socket of the Invoke Subprogram node.

loop invocation

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .