def create_selected(self):
"""Create the curves selected in the curve list."""
curves = []
sel = cmds.ls(sl=True)
target = sel[0] if sel else None
for item in self.control_list.selectedItems():
text = item.text()
control_file = os.path.join(CONTROLS_DIRECTORY, '{0}.json'.format(text))
fh = open(control_file, 'r')
data = json.load(fh)
fh.close()
curve = create_curve(data)
if target:
cmds.delete(cmds.parentConstraint(target, curve))
curves.append(curve)
if curves:
cmds.select(curves)
评论列表
文章目录