Copy link to clipboard
Copied
Hello @Tantanmen,
You may use the setAnnotationPropertyValueFromId() and use "label" as the first argument – I.e., the target property's identifier.
Here is a simple sample script which assigns the same label to all Output nodes in a Substance compositing graph:
import sd
from sd.api import sdvaluestring
app = sd.getContext().getSDApplication()
ui_mgr = app.getQtForPythonUIMgr()
graph = ui_mgr.getCurrentGraph()
nodes = graph.getNodes()
for node in nodes:
if "output" in node.getDefinition
...
Copy link to clipboard
Copied
Hello @Tantanmen,
You may use the setAnnotationPropertyValueFromId() and use "label" as the first argument – I.e., the target property's identifier.
Here is a simple sample script which assigns the same label to all Output nodes in a Substance compositing graph:
import sd
from sd.api import sdvaluestring
app = sd.getContext().getSDApplication()
ui_mgr = app.getQtForPythonUIMgr()
graph = ui_mgr.getCurrentGraph()
nodes = graph.getNodes()
for node in nodes:
if "output" in node.getDefinition().getId():
node.setAnnotationPropertyValueFromId(
"label",
sdvaluestring.SDValueString.sNew("My Label")
)
I hope this is helpful!
Best regards.
Copy link to clipboard
Copied
Resolved!
Thank you so much!
Copy link to clipboard
Copied
I am glad, have fun!