Forum
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Set mass and fatness for all rigids in hierarchy of current selection 2 months 17 hours ago #599

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 157
  • Thank you received: 20
When you have 50 Carbon chain links, as in this tutorial, www.numerion-software.com/index.php/forum/tip-of-the-week/399
you want to use a script to get their mass and fatness.

Use this python script in Maya to set mass and fatness for all Carbon Rigid "bodies" in hierarchy of current selection.
Sets fatness on Carbon Shapes and mass on Carbon Rigids.


import maya.cmds as cmds
selection = cmds.ls(sl=True)
cmds.select(selection, hierarchy=True)
selectedHierarchy = cmds.ls(sl=True)
nodes = cmds.ls(sl=True, type='CarbonShape')
for node in nodes:
    cmds.setAttr(node + '.doubleSided', 0)
    cmds.setAttr(node + '.innerFatness', 0.15)
    cmds.setAttr(node + '.outerFatness', 0.01)
cmds.select(selectedHierarchy)
nodes = cmds.ls(sl=True, type='CarbonRigid')
for node in nodes:
    cmds.setAttr(node + '.mass', 0.001)
 

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.049 seconds