Mass of multiple Objects

Post Reply
info@dk-vision.com
Posts: 4
Joined: Thu Jul 12, 2012 10:51 pm

Mass of multiple Objects

Post by info@dk-vision.com » Mon Jul 23, 2012 2:16 pm

Is it possible to change the physikal densety,like make the objects 2x heavier, of multiple different objects at once?

User avatar
tsn
Posts: 283
Joined: Fri Jun 11, 2010 7:22 am

Re: Mass of multiple Objects

Post by tsn » Mon Jul 23, 2012 3:00 pm

When you import the objects as a MultiBody than it's possible to factorize mass via the "Density" parameter. If the objects are part of a standard SD file than you need a Python batch script:

Code: Select all

factor = 2.0
selObjs = scene.getSelectedNodes()
for node in selObjs:
	newMass = node.getParameter("@ mass") * factor
	node.setParameter("@ mass", newMass)
Of course, the objects' rigid body property must be active, otherwise the script throws an error.

-Thomas
Thomas Schlick | Next Limit Technologies

info@dk-vision.com
Posts: 4
Joined: Thu Jul 12, 2012 10:51 pm

Re: Mass of multiple Objects

Post by info@dk-vision.com » Mon Jul 23, 2012 3:47 pm

Thanks! I thing I have to dig a little bit into RF scripting! :roll:

User avatar
tsn
Posts: 283
Joined: Fri Jun 11, 2010 7:22 am

Re: Mass of multiple Objects

Post by tsn » Mon Jul 23, 2012 4:22 pm

info@dk-vision.com wrote:Thanks! I thing I have to dig a little bit into RF scripting! :roll:
It's always a good idea to have a look at Python and RF's scripting capabilities 8-)
Thomas Schlick | Next Limit Technologies

info@dk-vision.com
Posts: 4
Joined: Thu Jul 12, 2012 10:51 pm

Re: Mass of multiple Objects

Post by info@dk-vision.com » Mon Aug 13, 2012 10:50 pm

But it would be nice to have something like a general mass parameter, something like kg/dm³.

User avatar
tsn
Posts: 283
Joined: Fri Jun 11, 2010 7:22 am

Re: Mass of multiple Objects

Post by tsn » Tue Aug 14, 2012 7:55 am

info@dk-vision.com wrote:But it would be nice to have something like a general mass parameter, something like kg/dm³.
For MultiBodies there is exactly the requested parameter (not exactly, but kg/m^3): that's density and you can change it globally in the Node Params. From this value RF calculates the mass for each node inside the MultiBody. When you go to "File > Summary Info..." you can see the individual mass for the nodes.

For single nodes from an SD you could turn the script I provided into a system or user script and hook it to the icon bar. When you call it, a GUI appears where you can enter the desired value and change the value for the selected nodes. Just have a look at the manual's scripting reference. There you'll find all you need. If you need assistance, just get back to the forum and we'll get you started.
Thomas Schlick | Next Limit Technologies

Post Reply