Jump to content

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
Link to comment
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.


 

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...