Jump to content
anicg

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

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×