1
$\begingroup$

Hi everyone,

I created geometry nodes and want to export them in gltf/glb format (to use with three.js). The important thing here is that as a result I need to have many individual sprinkle meshes with position and !!!rotation!!!

enter image description here enter image description here

To my understanding such operation requires converting the instances to actual meshes (because geometry nodes are not supported outside of blender).

I figured that I would do the following:

  1. Apply the geometry nodes modifier and get one big mesh built of many small sprinkles.
  2. Separate the output mesh with 'Separate by lose parts' tool. This gives me many meshes of individual sprinkles. Great so far.
  3. Set origin for each mesh to the center of mass, so that the position of meshes is correct.

But the actual output of such operations is many meshes with correct postition but the rotation is set to [0, 0, 0] which is not what I am looking for. Every mesh also has a different geometry (which makes the sprinkles visually rotated while rotation set to 0). Ideally I would like all of them to have the same geometry but the rotation specified relatively to the original mesh which I was gaining the instance geometry from.

enter image description here

Do you have any suggestions or ideas? I think of 3 possible solutions.

  1. Generating many individual meshes directly from geometry nodes. This could preserve the position and rotation with no need to 'separate by loose parts' and 'set origin to center of mass.
  2. After doing all steps that I listed, recognizing that all these meshes are in fact the same geometry and rotating them relatively to the original mesh.
  3. Somehow saving the rotation vector calculated inside the geometry nodes to vertices (or something else?). In result the sprinkle meshes would still have the rotation = [0, 0, 0], but the vertices would store the data about rotation and I would then handle it programatically.

Thanks.

EDIT Actually a thing that would also work for me is if I could print the list of all positions and rotations for each point/instance directly from geometry nodes.

$\endgroup$
3
  • $\begingroup$ I'm not good at python scripting and such things, but as long as the sprinkle instances are not realized, you can see the positions and rotations in the Spreadsheet. Unfortunately this has no option to output the columns in a text file (yet), or at least not that I know. But maybe someone else has an idea how to output the data with a script... $\endgroup$ Aug 25 at 7:06
  • $\begingroup$ "Actually a thing that would also work for me is if I could print the list of all positions and rotations for each point/instance directly from geometry nodes." - Find object instances with python $\endgroup$ Aug 25 at 10:43
  • 1
    $\begingroup$ Thank you guys! $\endgroup$ Aug 25 at 12:41

0

You must log in to answer this question.

Browse other questions tagged .