def channelbox_command_syncGraph(box, menuItem, key, *args):
with sysCmd.Undo(0):
state = channelBox_Checkbox_Update(box, key, menuItem)
if not state and box.menu_jobs[key] > 0:
# if user disabled the option, and ScriptJob is running, kill the ScriptJob
cmds.scriptJob(k=box.menu_jobs[key])
box.menu_jobs[key] = -1
if state:
mel.eval("GraphEditor;") # open graph editor
cmds.channelBox(box.channelbox, e=1, exe=(channelbox_command_animCurve(box, menuItem, key), 0))
if box.menu_jobs[key] < 0: # if ScriptJob is not running, start it
box.menu_jobs[key] = cmds.scriptJob(
event=("ChannelBoxLabelSelected", partial(channelbox_command_syncGraph_scriptJob, box)),
parent=box.channelbox)
jtChannelBox_Commands_Default.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录