Skip to content

Commit

Permalink
Use path in listRelatives to account for name clashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
chadmv committed May 14, 2015
1 parent a935cf6 commit 4e5549d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/cvshapeinverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def invert(base=None, corrective=None, name=None):

invertedShape = cmds.duplicate(base, name=name)[0]
# Delete the unnessary shapes
shapes = cmds.listRelatives(invertedShape, children=True, shapes=True)
shapes = cmds.listRelatives(invertedShape, children=True, shapes=True, path=True)
for s in shapes:
if cmds.getAttr('%s.intermediateObject' % s):
cmds.delete(s)
Expand Down Expand Up @@ -114,7 +114,7 @@ def getShape(node):
@return The associated shape node.
"""
if cmds.nodeType(node) == 'transform':
shapes = cmds.listRelatives(node, shapes=True)
shapes = cmds.listRelatives(node, shapes=True, path=True)
if not shapes:
raise RuntimeError, '%s has no shape' % node
return shapes[0]
Expand Down

0 comments on commit 4e5549d

Please sign in to comment.