Community
Arnold for Houdini Forum
Rendering with Arnold in Houdini and Solaris using the HtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Houdini Arnold Operator assign shader based on primitive attribute

6 REPLIES 6
Reply
Message 1 of 7
holst.rune
1251 Views, 6 Replies

Houdini Arnold Operator assign shader based on primitive attribute

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.

Labels (4)
6 REPLIES 6
Message 2 of 7
Stephen.Blair
in reply to: holst.rune

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
Message 3 of 7
holst.rune
in reply to: Stephen.Blair

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?

Message 4 of 7
Stephen.Blair
in reply to: holst.rune

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



// Stephen Blair
// Arnold Renderer Support
Message 5 of 7
holst.rune
in reply to: holst.rune

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?

Message 6 of 7
julian.hodgson
in reply to: holst.rune

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.

Message 7 of 7
svenakelian
in reply to: holst.rune

@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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report