adding mass effects rigid body to multiple objects

hi there
I have to assign mass affects rigid body to multiple objects.The problem is that I have to assign unique modifiers to each object. but my script assigns modifier as instances to all selected objects. Is there a work around for this
Note: make unique button is not an option here.
my script as follows:

 
for o in $ do (
modPanel.addModToSelection (MassFX_RBody ()) ui:on
o.modifiers[#MassFX_Rigid_Body].materialID = -1565614346
o.modifiers[#MassFX_Rigid_Body].density = 8
o.modifiers[#MassFX_Rigid_Body].staticFriction = 0.5
o.modifiers[#MassFX_Rigid_Body].dynamicFriction = 0.2
o.modifiers[#MassFX_Rigid_Body].bounciness = 0.1)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
le1setreter's picture

try this addModifier o

try this

addModifier o (MassFX_RBody ()) ui:on

instead of

modPanel.addModToSelection (MassFX_RBody ()) ui:on
savascetin's picture

thank you

thank you very much. it works

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.