The script below selects all the child nurbCurves of the selected object. The issue I'm having is that after running the script, none of the keys from the children nodes appear in the timeline. Why is that? How can I correct this?

To test the script. Create a few nurb curve controls and animate the position. Then parent them together so their parent is the same master control. Then select the main control and run the script.

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)
有帮助吗?

解决方案

You are selecting the nurbsCurve shapes, but your animation is on the transform

# 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)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top