plarson
I'm wonder how one can get better control over active/passive switching on a group of rigid bodies using Soup.

In the standalone version of the free Dynamica plugin for Maya, there are a few built in scripts for smoothly keying a group of rigids to active. But it is limited to those seen in the image below. And the keying drastically reduces the options for further changes.



What would be interesting would be, for example: You have a large grid of passive rigid body cubes with say a fields that will pull them upwards and to the center when activated. Then a separate particleShape's positions being input to a bounding shape, the bounding shapes then being able to activate the passive rigids when they fall within the radii of the boundings. By passing WeightPP values back to each rigid's active/passive attributes. So one could spray the grid of rigid body cubes with particles and have them become active once within the radius of the particle's boundings. Additionally, other attributes, such as friction and bounce values changing based on their vicinity within the boundings.

To my understanding the flow of information would be something like the following: Starting with a set number of rigids named in sequence to match the array indexes. Rigid's positions -> an array -> input AtTransfer. Then AT's WeightPP output -> rigid's passive/active attribute based on array index.

But even if that is accurate I'm unsure of exactly how it should be done, or if there's something that would make it more difficult than I'm imagining.

I understand how to loop getAttr to grab the translate values of the rigids, and populate an array with them, using an expression. But not sure how to then use that array for the input of an AT node. It seems like a Point node could be used instead of normal expressions, with an array size equal to the number of rigids. And again a Point node to set the passive/active attributes based on $ID?

This is a casual question with the goals of gaining that control, and learning more about Soup. But I would really appreciate any tips on how this should be done, whether I have it all wrong, whether there's a better way to get the same control, etc.
Thank you.
Reply 0 0
pshipkov
this is job for pyexpression node.
will try to give you example over the weekend.
Reply 0 0
plarson
Thanks Peter, that would be much appreciated. I am not yet very familiar with the pyExpression node. I will start by looking carefully at your existing example scenes.
Reply 0 0
pshipkov
source the pyExpression AE template
load the pyExpression plugin
open this scene:
http://www.petershipkov.com/temp/pyExpression_rbds_control.ma
Reply 0 0
plarson
Very impressive. What a great node. I can imagine some really interesting effects using that. Making use of the particle's radiusPP is also nice. I'll be studying more Python to better grasp the script involved. Much appreciated. Thank you.
Reply 0 0
pechart
Great stuff, thanks for the example!
Reply 0 0
Reply