Which nodes can be created through the Scripting API?
Hi,
For example :
Hi,
For example :
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,
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.