Message 1 of 11
Python - Maya group meshes by material within selected group
Not applicable
11-12-2018
02:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is a python request I admit... I dunno how to code it.
Suppose you have a list of meshes with arbitrary names within a selected group and you want to merge them by material, but keep the result of each merge within the selected group.
From
GroupA
-mesh(mat1)
-mesh(mat2)
-mesh(mat2)
-...
to
GroupA
- merge1 (mat1 meshes)
- merge2 (mat2 meshes)
There may be usage of the material outside the selected group and those shouldn't be involved.
This is challenging because SelectByMaterial grabs the whole scene and Combine chucks meshes out of their current group and requires DeleteHistory to divorce the result from its transforms (left hanging in the wind).