Page MenuHome

Cleanup: some refactoring in mapped mesh extraction
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Aug 12 2022, 7:54 PM.

Details

Summary
  • Flip the logic to first detect if we are dealing with an unmodified mesh in editmode. And then if not, detect if we need a mapping or not.
  • runtime.is_original is only valid for the bmesh wrapper. Rename it to clarify that and only check it when the mesh is a bmesh wrapper.
  • Remove MR_EXTRACT_MAPPED and instead check only for the existence of the origindex arrays. Previously it would sometimes access those arrays without MR_EXTRACT_MAPPED set, which according to a comment means they are invalid.

Depends on D15658

Diff Detail

Repository
rB Blender
Branch
fix-subd-select (branched from master)
Build Status
Buildable 23341
Build 23341: arc lint + arc unit

Event Timeline

Brecht Van Lommel (brecht) requested review of this revision.Aug 12 2022, 7:54 PM
Brecht Van Lommel (brecht) created this revision.

This is refactoring I did for D15658, but that ultimately was not necessary to fix that specific bug.

I don't know if this fixes any real bugs, but maybe worth landing in master since I find the correctness of the old logic very hard to verify.

Looks good to me (tm). But would still like someone else more familiar with the extractor code to have a look.

This revision is now accepted and ready to land.Aug 16 2022, 10:32 AM

I haven't noted this in D15658, but the removal of MR_EXTRACT_MAPPED in the extractors kind of looks like the extension of D14773 where it was also removed in some places as the origindex layers were used even without mapped extraction. Comments in D14773 also point to removing all of these, but it was not done as back then we were in BCon3 already, and then was forgotten about.