← All ideas
  • Published 30 May 2022

GeoNodes - "instance on separated geometry" node

Was watching this blender bob video: youtube.com/watch for crowd generation. In it, the goal was to place people where seats are. His method works well, but it gave me an idea for geometry nodes where the functionality could be "built in", and no need to manually extract the location data he needed using edit mode techniques. The idea is to have functionality built into geometry nodes to include an "instance on seperated geometry" node with an offset parameter -- a postion offset parameter could allow placement in relation to the bounding box center of that piece of separated geometry.

0%

Development Status: Open

Upvote 0 Downvote 1
JeffG
30 May 2022

2 Comments

Not sure why another part of my comment is rejected by the site... trying again

Here's a snippet you could use in a script (edit mode enabled):

mesh = bmesh.from_edit_mesh(bpy.context.object.data)
lay  = mesh.verts.layers.int["Sitting position"]
for v in mesh.verts:
  if v.select:
    v[lay] = 1
bmesh.update_edit_mesh(bpy.context.object.data, loop_triangles=False, destructive=False)

Hm... how about this for a more general solution?

  1. For your chair mesh, add a new custom marker attribute (name it "Sitting position" or something like that) -- Integer, Vertex domain.
  2. Add a free-floating marker vertex to your chair mesh.
  3. Using the python interface during edit mode, set this attribute for this new vertex from 0 (default) to 1.
  4. In the geometry node network, use the delete geometry node in combination with a filter for this attribute (maybe after realizing your instances, depending on what you've set up), so all that remains are your sitting positions.
  5. Spawn your instances on points there.

Et voila. :)

You could check your custom attribute in the spreadsheet view.