Cleanup: Overlay-Next: Remove active_base

This commit is contained in:
Clément Foucault
2024-11-26 14:36:14 +01:00
parent fc2f815b66
commit 0ebfbaa463
2 changed files with 4 additions and 7 deletions

View File

@@ -32,8 +32,7 @@ void Instance::init()
state.v3d = ctx->v3d;
state.region = ctx->region;
state.rv3d = ctx->rv3d;
state.active_base = BKE_view_layer_active_base_get(ctx->view_layer);
state.object_active = ctx->obact;
state.object_active = BKE_view_layer_active_object_get(ctx->view_layer);
state.object_mode = ctx->object_mode;
state.cfra = DEG_get_ctime(state.depsgraph);
state.is_viewport_image_render = DRW_state_is_viewport_image_render();

View File

@@ -48,7 +48,6 @@ struct State {
const SpaceLink *space_data;
const ARegion *region;
const RegionView3D *rv3d;
const Base *active_base;
DRWTextStore *dt;
View3DOverlay overlay;
float pixelsize;
@@ -534,10 +533,9 @@ struct Resources : public select::SelectMap {
{
const bool is_edit = (state.object_mode & OB_MODE_EDIT) &&
(ob_ref.object->mode & OB_MODE_EDIT);
const bool active = (state.active_base != nullptr) &&
((ob_ref.dupli_parent != nullptr) ?
(state.active_base->object == ob_ref.dupli_parent) :
(state.active_base->object == ob_ref.object));
const bool active = ((ob_ref.dupli_parent != nullptr) ?
(state.object_active == ob_ref.dupli_parent) :
(state.object_active == ob_ref.object));
const bool is_selected = ((ob_ref.object->base_flag & BASE_SELECTED) != 0);
/* Object in edit mode. */