Jump to content

assign materials to prims in solaris with vex?


Recommended Posts

In solaris I have a material library with materials that match the name property of each primitive mesh in the scene graph. I can use use the material assignment node to assign one material to one primative. This works and in the scene graph you can see the material binding. see attached image below:

image.thumb.png.8efe7e74946f016245021ed038d61388.png

However I want to do this with a wrangle and assign all materals to matching prims. in a wrangle :

string name = usd_name(0, s@primpath);
string mats = "/materials/"+name;
usd_addrelationshiptarget(0, s@primpath, "material:binding", mats);

as shown in this tutorial

in the scene graph it looks like it has assigned the material relationship but the materail doen't show up in the viewport. 

 image.thumb.png.2f148d3c497a1f073ea1adeb475460c2.png

If there is an obvious mistake or if there is a beter way to assign all materials with the same names as prims in solaris please let me know. 

Thanks you for  your attention.  

 

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