nicholas_yue Posted September 18, 2020 Share Posted September 18, 2020 Hi, I have the following geometry with prim group. I wish to assign a specific material to a specific prim group, I am using an Attribute Wrangler SOP to perform the VEX operation but can't work out the variable name I should be using to do the comparison printf('%s',s@path); printf('nicholas test\n'); // if(match('*sphere*', s@path)) s@shop_materialpath = '/mat/red'; Cheers Quote Link to comment Share on other sites More sharing options...
toadstorm Posted September 18, 2020 Share Posted September 18, 2020 Generally you'd just use the group mask parameter on the primitive wrangle itself, rather than a conditional statement. If you have to use a conditional, though, it'd look like this: if(inprimgroup(0, "sphere", @primnum)) { s@shop_materialpath = "whatever"; } This wouldn't let you use wildcards, though. It's better to just use the group mask parameter on the wrangle. Quote Link to comment Share on other sites More sharing options...
anim Posted September 19, 2020 Share Posted September 19, 2020 On 9/18/2020 at 8:51 PM, toadstorm said: This wouldn't let you use wildcards, though. It's better to just use the group mask parameter on the wrangle. Expand or directly Material SOP for that matter but also you should be able to use wildcards, adhoc groups (or any syntax that group fields allow) with inprimgroup() function 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.