Overview
Prevent entering Edit Mode on extremely heavy meshes by patching MACHIN3tools operators and object.mode_set, with optional debug logging.
UI Location
Edit → Preferences → Add-ons → search for Guard Edit Mode for MACHIN3tools (debug).
Features
- Vertex-count guard: Checks the active mesh’s vertex count before allowing Edit Mode, and blocks it when the count exceeds a configurable threshold.
- Operator patching: Wraps
machin3.edit_mode,machin3.mesh_mode, andobject.mode_setto enforce the guard, handling bothexecute()andinvoke()where needed. - User preferences: Vertex Threshold sets the maximum allowed vertices; Enable debug logging prints detailed events and errors to the system console.
- Non-destructive: On unregister, restores original operator methods.
Usage
- Install and enable the addon.
- In the add-on preferences, set Vertex Threshold (e.g.
1,000,000) and optionally enable debug logging to see guard decisions in the console. - Use MACHIN3tools (or
Tab/mode switching) as usual — if the active mesh exceeds the threshold when attempting to enter Edit Mode, a popup warns you and the action is cancelled. - Disable or uninstall the addon to remove all patches and restore original behavior.