Skip to content

Instantly share code, notes, and snippets.

@linniksergey
Last active November 5, 2020 14:17
Show Gist options
  • Save linniksergey/8f35b0e601add15ff1355cb4b3fe97ef to your computer and use it in GitHub Desktop.
Save linniksergey/8f35b0e601add15ff1355cb4b3fe97ef to your computer and use it in GitHub Desktop.
# select all nodes
nodes = comp.GetToolList().values() #[]
# select all selected nodes
selected_nodes = comp.GetToolList(True).values() #[]
# select selected savers
selected_savers = comp.GetToolList(True, "Saver").values() #[]
# select all savers
all_savers = comp.GetToolList(False, "Saver").values() #[]
# select active tool
a = comp.ActiveTool #object
# make node
a = comp.Transform() #pointer to object
### get/set Attributes
# Node name
node.GetAttrs('TOOLS_Name') #str
node.SetAttrs({"TOOLS_Name": "hui"})
### Connect Nodes
# Output to input
node1.Input = node2.Output
# List of all Tool Inputs
tool = comp.ActiveTool
inputs = tool.GetInputList() #dict
print("\n".join(str(number) + ": " + inp.Name for number, inp in inputs.iteritems()))
# List of all Tool Input Attributes
print(inputs[37].GetAttrs()) #dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment