Page MenuHome

Python 'View' functions for Sequencer/Preview makes Blender crash
Closed, InvalidPublic


Blender 2.79b on Windows 8

This line crashes Blender in the script context bellow:


And so does:

view_frame, view_ghost_border, .view_zoom_ratio

Script to expose the crash:

# Adds a windowless fullscreen preview to the sequencer
# Have a Sequencer/Preview area open, and select 'True Fullscreen' in the View Menu.
# Uncomment this line: "bpy.ops.sequencer.view_all_preview()" to make Blender crash.
# Use Alt+F11, Alt+F10 and home to return to a normal screen

import bpy

class SEQUENCE_MT_true_fullscreen(bpy.types.Operator):
	"""True fullscreen preview. Close in upper right corner"""
	bl_label = "True Fullscreen"
	bl_idname = "sequencer.true_fullscreen"
	bl_options = {'REGISTER', 'UNDO'}

	def execute(self, context):

		if not bpy.context.scene.sequence_editor: #create sequence, if missing
		context = bpy.context
		for area in bpy.context.screen.areas:
			if area.type == 'SEQUENCE_EDITOR':
				if area.spaces[0].view_type == 'PREVIEW':  
				   override = bpy.context.copy()
				   override['space_data'] =
				   override['region'] = area.regions[-1]
				   override['area'] = area
       			           override['screen'] = context.screen
				   bpy.ops.screen.screen_full_area(override, use_hide_panels=True)
				   bpy.ops.sequencer.view_all_preview() # This line crashes Blender
                                  #and so does .view_frame(), view_ghost_border(), .view_zoom_ratio()

		return {'FINISHED'}

def menu_append(self, context):

def register():
	bpy.types.SEQUENCER_MT_view.append(menu_append) # add to "view" vse header menu

def unregister():

if __name__ == "__main__":



Event Timeline

Bastien Montagne (mont29) triaged this task as Needs Information from User priority.

Cannot reproduce any crash here with this code (once tabulation is fixed…). Please at the very least give us error message!

Strange. It crashes here on 2.8 too.

I get no error message. The Blender UI just disappears.

The bug was encountered on StackExchange:

Apparently, it can be worked-around by delaying the call.

Bastien Montagne (mont29) claimed this task.

OK finally managed to reproduce (that operator only works when VSE editor is in only-preview mode).

You simply have invalid context for the crashing op call, just pass your override to it and it works as expected.

Also, We do not handle user support on this tracker, only bug reports. User forums like or should be used for that matter.

I was working with him on this script, we did end up getting it to work, and yes, the context was the problem... but regardless, shouldn't blender give an error rather than just crashing? Seems like it is still a bug.

There are gazillions of ways to make Blender crash with bad py code… ideally yes, that should be checked in the poll callback of the operators, but that’s not a bug.