我正在尝试为maya python中的骨架创建o层次结构。我正在这样做Maya Python创建关节Hierachy
def makeSkelet(args):
helperSkelet('Root_Locator', 'root_Joint')
helperSkelet('Pelvis_Locator', 'pelvis_Joint')
helperSkelet('Spine_Locator', 'spine_Joint')
helperSkelet('Spine01_Locator', 'spine01_Joint')
helperSkelet('Spine02_Locator', 'spine02_Joint')
helperSkelet('Neck_Locator', 'neck_Joint')
helperSkelet('Head_Locator', 'head_Joint')
mc.select(cl=True)
helperSkelet('ArmL_Locator', 'armL_joint')
helperSkelet('ElbowL_Locator', 'elbowL_Joint')
helperSkelet('HandL_Locator', 'handL_Joint')
mc.select(cl=True)
helperSkelet('ArmR_Locator', 'armR_joint')
helperSkelet('ElbowR_Locator', 'elbowR_Joint')
helperSkelet('HandR_Locator', 'handR_Joint')
mc.select(cl=True)
helperSkelet('HipL_Locator', 'hipL_joint')
helperSkelet('KneeL_Locator', 'kneeL_Joint')
helperSkelet('AnkleL_Locator', 'ankleL_Joint')
helperSkelet('FootL_Locator', 'footL_Joint')
mc.select(cl=True)
helperSkelet('HipR_Locator', 'hipR_joint')
helperSkelet('KneeR_Locator', 'kneeR_Joint')
helperSkelet('AnkleR_Locator', 'ankleR_Joint')
helperSkelet('FootR_Locator', 'footR_Joint')
现在这工作正常,因为关节必须按此顺序创建。 (助手骨骼是一个函数,我创建关于一个定位器位置的关节)
我想知道是否有一个更优化的方式来做到这一点考虑到订单或创建必须保持。
谢谢
如果一切正常,我不能想办法把“优化”它比它已经是了。当然,你可以将它压缩到一个关节的“列表”中,并循环遍历列表,但仍然不会优化它。 – davedwards