Last active
November 5, 2020 14:17
-
-
Save linniksergey/8f35b0e601add15ff1355cb4b3fe97ef to your computer and use it in GitHub Desktop.
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
# 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