Jump to content
avak

calling an attribute to be used for reading texture's sequence numbers

Recommended Posts

Hello,

I used connectivity SOP to create a class attribute for each closed primitives, so we have an attribute, class with integer number value assigned to it. then I have a uvquickshade to read a texture which its naming format is like this (color.#.jpg).

now I have a problem with how to read this attribute (class) to be used inside uvquickshade node to read # and load textures.Seems simple but when I add it like this : color.@class.jpg or color.$CLASS.jpg or color.`@class`.jpg it doesn't work. Thanks for your help

 

Edited by avak

Share this post


Link to post
Share on other sites

I am not sure if the uvquickshade is something that can run over each primitive, and I am not the best with Hscript (which is what you need for your string to work) however the workaround for this could be as follows:

in primwrangle:

s@texture = "yourpath."+itoa(prim(0,"class",@primnum))+".jpg";

then in a primvop put down a texture node, and connect uv from global to uv on texture node.

put down a bind and import the attribute "texture"

pipe the bind node into the map slot on the texture node.


 

Share this post


Link to post
Share on other sites
22 minutes ago, Jesper Rahlff said:

I am not sure if the uvquickshade is something that can run over each primitive, and I am not the best with Hscript (which is what you need for your string to work) however the workaround for this could be as follows:

in primwrangle:

s@texture = "yourpath."+itoa(prim(0,"class",@primnum))+".jpg";

then in a primvop put down a texture node, and connect uv from global to uv on texture node.

put down a bind and import the attribute "texture"

pipe the bind node into the map slot on the texture node.


 

I will try it now, Thanks

Share this post


Link to post
Share on other sites
36 minutes ago, Jesper Rahlff said:

I am not sure if the uvquickshade is something that can run over each primitive, and I am not the best with Hscript (which is what you need for your string to work) however the workaround for this could be as follows:

in primwrangle:

s@texture = "yourpath."+itoa(prim(0,"class",@primnum))+".jpg";

then in a primvop put down a texture node, and connect uv from global to uv on texture node.

put down a bind and import the attribute "texture"

pipe the bind node into the map slot on the texture node.


 

I will try it now, Thanks

...Probably I am doing something wrong, 

I followed the steps but still not able to read textures,

 

questio.zip

Share this post


Link to post
Share on other sites

I believe I did it Jesper

Should I connect the output of texture node to a bind export? 

 

I, image.thumb.png.d73db1a4b8975a49a39135769491356e.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×