Created
July 27, 2013 03:12
-
-
Save sanfx/6093531 to your computer and use it in GitHub Desktop.
Set the node order in list same as order in DAG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def orderSelectionToList(): | |
""" Set the node order in list same as order in DAG | |
Returns: | |
selNodes(List): sorted node order in list as in DAG | |
""" | |
selNodes = nuke.selectedNodes() | |
lastNode = nuke.selectedNode() | |
if lastNode.dependencies()[0] in selNodes: | |
return list(reversed(selNodes)) | |
else: | |
return selNodes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment