Object ID as seed*
I don’t believe there is a per object ID, just a per point ID, or mesh island ID, where do you retrieve this object ID?
Not quite, I need to be able to generate random seeds for existing, separate objects. So if I have Object.001, Object.002, Object.003 etc. with the same node tree, that node tree should automatically generate a random seed for each object. This feature would be very useful in quickly adding randomness to objects that share the same node tree.
Hum, for now it’s not possible to have an automatically varying seed. So you can’t duplicate an object and have a different result.
But you can expose the seed in the geometry node modifier , so by changing this parameter you’ll have another result.
Yes that’s what I’ve been doing, it just becomes incredibly cumbersome if you have dozens of objects that all need random seeds. Hopefully this feature will be added soon, I feel like it would be easy to implement whilst saving users a lot of manual work.
Reference a dummy object and set the mode to relative.
That’s a good idea but in practice Blender just ignores the location if you pipe it into the seed input (even if you compute the length first and convert that into an integer).
Subtract position from the empty objects relative location, this makes each vector unique in space.
Then I’ll get a per point random seed, because position references each point on the mesh, not each object. I need a single random seed for each object.
Sorry to spam the thread but I’ve got another issue that’s been driving me crazy. I have an alembic point cloud that I’ve imported into Blender, and am using geometry nodes to instance objects on the points from a collection. In Houdini, I specified that points were to be deleted when they reached a certain height. The problem is that when I instance objects from the collection onto the points, as points disappear from the point cloud Blender chooses different objects to instance on the points, when the instance index for each point should stay the same throughout. I assume this has something to do with Blender’s internal indexing, as Houdini shows that the index attribute for each point remains throughout the simulation. Does anyone know how I can prevent this switching between objects in the instance collection? Thanks for the help!
Isn’t that what “index” and “ID” are for. “Index” can change when points are removed or added whereas “ID” is persistent.
I think you have to set the IDs first with the “set ID” node or else the id will equal the index.
Thanks for the tip, I’ve added a “set ID” node and connected an “ID” node before I instance on the points, but I’m still having the same issue. In the video you can see my current setup. What do you think I’m missing?
Maybe you can have a driver on an integer node that generates a per-object unique id through a scripted expression ? I’m not sure that would work
what if you generate a random number, then feed that in as your seed: Geometry Nodes - #3491 by SterlingRoth
I have been looking into that but was quickly discouraged by how complicated and hacky things got! It would be great if Blender had a built in rand() function that you could just stick in a value field.
Thanks that worked! One thing I had forgotten to do was set geometry to origin for all the objects, now the relative location is different for each and the randomisation works.
Does anyone have any ideas about my instancing on alembic issue? I’m pretty stuck until I can properly instance objects from my collection on the point cloud. If anyone feels like taking a look, here’s the alembic file I’m using: https://drive.google.com/file/d/1wL5Mex0hTFybfxM-l47rOzepu2OrcaX1/view?usp=sharing. I think the main issue is that points are deleted from the alembic; this issue doesn’t arise when I use an alembic where points are continually emitted and never deleted.
(post deleted by author)