3
$\begingroup$

I wonder if there is a way to solve this problem. There are several objects whose size and position are identical. And there is a single terrain mesh. I want to position these objects with always the same distance to terrain mesh.

I want the white objects to be positioned where the red objects are drawn:

enter image description here

Can this be solved with a script, or is there another way to do this?

$\endgroup$
1
  • $\begingroup$ Misunderstood i think , whites should be red after something.. $\endgroup$
    – ahmet oru
    Jan 12, 2023 at 13:49

2 Answers 2

6
$\begingroup$

You can do this with a Shrinkwrap constraint. Select one of your objects give it the constraint, and adjust the projection direction and distance as you like:

enter image description here

Here, I'm copying the constraint to the other objects using the shipped add-on - 'Interface: Copy Attributes Menu'. But it can be done through Header > Object > Constraints.

If you want to apply the constraints and get rid of them, that would be CtrlA > Apply Visual, followed by 'Clear Object Constraints', again, from the header menu.

$\endgroup$
4
$\begingroup$

Alternate version with Geometry Nodes:

Set a Vertex Group:

enter image description here

Instance along that Vertex Group by converting it to a Curve:

enter image description here

  • The diamond shaped 'Selection' Node can be set in the Modifiers Properties, click the cross icon and then click the blank field and select your Vertex group

  • Number of instances is set with Count in the Resample Curve Node

  • Distance from surface is the Z Axis in Set Position node

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .