Get position of each instance from a multimeshinstance
Asked Answered
R

1

0

I am trying to limit where my MultiMeshInstance3D populates each instance on an object. I do not understand what method/attribute/functions I should be accessing/calling in order to do this. The scene is a simple sphere with a MultiMeshInstance3D populated on it.

I want to limit the population of these green squares to the upper half of the sphere. I would really like to know how to limit them to any part of the Target Surface on any mesh.

Additionally if I import an object from blender how can I limit the populations to only one surface? i.e. multiple meshes were exported, and imported as one object, and show as 'Surface1, Surface2. etc' in Godot.

Thank you

Godot v4 b3

Ramer answered 21/10, 2022 at 0:20 Comment(0)
S
0

Like I understood, the MultiMeshInstance3D differs from MultiMeshInstance before Goto 4.x and you are populating via the Properties of it (like TargetMesh, etc.).
In one of my projects I'm placing different multi meshes in 3D space via code, so I can keep any reference/index while positioning (in an array f.e.).
To achive what you want, you have to do this on your own by code.

  • get your target mesh
  • randomize position for each want mesh instance
  • if position is in an area you want (f.e. upper half of the sphere) place your mesh instance

You have to know, how to get the geometrical data of your target mesh and how to place your instances correctly.

I'm sure in Godot is a way to merge the different surfaces, can't say how it works in Blender. Maybe MeshDataTool could be a starting point because it could help to solve both of your problems. For example take a look at "create_from_surface".

Sitar answered 11/11, 2022 at 13:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.