Blender crashes when using temp_override on 'UV' area with transform.translate, transform.resize #106373

Open
opened 2023-03-31 12:32:53 +02:00 by Vincent · 3 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.41

Blender Version
Broken: version: 3.3.5, branch: master, commit date: 2023-03-20 10:19, hash: dd0cd1df1d1a
Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-20 08:50, hash: rBef9ca44dee7f
Broken: version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: 1be25cfff18b
Worked: none

Short description of error
When executing transform.resize or transform.translate with context.temp_override(area=uv_area) Blender crashes. This happens when the area.ui_type is UV, with VIEW_3D is works fine.

Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF72DEF3C80
Module  : blender.exe
Thread  : 000009dc

the complete crash file is attached

Exact steps for others to reproduce the error

  1. create a new Text and paste the below code into the text (the attached file issue.blend can also be used)
import bpy 
context = bpy.context
area = context.area
area.ui_type = "UV"
with context.temp_override(area=area):
    bpy.ops.transform.resize(value=(0.5, 0.5, 0.5), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False)
    bpy.ops.transform.translate(value=(0.25, -0.25, 0), orient_axis_ortho='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False)
  1. run this text, Blender will now crash

Note: not using temp_override() and executing these operators in the current context with the ui_type set to UV works fine. Like this:

import bpy 
context = bpy.context
area = context.area
area.ui_type = "UV"
bpy.ops.transform.resize(value=(0.5, 0.5, 0.5), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False)
bpy.ops.transform.translate(value=(0.25, -0.25, 0), orient_axis_ortho='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False)
**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.41 **Blender Version** Broken: version: 3.3.5, branch: master, commit date: 2023-03-20 10:19, hash: `dd0cd1df1d1a` Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-20 08:50, hash: `rBef9ca44dee7f` Broken: version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: `1be25cfff18b` Worked: none **Short description of error** When executing `transform.resize` or `transform.translate` with `context.temp_override(area=uv_area)` Blender crashes. This happens when the area.ui_type is UV, with VIEW_3D is works fine. ``` Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF72DEF3C80 Module : blender.exe Thread : 000009dc ``` the complete crash file is attached **Exact steps for others to reproduce the error** 1. create a new Text and paste the below code into the text (the attached file issue.blend can also be used) ```py import bpy context = bpy.context area = context.area area.ui_type = "UV" with context.temp_override(area=area): bpy.ops.transform.resize(value=(0.5, 0.5, 0.5), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False) bpy.ops.transform.translate(value=(0.25, -0.25, 0), orient_axis_ortho='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False) ``` 2. run this text, Blender will now crash **Note**: not using `temp_override()` and executing these operators in the current context with the ui_type set to UV works fine. Like this: ```py import bpy context = bpy.context area = context.area area.ui_type = "UV" bpy.ops.transform.resize(value=(0.5, 0.5, 0.5), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False) bpy.ops.transform.translate(value=(0.25, -0.25, 0), orient_axis_ortho='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False) ```
Vincent added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-31 12:32:53 +02:00
Member

Thanks for the report. I can confirm the crash.
But unable to replicate when I pass remaining parameters to temp_override (i.e. window, region)

Thanks for the report. I can confirm the crash. But unable to replicate when I pass remaining parameters to temp_override (i.e. window, region)
Pratik Borhade added
Module
Python API
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-04-07 08:52:28 +02:00
Author

Ok, so apparently it does not crash when the region is specified. In other cases, it does.
So if the area is passed, the region is required (at least for ui_type='UV').
e.g., temp_override(area=uv_area, window=context.window, screen=context.screen) does crash
but temp_override(area=uv_area, region=area.regions[0]) does not crash (same for temp_override(area=uv_area, region=area.regions[0], window=context.window, screen=context.screen))

Ok, so apparently it does **not** crash when the region is specified. In other cases, it does. So if the area is passed, the region is required (at least for ui_type='UV'). e.g., `temp_override(area=uv_area, window=context.window, screen=context.screen)` does crash but `temp_override(area=uv_area, region=area.regions[0])` does not crash (same for `temp_override(area=uv_area, region=area.regions[0], window=context.window, screen=context.screen)`)
Member

From https://docs.blender.org/api/4.0/bpy.types.Context.html#bpy.types.Context.temp_override

When overriding window, area and regions: the arguments must be consistent, so any region argument that’s passed in must be contained by the current area or the area passed in. The same goes for the area needing to be contained in the current window.

Guess this could be improved upon (maybe @ideasman42 can come up with a better wording), but it basically tries to tell you area & region must "fit".

From https://docs.blender.org/api/4.0/bpy.types.Context.html#bpy.types.Context.temp_override > When overriding window, area and regions: the arguments must be consistent, so any region argument that’s passed in must be contained by the current area or the area passed in. The same goes for the area needing to be contained in the current window. Guess this could be improved upon (maybe @ideasman42 can come up with a better wording), but it basically tries to tell you area & region must "fit".
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
3 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#106373
No description provided.