diff options
author | Monique Dewanchand <mdewanchand> | 2022-09-01 11:00:53 +0300 |
---|---|---|
committer | Monique <mdewanchand@atmind.nl> | 2022-09-01 11:22:43 +0300 |
commit | 17501c146edc4af8a5e04565dc4d0b30ed5c5323 (patch) | |
tree | 73fe3334ff45b67d45fa1b5a5ae7ff06ec990a5a /source/blender/makesrna | |
parent | f9c249917dbf9c450abf52df1f60b3d587bc106a (diff) |
Cleanup: Remove/replace View Layer macros.
This patch is a cleanup required before refactoring the view layer syncing
process {T73411}.
* Remove FIRSTBASE.
* Remove LASTBASE.
* Remove BASACT.
* Remove OBEDIT_FROM_WORKSPACE.
* Replace OBACT with BKE_view_layer_active_object.
* Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15799
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 8 |
4 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 2aa0a1bba01..789a8b381b6 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -14,6 +14,8 @@ #include "DNA_texture_types.h" #include "DNA_workspace_types.h" +#include "BKE_layer.h" + #include "BLI_math.h" #include "BLT_translation.h" @@ -971,7 +973,7 @@ static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain, static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr) { ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); Brush *brush = (Brush *)ptr->owner_id; if (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED) { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a3b93b23583..bedf823656a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -707,7 +707,7 @@ static void rna_Gpencil_extend_selection(bContext *C, PointerRNA *UNUSED(ptr)) { /* Extend selection to all points in all selected strokes. */ ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if ((ob) && (ob->type == OB_GPENCIL)) { bGPdata *gpd = (bGPdata *)ob->data; CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) { @@ -2250,7 +2250,7 @@ static char *rna_MeshStatVis_path(const PointerRNA *UNUSED(ptr)) static void rna_Scene_update_active_object_data(bContext *C, PointerRNA *UNUSED(ptr)) { ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 4cd0b27c772..42523508c14 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -22,6 +22,7 @@ #include "DNA_space_types.h" #include "BKE_brush.h" +#include "BKE_layer.h" #include "BKE_material.h" #include "BKE_paint.h" @@ -164,7 +165,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob); if (!edit) { @@ -184,7 +185,7 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); @@ -215,7 +216,7 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, bool *UNUSED(r_free)) { ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); # if 0 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); @@ -373,7 +374,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); @@ -389,7 +390,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) static void rna_Sculpt_ShowMask_update(bContext *C, PointerRNA *UNUSED(ptr)) { ViewLayer *view_layer = CTX_data_view_layer(C); - Object *object = OBACT(view_layer); + Object *object = BKE_view_layer_active_object_get(view_layer); if (object == NULL || object->sculpt == NULL) { return; } @@ -487,7 +488,7 @@ static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob && ob->type == OB_MESH) { /* of course we need to invalidate here */ @@ -504,7 +505,7 @@ static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob && ob->type == OB_MESH) { ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); @@ -523,7 +524,7 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); bScreen *screen; Image *ima = scene->toolsettings->imapaint.canvas; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3e253d9da8e..9b08b6ef665 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1664,7 +1664,7 @@ static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first); if (win != NULL) { ViewLayer *view_layer = WM_window_get_active_view_layer(win); - obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + obedit = BKE_view_layer_edit_object_get(view_layer); } return ED_space_image_show_uvedit(sima, obedit); } @@ -1677,7 +1677,7 @@ static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr) wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first); if (win != NULL) { ViewLayer *view_layer = WM_window_get_active_view_layer(win); - obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + obedit = BKE_view_layer_edit_object_get(view_layer); } return ED_space_image_check_show_maskedit(sima, obedit); } @@ -2177,7 +2177,7 @@ static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr) ViewLayer *view_layer = CTX_data_view_layer(C); Main *bmain = CTX_data_main(C); - Object *obact = OBACT(view_layer); + Object *obact = BKE_view_layer_active_object_get(view_layer); if (obact == NULL) { return; } @@ -2250,7 +2250,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) SpaceAction *saction = (SpaceAction *)(ptr->data); ScrArea *area = CTX_wm_area(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *obact = OBACT(view_layer); + Object *obact = BKE_view_layer_active_object_get(view_layer); /* special exceptions for ShapeKey Editor mode */ if (saction->mode == SACTCONT_SHAPEKEY) { |