io_scene_3ds: Update for Blender 3.x #2
@ -144,8 +144,6 @@ class STORYPENCIL_OT_AddSecondaryWindowOperator(Operator):
|
|||||||
|
|
||||||
def configure_new_secondary_window(self, context, new_window):
|
def configure_new_secondary_window(self, context, new_window):
|
||||||
wrk_name = context.scene.storypencil_edit_workspace.name
|
wrk_name = context.scene.storypencil_edit_workspace.name
|
||||||
override_context = context.copy()
|
|
||||||
override_context["window"] = new_window
|
|
||||||
# Open the 2D workspace
|
# Open the 2D workspace
|
||||||
blendpath = os.path.dirname(bpy.app.binary_path)
|
blendpath = os.path.dirname(bpy.app.binary_path)
|
||||||
version = bpy.app.version
|
version = bpy.app.version
|
||||||
@ -159,8 +157,8 @@ class STORYPENCIL_OT_AddSecondaryWindowOperator(Operator):
|
|||||||
if wk.name == wrk_name:
|
if wk.name == wrk_name:
|
||||||
new_window.workspace = wk
|
new_window.workspace = wk
|
||||||
return
|
return
|
||||||
bpy.ops.workspace.append_activate(
|
with context.temp_override(window=new_window):
|
||||||
override_context, idname=wk_name, filepath=template_path)
|
bpy.ops.workspace.append_activate(context, idname=wk_name, filepath=template_path)
|
||||||
|
|
||||||
|
|
||||||
class STORYPENCIL_OT_WindowBringFront(Operator):
|
class STORYPENCIL_OT_WindowBringFront(Operator):
|
||||||
@ -172,13 +170,12 @@ class STORYPENCIL_OT_WindowBringFront(Operator):
|
|||||||
win_id: bpy.props.StringProperty()
|
win_id: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
c = context.copy()
|
|
||||||
win = get_window_from_id(context.window_manager, self.win_id)
|
win = get_window_from_id(context.window_manager, self.win_id)
|
||||||
if not win:
|
if not win:
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
c["window"] = win
|
with context.temp_override(window=win):
|
||||||
bpy.ops.wm.window_fullscreen_toggle(c)
|
bpy.ops.wm.window_fullscreen_toggle()
|
||||||
bpy.ops.wm.window_fullscreen_toggle(c)
|
bpy.ops.wm.window_fullscreen_toggle()
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
@ -191,12 +188,11 @@ class STORYPENCIL_OT_WindowCloseOperator(Operator):
|
|||||||
win_id: bpy.props.StringProperty()
|
win_id: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
c = context.copy()
|
|
||||||
win = get_window_from_id(context.window_manager, self.win_id)
|
win = get_window_from_id(context.window_manager, self.win_id)
|
||||||
if not win:
|
if not win:
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
c["window"] = win
|
with context.temp_override(window=win):
|
||||||
bpy.ops.wm.window_close(c)
|
bpy.ops.wm.window_close()
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user