Rename any instance of scene layer or render layer in code with view layer
[blender.git] / release / scripts / startup / bl_operators / clip.py
index f39dc1a8b08cbe3e183e19a9610b241a33d57e90..467512a9746208713294b763f2cae4de19dbb752 100644 (file)
@@ -611,24 +611,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
@@ -940,8 +940,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)
 
@@ -985,7 +985,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)