diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
9 files changed, 123 insertions, 122 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index e5f1de7d5eb..75717213cb1 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -88,9 +88,9 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) RegionView3D *rv3d = CTX_wm_region_view3d(C); if (rv3d == NULL) { - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype == SPACE_VIEW3D) { - ARegion *region = BKE_area_find_region_active_win(sa); + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype == SPACE_VIEW3D) { + ARegion *region = BKE_area_find_region_active_win(area); if (region) { rv3d = region->regiondata; } @@ -103,14 +103,14 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) * so return that, the caller can then access the region->regiondata */ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); *r_v3d = NULL; *r_region = NULL; - if (sa && sa->spacetype == SPACE_VIEW3D) { + if (area && area->spacetype == SPACE_VIEW3D) { ARegion *region = CTX_wm_region(C); - View3D *v3d = (View3D *)sa->spacedata.first; + View3D *v3d = (View3D *)area->spacedata.first; if (region) { RegionView3D *rv3d; @@ -121,7 +121,7 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_regi return true; } else { - if (ED_view3d_area_user_region(sa, v3d, r_region)) { + if (ED_view3d_area_user_region(area, v3d, r_region)) { *r_v3d = v3d; return true; } @@ -136,12 +136,13 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_regi * Similar to #ED_view3d_context_user_region() but does not use context. Always performs a lookup. * Also works if \a v3d is not the active space. */ -bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion **r_region) +bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region) { RegionView3D *rv3d = NULL; ARegion *region_unlock_user = NULL; ARegion *region_unlock = NULL; - const ListBase *region_list = (v3d == sa->spacedata.first) ? &sa->regionbase : &v3d->regionbase; + const ListBase *region_list = (v3d == area->spacedata.first) ? &area->regionbase : + &v3d->regionbase; BLI_assert(v3d->spacetype == SPACE_VIEW3D); @@ -239,14 +240,14 @@ void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *region) } } -void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *sa) +void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area) { wmWindowManager *wm = bmain->wm.first; if (v3d->shading.type != OB_RENDER) { ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if ((region->regiontype == RGN_TYPE_WINDOW) && region->regiondata) { ED_view3d_stop_render_preview(wm, region); break; @@ -257,7 +258,7 @@ void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *sa) /* ******************** default callbacks for view3d space ***************** */ -static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene) +static SpaceLink *view3d_new(const ScrArea *UNUSED(area), const Scene *scene) { ARegion *region; View3D *v3d; @@ -336,7 +337,7 @@ static void view3d_free(SpaceLink *sl) } /* spacetype; init callback */ -static void view3d_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void view3d_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -732,9 +733,9 @@ static void *view3d_main_region_duplicate(void *poin) } static void view3d_main_region_listener( - wmWindow *UNUSED(win), ScrArea *sa, ARegion *region, wmNotifier *wmn, const Scene *scene) + wmWindow *UNUSED(win), ScrArea *area, ARegion *region, wmNotifier *wmn, const Scene *scene) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; RegionView3D *rv3d = region->regiondata; wmGizmoMap *gzmap = region->gizmo_map; @@ -927,7 +928,7 @@ static void view3d_main_region_listener( } break; case NC_LIGHTPROBE: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case NC_IMAGE: /* this could be more fine grained checks if we had @@ -992,7 +993,7 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { @@ -1070,7 +1071,7 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, { wmMsgSubscribeValue msg_sub_value_region_tag_refresh = { .owner = region, - .user_data = sa, + .user_data = area, .notify = WM_toolsystem_do_msg_notify_tag_refresh, }; WM_msg_subscribe_rna_anon_prop(mbus, Object, mode, &msg_sub_value_region_tag_refresh); @@ -1078,9 +1079,9 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, } } -static void view3d_main_region_cursor(wmWindow *win, ScrArea *sa, ARegion *region) +static void view3d_main_region_cursor(wmWindow *win, ScrArea *area, ARegion *region) { - if (!WM_cursor_set_from_tool(win, sa, region)) { + if (!WM_cursor_set_from_tool(win, area, region)) { WM_cursor_set(win, WM_CURSOR_DEFAULT); } } @@ -1101,7 +1102,7 @@ static void view3d_header_region_draw(const bContext *C, ARegion *region) } static void view3d_header_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1174,7 +1175,7 @@ static void view3d_header_region_message_subscribe(const struct bContext *UNUSED struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { @@ -1318,7 +1319,7 @@ static void view3d_buttons_region_layout(const bContext *C, ARegion *region) } static void view3d_buttons_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1441,11 +1442,11 @@ static void view3d_tools_region_draw(const bContext *C, ARegion *region) /* area (not region) level listener */ static void space_view3d_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, struct wmNotifier *wmn, Scene *UNUSED(scene)) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -1453,7 +1454,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_WORLD: if (v3d->flag2 & V3D_HIDE_OVERLAYS) { - ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } break; } @@ -1463,7 +1464,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), case ND_WORLD_DRAW: case ND_WORLD: if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) { - ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } break; } @@ -1472,7 +1473,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_NODES: if (v3d->shading.type == OB_TEXTURE) { - ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } break; } @@ -1480,7 +1481,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), } } -static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(sa)) +static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(area)) { Scene *scene = CTX_data_scene(C); LightCache *lcache = scene->eevee.light_cache_data; @@ -1538,7 +1539,7 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes return -1; /* found but not available */ } -static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_id) +static void view3d_id_remap(ScrArea *area, SpaceLink *slink, ID *old_id, ID *new_id) { View3D *v3d; ARegion *region; @@ -1553,8 +1554,8 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i v3d->camera = (Object *)new_id; if (!new_id) { /* 3D view might be inactive, in that case needs to use slink->regionbase */ - ListBase *regionbase = (slink == sa->spacedata.first) ? &sa->regionbase : - &slink->regionbase; + ListBase *regionbase = (slink == area->spacedata.first) ? &area->regionbase : + &slink->regionbase; for (region = regionbase->first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = is_local ? ((RegionView3D *)region->regiondata)->localvd : diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 694cb7ee7d4..699ad40da9c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2396,9 +2396,9 @@ void ED_view3d_screen_datamask(const bContext *C, CustomData_MeshMasks_update(r_cddata_masks, &CD_MASK_BAREMESH); /* Check if we need tfaces & mcols due to view mode. */ - for (const ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_VIEW3D) { - ED_view3d_datamask(C, scene, sa->spacedata.first, r_cddata_masks); + for (const ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_VIEW3D) { + ED_view3d_datamask(C, scene, area->spacedata.first, r_cddata_masks); } } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 09be73c87d1..0a30336aed8 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -175,7 +175,7 @@ typedef struct ViewOpsData { /** Context pointers (assigned by #viewops_data_alloc). */ Main *bmain; Scene *scene; - ScrArea *sa; + ScrArea *area; ARegion *region; View3D *v3d; RegionView3D *rv3d; @@ -277,9 +277,9 @@ static void viewops_data_alloc(bContext *C, wmOperator *op) vod->bmain = CTX_data_main(C); vod->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); vod->scene = CTX_data_scene(C); - vod->sa = CTX_wm_area(C); + vod->area = CTX_wm_area(C); vod->region = CTX_wm_region(C); - vod->v3d = vod->sa->spacedata.first; + vod->v3d = vod->area->spacedata.first; vod->rv3d = vod->region->regiondata; } @@ -1120,7 +1120,7 @@ static float view3d_ndof_pan_speed_calc(RegionView3D *rv3d) * often `!rv3d->is_persp` since it doesn't make sense to dolly in ortho. */ static void view3d_ndof_pan_zoom(const struct wmNDOFMotionData *ndof, - ScrArea *sa, + ScrArea *area, ARegion *region, const bool has_translate, const bool has_zoom) @@ -1161,7 +1161,7 @@ static void view3d_ndof_pan_zoom(const struct wmNDOFMotionData *ndof, /* all callers must check */ if (has_translate) { - BLI_assert(ED_view3d_offset_lock_check((View3D *)sa->spacedata.first, rv3d) == false); + BLI_assert(ED_view3d_offset_lock_check((View3D *)area->spacedata.first, rv3d) == false); } } @@ -1178,18 +1178,18 @@ static void view3d_ndof_pan_zoom(const struct wmNDOFMotionData *ndof, sub_v3_v3(rv3d->ofs, pan_vec); if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region); + view3d_boxview_sync(area, region); } } } static void view3d_ndof_orbit(const struct wmNDOFMotionData *ndof, - ScrArea *sa, + ScrArea *area, ARegion *region, ViewOpsData *vod, const bool apply_dyn_ofs) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; RegionView3D *rv3d = region->regiondata; float view_inv[4]; @@ -1422,12 +1422,12 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event) const bool has_zoom = (ndof->tvec[2] != 0.0f) && !rv3d->is_persp; if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->region, has_translate, has_zoom); + view3d_ndof_pan_zoom(ndof, vod->area, vod->region, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } if (has_rotation) { - view3d_ndof_orbit(ndof, vod->sa, vod->region, vod, true); + view3d_ndof_orbit(ndof, vod->area, vod->region, vod, true); xform_flag |= HAS_ROTATE; } } @@ -1505,7 +1505,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev const bool has_zoom = (ndof->tvec[2] != 0.0f) && ED_view3d_offset_lock_check(v3d, rv3d); if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->region, has_translate, true); + view3d_ndof_pan_zoom(ndof, vod->area, vod->region, has_translate, true); xform_flag |= HAS_TRANSLATE; } } @@ -1535,7 +1535,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev if (!is_orbit_around_pivot) { ED_view3d_distance_set(rv3d, 0.0f); } - view3d_ndof_orbit(ndof, vod->sa, vod->region, vod, is_orbit_around_pivot); + view3d_ndof_orbit(ndof, vod->area, vod->region, vod, is_orbit_around_pivot); xform_flag |= HAS_ROTATE; if (!is_orbit_around_pivot) { ED_view3d_distance_set(rv3d, dist_backup); @@ -1543,7 +1543,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev } if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->region, has_translate, has_zoom); + view3d_ndof_pan_zoom(ndof, vod->area, vod->region, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } } @@ -1607,11 +1607,11 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *e ED_view3d_camera_lock_init_ex(depsgraph, v3d, rv3d, false); if (ndof->progress != P_FINISHING) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, sa, region, has_translate, has_zoom); + view3d_ndof_pan_zoom(ndof, area, region, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } } @@ -1751,7 +1751,7 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y) add_v3_v3(vod->rv3d->ofs, dvec); if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } } @@ -2189,7 +2189,7 @@ static void viewzoom_apply_3d(ViewOpsData *vod, CLAMP(vod->rv3d->dist, dist_range[0], dist_range[1]); if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d); @@ -2280,7 +2280,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); View3D *v3d; RegionView3D *rv3d; - ScrArea *sa; + ScrArea *area; ARegion *region; bool use_cam_zoom; float dist_range[2]; @@ -2291,15 +2291,15 @@ static int viewzoom_exec(bContext *C, wmOperator *op) if (op->customdata) { ViewOpsData *vod = op->customdata; - sa = vod->sa; + area = vod->area; region = vod->region; } else { - sa = CTX_wm_area(C); + area = CTX_wm_area(C); region = CTX_wm_region(C); } - v3d = sa->spacedata.first; + v3d = area->spacedata.first; rv3d = region->regiondata; use_cam_zoom = (rv3d->persp == RV3D_CAMOB) && @@ -2342,7 +2342,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region); + view3d_boxview_sync(area, region); } ED_view3d_depth_tag_update(rv3d); @@ -2538,7 +2538,7 @@ static void viewdolly_apply(ViewOpsData *vod, const int xy[2], const short zoom_ } if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d); @@ -2603,7 +2603,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) { View3D *v3d; RegionView3D *rv3d; - ScrArea *sa; + ScrArea *area; ARegion *region; float mousevec[3]; @@ -2612,18 +2612,18 @@ static int viewdolly_exec(bContext *C, wmOperator *op) if (op->customdata) { ViewOpsData *vod = op->customdata; - sa = vod->sa; + area = vod->area; region = vod->region; copy_v3_v3(mousevec, vod->init.mousevec); } else { - sa = CTX_wm_area(C); + area = CTX_wm_area(C); region = CTX_wm_region(C); negate_v3_v3(mousevec, ((RegionView3D *)region->regiondata)->viewinv[2]); normalize_v3(mousevec); } - v3d = sa->spacedata.first; + v3d = area->spacedata.first; rv3d = region->regiondata; const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init"); @@ -2636,7 +2636,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) view_dolly_to_vector_3d(region, rv3d->ofs, mousevec, delta < 0 ? 0.2f : 1.8f); if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region); + view3d_boxview_sync(area, region); } ED_view3d_depth_tag_update(rv3d); @@ -2886,9 +2886,9 @@ static void view3d_from_minmax_multi(bContext *C, const bool ok_dist, const int smooth_viewtx) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; /* when using all regions, don't jump out of camera view, @@ -4376,7 +4376,7 @@ static void viewroll_apply(ViewOpsData *vod, int x, int UNUSED(y)) } if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d); @@ -5279,7 +5279,7 @@ static int toggle_shading_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); View3D *v3d = CTX_wm_view3d(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); int type = RNA_enum_get(op->ptr, "type"); if (type == OB_SOLID) { @@ -5307,7 +5307,7 @@ static int toggle_shading_exec(bContext *C, wmOperator *op) } } - ED_view3d_shade_update(bmain, v3d, sa); + ED_view3d_shade_update(bmain, v3d, area); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); return OPERATOR_FINISHED; @@ -5340,7 +5340,7 @@ void VIEW3D_OT_toggle_shading(wmOperatorType *ot) static int toggle_xray_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *obact = CTX_data_active_object(C); if (obact && ((obact->mode & OB_MODE_POSE) || @@ -5362,7 +5362,7 @@ static int toggle_xray_exec(bContext *C, wmOperator *op) } } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 4b194d6687d..e4863c0cdeb 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -110,7 +110,7 @@ typedef struct RulerInfo { /* wm state */ wmWindow *win; - ScrArea *sa; + ScrArea *area; ARegion *region; /* re-assigned every modal update */ /* Track changes in state. */ @@ -299,7 +299,7 @@ static void ruler_state_set(bContext *C, RulerInfo *ruler_info, int state) static void view3d_ruler_item_project(RulerInfo *ruler_info, float r_co[3], const int xy[2]) { - ED_view3d_win_to_3d_int(ruler_info->sa->spacedata.first, ruler_info->region, r_co, xy, r_co); + ED_view3d_win_to_3d_int(ruler_info->area->spacedata.first, ruler_info->region, r_co, xy, r_co); } /* use for mousemove events */ @@ -323,7 +323,7 @@ static bool view3d_ruler_item_mousemove(struct Depsgraph *depsgraph, view3d_ruler_item_project(ruler_info, co, mval); if (do_thickness && inter->co_index != 1) { // Scene *scene = CTX_data_scene(C); - // View3D *v3d = ruler_info->sa->spacedata.first; + // View3D *v3d = ruler_info->area->spacedata.first; const float mval_fl[2] = {UNPACK2(mval)}; float ray_normal[3]; float ray_start[3]; @@ -1064,10 +1064,10 @@ static void WIDGETGROUP_ruler_setup(const bContext *C, wmGizmoGroup *gzgroup) } wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); ruler_info->win = win; - ruler_info->sa = sa; + ruler_info->area = area; ruler_info->region = region; gzgroup->customdata = ruler_info; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 57989680705..be0084d8869 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -105,7 +105,7 @@ static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event) wmWindow *win = CTX_wm_window(C); const int ctrl = win->eventstate->ctrl, shift = win->eventstate->shift; - /* watch it: if sa->win does not exist, check that when calling direct drawing routines */ + /* watch it: if area->win does not exist, check that when calling direct drawing routines */ switch (event) { case B_SEL_VERT: diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 610c40c37eb..c16131c8317 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -91,8 +91,8 @@ void VIEW3D_OT_zoom_border(struct wmOperatorType *ot); void VIEW3D_OT_toggle_shading(struct wmOperatorType *ot); void VIEW3D_OT_toggle_xray(struct wmOperatorType *ot); -void view3d_boxview_copy(struct ScrArea *sa, struct ARegion *region); -void view3d_boxview_sync(struct ScrArea *sa, struct ARegion *region); +void view3d_boxview_copy(struct ScrArea *area, struct ARegion *region); +void view3d_boxview_sync(struct ScrArea *area, struct ARegion *region); void view3d_orbit_apply_dyn_ofs(float r_ofs[3], const float ofs_old[3], @@ -181,7 +181,7 @@ typedef struct V3D_SmoothParams { void ED_view3d_smooth_view_ex(const struct Depsgraph *depsgraph, struct wmWindowManager *wm, struct wmWindow *win, - struct ScrArea *sa, + struct ScrArea *area, struct View3D *v3d, struct ARegion *region, const int smooth_viewtx, diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index b8dbd277fbc..cd7db2ff23a 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1226,7 +1226,7 @@ static bool do_lasso_select_paintface(ViewContext *vc, #if 0 static void do_lasso_select_node(int mcords[][2], short moves, const eSelectOp sel_op) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; bNode *node; rcti rect; diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 5db26e26f0b..acbd4b85ece 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -229,25 +229,25 @@ void ED_view3d_polygon_offset(const RegionView3D *rv3d, const float dist) bool ED_view3d_context_activate(bContext *C) { bScreen *sc = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region; - /* sa can be NULL when called from python */ - if (sa == NULL || sa->spacetype != SPACE_VIEW3D) { - sa = BKE_screen_find_big_area(sc, SPACE_VIEW3D, 0); + /* area can be NULL when called from python */ + if (area == NULL || area->spacetype != SPACE_VIEW3D) { + area = BKE_screen_find_big_area(sc, SPACE_VIEW3D, 0); } - if (sa == NULL) { + if (area == NULL) { return false; } - region = BKE_area_find_region_active_win(sa); + region = BKE_area_find_region_active_win(area); if (region == NULL) { return false; } /* bad context switch .. */ - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); return true; @@ -666,7 +666,7 @@ bool ED_view3d_camera_lock_autokey(View3D *v3d, * Use with quad-split so each view is clipped by the bounds of each view axis. * \{ */ -static void view3d_boxview_clip(ScrArea *sa) +static void view3d_boxview_clip(ScrArea *area) { ARegion *region; BoundBox *bb = MEM_callocN(sizeof(BoundBox), "clipbb"); @@ -675,7 +675,7 @@ static void view3d_boxview_clip(ScrArea *sa) int val; /* create bounding box */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; @@ -747,7 +747,7 @@ static void view3d_boxview_clip(ScrArea *sa) } /* create bounding box */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; @@ -812,13 +812,13 @@ static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_ } /* sync center/zoom view of region to others, for view transforms */ -void view3d_boxview_sync(ScrArea *sa, ARegion *region) +void view3d_boxview_sync(ScrArea *area, ARegion *region) { ARegion *artest; RegionView3D *rv3d = region->regiondata; short clip = 0; - for (artest = sa->regionbase.first; artest; artest = artest->next) { + for (artest = area->regionbase.first; artest; artest = artest->next) { if (artest != region && artest->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3dtest = artest->regiondata; @@ -833,18 +833,18 @@ void view3d_boxview_sync(ScrArea *sa, ARegion *region) } if (clip) { - view3d_boxview_clip(sa); + view3d_boxview_clip(area); } } /* for home, center etc */ -void view3d_boxview_copy(ScrArea *sa, ARegion *region) +void view3d_boxview_copy(ScrArea *area, ARegion *region) { ARegion *artest; RegionView3D *rv3d = region->regiondata; bool clip = false; - for (artest = sa->regionbase.first; artest; artest = artest->next) { + for (artest = area->regionbase.first; artest; artest = artest->next) { if (artest != region && artest->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3dtest = artest->regiondata; @@ -859,12 +859,12 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *region) } if (clip) { - view3d_boxview_clip(sa); + view3d_boxview_clip(area); } } /* 'clip' is used to know if our clip setting has changed */ -void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) +void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip) { ARegion *region_sync = NULL; RegionView3D *rv3d = region->regiondata; @@ -900,13 +900,13 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region_sync ? region_sync : sa->regionbase.last); + view3d_boxview_sync(area, region_sync ? region_sync : area->regionbase.last); } /* ensure locked regions have an axis, locked user views don't make much sense */ if (viewlock & RV3D_LOCK_ROTATION) { int index_qsplit = 0; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->alignment == RGN_ALIGN_QSPLIT) { rv3d = region->regiondata; if (rv3d->viewlock) { @@ -922,7 +922,7 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) } } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } /** \} */ diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 3dc5b3025aa..71a4c2e0780 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -128,7 +128,7 @@ void ED_view3d_smooth_view_ex( const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, - ScrArea *sa, + ScrArea *area, View3D *v3d, ARegion *region, const int smooth_viewtx, @@ -293,7 +293,7 @@ void ED_view3d_smooth_view_ex( } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_copy(sa, region); + view3d_boxview_copy(area, region); } ED_region_tag_redraw(region); @@ -309,9 +309,9 @@ void ED_view3d_smooth_view(bContext *C, const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - ED_view3d_smooth_view_ex(depsgraph, wm, win, sa, v3d, region, smooth_viewtx, sview); + ED_view3d_smooth_view_ex(depsgraph, wm, win, area, v3d, region, smooth_viewtx, sview); } /* only meant for timer usage */ @@ -1200,7 +1200,7 @@ finally: static uint free_localview_bit(Main *bmain) { - ScrArea *sa; + ScrArea *area; bScreen *sc; ushort local_view_bits = 0; @@ -1208,8 +1208,8 @@ static uint free_localview_bit(Main *bmain) /* sometimes we loose a localview: when an area is closed */ /* check all areas: which localviews are in use? */ for (sc = bmain->screens.first; sc; sc = sc->id.next) { - for (sa = sc->areabase.first; sa; sa = sa->next) { - SpaceLink *sl = sa->spacedata.first; + for (area = sc->areabase.first; area; area = area->next) { + SpaceLink *sl = area->spacedata.first; for (; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; @@ -1235,12 +1235,12 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, wmWindow *win, Main *bmain, ViewLayer *view_layer, - ScrArea *sa, + ScrArea *area, const bool frame_selected, const int smooth_viewtx, ReportList *reports) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; Base *base; float min[3], max[3], box[3]; float size = 0.0f; @@ -1302,7 +1302,7 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, memcpy(v3d->localvd, v3d, sizeof(View3D)); v3d->local_view_uuid = local_view_bit; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; bool ok_dist = true; @@ -1343,7 +1343,7 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, ED_view3d_smooth_view_ex(depsgraph, wm, win, - sa, + area, v3d, region, smooth_viewtx, @@ -1365,11 +1365,11 @@ static void view3d_localview_exit(const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, ViewLayer *view_layer, - ScrArea *sa, + ScrArea *area, const bool frame_selected, const int smooth_viewtx) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; if (v3d->localvd == NULL) { return; @@ -1390,7 +1390,7 @@ static void view3d_localview_exit(const Depsgraph *depsgraph, MEM_freeN(v3d->localvd); v3d->localvd = NULL; - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; @@ -1411,7 +1411,7 @@ static void view3d_localview_exit(const Depsgraph *depsgraph, ED_view3d_smooth_view_ex(depsgraph, wm, win, - sa, + area, v3d, region, smooth_viewtx, @@ -1439,23 +1439,23 @@ static int localview_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); View3D *v3d = CTX_wm_view3d(C); bool frame_selected = RNA_boolean_get(op->ptr, "frame_selected"); bool changed; if (v3d->localvd) { - view3d_localview_exit(depsgraph, wm, win, view_layer, sa, frame_selected, smooth_viewtx); + view3d_localview_exit(depsgraph, wm, win, view_layer, area, frame_selected, smooth_viewtx); changed = true; } else { changed = view3d_localview_init( - depsgraph, wm, win, bmain, view_layer, sa, frame_selected, smooth_viewtx, op->reports); + depsgraph, wm, win, bmain, view_layer, area, frame_selected, smooth_viewtx, op->reports); } if (changed) { DEG_id_type_tag(bmain, ID_OB); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); /* Unselected objects become selected when exiting. */ if (v3d->localvd == NULL) { @@ -1558,15 +1558,15 @@ void VIEW3D_OT_localview_remove_from(wmOperatorType *ot) static uint free_localcollection_bit(Main *bmain, ushort local_collections_uuid, bool *r_reset) { - ScrArea *sa; + ScrArea *area; bScreen *sc; ushort local_view_bits = 0; /* Check all areas: which localviews are in use? */ for (sc = bmain->screens.first; sc; sc = sc->id.next) { - for (sa = sc->areabase.first; sa; sa = sa->next) { - SpaceLink *sl = sa->spacedata.first; + for (area = sc->areabase.first; area; area = area->next) { + SpaceLink *sl = area->spacedata.first; for (; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; |