PyWavefront icon indicating copy to clipboard operation
PyWavefront copied to clipboard

collect faces by material

Open RoyJames opened this issue 2 years ago • 2 comments

This behavior is only active when collect_faces==True. This flag indicates that the user is interested in playing with faces at the cost of additional memory. This change allows people to have the option to operate on faces that has a specific material. I definitely need this feature for my own project. Pushing this change in case other people may find it useful.

RoyJames avatar Nov 09 '21 22:11 RoyJames

LGTM

Any down sides to adding this? Additional memory perhaps?

greenmoss avatar Nov 10 '21 01:11 greenmoss

LGTM

Any down sides to adding this? Additional memory perhaps?

The only downside is additional memory for duplicating faces when this flag is active - face triangle indices will be stored in two places: Material.faces (newly added in this PR) and Mesh.faces (original code). The latter is just the combination of all Material.faces.

RoyJames avatar Nov 10 '21 18:11 RoyJames