Skip to content

Instantly share code, notes, and snippets.

@oktomus
Created July 7, 2020 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oktomus/2d8fc8dfe0bbbbda12143f65a4f4ff02 to your computer and use it in GitHub Desktop.
Save oktomus/2d8fc8dfe0bbbbda12143f65a4f4ff02 to your computer and use it in GitHub Desktop.
Substance Designer Scripting utils
import sd
def print_selected_nodes_properties():
"""Show all inputs and outputs of a node."""
context = sd.getContext()
app = context.getSDApplication()
packageMgr = app.getPackageMgr()
uiMgr = app.getQtForPythonUIMgr()
node = uiMgr.getCurrentGraphSelection()[0]
print("Inputs...")
for nodeInput in node.getProperties(SDPropertyCategory.Input):
print(nodeInput.getId())
print("Outputs...")
for nodeOutput in node.getProperties(SDPropertyCategory.Output):
print(nodeOutput.getId())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment