Page MenuHome

crash in specific situation with python context override
Closed, ArchivedPublic

Description

System Information
tested on laptop and workstation (fedora20/intel graphics, fedora20/nvidia780)

Blender Version
Broken: Blender 2.71 (sub 1), Commit date: 2014-07-14 11:34, Hash 8a04bed
Worked: never? (tried builds back to 2.65)

Short description of error
getting a crash when overriding context 'area' in concert with closing regions via operators AND taking a screenshot via operator (quite specific situation, I know, but I guess this could come up elsewhere, too)

Exact steps for others to reproduce the error

  • open attached .blend
  • execute script from TextEditor
  • also some more information in the TextEditor (including patch to prevent crash [but not real fix])

Event Timeline

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to 50.Jul 20 2014, 8:24 AM

note, I tried to redo this but couldn't get a crash, something strange is going on with the context though.

@Campbell Barton (campbellbarton) did you try to run the script without changing the 'editors'? The crash will only happen if you see some 3D Viewport. The complete backtrace is: P130

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Archived.Sep 3 2014, 12:39 PM

The problem is your setting the area but leaving the text editor region set.

You can use a script like this to get the view3d area & region.

def view3d_find():
    # returns first 3d view, normally we get from context
    for area in bpy.context.window.screen.areas:
        if area.type == 'VIEW_3D':
            v3d = area.spaces[0]
            rv3d = v3d.region_3d
            for region in area.regions:
                if region.type == 'WINDOW':
                    return area, region, rv3d
    return None, None, None

Thanx alot for investigating this! Makes total sense now :$