Replace polyop.detachFaces with a two-phase approach: Phase 1 reads
all face vertex positions into plain Python tuples without mutating
the source mesh, Phase 2 creates new PolyMeshObject nodes from the
cached data. This eliminates the index-shifting sequential dependency
that forced reverse iteration and removes per-call detachFaces overhead.
Wrap per-face scene operations in `with pymxs.undo(False):` inside
both convert_to_triangle_faces() and convert_to_mnmesh_faces().
The outer `with pymxs.undo(True, "Explode Geometry"):` in do_explode()
still provides a single undo group entry, so Ctrl+Z reverts the
entire operation in one step while eliminating per-face undo overhead.
Wrap the explode operation in disableSceneRedraw/enableSceneRedraw
with a try/finally to ensure redraws are always re-enabled. This
prevents per-face viewport updates during the loop, with a single
redrawViews() call in the finally block after completion.
Measure the explode operation with time.perf_counter() and print a
"completed successfully in N seconds" summary to the MAXScript Listener
after a successful run. Uses a direct print() so the summary always shows
regardless of the debug-messages toggle.
Mirrored to Bundle2/Contents/python/explode_geometry.py.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Relocate the progress panel so it renders above the Explode button, and
add a "Show Debug Messages" checkbox to the Explode Options. Replace the
print() calls with a stdlib logging.Logger ("ExplodeGeometry") that writes
to the MAXScript Listener via stdout. When the checkbox is checked the
logger level is DEBUG (all messages); otherwise it is WARNING so only
warning/critical messages pass through.
Mirrored to Bundle2/Contents/python/explode_geometry.py.
Closes#3
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Show progress panel when Explode begins, hide before dialog closes
- Update node name and counter labels per object during processing
- Add on_progress callback to convert_to_triangle_faces and convert_to_mnmesh_faces
- Mirror all changes to Bundle2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>