Pyton script executing node?

I would love to have a script executing node . I usually spend days with miss and hit to make something working in geometry nodes while chat GPT makes me working script that does what I want in seconds . Sometimes with extra helpful features I even haven’t thought about .

Blender scripts is a field where chat really shines. vs 3d max script for example. it’s a challenge to even persuade it to make one.

Still it’s somewhat easier to keep things procedural and node based for extra modification. So It would be nice to mix both approaches and have a node that would execute python using attributes and selection as input.

Can we we have it somehow ?

You mean… something like this

(He has also a longer Part I and II and more…)

or Erindale… ( here using python to import CSV data and GN )

(He has a lot of GN…)

Hi Ivagr,
this question got asked a couple months ago:
Please provide a scripting language that can replace shader and geometry nodes - General Forums / Blender Development Discussion - Blender Artists Community

Also, this here might be of interested for you:
#115112 - WIP: Add a math expression geometry node - blender - Blender Projects

So correct me please if I am wrong.

  1. python can be used to create and connect existing geometry nodes. Not sure what’s the purpose of this if I can do it manually too. Just for speed up maybe? why do visual programming when you can write the code comfortably?

  2. python can be used to create an attribute from CSV on some input object geometry nodes can have access to.

But there is no way I can bevel selected edges by some node executing a script doing so in the middle of node flow . right?

I should either create my own “bevel edge” node network I have no idea how currently or just create and store bevel_edge_weight attribute on edges , put bevel modifier after geo nodes and then next geo node modifier to continue ?

ps . Something like script node in shaders ? I never used it really but as I understand it allows to write your own OSL shader code for Cycles to execute.

ps2. BTW does anyone know how to pass attributes through modifiers ? I have managed to pass bevel_wight_edge and UVMap from geo node to next modifier but not vertex group or just random custom attribute .

You might want to try this addon, which allows to write custom GN nodes from python… I haven’t tried it, as I write my own nodes from scratch, but it looks very neat.

Attributes stay stored in the object… When you store an Attribute in one modifier, the following modifiers will have access to that attribute (unless one of the modifiers deletes or changes the attribute).

2 Likes

Thanks Secrop

ll try this addon for sure . looks like it’s exactly what wanted.

ps. Well actually it’s not . it’s same as the first video in this thread. Just creates more nodes I could perfectly do without this script

If that’s your problem, than you’re out of luck! Unless you grab Blender source code and implement your own nodes in it.

Even builtin nodes are normally composed of other ‘nodes’ (or to be more precise, they call functions represented by other nodes; note that nodes are representations, and not real functions…)
For example, the TransformGeometry node is basically two VectorMath functions and a VectorRotate function, crunched together. And the VectorMath might call three Math operations or more, depending the operation you’re performing.

And this limits you in a way that you cannot do much more than the possibilities of the GeometryNode Engine.

1 Like