geometry-script icon indicating copy to clipboard operation
geometry-script copied to clipboard

Creation of ShaderNodeTrees and CompositorNodeTrees

Open alphadito opened this issue 2 years ago • 5 comments
trafficstars

It's very tempting to do a sizable refactor to support ShaderNodeTrees and CompositorNodeTrees.

Then we could call this repo X-node-Script (:

Is this out of scope?

alphadito avatar Nov 18 '23 00:11 alphadito

NodeTree Script is an extension of Geometry Script to support Geometry, Shader, Compositor, and Texture NodeTrees. It also happens to refactor a bit of the core code, basically, breaking down larger functions within tree.py and node_mapper.py into smaller methods of the newly defined, Node, Noderegistrar, Docs, and NodeTree classes.

Here's an example script using both shader and geometry node trees.

The diff is a bit much for a single PR but there might be some interesting pieces to steal from there (:

It should be able to work with any geometry script files by just replacing:

from geometry_script import *

with

from nodetree_script import *
from nodetree_script.api.dynamic.geometry import *

Also make sure the add-on folder is called nodetree_script as opposed to GitHub's default zip file naming convention <repo_name>-<branch_name>.

alphadito avatar Dec 12 '23 17:12 alphadito

This is amazing !!! Unfortunately I couldn't get it to work, I disabled the geometry script, downloaded and installed this one. Restarted Blender. But no luck when I tried to run the möbius strip.

Something went wrong at the installation, the documentation for the different node types also were not generated. If I check on the console, I get this:

>>> from nodetree_script import *
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
ModuleNotFoundError: No module named 'nodetree_script'

I am using Blender 3.6.5 on an Intel Mac.

rsaccon avatar Dec 12 '23 21:12 rsaccon

Ah ok I just got it running on my Intel Mac with blender 3.6 but had to push up a couple of fixes. Can you try again? Also make sure there's no '-main' at the end of the add-on folder.

alphadito avatar Dec 12 '23 21:12 alphadito

Now it works perfectly. Are you gonna merge this into Geometry Script or are you gonna keep this as separate project ?

rsaccon avatar Dec 12 '23 22:12 rsaccon

I'll probably work on it separately for the time being... but anyone is welcome to merge back any part of it.

alphadito avatar Dec 12 '23 22:12 alphadito