ghost654
ghost654

Reputation: 171

Maya Python - stack similar uv shells

I have a tool that will take multiple meshes and atlas their textures together.

The meshes are duplicated and the UVs are layed out with pm.polyMultiLayoutUV. example -

pm.polyMultiLayoutUV(sc=1, rbf=1, lm=1, l=2, ou=0, ov=0, sv=1, su=1, psc=0, gu=1, gv=1, ps=0.2, fr=True)

After that it will bake the textures to the new uv layout using pm.surfaceSampler.

It works great except if it includes duplicated meshes. Ideally it would stack the UVs for the duplicated meshes that have the exact same UV and texture layout. But in this case it will not stack it will all be layed out individually taking up space.

My question is does anyone know any command or way to keep UVS that are the exact same stacked on top of each other. The polymultilayout will break up all the stacked Uvs.

Upvotes: 0

Views: 1249

Answers (1)

DrWeeny
DrWeeny

Reputation: 2512

before making the layout, I would compare the uvs coordinate of each object to find the similar ones. Then I will exclude them from the uv layout except one for each. And then I will copy paste back the new uv coordinates to the duplicate/excluded ones.

Upvotes: 0

Related Questions