align active with orthographic view and use_auto_perspective navigation setting to return to perspective viewport afterwards #100329

Closed
opened 2022-08-10 18:35:20 +02:00 by MACHIN3 · 11 comments

System Information
Operating system: Linux-4.15.0-175-generic-x86_64-with-glibc2.27 64 Bits
Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.103.01

Blender Version
Broken: version: 3.2.2, branch: master, commit date: 2022-08-02 18:15, hash: bcfdb14560
Worked: 3.1 and earlier

Short description of error
I have a very simple operator, that runs bpy.ops.view3d.view_axis(type='TOP', align_active=True), makes the view orthographic and sets context.space_data.region_3d.is_orthographic_side_view = True

The last seems to be required, so the PreferencesInput.use_auto_perspective navigation setting (in preferences) works. Meaning, once the view is rotated the view switches back to perspective from orthographic.

This used to work beautifully for a long time. Unfortunately it no longer does as of Blender 3.2.
The reason being, setting context.space_data.region_3d.is_orthographic_side_view = True will actually change the viewport to a side view now, thereby loosing the alignment to the active selection.

video demo

I can understand if this was an intentional change, but would like to hear suggestions, about whether/how the previous behavior of the operator could then be reproduced now.
Thanks!

align_active_with_ortho_view_and_use_auto_perspective.blend

Exact steps for others to reproduce the error

  • open the blend file in 3.1 and 3.2
  • ensure use_auto_perspective is enabled in your navigation preferences
  • in each one run the script, then call the ViewSelectionFromTop() operator in the 3d view
  • in 3.1 it will align an orthographic view to the face, and once the viewport is rotated switch back to a perspective view
    • commenting out the last line, will lead to the perspective switch no longer working
  • in 3.2 it will go into an orthographic side view, no longer aligned to the face selection
    • commenting out the last line, will lead to the perspective switch also no longer working, but the view is now still aligned with the selection
**System Information** Operating system: Linux-4.15.0-175-generic-x86_64-with-glibc2.27 64 Bits Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.103.01 **Blender Version** Broken: version: 3.2.2, branch: master, commit date: 2022-08-02 18:15, hash: `bcfdb14560` Worked: 3.1 and earlier **Short description of error** I have a very simple operator, that runs `bpy.ops.view3d.view_axis(type='TOP', align_active=True)`, makes the view orthographic and sets `context.space_data.region_3d.is_orthographic_side_view = True` The last seems to be required, so the `PreferencesInput.use_auto_perspective` navigation setting (in preferences) works. Meaning, once the view is rotated the view switches back to perspective from orthographic. This used to work beautifully for a long time. Unfortunately it no longer does as of Blender 3.2. The reason being, setting `context.space_data.region_3d.is_orthographic_side_view = True` will actually change the viewport to a side view now, thereby loosing the alignment to the active selection. [video demo ](https://www.youtube.com/watch?v=NKBr3-TRRck) I can understand if this was an intentional change, but would like to hear suggestions, about whether/how the previous behavior of the operator could then be reproduced now. Thanks! [align_active_with_ortho_view_and_use_auto_perspective.blend](https://archive.blender.org/developer/F13357539/align_active_with_ortho_view_and_use_auto_perspective.blend) **Exact steps for others to reproduce the error** * open the blend file in 3.1 and 3.2 * ensure use_auto_perspective is enabled in your navigation preferences * in each one run the script, then call the ViewSelectionFromTop() operator in the 3d view * in 3.1 it will align an orthographic view to the face, and once the viewport is rotated switch back to a perspective view * commenting out the last line, will lead to the perspective switch no longer working * in 3.2 it will go into an orthographic side view, no longer aligned to the face selection * commenting out the last line, will lead to the perspective switch also no longer working, but the view is now still aligned with the selection
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3

Added subscriber: @aschellekens09

Added subscriber: @aschellekens09

Reproduced on win 10 using blender 3.2 ( did not try 3.1 but can confirm operator sets orthographic side view)

Reproduced on win 10 using blender 3.2 ( did not try 3.1 but can confirm operator sets orthographic side view)

Added subscriber: @APEC

Added subscriber: @APEC

Added subscribers: @ideasman42, @mano-wii

Added subscribers: @ideasman42, @mano-wii

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'

I'm pretty sure the behavior has changed in 3ecc03c3d6.
It was a fix for the bug described in #93779 (Disappearing grid and wrongly labeled "Front Orthographic" instead of "Top Orthographic" view)

The problem described here doesn't look like a bug to me. So closing.

For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

(Note: The report can be reopened if the change is approved by the developers)

I'm pretty sure the behavior has changed in 3ecc03c3d6. It was a fix for the bug described in #93779 (Disappearing grid and wrongly labeled "Front Orthographic" instead of "Top Orthographic" view) The problem described here doesn't look like a bug to me. So closing. For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests (Note: The report can be reopened if the change is approved by the developers)
Author

@ideasman42 With the mentioned change, Is there any way now, to set a custom orthographic view (not side view) via Python, but have it then also respect the PreferencesInput.use_auto_perspective setting, and so return to a perspective view, once the user rotates the viewport?

The way I achieved this previously may not have been the intended use for is_orthographic_side_view, but it sure was very useful and is broken now.
The only solution now, is to manually switch to an actual side view afterwards, and then rotate into perspective again from it.

@ideasman42 With the mentioned change, Is there any way now, to set a custom orthographic view (not side view) via Python, but have it then also respect the `PreferencesInput.use_auto_perspective` setting, and so return to a perspective view, once the user rotates the viewport? The way I achieved this previously may not have been the intended use for `is_orthographic_side_view`, but it sure was very useful and is broken now. The only solution now, is to manually switch to an actual side view afterwards, and then rotate into perspective again from it.

You can set region_3d.view_perspective = 'ORTHO'

Default file with the time-line set to a Python console:

C.screen.areas- [x].regions- [x].data.view_perspective = 'ORTHO'.

You can set `region_3d.view_perspective = 'ORTHO'` Default file with the time-line set to a Python console: `C.screen.areas- [x].regions- [x].data.view_perspective = 'ORTHO'`.
Author

You misundertood. I'm doing that already, see blend file or video demo. But it won't cause the PreferencesInput.use_auto_perspective to work, in that it won't return to a perspective view once the user rotates the view.

I want to set a custom ortho viewport, but not a side view, and I want the user to rotate out of it into a perspective view, just as he can do from the ortho side views.

You misundertood. I'm doing that already, see blend file or video demo. But it won't cause the `PreferencesInput.use_auto_perspective` to work, in that it won't return to a perspective view once the user rotates the view. I want to set a custom ortho viewport, but not a side view, and I want the user to rotate out of it into a perspective view, just as he can do from the ortho side views.

In that case this seems more like a feature request, as Blender it's self also doesn't leave orthographic view after accessing bpy.ops.view3d.view_axis(type='TOP', align_active=True) vie shortcuts.

In that case this seems more like a feature request, as Blender it's self also doesn't leave orthographic view after accessing `bpy.ops.view3d.view_axis(type='TOP', align_active=True)` vie shortcuts.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#100329
No description provided.