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: 

Call different texture files based on primitive attributes in Houdini

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
1508 Views, 7 Replies

Call different texture files based on primitive attributes in Houdini

Hey all,

New Arnold user here--Im using it with Houdini. Im trying to call a series of texture files from disk. There is an object that is iterated around 300 times, it has the same uv set for each iteration, but I want to call a different texture variation from disk for each iteration within the same shader. These 'objects' by the way are not objects in the maya sense, they are primitive groups within the same object--with a different primitive attribute id for each group.

When I was using mantra, I was creating material overrides using local variables. For example, the parameter 'displacement' was created on the primitives. It was a string attribute which literally specified which displacement texture maps to call based on their file location and name -- the id attribute was applied within the string to call the different textures sets

so for

id 2
the override was

displacement

`/Users/machineroom/Desktop/Justin/HOUDINI/PROJECTS/TREE_BLOOM/tex/disp_test_new/disp_test.2.exr`

This parameter (displacement) was then piped into the file input for the displacement maps.

Is there a way for me to replicate this setup to some degree using arnold?--perhaps the utility node?

This video here was helpful, but not as fully procedural as I would like considering the vast number of texture files I am going to have to call, and how specific I am going to have to be.

https://vimeo.com/265891657

Ive attached a series of picture files in hopes of making things clearer.

pic 1: The object itself

pic 2: visualization of id attributes-small window on left shows that each petal has a different id

pic 3: the material overrides set up on the object

pic 4: the shader setup itself

Thank you in advance for any suggestions

2920-1-object-itself.png

2921-2-idvalues.png

2922-3-material-override-object-level.png4-material-overridein-shader.png

7 REPLIES 7
Message 2 of 8
Stephen.Blair
in reply to: Anonymous

Use the attr token to get user data exported on the shape



// Stephen Blair
// Arnold Renderer Support
Message 3 of 8
Anonymous
in reply to: Anonymous

thanks for the quick response--trying to set it up now

Message 4 of 8
Anonymous
in reply to: Anonymous

Hey @Stephen Blair so I now have the primitives tagged with the following attribute:

basically the file locations are stored as a string and the attribute is called disppath
@disppath
'/Users/machineroom/Desktop/Justin/HOUDINI/PROJECTS/TREE_BLOOM/tex/disp_test_new/disp_test.1.exr'

etc etc.

Its a primitive attribute again

On the shader side i have the image file hooked up:

i'm trying a few different inputs to get it to call the string but im not getting any results:

The last thing I tried was

<disppath:> because i thought the other two inputs were optional..

Im obviously doing something wrong.

what is the syntax here for the input?

Thanks!

2925-screen-shot-2018-12-21-at-122606-pm.png

Message 5 of 8
Stephen.Blair
in reply to: Anonymous

<attr:disppath>



// Stephen Blair
// Arnold Renderer Support
Message 6 of 8
Anonymous
in reply to: Anonymous

@Stephen Blair

Thanks. I did have that figured out finally. I think the reason its still not working is because i have to add that attr as user data inside the shader. How do I bind the string attr to the shader itself? As far as inputs are concerned the image node is what is calling the file--where does the user data attribute get plugged in? Right now I just have the user attrib node in there with the attr string, but its not plugged in yet. Ive attached another screenshot to show where im at. Thanks for the help!

screen-shot-2018-12-21-at-32739-pm.png

Message 7 of 8
Anonymous
in reply to: Anonymous

Hi

7 months ago I did a tutorial on mtoa token <attr😆 & <shapeName> , for Maya, maybe you can adapt that to Houdini
take a look here
https://www.youtube.com/watch?v=OtL7HMWyBPI

Message 8 of 8
Philip_Pappas
in reply to: Anonymous

Hello, found this post after i learned python while trying to do the same thing in Houdini Mantra but as soon as i plugin to the material node my primitive attribute a warning pops saying

"Error: Infinite recursion in evaluation..."

also no textures show up on the viewport.

Can you share an example?it would be really helpful to spot the error

,

Hello, found this post after i learned python while trying to do the same thing in Houdini Mantra but as soon as i plugin to the material node my primitive attribute a warning pops saying

"Error: Infinite recursion in evaluation..."

also no textures show up on the viewport.

Can you share an example?it would be really helpful to spot the error

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

Post to forums  

Autodesk Design & Make Report