Merge branch 'master' into blender2.8
[blender.git] / release / scripts / startup / bl_operators / clip.py
index 35b8a08bf21780472532ec984fc9862ec2901c41..e67b275a3ee34b76c222eb7a5eeb4819f3f97f91 100644 (file)
@@ -235,7 +235,7 @@ class CLIP_OT_track_to_empty(Operator):
         ob = None
 
         ob = bpy.data.objects.new(name=track.name, object_data=None)
-        ob.select = True
+        ob.select_set(action='SELECT')
         context.scene.objects.link(ob)
         context.scene.objects.active = ob
 
@@ -515,7 +515,7 @@ object's movement caused by this constraint"""
         # XXX, should probably use context.selected_editable_objects
         # since selected objects can be from a lib or in hidden layer!
         for ob in scene.objects:
-            if ob.select:
+            if ob.select_set(action='SELECT'):
                 self._bake_object(scene, ob)
 
         return {'FINISHED'}
@@ -612,24 +612,24 @@ class CLIP_OT_setup_tracking_scene(Operator):
         CLIP_set_viewport_background(context, True, sc.clip, sc.clip_user)
 
     @staticmethod
-    def _setupRenderLayers(context):
+    def _setupViewLayers(context):
         scene = context.scene
-        rlayers = scene.render.layers
+        view_layers = scene.view_layers
 
-        if not scene.render.layers.get("Foreground"):
-            if len(rlayers) == 1:
-                fg = rlayers[0]
+        if not view_layers.get("Foreground"):
+            if len(view_layers) == 1:
+                fg = view_layers[0]
                 fg.name = 'Foreground'
             else:
-                fg = scene.render.layers.new("Foreground")
+                fg = view_layers.new("Foreground")
 
             fg.use_sky = True
             fg.layers = [True] + [False] * 19
             fg.layers_zmask = [False] * 10 + [True] + [False] * 9
             fg.use_pass_vector = True
 
-        if not scene.render.layers.get("Background"):
-            bg = scene.render.layers.new("Background")
+        if not view_layers.get("Background"):
+            bg = view_layers.new("Background")
             bg.use_pass_shadow = True
             bg.use_pass_ambient_occlusion = True
             bg.layers = [False] * 10 + [True] + [False] * 9
@@ -941,8 +941,8 @@ class CLIP_OT_setup_tracking_scene(Operator):
     def _setupObjects(self, context):
         scene = context.scene
 
-        fg = scene.render.layers.get("Foreground")
-        bg = scene.render.layers.get("Background")
+        fg = scene.view_layers.get("Foreground")
+        bg = scene.view_layers.get("Background")
 
         all_layers = self._mergeLayers(fg.layers, bg.layers)
 
@@ -986,7 +986,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
         self._setupWorld(context)
         self._setupCamera(context)
         self._setupViewport(context)
-        self._setupRenderLayers(context)
+        self._setupViewLayers(context)
         self._setupNodes(context)
         self._setupObjects(context)