Rename any instance of scene layer or render layer in code with view layer
[blender.git] / source / blender / editors / mesh / mesh_navmesh.c
index 8d60a94ee349a80a751a70f80921f30c65ca34b2..d7e59a05772cf20f2be49ebd27557ce14fe9892a 100644 (file)
@@ -331,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];
-       SceneLayer *scene_layer = CTX_data_scene_layer(C);
+       ViewLayer *view_layer = CTX_data_view_layer(C);
        Object *obedit;
        int createob = base == NULL;
        int nverts, nmeshes, nvp;
@@ -356,8 +356,8 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
        }
        else {
                obedit = base->object;
-               BKE_scene_layer_base_deselect_all(scene_layer);
-               BKE_scene_layer_base_select(scene_layer, 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);
        }
@@ -466,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;
                                }
                        }