Browse Source

Maintain the current selection after exporting

pull/109/head
Adam Johnson 6 years ago
parent
commit
f87a9b9efe
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 9
      korman/operators/op_export.py

9
korman/operators/op_export.py

@ -105,7 +105,7 @@ class ExportOperator(bpy.types.Operator):
# Separate blender operator and actual export logic for my sanity # Separate blender operator and actual export logic for my sanity
ageName = path.stem ageName = path.stem
with _UiHelper() as _ui: with _UiHelper(context) as _ui:
e = exporter.Exporter(self) e = exporter.Exporter(self)
try: try:
if self.profile_export: if self.profile_export:
@ -151,10 +151,11 @@ class ExportOperator(bpy.types.Operator):
class _UiHelper: class _UiHelper:
"""This fun little helper makes sure that we don't wreck the UI""" """This fun little helper makes sure that we don't wreck the UI"""
def __enter__(self): def __init__(self, context):
self.active_object = bpy.context.object self.active_object = context.active_object
self.selected_objects = bpy.context.selected_objects self.selected_objects = context.selected_objects
def __enter__(self):
scene = bpy.context.scene scene = bpy.context.scene
self.layers = tuple(scene.layers) self.layers = tuple(scene.layers)
self.frame_num = scene.frame_current self.frame_num = scene.frame_current

Loading…
Cancel
Save