diff options
Diffstat (limited to 'io_scene_ms3d/ms3d_utils.py')
-rw-r--r-- | io_scene_ms3d/ms3d_utils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_ms3d/ms3d_utils.py b/io_scene_ms3d/ms3d_utils.py index 2bcfba8a..330c53bb 100644 --- a/io_scene_ms3d/ms3d_utils.py +++ b/io_scene_ms3d/ms3d_utils.py @@ -103,7 +103,7 @@ def pre_setup_environment(porter, blender_context): blender_context.preferences.edit.use_global_undo = False # inject active_object to self - porter.active_object = blender_context.scene.objects.active + porter.active_object = blender_context.view_layer.objects.active # change to a well defined mode enable_edit_mode(True, blender_context) @@ -118,11 +118,11 @@ def pre_setup_environment(porter, blender_context): ############################################################################### def post_setup_environment(porter, blender_context): # restore active object - blender_context.scene.objects.active = porter.active_object + blender_context.view_layer.objects.active = porter.active_object - if not blender_context.scene.objects.active \ + if not blender_context.view_layer.objects.active \ and blender_context.selected_objects: - blender_context.scene.objects.active \ + blender_context.view_layer.objects.active \ = blender_context.selected_objects[0] # restore pre operator undo state |