Creating custom nodes with scripting API?

New Here ,
Mar 27, 2022 Mar 27, 2022

Copy link to clipboard

Copied

Using the scripting API is it possible to create a custom node that outputs an image? I want to create some random curves and pass it onto the distance node. If it's possible, are there any tutorials or examples that would explain how to do it?

TOPICS
Scripting

Views

41

Likes

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 ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

Hello,

 

This is indeed possible with the Python API. I have attached a sample script which performs the following operations:

 

  1. Create Uniform color and Levels nodes
  2. Set the value of the Output color property of the Uniform Color node
  3. Set the value of the Level Out Low and Level Out High properties of the Levels node
  4. Connect the Uniform color node's output to the Levels' node input

 

LucaGiarrizzo_0-1648461310553.png

 

Remove the .txt extension from the script's filename to run it as a Python script in Designer's Python Editor window, which you can find in the Windows menu.

 

The Scripting section of Designer's documentation includes sample scripts for accessing node and their properties. Additionally, the Help menu lets you access the API Scripting Reference, which lists all classes, methods and modules available in the Python API.

 

I hope this is helpful and informative!

 

Best regards.

 

Luca Giarrizzo
QA Analyst
Substance 3D Designer

Likes

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 ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

Thanks for that. I was hoping to create a node from scratch rather than creating a graph with code. Currently I use the HTML5 canvas API to create images with code and import them into Substance Designer. It would be great if you could create the custom image generator in Substance Designer using some sort of graphics API and expose some parameters for the user to tweak. Is that possible?

Likes

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 ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

LATEST

Hello,

 

Thank you for clarifying your request. It is currently not possible to pass the output of a graphics API as a node in Designer.

 

The closest thing would be the Pixel Processor node, which executes a Function graph on each pixel of an image as a compiled shader. Along with the FX-Map node, it is one of the most complex yet powerful nodes in Designer. You can get started learning about using this node with this tutorial.

 

Best regards.

 

Luca Giarrizzo
QA Analyst
Substance 3D Designer

Likes

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