Blender crashes at OpenGL render if viewport.lock_rotation is True #119058

Closed
opened 2024-03-04 17:08:20 +01:00 by Seb Verkhozin · 1 comment

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.17

Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked: (newest version of Blender that worked as expected)

Short description of error
I use region_3d.lock_rotation to imitate flat canvas in my addon. But when viewport rotation is locked OpenGL render crashes Blender. Not big deal if users will use only addon operators, which unlock viewport before rendering, but if not - thats a problem. Confirmed at 4.1 beta and earlier versions as well

Exact steps for others to reproduce the error

  1. Open default blender file and run the code below to lock viewport rotation
import bpy
a = next(iter([i for i in bpy.context.screen.areas if i.type == 'VIEW_3D']))
a.spaces[0].region_3d.lock_rotation = True
  1. In viewport click View -> Viewport Render Image

// or use attached file with code

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.17 **Blender Version** Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: (newest version of Blender that worked as expected) **Short description of error** I use region_3d.lock_rotation to imitate flat canvas in my addon. But when viewport rotation is locked OpenGL render crashes Blender. Not big deal if users will use only addon operators, which unlock viewport before rendering, but if not - thats a problem. Confirmed at 4.1 beta and earlier versions as well **Exact steps for others to reproduce the error** 1. Open default blender file and run the code below to lock viewport rotation ``` import bpy a = next(iter([i for i in bpy.context.screen.areas if i.type == 'VIEW_3D'])) a.spaces[0].region_3d.lock_rotation = True ``` 2. In viewport click View -> Viewport Render Image // or use attached file with code
Seb Verkhozin added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2024-03-04 17:08:21 +01:00

I can confirm the issue.
Here is the call stack at the time of the crash:

Exception thrown: read access violation.
oglrender->region was nullptr.
>	blender.exe!screen_opengl_render_init(bContext * C, wmOperator * op) Line 797	C++
 	blender.exe!screen_opengl_render_invoke(bContext * C, wmOperator * op, const wmEvent * event) Line 1260	C++
 	blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, const wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1551	C++
 	blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, const wmEvent * event) Line 1752	C++
 	blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, wmOperatorCallContext context, PointerRNA * properties, const wmEvent * event) Line 1801	C++
 	blender.exe!WM_operator_name_call_ptr_with_depends_on_cursor(bContext * C, wmOperatorType * ot, wmOperatorCallContext opcontext, PointerRNA * properties, const wmEvent * event, const char * drawstr) Line 1990	C++
 	blender.exe!ui_apply_but_funcs_after(bContext * C) Line 1030	C++
 	blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * __formal) Line 11666	C++
 	blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, const bool always_pass) Line 834	C++
 	blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3326	C++
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3445	C++
 	blender.exe!wm_event_do_handlers(bContext * C) Line 4072	C++
 	blender.exe!WM_main(bContext * C) Line 638	C++
 	blender.exe!main(int argc, const char * * __formal) Line 579	C++
 	[External Code]	

I can confirm the issue. Here is the call stack at the time of the crash: ``` Exception thrown: read access violation. oglrender->region was nullptr. ``` ``` > blender.exe!screen_opengl_render_init(bContext * C, wmOperator * op) Line 797 C++ blender.exe!screen_opengl_render_invoke(bContext * C, wmOperator * op, const wmEvent * event) Line 1260 C++ blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, const wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1551 C++ blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, const wmEvent * event) Line 1752 C++ blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, wmOperatorCallContext context, PointerRNA * properties, const wmEvent * event) Line 1801 C++ blender.exe!WM_operator_name_call_ptr_with_depends_on_cursor(bContext * C, wmOperatorType * ot, wmOperatorCallContext opcontext, PointerRNA * properties, const wmEvent * event, const char * drawstr) Line 1990 C++ blender.exe!ui_apply_but_funcs_after(bContext * C) Line 1030 C++ blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * __formal) Line 11666 C++ blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, const bool always_pass) Line 834 C++ blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3326 C++ blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3445 C++ blender.exe!wm_event_do_handlers(bContext * C) Line 4072 C++ blender.exe!WM_main(bContext * C) Line 638 C++ blender.exe!main(int argc, const char * * __formal) Line 579 C++ [External Code] ```
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-03-06 17:50:18 +01:00
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
2 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#119058
No description provided.