The first one should be fairly easy, it’s just the how of it is escaping me for some reason.
I need to know how to define where to place instances on a spline using pure math. Normally, I just throw on a color ramp, set it to constant, and call it a day. But now, I need to define it as a purely numbermatic input so that it works as a setting in a group node.
Like say that a spline equals 0 to 1. I want to put Instanced Object A at 0.3 to 0.5, Instanced Object B, and 0.55 to 0.7, and Instanced Object C and 0.7 to 1.0. How would I do this with nodes that can be plugged into a group input?
The second question might be a little more difficult. Say I want to create a few different branches for my trees to add some variety. Normally, I’d create three different objects, throw them in a collection, and instance said collection. But now, I want to do it entirely inside the same node tree. No separate objects, no collections. Is there a way to group two procedural objects together in such a way that Blender sees them as being in a collection like setup?
I know this is shading nodes, but it’s the same math nodes and it’s easier to show how it works quickly this way. You can use those Thresholds for the group inputs. This particular AND node, as I call it, says “if X is between .3 and .5, return 1”- in your case, that would be “if X is between .3 and .5, put instance here”. You can then just create a bunch of these with different thresholds.
That did it! I need to delve more into these pure math nodes, since I’m still pretty weak on that front.
Do you have any idea how to do the 2nd? I thought about stacking multiple Instance On Points nodes together, with the selection set to the setup you’ve shown me above, but that seems kinda inefficient.
As to question two… I’m sorry, I know essentially nothing about geo nodes. The funny thing is shader nodes have always really clicked for me, but I can’t wrap my head around geo nodes at all. Your idea does sound like it would work, though. I use that node setup all the time for breaking something into three or four distinct shaders, so I feel like it would work also with three or four distinct objects
One cool thing to note is that if you want a logical OR node, you can just switch the third math node to Maximum. The AND node uses the smaller of two inputs- 0 or 1. If one input is 0, the result must be False. Hence the minimum node. The maximum node obviously will return the largest, so if you have a 0 and 1 input, you’ll return 1. It blew my mind when I realized how easy it was to make logical expressions with shader nodes
Yes, I wish one day, they get round to porting these new math nodes into shader nodes as well, same with the random number node.
And the ability to copy past compatible nodes from the shader editor to GN editor would be lovely.
To randomly distribute points along a spline, use the sample curve node with a random value. Resampling this curve first will give you control over the number of points. Make sure to set the sample curve node to factor, so it won’t depend on arbitrary spline lengths.
Just thought I would throw this here in case you needed it.
This might solve one of the problems I’ve been banging my head against. I’ll definitely try it out tomorrow.
And if you think of anything else to punt my way, feel free.
Here’s a shot of where I’m currently at with the nodes. It should give you a good idea of what I’m intending here. I’m probably gonna end up having two more nodes beyond the three I already have. One for the trunk itself, and the other for the branch distribution. I just have to figure out how to mix them together so it’s semi-sorta intuitive.
I would’ve posted this in the Tree thread, but I’m not allowed to make another post there until someone else replies. So instead, I’ll do it here.
It is done. I’m gonna call this release Geotree 0.2, because, hey, why not?
I would write up a nice little manual, but I want to see how easy it is to use to the uninitiated, plus, I still need to contact the guy who made GN_Tree to tell him I’ve used some of his node setups. Consider this not an official release.
I try this with real geometry, like a cube, an icosphere, or a cylinder, and the bounds falloff well beyond the edges of the object. I’ve tried adjusting my various transforms, but it doesn’t seem to make any difference.
I’ve done a good bit on my trees since my last update, but there are two things I want to do that I haven’t been able to implement. I want to change the scale and rotation of my limbs as they move up the base trunk curve. I want it so that lower limbs are thicker, and higher limbs are angled more upwards.
You’d think it’d be easy, but it hasn’t been. It just does not want to cooperate with me. Even the guys over on the Blender discord server were stumped by it.
All I wanted to do was take a point from the index, and have it rotate my objects by a greater degree as it moves up the spline linearly from 0 to X. Seems like the easiest thing in the world to do, but for some reason, it always turned out looking spastic.
Then I realized that it was determining the starting point not from the base of the spline like I always assumed, but from the origin, which was set in the center of the spline. That’s why my trees would spaz out, with some of them point upwards on one half, and downwards on the other.
Once I knew what was screwing me over, all I had to do was add a multiply node with the position as a value, clamp it, then just slide the other value upwards.