[Bf-blender-cvs] [89f7fb0aef8] blender2.8: Pqrtiql fix of some operators in object.py.

Bastien Montagne noreply at git.blender.org
Mon Apr 23 14:27:45 CEST 2018


Commit: 89f7fb0aef8d420408ff3fcc0180f63ebef0d64b
Author: Bastien Montagne
Date:   Mon Apr 23 14:26:07 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB89f7fb0aef8d420408ff3fcc0180f63ebef0d64b

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. :/

===================================================================

M	release/scripts/startup/bl_operators/object.py

===================================================================

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'}



More information about the Bf-blender-cvs mailing list