...
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.