avak Posted March 8, 2018 Share Posted March 8, 2018 (edited) 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 March 8, 2018 by avak Quote Link to comment Share on other sites More sharing options...
Jesper Rahlff Posted March 8, 2018 Share Posted March 8, 2018 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. Quote Link to comment Share on other sites More sharing options...
avak Posted March 8, 2018 Author Share Posted March 8, 2018 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 Quote Link to comment Share on other sites More sharing options...
avak Posted March 8, 2018 Author Share Posted March 8, 2018 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 Quote Link to comment Share on other sites More sharing options...
Jesper Rahlff Posted March 8, 2018 Share Posted March 8, 2018 remember you need to set the bind node to string. Quote Link to comment Share on other sites More sharing options...
avak Posted March 8, 2018 Author Share Posted March 8, 2018 I believe I did it Jesper Should I connect the output of texture node to a bind export? I, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.