【发布时间】:2022-11-17 18:15:34
【问题描述】:
我有一个小的 python 脚本,它调用 MEL 命令来构建 nurbs 曲线圆。然后将曲线的形状与一个新的变换节点一起放置,它们一起生成一个动画控件。但是脚本运行时没有生成任何内容,也没有错误消息。
import pymel.all as pm
import maya.cmds as cmds
import maya.mel as mel
# ---------------------------------------------------------------------------------
def makeHandle(name='NEW', shape='Circle'):
handle= pm.createNode('animHandle')
shape = melcmds = 'circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1;'
mel.eval (melcmds)
for each in shape.getChildren(): pm.parent(each, handle, r=True, s=True)
newName = name + '_handle'
handle.rename(newName)
for each in handle.getChildren(): each.rename(name + '_handleShape')
pm.delete(shape)
pm.select(handle)
【问题讨论】: