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

How to set labels for output nodes in Python

New Here ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

  1. 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

Views

219

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 , 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
...

Votes

Translate

Translate
Adobe Employee ,
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 | QA Analyst, 3D & Immersive | 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 ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

Resolved!
Thank you so much!

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
Adobe Employee ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

LATEST

I am glad, have fun!

 

Luca Giarrizzo | QA Analyst, 3D & Immersive | 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