Skip to content

Bonsai: preserve drawing cameras per viewport - #9464

Open
franklincg wants to merge 1 commit into
IfcOpenShell:v0.9.0from
franklincg:money-agent-6432-multiple-drawings
Open

franklincg wants to merge 1 commit into
IfcOpenShell:v0.9.0from
franklincg:money-agent-6432-multiple-drawings

Conversation

@franklincg

Copy link
Copy Markdown

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 using SpaceView3D.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 --check
  • Both changed Python files compiled successfully inside Blender 4.5 (COMPILE_OK).
  • Added focused regression coverage for preserving the previous scene camera in other camera-mode viewports and leaving local/perspective views untouched.
  • I attempted the focused Blender pytest run, but this local Blender Python does not have pytest installed (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

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
@franklincg

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant