Jump to content

Assigning material to prim group


nicholas_yue

Recommended Posts

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

odforce_primgroup_vex.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

8 hours ago, toadstorm said:

This wouldn't let you use wildcards, though. It's better to just use the group mask parameter on the wrangle.

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

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...