Rename any instance of scene layer or render layer in code with view layer
[blender.git] / source / blender / editors / mesh / mesh_navmesh.c
index e5705d2d3e793dad0bec32209bc4a9792c6b3874..d7e59a05772cf20f2be49ebd27557ce14fe9892a 100644 (file)
@@ -40,6 +40,7 @@
 #include "BLI_math_vector.h"
 #include "BLI_linklist.h"
 
+#include "BKE_layer.h"
 #include "BKE_library.h"
 #include "BKE_context.h"
 #include "BKE_mesh.h"
@@ -330,14 +331,14 @@ static bool buildNavMesh(const RecastData *recastParams, int nverts, float *vert
 }
 
 static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh,
-                                  BaseLegacy *base, unsigned int lay)
+                                  Base *base, unsigned int lay)
 {
        float co[3], rot[3];
        BMEditMesh *em;
        int i, j, k;
        unsigned short *v;
        int face[3];
-       Scene *scene = CTX_data_scene(C);
+       ViewLayer *view_layer = CTX_data_view_layer(C);
        Object *obedit;
        int createob = base == NULL;
        int nverts, nmeshes, nvp;
@@ -355,8 +356,8 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
        }
        else {
                obedit = base->object;
-               BKE_scene_base_deselect_all(scene);
-               BKE_scene_base_select(scene, base);
+               BKE_view_layer_base_deselect_all(view_layer);
+               BKE_view_layer_base_select(view_layer, base);
                copy_v3_v3(obedit->loc, co);
                copy_v3_v3(obedit->rot, rot);
        }
@@ -465,15 +466,15 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
 static int navmesh_create_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
-       SceneLayer *sl = CTX_data_scene_layer(C);
+       ViewLayer *view_layer = CTX_data_view_layer(C);
        LinkNode *obs = NULL;
-       BaseLegacy *navmeshBase = NULL;
+       Base *navmeshBase = NULL;
 
        CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
        {
                if (base->object->type == OB_MESH) {
                        if (base->object->body_type == OB_BODY_TYPE_NAVMESH) {
-                               if (!navmeshBase || base == sl->basact) {
+                               if (!navmeshBase || base == view_layer->basact) {
                                        navmeshBase = base;
                                }
                        }