3
$\begingroup$

Currently I'm trying to find a Geometry Nodes solution on how to get the name of the object that is assigned in an Object Info node, as a string value, to be able to use it in a string type Compare node. I'm trying to figure this out because I need to be able to rotate geometry but only when a specific object gets assigned to the Object Info node, otherwise the normal behaviour should be used.

With Geometry Nodes I've built a system that makes it possible to dynamically generate room layouts with 3D assets from our Asset Library, a Python script and a CSV file. Everything works properly but 1 specific door handle doesn't get placed properly (to place the objects I make use of the Instance On Points and Instance To Points nodes).

This is how the door handles gets placed with the current Geometry Nodes setup (the bottom 2 are correct but the top object isn't placed correctly): Wrong placement

This is what it should look like: Correct placement

This is Geometry Nodes setup: GeoNodes

I've tried to solve this by adding a custom Object Property to this specific door handle object but I can't find a way to access that property with Geometry Nodes, maybe that is because the object is linked from our Asset Library?

Or are there other ways to access custom object properties with Geometry Nodes? Would it for example be easier / better to add code to my Python script that toggles a Boolean Node connected to the Switch node when the "H81 door handle object" is used?

If someone has another idea then those ideas are welcome as well! :)

Thanks in advance!

$\endgroup$
1
  • 1
    $\begingroup$ Can't read the object name. Can't read custom properties. You would need Python to read these and store in a format accessible by geonodes. $\endgroup$ Commented Feb 11 at 16:26

1 Answer 1

3
$\begingroup$

I think this should work, if I read your question correctly. You can't use object names as a mask because it's not a field attribute. So you just need to figure out how to translate the value you want into a field-type attribute.

enter image description here

In this case I added a vertex group called "is_cone" and set the verts in the cone object to this group. There might be other ways, but this seemed easiest to me.

enter image description here

$\endgroup$
3
  • $\begingroup$ That seems like a good way to be able to get a field-type attribute into the GeoNodes system indeed, the only issue I'm running into with this approach is that the Switch node can't read Field type input data (I need a Switch node to switch between the 2 different transform behaviours depending on the assigned object). I'll have to look into that or try to fix it with Python. Thanks for the insights! $\endgroup$ Commented Feb 13 at 9:59
  • 1
    $\begingroup$ Thats the point of field attributes, you don't use a switch node, you just apply a node to all of the geometry and then use the field attribute into the Selection input of that node to "Switch" between which geo is affected. $\endgroup$ Commented Feb 13 at 15:27
  • 1
    $\begingroup$ Ah I understand now, just did a quick test and it seems to work perfectly. Will do some additional testing but it looks great so far, never even considered the options and use cases of field attributes. There is always more to learn :) $\endgroup$ Commented Feb 14 at 8:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.