Skip to content

Commit

Permalink
Core: Finchildren functions in dag.py. The return is a str not a pynode
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcampos committed Nov 6, 2024
1 parent 37aa554 commit 9dc99fb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions release/scripts/mgear/core/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def getShapes(node):
list: The shapes of the node
"""
return node.listRelatives(shapes=True)
return node.listRelatives(shapes=True, fullPath=True)


def findChild(node, name):
Expand Down Expand Up @@ -90,13 +90,13 @@ def __findChildren(node, name, firstOnly=False, partialName=False):
if partialName:
children = [item for item
in node.listRelatives(allDescendents=True,
type="transform")
if item.name().split("|")[-1].split("_")[-1] == name]
type="transform", fullPath=True)
if item.split("|")[-1].split("_")[-1] == name]
else:
children = [item for item
in node.listRelatives(allDescendents=True,
type="transform")
if item.name().split("|")[-1] == name]
type="transform", fullPath=True)
if item.split("|")[-1] == name]
if not children:
return False
if firstOnly:
Expand All @@ -121,12 +121,12 @@ def __findChild(node, name):
try:
for item in cmds.listRelatives(node.name(),
allDescendents=True,
type="transform"):
type="transform", fullPath=True):
if item.split("|")[-1] == name:
return pm.PyNode(item)
except pm.MayaNodeError:
for item in node.listRelatives(allDescendents=True,
type="transform"):
type="transform", fullPath=True):
if item.split("|")[-1] == name:
return item

Expand Down Expand Up @@ -185,8 +185,8 @@ def findComponentChildren(node, name, sideIndex):
"""
children = []
for item in node.listRelatives(allDescendents=True,
type="transform"):
checkName = item.name().split("|")[-1].split("_")
type="transform", fullPath=True):
checkName = item.split("|")[-1].split("_")
if checkName[0] == name and checkName[1] == sideIndex:
children.append(item)

Expand Down

0 comments on commit 9dc99fb

Please sign in to comment.