Search - User list
Full Version: texture file, getting number from node
Root » Technical Discussion » texture file, getting number from node
maxxx1138
Still *very*new to Houdini, and trying to figure some stuff out.

So, my project will have many pages of a book that have different textures on each one. I'm currently trying to work out how to get each page to have that different texture, based on it's own name. I'm running into trouble, though, trying to get information about a node relative to the texture node.

Here are two screencaps:

http://www.maudit.net/houdini_class/images/houdini_class_01.jpg [maudit.net]

http://www.maudit.net/houdini_class/images/houdini_class_02.jpg [maudit.net]

In the first one, you can see the simple shader I put together in the VOPs network. As you can see, I am using opdigits in the texture map area to call that map based on the last digit of the node the texture is being called from. In the second one, you can see I've done the same with shaders that I am calling in the shop node.

Here's my problem:

I need to be able to find the name of the geometry that the shader is attached to, I need a path that is relative from this texture node. My current solution would work, but it would require a different shader for each page, which I do not want. I want one shader, but to have it call the correct texture. So, if the shader is attached to geometry that is called page1, page2 etc. I'd like the texture to use that number off the page node, not off of it's own node. I don't know how to get that relative path. I looked at all of the “op” stuff under exhelp and can't figure this one out. Seems like one of them, like opfullpathfrom() or something like that might work, but I can't get this data. Because this shader is under /vex/surface/pages2/texture2, I do not see a way to back upstream and find the object it's attached to. I need this path to not be specific either, as it will be for more than one piece of geometry.

Someone told me that $OBJ would return the model the shader is attached to, but I don't know what exactly they mean as far as where I could use the variable. They also told me to create a paramter for the texture so I could control it from the SHOP, but when I do this I don't realyl see it giving me a lot more control.

Any ideas or help would be greatly appreciated.

cheers,

-Matt
edward
Here's one example using the Shader SOP *without* indirect references and copy/stamping. Note that you won't be able to see the shader in the viewer, but it will render correctly.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB