def add_curve_to_system(curve_shape, hair_system=None):
if hair_system is None:
selection = cmds.ls(sl=True, dag=True, leaf=True, type='hairSystem')
if selection:
hair_system = selection[0]
else:
hair_system = create_hair_system()
follicle_nodes, out_curve_nodes = curve_to_hair(curve_shape, hair_system)
follicles_grp = hair_system + 'Follicles'
if not cmds.objExists(follicles_grp):
cmds.group(empty=True, name=follicles_grp)
cmds.parent(follicle_nodes[0], follicles_grp)
outcurves_grp = hair_system + 'OutputCurves'
if not cmds.objExists(outcurves_grp):
cmds.group(empty=True, name=outcurves_grp)
cmds.parent(out_curve_nodes[0], outcurves_grp)
return follicle_nodes
评论列表
文章目录