yann19
2018-09-13 20:21:24 UTC
Hi all,
What is the best way that I can break apart and check all the nodes within
a given node's full path?
I am trying to check the list of nodes within the path, and should the
node/path fulfills a certain node type, it will stop iterating and store
that selection..
So far I have tried the following:
for node in set(selections):
node_split = node.split('|')
split_len = len(node_split)
for num in range(split_len):
# I need to use +2, if using a +1, a "|" will be returned...
num = num + 2
item = "|" + "|".join(node_split[1:num])
if cmds.nodeType(item) == "customType":
print item
It seems to work for my cause but wondering if there is a better way to
deal with this?
What is the best way that I can break apart and check all the nodes within
a given node's full path?
I am trying to check the list of nodes within the path, and should the
node/path fulfills a certain node type, it will stop iterating and store
that selection..
So far I have tried the following:
for node in set(selections):
node_split = node.split('|')
split_len = len(node_split)
for num in range(split_len):
# I need to use +2, if using a +1, a "|" will be returned...
num = num + 2
item = "|" + "|".join(node_split[1:num])
if cmds.nodeType(item) == "customType":
print item
It seems to work for my cause but wondering if there is a better way to
deal with this?
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d12316b3-8bfa-4295-8e8f-f3b2588015e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d12316b3-8bfa-4295-8e8f-f3b2588015e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.