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/editors/object/object_select.c | |
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/editors/object/object_select.c')
-rw-r--r-- | source/blender/editors/object/object_select.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 6f7fc2efa61..82c39d38d74 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -120,7 +120,7 @@ void ED_object_base_activate_with_mode_exit_if_needed(bContext *C, Base *base) ViewLayer *view_layer = CTX_data_view_layer(C); /* Currently we only need to be concerned with edit-mode. */ - Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + Object *obedit = BKE_view_layer_edit_object_get(view_layer); if (obedit) { Object *ob = base->object; if (((ob->mode & OB_MODE_EDIT) == 0) || (obedit->type != ob->type)) { @@ -626,7 +626,7 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) ED_object_base_deselect_all(view_layer, v3d, SEL_DESELECT); } - ob = OBACT(view_layer); + ob = BKE_view_layer_active_object_get(view_layer); if (ob == NULL) { BKE_report(op->reports, RPT_ERROR, "No active object"); return OPERATOR_CANCELLED; @@ -777,7 +777,8 @@ static bool select_grouped_children(bContext *C, Object *ob, const bool recursiv return changed; } -static bool select_grouped_parent(bContext *C) /* Makes parent active and de-selected OBACT */ +/* Makes parent active and de-selected BKE_view_layer_active_object_get. */ +static bool select_grouped_parent(bContext *C) { ViewLayer *view_layer = CTX_data_view_layer(C); View3D *v3d = CTX_wm_view3d(C); @@ -785,7 +786,8 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel bool changed = false; if (!basact || !(basact->object->parent)) { - return 0; /* we know OBACT is valid */ + /* We know BKE_view_layer_active_object_get is valid. */ + return 0; } baspar = BKE_view_layer_base_find(view_layer, basact->object->parent); @@ -1021,7 +1023,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) changed = ED_object_base_deselect_all(view_layer, v3d, SEL_DESELECT); } - ob = OBACT(view_layer); + ob = BKE_view_layer_active_object_get(view_layer); if (ob == NULL) { BKE_report(op->reports, RPT_ERROR, "No active object"); return OPERATOR_CANCELLED; |