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

PythonApi - Select nodes from script

Explorer ,
Apr 16, 2025 Apr 16, 2025

It would be incredibly useful for validation tooling (in studios) to be able to select a list of nodes via the python api. 

Example being - running validation on a graph and finding nodes that don't match some specification and being able to select the nodes so a user can address them in whatever way is necessary 

Idea No status
165
Translate
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 , Apr 17, 2025 Apr 17, 2025

Hello @TooLzor,

 

Thank you for the feedback! I have shared your suggestion and use case with the rest of the team.

Feel free to let us know about any other requests you have for Designer's Python API.

 

Best regards.

Translate
3 Comments
Adobe Employee ,
Apr 17, 2025 Apr 17, 2025

Hello @TooLzor,

 

Thank you for the feedback! I have shared your suggestion and use case with the rest of the team.

Feel free to let us know about any other requests you have for Designer's Python API.

 

Best regards.

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Translate
Report
Explorer ,
Apr 17, 2025 Apr 17, 2025

Thanks @Luca Giarrizzo , Having used the designer api off and on for a few years I always feel like it really needs some love overall...It feels very unpythonic and more like a brute force wrapper around C++ or something. 

From a tools perspective it does feel like a chore to look through the docs to try to figure out how to interact with nodes rather than get on with building things with it.

 

E.g. Getting the outputsize of an output node - I can see in the graph when it says 2048 under it, but it feels like it could be a lot easier to get this information in the api 

In this example, it feels like I should just be able to do:

 

import sd
ctx = sd.getContext()
app = ctx.getSDApplication()
graph = app.getUIMgr().getCurrentGraph()
output_nodes = graph.getOutputNodes()
print("\n".join([x.getOutputSize() for x in output_nodes]))

Instead of this - having to get properties, transform it into another class to then get the size of it...

import sd
from sd.api.sdproperty import SDPropertyCategory
from sd.api.sdvaluetexture import SDValueTexture

ctx = sd.getContext()
app = ctx.getSDApplication()
uiMgr = app.getQtForPythonUIMgr()

def get_output_size(node):
    prop = node.getProperties(SDPropertyCategory.Output)
    value = node.getPropertyValue(prop[0])
    sd_texture = SDValueTexture.get(value)
    size = sd_texture.getSize()
    return size

graph = app.getUIMgr().getCurrentGraph()
graph.compute()
for node in graph.getOutputNodes():
    size = get_output_size(node)
    print(f"{node.getDefinition().getLabel()} size is {size}")

 I assume part of it is there's probably output nodes that "don't have a size" or something but surely there must be a more userfriendly/dev friendly wrapper that could be made - especially since it doesn't feel like we have full access to the capabilities of designer from this api as it is currently..

Translate
Report
Adobe Employee ,
Apr 17, 2025 Apr 17, 2025
LATEST

Thank you for the detailed feedback. These are fair points we have discussed in the past.

While powerful tools can definitely be achieved with our API, I agree there are structural problems and some tasks are convoluted for no obvious reason.

 

I have shared your feedback internally for discussion.

 

Have a pleasant rest of the week!

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Translate
Report