I might have gone a bit over the board with these nodes

8 days ago by hayk to c/blender

load all comments
TacticalToothbrush 5 points 8 days ago

YES! readable tree is overrated! jk

I try to reuse same input node as many places as I can but this is too much.

No sim, no closure, big spaghetti. What the heck is this thing doing though?

path: 0 26155238, hotness: undefined, score: 5, children: 14
hayk 6 points 8 days ago

believe it or not, it does reuse many nodes. sim/repeat won't be of much help here, there're no repetitions. I'm testing an addon I've been creating which converts regular Python logic into geometry nodes. this is like ~500 lines of Python code converted into nodes. It's making a procedural full-quad wall with crenellations from an edge. unsurprisingly, most of the nodes are to correctly treat edge cases/self intersections, removing stray edges/faces etc.

path: 0 26155238 26162936, hotness: undefined, score: 6, children: 13
nachitima 2 points 6 days ago

I've built a DSL for generating geometry nodes setups from a high-level Python-like script. It is still undergoing major architectural improvements, but you can already try it out. Let me know what you think. ✌️

https://github.com/denikryt/NodeForge

path: 0 26155238 26162936 26194725, hotness: undefined, score: 2, children: 7
hayk 1 point 6 days ago

looks nice! i wanted something more code friendly, so mine actually parses math expressions, if statements, lambda functions, loops etc and decides internally what nodes it needs to put together (hence the horrible looking node sausage). so you literally write a python logic, which it then transpiles and compiles into a node tree. in other words, you never actually have to think in nodes.

path: 0 26155238 26162936 26194725 26196760, hotness: undefined, score: 1, children: 5
nachitima 2 points 6 days ago

My goal was to think about nodes as functions and operations that could be described with simple Pythonic syntax. Every node is a function with positional arguments as socket inputs and a return value as a socket output. The mathematical operation nodes could be described as simple operators like + - // etc. The links between nodes are described as simple variable assignments and passing variables into functions and so on.

Basically, the idea it to think about Geometry Nodes setup as a script and reduce the Blender API Geometry Nodes boilerplate, while keeping it possible to address a specific node when needed.

I also put a bunch of work into the Extension API, which makes it possible to extend the functionality of the DSL with additional third-party libraries with its own defined methods and logic and use them in a familiar way.

I'd be happy if you tried it out! 🌽

path: 0 26155238 26162936 26194725 26196760 26197269, hotness: undefined, score: 2, children: 4
hayk 1 point 6 days ago

yep, that's the same idea! i'm happy to share the code once i clean it up a bit, and you should feel free to transfer any of the functionality. there are few features i added which i really like, such as a support for LSP and type hints in an external IDE, plus an ability to write the code outside, while the add-on auto-regenerates the node-group if a file is changed. another cool thing is you can inline functions, i.e.:

# these two are automatically inlined (i.e., nodes added to the active group)
@inline
def foo(x: float, y: bool):
  return x**2 if y else x**3

foo = lambda x, y: x**2 if y else x**3

# while this becomes a reusable node group
def foo(x: float, y: bool):
  return x**2 if y else x**3
path: 0 26155238 26162936 26194725 26196760 26197269 26200437, hotness: undefined, score: 1, children: 3
nachitima 1 point 5 days ago

Interesting, I'm looking forward to seeing your project! I'll note the features you've mentioned, the LSP should be a really handy one : )
The declaring of inline functions i.e. creating nodes in the root node group is something I feel is lacking in my project right now. Would you make a post about the addon somewhere?

path: 0 26155238 26162936 26194725 26196760 26197269 26200437 26213527, hotness: undefined, score: 1, children: 2
hayk 1 point 4 days ago

yep ill just post it on the same lemmy instance. can also dm you the link

path: 0 26155238 26162936 26194725 26196760 26197269 26200437 26213527 26227915, hotness: undefined, score: 1, children: 1
nachitima 2 points 4 days ago

I can't receive DMs in my discord-fediverse bridge yet 😁 I'll stay tuned for updates in this Blender community ✌️

path: 0 26155238 26162936 26194725 26196760 26197269 26200437 26213527 26227915 26239075, hotness: undefined, score: 2, children: 0
blender
blender

@lemmy.world

login for more options
3658
266
284

A community for users of the awesome, open source, free, animation, modeling, procedural generating, sculpting, texturing, compositing, and rendering software; Blender.

Rules:

  1. Be nice
  2. Constructive Criticism only
  3. If a render is photo realistic, please provide a wireframe or clay render

go to feed...