3
$\begingroup$

Is there a way to convert nodes (or nodes group) into Python script automatically?

If not what is the python script to:

  • create a node and set his position
  • attach a node to another and choose the input and output (and found the name of the input/output script)
  • create a group
  • choose if we want to create the node in the compositor or for a cycles shader
  • mute a node
$\endgroup$
5

2 Answers 2

3
$\begingroup$

There's not an out-of-the-box, native way to do this, at least as of the current version (Blender 3.6). However, you can write a script using the Python API.

As for a solution that does all this automatically, I've created an open source add-on that does all this for Geometry Nodes and Shader Nodes for Blender 3.0-3.6, with work in progress for Compositing Nodes.

https://github.com/BrendanParmer/NodeToPython

$\endgroup$
2
  • $\begingroup$ You're right, I was trying to futureproof the response in case something were to change after v3.6. As far as I'm aware this hasn't ever been a feature that comes with Blender $\endgroup$ Commented Aug 3, 2023 at 2:44
  • $\begingroup$ Alright, all good then. Thank you for the answer and the addon. Congrats for the 100 stars ! ;) $\endgroup$
    – Gorgious
    Commented Aug 3, 2023 at 9:52
-1
$\begingroup$

Here is a repo that does exactly what you want. It has a ready-to-run python script that can be run from the command line in the background without opening the blender GUI. It creates a water material on a surface mesh for a convecting bubble - this is done with 2 different shaders and mixing them using a mixer shader. The script loops through the different files and renders the images as jpeg. The images are also there in the repo. Just clone the repo and run the command given in the README file in the terminal. This scripting was done with Blender v2.78.

https://github.com/nataraj2/BlenderScripting

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .