3
$\begingroup$

This is continuation of this question, which was answered nicely.

So, I can now make this happen:

enter image description here

But I would like to be able to use Geometry Proximity to control the point where the trees are growing from. Like this, in a way:

enter image description here

But obviously I don't want the trees being distorted in there.

So how can I achieve this without the trees being distorted? Maybe something to do with index and the amount of vertices in the initial tree object?

(I know this exact thing can be done with curves and endpoint-selection, but I would like to apply this 'shapekey'-method to way more complicated purposes than this simplified tree situation.)

Here are the nodes of the topmost GIF:

enter image description here

$\endgroup$

3 Answers 3

5
$\begingroup$

You can solve it by using the Capture Attribute node like this:

enter image description here

Explanation

The context of the Mix node are the single vertices of all the trees. If you want to morph every tree instance with a constant value, then you need to use the same mix factor for all vertices of one instance.

If you would simply like to scale your instances, you could go for the solution, proposed by Kuboa, and scale the instances during instantiation. But you can't do this in combination with the Mix node solution.

Starting at a single vertex of a tree, the idea is, to use the position of the point, that was used to instantiate this tree, for calculating the mix factor of the vertex. This is the point, where the Capture Attribute node comes into play:

Capture Attribute node

In this case, the Capture Attribute node writes the index of the current point into an anonymous attribute, that is attached to the point itself.

When creating and realizing the tree instances, every vertex of these instances will inherit this attribute:

Instantiation of trees

When we calculate the mix factor for each vertex, we can use this information to read the position of the related instantiation point. To read this anonymous attribute, that is bound to the current vertex, we simply connect the Attribute output of the Capture Attribute node to the Index input of the Transfer Attribute node as shown below.

Read the position of the instantiation point

This way, we read the position of the instantiation point, that has the index, that was stored in the anonymous attribute of the vertex in the current context.

Next we use this, to calculate the distance from the instantiation point to the reference point. In this example, the reference point is set to (0, 0, 0). You could as well connect the location of an empty here, if you like - comparable to the solution of Kuboa.

Finally, we calculate the mix factor by inverting the distance and multiplying it with the animation factor.

Alternative to using the Capture Attribute node

Instead of using the Capture Attribute node, we could as well calculate the index of the instantiation point based on the index of each vertex of a tree. This is possible, because every tree instance has the same number of vertices:

calculate the index of the original point

What about using the Geometry Proximity node

My first idea was, to use the Geometry Proximity node like this, where the target is connected to the original points:

enter image description here

This in fact works, if you pull down the Density Factor of the Distribute Points on Faces node to 0.05. But for higher values, the trees get distorted. This happens, because for some vertices of a tree, foreign points are closer than the related point. Thus, these vertices are assigned to the wrong original point and they start growing earlier or later than the other vertices of the same tree. This distorts the tree.

$\endgroup$
1
  • 1
    $\begingroup$ Excellent! Thank you! :D This helped heaps! $\endgroup$ Apr 19 at 17:24
2
$\begingroup$

A bit edited version of André's answer to suit my needs:

enter image description here

Works like a charm! Thank you André!

Here are the node changes:

enter image description here

Now off to make some nice stuff with this technique! -> whee!

$\endgroup$
2
$\begingroup$

I couldn't tell exactly the effect you're going for, but here's a setup where I'm controlling the scales of the trees via their Instance on Points nodes, using a control empty. Empty's scale also comes into play for extra granularity:

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you! This certainly solves this specific issue - but André's solution works also if, say, there was 4th object 'tree3' in where the green ball flattens... or ... the trunk is modeled to go twisting instead of being straight... sorry can't explain clearly. But yes, your solution is good for some things, sure :) Thanks! $\endgroup$ Apr 19 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.