def create_hair_system(nucleus=None):
'''Create a hair system, add it to the specified nucleus or active nucleus'''
if not nucleus:
nucleus = get_nucleus()
hair_system = cmds.createNode('hairSystem')
cmds.connectAttr('time1.outTime', hair_system + '.currentTime')
index = cmds.getAttr(nucleus + '.inputActive', size=True)
input_active = '{}.inputActive[{}]'.format(nucleus, index)
input_start = '{}.inputActiveStart[{}]'.format(nucleus, index)
output_object = '{}.outputObjects[{}]'.format(nucleus, index)
cmds.setAttr(hair_system + '.active', 1)
cmds.connectAttr(hair_system + '.currentState', input_active)
cmds.connectAttr(hair_system + '.startState', input_start)
cmds.connectAttr(output_object, hair_system + '.nextState')
cmds.connectAttr(nucleus + '.startFrame', hair_system + '.startFrame')
return hair_system
评论列表
文章目录