Frage

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)
War es hilfreich?

Lösung

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)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top