python maya选择子对象“nurbs”,然后隐藏关键帧

2024-09-27 21:33:16 发布

您现在位置:Python中文网/ 问答频道 /正文

下面的脚本选择选定对象的所有子nurbcurve。我遇到的问题是,运行脚本后,子节点中的任何键都不会出现在时间轴中。为什么?我该怎么更正?在

测试脚本。创建几个nurb曲线控件并设置位置动画。然后将它们组合在一起,这样它们的父控件就是同一个主控件。然后选择主控件并运行脚本。在

import maya.cmds as cmds

# Get selected objects
curSel = maya.cmds.ls(sl=True)

# Or, you can also specify a type in the listRelatives command
nurbsNodes = maya.cmds.listRelatives(curSel, allDescendents=True, noIntermediate=True, fullPath=True, type="nurbsCurve", path=True)

cmds.select(nurbsNodes)

Tags: 对象脚本true节点type曲线控件cmds
1条回答
网友
1楼 · 发布于 2024-09-27 21:33:16

您正在选择nurbsCurve形状,但动画位于变换

# list the shape nodes
nurbsShapes = maya.cmds.listRelatives(curSel, allDescendents=True, noIntermediate=True, fullPath=True, type="nurbsCurve", path=True)
# list the transform nodes to each shape node
nurbsTransforms = maya.cmds.listRelatives(nurbsShapes, type='transform', parent=True)
# select the transform nodes
cmds.select(nurbsTransforms)

相关问题 更多 >

    热门问题