diff options
author | NBurn <7nburn@gmail.com> | 2019-01-29 04:04:35 +0300 |
---|---|---|
committer | NBurn <7nburn@gmail.com> | 2019-01-29 04:04:35 +0300 |
commit | edd2de62eb13284f7e02256701fec1483973018d (patch) | |
tree | 02a6ab0c10b9131e346d2e55b36bfd14873fafa3 /io_scene_ms3d/ms3d_utils.py | |
parent | bdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff) |
addons: view_layer.objects.active syntax update
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 |