stevegh Posted May 3, 2013 Share Posted May 3, 2013 Fun thought to leave you gents with on this lovely Friday: How can I specify which shading layer to use inside a material written in VEX? I know we can grab the shading layer VEX node and pop that in to the texture s/t we want, but viewing the code that this generates leads me to believe that there have to be pragmas for each uv layer: #pragma label uv "UV Coordinates"#pragma hint uv hidden#pragma hint uv vector#pragma label uv4 "UV Coordinates"#pragma hint uv4 hidden#pragma hint uv4 vector#pragma label uv3 "UV Coordinates"#pragma hint uv3 hidden#pragma hint uv3 vector#pragma label uv2 "UV Coordinates"#pragma hint uv2 hidden#pragma hint uv2 vector[/CODE]followed by some lame if cases:[CODE]string layer;if(DSL>1){layer = itoa(DSL);}else{layer = "";}bound_uv = isbound("uv" + layer);if( bound_uv ) { if(layer == "") {uv1 = uv;} if(layer == "2") {uv1 = uv2;} if(layer == "3") {uv1 = uv3;} if(layer == "4") {uv1 = uv4;}} else { uv1 = set(s, t, .5);}[/CODE]and even this doesn't seem to work.Am I incorrect?Have a good weekend ya'll! Quote Link to comment Share on other sites More sharing options...
stevegh Posted May 3, 2013 Author Share Posted May 3, 2013 Ok this DOES work but there must be a nicer way? 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.