Jump to content

Python/VEX: create and assign material to each existing shop_materialpath


anicg

Recommended Posts

For each existing shop_materialpath (there are a lot of them):

- create a group, with the same name as the shop_materialpath

- create and assign a material with the same name as the shop_materialpath

Edited by anicg
Link to comment
Share on other sites

10 hours ago, sadhu said:

Check this file

group_material.hipnc

I'm a bit lost here, I meant for each existing shop_materialpath, I do not need to create any shop_materialpath, I need to create groups and materials.

I have a 3D model pack that has some 30 shop_materialpaths, I just need each one of them to become a group and have a material in the mat context with the same name.

the shop_materialpath is a starting point, it's an input that we already have.

Edited by anicg
Link to comment
Share on other sites

not entirely sure what youre wanting but hopefully this helps:

shop_materialpath.hipnc
shop_materialpath_py.txt

assuming all of your geometry has a shop_materialpath attribute, the wrangle will create a group for each
then if you run the code in the source editor (if its not already there paste in the txt file) it will create a new material in /mat for each group, and add each group and corresponding shop_materialpath to the material node

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