Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Creation of ShaderNodeTrees and CompositorNodeTrees #40

Open
alphadito opened this issue Nov 18, 2023 · 5 comments
Open

Creation of ShaderNodeTrees and CompositorNodeTrees #40

alphadito opened this issue Nov 18, 2023 · 5 comments

Comments

@alphadito
Copy link
Contributor

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
Copy link
Contributor Author

alphadito commented Dec 12, 2023

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>.

@rsaccon
Copy link

rsaccon commented Dec 12, 2023

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.

@alphadito
Copy link
Contributor Author

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.

@rsaccon
Copy link

rsaccon commented Dec 12, 2023

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

@alphadito
Copy link
Contributor Author

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants