0
New Here
,
/t5/substance-3d-designer-discussions/how-to-set-labels-for-output-nodes-in-python/td-p/13499358
Jan 17, 2023
Jan 17, 2023
Copy link to clipboard
Copied
- I would like to set labels for output nodes in Python, but the documentation only tells me how to get them.
If it is possible to set labels, I would like to know how to write them.
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Adobe Employee
,
Jan 19, 2023
Jan 19, 2023
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
...
Adobe Employee
,
/t5/substance-3d-designer-discussions/how-to-set-labels-for-output-nodes-in-python/m-p/13502640#M2131
Jan 19, 2023
Jan 19, 2023
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.
Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Tantanmen
AUTHOR
New Here
,
/t5/substance-3d-designer-discussions/how-to-set-labels-for-output-nodes-in-python/m-p/13502939#M2134
Jan 19, 2023
Jan 19, 2023
Copy link to clipboard
Copied
Resolved!
Thank you so much!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Adobe Employee
,
LATEST
/t5/substance-3d-designer-discussions/how-to-set-labels-for-output-nodes-in-python/m-p/13503309#M2136
Jan 19, 2023
Jan 19, 2023
Copy link to clipboard
Copied
I am glad, have fun!
Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

