diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-04-23 15:26:07 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-04-23 15:26:07 +0300 |
commit | 89f7fb0aef8d420408ff3fcc0180f63ebef0d64b (patch) | |
tree | f8a35b0ea2ed4ee2f0c436b8bf61ace3968cef7b /release/scripts/startup/bl_operators | |
parent | d276ef7062ba62f18a88c026ffc78603f901f0e2 (diff) |
Pqrtiql fix of some operators in object.py.
They were still trying to set active object of Scene.
Select hierarchy with extend option is still not zorking for some
;ysterious reasons. :/
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/object.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 8ccaa59bcc9..5fd54eceb25 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -123,6 +123,7 @@ class SelectCamera(Operator): def execute(self, context): scene = context.scene + view_layer = context.view_layer view = context.space_data if view.type == 'VIEW_3D' and not view.lock_camera_and_layers: camera = view.camera @@ -136,8 +137,8 @@ class SelectCamera(Operator): else: if not self.extend: bpy.ops.object.select_all(action='DESELECT') - scene.objects.active = camera - camera.hide = False + view_layer.objects.active = camera + # camera.hide = False # XXX TODO where is this now? camera.select_set(action='SELECT') return {'FINISHED'} @@ -171,6 +172,7 @@ class SelectHierarchy(Operator): def execute(self, context): scene = context.scene + view_layer = context.view_layer select_new = [] act_new = None @@ -206,7 +208,7 @@ class SelectHierarchy(Operator): for obj in select_new: obj.select_set(action='SELECT') - scene.objects.active = act_new + view_layer.objects.active = act_new return {'FINISHED'} return {'CANCELLED'} |