OBJECT_OT_editmode_toggle crashes due to mismatch in context when setting bpy.context.screen.scene #43976

Closed
opened 2015-03-12 18:02:08 +01:00 by tamachan · 14 comments

System Information
Win8.1 x64

Blender Version
Broken: Blender 2.73 daily build(x86) (sub 9), Commit date: 2015-03-09 17:45, Hash afa8a0a

Short description of error
Silently Crash when scene's FULL_COPY.

Blender 2.73 (sub 9), Commit date: 2015-03-09 17:45, Hash afa8a0a
bpy.ops.scene.new(type='FULL_COPY') # Operator
bpy.ops.object.select_all(action='DESELECT') # Operator

backtrace
5: PyInit_mathutils_noise_types - 0x17F9070
4: xmlFileMatch - 0xFD9E50
3: xmlFileMatch - 0xFD9E50
2: UnhandledExceptionFilter - 0x7517F510
1: LdrSetAppCompatDllRedirectionCallback - 0x7709C9A0
0: RtlInitializeExceptionChain - 0x7705B4C0

Crash report: untitled.crash.txt
Script: vrm.py
.Blend file: untitled.blend

Exact steps for others to reproduce the error

  • install vrm.py to addons.
  • open untitled.blend (or blender's default scene)
  • fill output's path in "Vector Rendering Method" panel in Render tab.
  • press "Render" button in VRM panel.
**System Information** Win8.1 x64 **Blender Version** Broken: Blender 2.73 daily build(x86) (sub 9), Commit date: 2015-03-09 17:45, Hash afa8a0a **Short description of error** Silently Crash when scene's FULL_COPY. > Blender 2.73 (sub 9), Commit date: 2015-03-09 17:45, Hash afa8a0a > bpy.ops.scene.new(type='FULL_COPY') # Operator > bpy.ops.object.select_all(action='DESELECT') # Operator > > backtrace > 5: PyInit_mathutils_noise_types - 0x17F9070 > 4: xmlFileMatch - 0xFD9E50 > 3: xmlFileMatch - 0xFD9E50 > 2: UnhandledExceptionFilter - 0x7517F510 > 1: LdrSetAppCompatDllRedirectionCallback - 0x7709C9A0 > 0: RtlInitializeExceptionChain - 0x7705B4C0 Crash report: [untitled.crash.txt](https://archive.blender.org/developer/F150245/untitled.crash.txt) Script: [vrm.py](https://archive.blender.org/developer/F150246/vrm.py) .Blend file: [untitled.blend](https://archive.blender.org/developer/F150248/untitled.blend) **Exact steps for others to reproduce the error** - install vrm.py to addons. - open untitled.blend (or blender's default scene) - fill output's path in "Vector Rendering Method" panel in Render tab. - press "Render" button in VRM panel.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @tamachan

Added subscriber: @tamachan

Added subscriber: @mont29

Added subscriber: @mont29

Eeeeeh! We cannot take into account a full script like that, error is most likely in py code and we cannot check the whole of it. There are many ways to make Blender crash from python scripting…

Unless you can prove issue is on Blender side, by making a simple reproducible case (within a few lines of python), of course.

Eeeeeh! We cannot take into account a full script like that, error is most likely in py code and we cannot check the whole of it. There are many ways to make Blender crash from python scripting… Unless you can prove issue is on Blender side, by making a simple reproducible case (within a few lines of python), of course.
Author

New slimed script: vrm.py

New slimed script: [vrm.py](https://archive.blender.org/developer/F150252/vrm.py)
Author

Exact steps for others to reproduce the error

  • install F150252
  • Launch blender
  • press "Render" button "Vector Rendering Method" panel in Render tab.
  • (Crash)
Exact steps for others to reproduce the error - install [F150252](https://archive.blender.org/developer/F150252/vrm.py) - Launch blender - press "Render" button "Vector Rendering Method" panel in Render tab. - (Crash)

Added subscriber: @ideasman42

Added subscriber: @ideasman42

OK, so issue is, once you have assigned your new scene to bpy.context.screen.scene, that one and bpy.context.scene do not match (the later staying at old scene, simple prints show that easily).

Campbell, not quite sure this is expected? And if so, how to work around that?

OK, so issue is, once you have assigned your new scene to `bpy.context.screen.scene`, that one and `bpy.context.scene` do not match (the later staying at old scene, simple prints show that easily). Campbell, not quite sure this is expected? And if so, how to work around that?
Bastien Montagne changed title from Silently Crash when scene's FULL_COPY. to OBJECT_OT_editmode_toggle crashes due to mismatch in context when setting `bpy.context.screen.scene` 2015-03-13 18:23:17 +01:00

The buttons context has its own scene which isn't necessarily the same as the screen's scene.

In this case you don't really want to be using the properties context. use EXEC_SCREEN/INVOKE_SCREEN context. See file attached.

vrm-1.py

However strongly recommend to not use editmode to get the mesh data, use bmesh.from_edit_mesh(mesh) instead.

The buttons context has its own scene which isn't necessarily the same as the screen's scene. In this case you don't really want to be using the properties context. use `EXEC_SCREEN/INVOKE_SCREEN` context. See file attached. [vrm-1.py](https://archive.blender.org/developer/F151862/vrm-1.py) However strongly recommend to not use editmode to get the mesh data, use `bmesh.from_edit_mesh(mesh)` instead.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2015-03-15 23:55:37 +01:00

This issue was referenced by 06cc89d744

This issue was referenced by 06cc89d744e0f432ab79a2e4283dd31de6c09d03

Fixed crash but the workaround is still needed.

Fixed crash but the workaround is still needed.

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'

Closed by commit 06cc89d744.

Closed by commit 06cc89d744.
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
4 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#43976
No description provided.