Maniphest T100329

align active with orthographic view and use_auto_perspective navigation setting to return to perspective viewport afterwards
Closed, Archived

Assigned To
None
Authored By
MACHIN3 (MACHIN3)
Aug 10 2022, 6:35 PM
Tags
  • BF Blender
Subscribers
Campbell Barton (campbellbarton)
Eugene Du (APEC)
Germano Cavalcante (mano-wii)
MACHIN3 (MACHIN3)
zender (aschellekens1100)

Description

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: rBbcfdb14560e7
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!

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

Related Objects

Mentioned Here
T93779: Disappearing grid and wrongly labeled "Front Orthographic" instead of "Top Orthographic" view
rB3ecc03c3d6b7: Fix T93779: Python is unable to set axis aligned views

Event Timeline

MACHIN3 (MACHIN3) created this task.Aug 10 2022, 6:35 PM
MACHIN3 (MACHIN3) updated the task description.
MACHIN3 (MACHIN3) updated the task description.Aug 10 2022, 6:40 PM
MACHIN3 (MACHIN3) updated the task description.
MACHIN3 (MACHIN3) updated the task description.
zender (aschellekens1100) added a subscriber: zender (aschellekens1100).Aug 10 2022, 7:23 PM

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

Eugene Du (APEC) added a subscriber: Eugene Du (APEC).Aug 10 2022, 7:47 PM
Germano Cavalcante (mano-wii) closed this task as Archived.Aug 10 2022, 11:07 PM
Germano Cavalcante (mano-wii) added subscribers: Campbell Barton (campbellbarton), Germano Cavalcante (mano-wii).

I'm pretty sure the behavior has changed in rB3ecc03c3d6b7: Fix T93779: Python is unable to set axis aligned views.
It was a fix for the bug described in T93779: 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)

MACHIN3 (MACHIN3) added a comment.EditedAug 11 2022, 9:17 AM

@Campbell Barton (campbellbarton) 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.

Campbell Barton (campbellbarton) added a comment.Aug 12 2022, 7:14 AM

You can set region_3d.view_perspective = 'ORTHO'

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

C.screen.areas[3].regions[5].data.view_perspective = 'ORTHO'.

MACHIN3 (MACHIN3) added a comment.EditedAug 12 2022, 7:26 AM

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.

Campbell Barton (campbellbarton) added a comment.Aug 12 2022, 7:57 AM

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.