Bonsai: preserve drawing cameras per viewport - #9464
franklincg wants to merge 1 commit into
Conversation
Pin other camera-perspective viewports to the previous scene camera before activating a new drawing camera, while preserving existing local-camera and perspective views. Prefer the invoking VIEW_3D area so multi-viewport activation targets the correct space. AI-assisted change: implementation and focused regression tests were developed with OpenAI Codex and reviewed by the contributor. Refs IfcOpenShell#6432
|
Thanks for confirming #6432 is still funded. The first focused camera-localization slice is now in this PR and is mergeable. GitHub Actions is currently waiting on the standard maintainer approval for an external contributor. Could a maintainer approve the workflow and review this slice? I kept the PR deliberately narrow: it prevents other camera-mode 3D viewports from following the scene camera when a different drawing is activated, while preserving existing local cameras and perspective views. For the funded item, please also let me know whether you consider this camera-independence slice an acceptable first funded milestone, or whether you want the visibility / representation state made viewport-local before any payout. I can continue with the next bounded slice based on that answer. |
Summary
This is a focused first step toward #6432: keep camera-mode 3D viewports on their current drawing camera when another viewport activates a different drawing.
Before changing
scene.camera, Bonsai now pins other camera-perspective viewports that are still following the scene camera to the previous camera usingSpaceView3D.use_local_camera. The viewport that invoked drawing activation is preferred as the active target, while existing user-local cameras and non-camera perspective views are left unchanged.Scope
This addresses the camera-switching part of #6432. Bonsai still has drawing activation paths that change object visibility and IFC representations at scene/view-layer level, so this PR does not claim to make all drawing state viewport-local yet. I kept this change narrow rather than mixing a broader visibility/representation redesign into the camera fix.
Testing
git diff --checkCOMPILE_OK).pytestinstalled (ModuleNotFoundError: No module named 'pytest'), so the repository CI remains the authoritative test run.AI assistance
OpenAI Codex was used to help investigate, implement, and review this change. I reviewed the resulting code and tests and take responsibility for the contribution.
Refs #6432