Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Now it is easy to loop through the individual elements of “userSelection” userSelection. A simple “for for … in …” loop will do the job. The process of checking whether rigid body dynamics is already activated or not should not be difficult, as it is simply an if-condition. Reading out the current “@ mass” value is also no mystery. So the body of the script could look like this:

...

You can extend this script to perform more than one parameter change or add a nice little GUI. With ChangeRBDMass.rfs, a simulation looks much better, because the different masses cause “instabilities”, forcing the bodies to act in a different way and the result looks moch more vivid. The example below shows a fixed mass of 1,000, the second uses a “percentVariation” value of 25.

 

Image Added