question

Rune Mansson avatar image
Rune Mansson asked ·

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.

shadershoudinihtoa arnold houdinioperator
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Julian Hodgson avatar image
Julian Hodgson answered ·

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.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Rune Mansson avatar image
Rune Mansson answered ·

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?

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

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

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

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

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

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 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.