Houdini Arnold Operator assign shader based on primitive attribute

Houdini Arnold Operator assign shader based on primitive attribute

Anonymous
Not applicable
2,154 Views
6 Replies
Message 1 of 7

Houdini Arnold Operator assign shader based on primitive attribute

Anonymous
Not applicable

Hi guys

I'm currently trying to assign different shaders to a bunch of shapes in the same geo node using Arnold Operators in Houdini. Each shape has a primitive attribute called name with a unique value.

Now I'm trying to assign shaders to these shapes based on their names, but Arnold doesn't respond to any of the methods in the help documents on operators.

If I use an assign material node to assign a shader to a collection that grabs the whole geo node, everything works well. However trying to isolate the assignment further has been fruitless so far.

I've tried this:

COLLECTION NODE
Selection: /obj/myObjects*
Collection: myCollection

ASSIGN MATERIAL NODE:
Selection: #myCollection
Shader Network: /shop/grey_mat

This works, all objects get a grey shader. Now this next thing doesn't work:

COLLECTION NODE
Selection: /obj/myObjects*
Collection: myCollection

ASSIGN MATERIAL NODE:
Selection: #myCollection and *.(name=='*nameValue*')
Shader Network: /shop/grey_mat

Now no shaders are assigned even though they primitives in the geo node does have the primitive attribute. I've also tried this method, which doesn't work either:

COLLECTION NODE
Selection: /obj/myObjects*
Collection: myCollection

ASSIGN MATERIAL NODE:
Selection: #myCollection and *nameValue*
Shader Network: /shop/grey_mat

Funny thing is, when I load similar geometry as a packed alembic. All the above methods work and shaders are assigned correctly. Anyone know what I'm doing wrong?

Any help is appreciated.

0 Likes
2,155 Views
6 Replies
Replies (6)
Message 2 of 7

Stephen.Blair
Community Manager
Community Manager

That "bunch of shapes in the same geo node" is probably exported a single polygon mesh. Export an ASS file and check.



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 3 of 7

Anonymous
Not applicable

Yes it is indeed exported as a single polygonal mesh. How do I make sure they stay as separate pieces of geo? Do I need to mimic a maya path attribute?

0 Likes
Message 4 of 7

Stephen.Blair
Community Manager
Community Manager

AFAIK everything in a Geometry node is exported as a single polymesh
@ ?



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 5 of 7

Anonymous
Not applicable

It makes sense now why only procedurals and packed alembics work then, because of their internal hierarchy that keeps shapes separate. Is there really no way around this other than caching out your geo with a hierarchy through the alembic rop node?

0 Likes
Message 6 of 7

julian.hodgson
Advocate
Advocate

Yes currently all the geometry will be exported as a single mesh and the operator won't change the shader per polygon for example.

If you are instancing, you could look into using the copy to points with the pack and instance option, as this will create ginstances for each copy. Then you could try to use a selection based operator on a custom attribute such as the path attribute.

0 Likes
Message 7 of 7

svenakelian
Participant
Participant

@Stephen It might be a good idea for the ASS exporter to use something like the SOP Alembic ROP, it can create a hierarchy from prim attributes, path by convention I think.

Another option would be to use prim groups, I'm not sure if this is possible either with operators currently.

0 Likes