• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Which nodes can be created through the Scripting API?

New Here ,
Jun 23, 2023 Jun 23, 2023

Copy link to clipboard

Copied

Hi,

For example :

graph.newNode("sbs::compositing::uniform")
Creates a new uniform node in my Substance Designer graph, great.
 
Besides uniform, which other ones can be created this way?
 
I've been trying to find a function that returns the complete list of nodes. The closest one so far seems to be :
node.getDefinition().getLabel())
This returns Uniform Color
 
And 2nd question, is it possible to spawn a graph from a sbrar imported resource?
Thanks!
TOPICS
Scripting

Views

107

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jun 30, 2023 Jun 30, 2023

Hello @Bjorn_AltaVR,

 

Thanks for the question.

 

All the Atomic Nodes can be created from the way you mentionned upthere. You'll find the entire list under 
Help > Scripting Documentation > Modules definition > sbs::compositing

 

For instance nodes, this will require to locate and open the package file, find the desired graph, create a node and close the package:

import sd
# from sd.api import sdproperty
app = sd.getContext().getSDApplication()
# Get managers
ui_mgr = app.getQtF
...

Votes

Translate

Translate
Adobe Employee ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

Hello @Bjorn_AltaVR,

 

Thanks for the question.

 

All the Atomic Nodes can be created from the way you mentionned upthere. You'll find the entire list under 
Help > Scripting Documentation > Modules definition > sbs::compositing

 

For instance nodes, this will require to locate and open the package file, find the desired graph, create a node and close the package:

import sd
# from sd.api import sdproperty
app = sd.getContext().getSDApplication()
# Get managers
ui_mgr = app.getQtForPythonUIMgr()
pkg_mgr = app.getPackageMgr()
# Get current graph
graph = ui_mgr.getCurrentGraph()
# Load target package
my_package = pkg_mgr.loadUserPackage("D:/OneDrive - Adobe/test_files/sbsar/test/tst-islands.sbsar")
print(my_package.getFilePath())
# Find target graph resource in target package
for item in my_package.getChildrenResources(isRecursive=True😞
	if item.getIdentifier() == "test_islands":
	 tgt_resource = item
# Create nodes
my_levels_node = graph.newNode("sbs::compositing::levels")
my_instance_node = graph.newInstanceNode(tgt_resource)
# Close target package
pkg_mgr.unloadUserPackage(my_package)

 

Same thing goes for .SBSAR

 

Best regards,

 

Cyril Dellenbach (Micro) | QA Support Artist | Adobe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 10, 2023 Jul 10, 2023

Copy link to clipboard

Copied

LATEST

Perfect, thank you very much.

One more question, do you know how to expose parameters like this through Python ? Thank you

Bjorn_AltaVR_0-1688991484795.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines