Some More Random Geometry Node Questions

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?

You can do this with Greater Than / Less Than / Minimum math nodes- essentially creating an AND logic gate:


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.

2 Likes

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.

1 Like

I’m glad that helped! :smiley:

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 :thinking:

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

1 Like

For question #2 - check out the geometry to instance node:

The multiple inputs act as separate objects, essentially generating a virtual collection.

5 Likes

Yes, you can create instances and do that,

have a look here…

1 Like

Hell, I was expecting something more complicated than that. Thanks! :smiley:

Between you and Josephhansen, I got this solved nice and quick.

I guess my only solution for targetted distribution is to use multiple Instance on Point nodes, which kinda sucks for organizing, but I guess I can make due.

2 Likes

Like below, but replace the Random Value node with your curve parameter…

Good luck.

2 Likes

The Boolean Math node in geo node has all the ANDs, ORs, NORs and NANDs. They are to be used in combination with the switch node which is basically an if-else

Would be nice to have that stuff in shader nodes.

3 Likes

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.

(not a rant, just a wish) :slightly_smiling_face:

2 Likes

In combination with the mathematical distribution limits, there’s a method of randomly distributing points along a spline that you may find useful:

Distributing Points On Splines

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.

1 Like

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.

3 Likes

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.

GeoTree.zip (3.8 MB)

2 Likes

I have some more random geometry node questions.

I’m trying to get points to exclusively spawn within the radius of an object. I first tried it out with a spherical empty, and it works just fine. My test cubes only spawn inside it’s bounds.

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.

Anyone know what my problem is, and how I can fix it?

You are only taking the object scale into account. You need to use the bounding box or attribute statistic node to get the actual measurements of the mesh.

2 Likes

That was surprisingly easy. Thanks. :smiley:

1 Like

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.

For anyone reading this, HELP!

1 Like

Used this basic principle…


…for a wing-rig (for a weekend challenge entry)

Was super proud of coming up with it in under 2 days at the time but it was one of my poorest performing entries. Hard lesson that effort doesn’t always translate into something that looks good :sweat_smile:

Good luck!

4 Likes

Awesome, thanks. It’s ALMOST doing what I want it to do. Some more adjustment is required, but at least you’ve set me on the right path.

And as an added bonus, one little mistake was all it took for me to figure out how to do the roots.

4 Likes

I found an even simpler solution.

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.

2 Likes