From ff7dbdbaeef1e1be0d8da18cb97a9e91be27f934 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 Oct 2013 04:07:18 +0000 Subject: rename give_cursor to ED_view3d_cursor3d_get --- source/blender/editors/armature/armature_add.c | 6 +++--- source/blender/editors/armature/armature_edit.c | 6 +++--- source/blender/editors/curve/editcurve.c | 4 ++-- source/blender/editors/gpencil/gpencil_edit.c | 2 +- source/blender/editors/gpencil/gpencil_paint.c | 2 +- source/blender/editors/include/ED_view3d.h | 4 ++-- source/blender/editors/mesh/editmesh_bisect.c | 2 +- source/blender/editors/mesh/editmesh_extrude.c | 6 +++--- source/blender/editors/mesh/editmesh_tools.c | 2 +- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_transform.c | 2 +- source/blender/editors/sculpt_paint/paint_image_proj.c | 4 ++-- source/blender/editors/space_view3d/view3d_draw.c | 2 +- source/blender/editors/space_view3d/view3d_edit.c | 6 +++--- source/blender/editors/space_view3d/view3d_snap.c | 10 +++++----- source/blender/editors/space_view3d/view3d_view.c | 4 ++-- source/blender/editors/transform/transform.c | 4 ++-- source/blender/editors/transform/transform_generics.c | 2 +- source/blender/editors/transform/transform_manipulator.c | 2 +- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 2 +- 20 files changed, 37 insertions(+), 37 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index d480d41f5d6..351fd2844c9 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -176,7 +176,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) newbone->flag |= BONE_CONNECTED; } - curs = give_cursor(scene, v3d); + curs = ED_view3d_cursor3d_get(scene, v3d); copy_v3_v3(newbone->tail, curs); sub_v3_v3v3(newbone->tail, newbone->tail, obedit->obmat[3]); @@ -216,7 +216,7 @@ static int armature_click_extrude_invoke(bContext *C, wmOperator *op, const wmEv ar = CTX_wm_region(C); v3d = CTX_wm_view3d(C); - fp = give_cursor(scene, v3d); + fp = ED_view3d_cursor3d_get(scene, v3d); copy_v3_v3(oldcurs, fp); @@ -691,7 +691,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "name", name); - copy_v3_v3(curs, give_cursor(CTX_data_scene(C), CTX_wm_view3d(C))); + copy_v3_v3(curs, ED_view3d_cursor3d_get(CTX_data_scene(C), CTX_wm_view3d(C))); /* Get inverse point for head and orientation for tail */ invert_m4_m4(obedit->imat, obedit->obmat); diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 90c1a439a19..1c6ba1d3562 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -252,7 +252,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); /* can be NULL */ float cursor_local[3]; - const float *cursor = give_cursor(scene, v3d); + const float *cursor = ED_view3d_cursor3d_get(scene, v3d); copy_v3_v3(cursor_local, cursor); @@ -502,7 +502,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op) /* Get points - cursor (tail) */ invert_m4_m4(obedit->imat, obedit->obmat); - mul_v3_m4v3(curs, obedit->imat, give_cursor(scene, v3d)); + mul_v3_m4v3(curs, obedit->imat, ED_view3d_cursor3d_get(scene, v3d)); /* Create a bone */ /* newbone = */ add_points_bone(obedit, ebp->vec, curs); @@ -536,7 +536,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op) /* get cursor location */ invert_m4_m4(obedit->imat, obedit->obmat); - mul_v3_m4v3(curs, obedit->imat, give_cursor(scene, v3d)); + mul_v3_m4v3(curs, obedit->imat, ED_view3d_cursor3d_get(scene, v3d)); /* get distances */ sub_v3_v3v3(vecA, ebp->vec, curs); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 7b03a15a011..bd91740521d 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4485,7 +4485,7 @@ static int spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event) if (rv3d) copy_v3_v3(axis, rv3d->viewinv[2]); - RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); + RNA_float_set_array(op->ptr, "center", ED_view3d_cursor3d_get(scene, v3d)); RNA_float_set_array(op->ptr, "axis", axis); return spin_exec(C, op); @@ -4821,7 +4821,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) mul_v3_m4v3(location, vc.obedit->obmat, bp->vec); } else { - copy_v3_v3(location, give_cursor(vc.scene, vc.v3d)); + copy_v3_v3(location, ED_view3d_cursor3d_get(vc.scene, vc.v3d)); } ED_view3d_win_to_3d_int(vc.ar, location, event->mval, location); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index c5dc8654e9d..0298699fac5 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -454,7 +454,7 @@ static void gp_strokepoint_convertcoords(bContext *C, bGPDstroke *gps, bGPDspoin copy_v3_v3(p3d, &pt->x); } else { - const float *fp = give_cursor(scene, v3d); + const float *fp = ED_view3d_cursor3d_get(scene, v3d); float mvalf[2]; /* get screen coordinate */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 255f0b7cfba..98fff3d65ce 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -211,7 +211,7 @@ static int gpencil_project_check(tGPsdata *p) static void gp_get_3d_reference(tGPsdata *p, float vec[3]) { View3D *v3d = p->sa->spacedata.first; - const float *fp = give_cursor(p->scene, v3d); + const float *fp = ED_view3d_cursor3d_get(p->scene, v3d); /* the reference point used depends on the owner... */ #if 0 /* XXX: disabled for now, since we can't draw relative to the owner yet */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index e504c858efa..0f3106794f5 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -82,8 +82,8 @@ typedef struct ViewDepths { bool damaged; } ViewDepths; -float *give_cursor(struct Scene *scene, struct View3D *v3d); -void ED_view3d_cursor3d_position(struct bContext *C, float fp[3], const int mval[2]); +float *ED_view3d_cursor3d_get(struct Scene *scene, struct View3D *v3d); +void ED_view3d_cursor3d_position(struct bContext *C, float fp[3], const int mval[2]); void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist); void ED_view3d_from_m4(float mat[4][4], float ofs[3], float quat[4], float *dist); diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index 7b5a6e50d9f..7bc3ff3ab77 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -203,7 +203,7 @@ static int mesh_bisect_exec(bContext *C, wmOperator *op) RNA_property_float_get_array(op->ptr, prop_plane_co, plane_co); } else { - copy_v3_v3(plane_co, give_cursor(scene, v3d)); + copy_v3_v3(plane_co, ED_view3d_cursor3d_get(scene, v3d)); RNA_property_float_set_array(op->ptr, prop_plane_co, plane_co); } diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index d3207d42983..ef300fa9db6 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -653,7 +653,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w BM_ELEM_SELECT, min); } else { - const float *curs = give_cursor(vc.scene, vc.v3d); + const float *curs = ED_view3d_cursor3d_get(vc.scene, vc.v3d); BMOperator bmop; BMOIter oiter; @@ -751,7 +751,7 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = ED_view3d_context_rv3d(C); - RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); + RNA_float_set_array(op->ptr, "center", ED_view3d_cursor3d_get(scene, v3d)); RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[2]); return edbm_spin_exec(C, op); @@ -871,7 +871,7 @@ static int edbm_screw_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = ED_view3d_context_rv3d(C); - RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); + RNA_float_set_array(op->ptr, "center", ED_view3d_cursor3d_get(scene, v3d)); RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[1]); return edbm_screw_exec(C, op); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 06afc3a4103..6a0a0694764 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1615,7 +1615,7 @@ static bool merge_target(BMEditMesh *em, Scene *scene, View3D *v3d, Object *ob, const float *vco = NULL; if (use_cursor) { - vco = give_cursor(scene, v3d); + vco = ED_view3d_cursor3d_get(scene, v3d); copy_v3_v3(co, vco); mul_m4_v3(ob->imat, co); } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index db75acef267..0a390da2ae4 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -152,7 +152,7 @@ void ED_object_location_from_view(bContext *C, float loc[3]) Scene *scene = CTX_data_scene(C); const float *cursor; - cursor = give_cursor(scene, v3d); + cursor = ED_view3d_cursor3d_get(scene, v3d); copy_v3_v3(loc, cursor); } diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 4d7abbe7c39..fef5ae392ea 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -712,7 +712,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) else { /* get the view settings if 'around' isn't set and the view is available */ View3D *v3d = CTX_wm_view3d(C); - copy_v3_v3(cursor, give_cursor(scene, v3d)); + copy_v3_v3(cursor, ED_view3d_cursor3d_get(scene, v3d)); if (v3d && !RNA_struct_property_is_set(op->ptr, "center")) around = v3d->around; } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 66d09c77cea..88cc954fb17 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3307,7 +3307,7 @@ static void paint_proj_begin_clone(ProjPaintState *ps, const float mouse[2]) /* setup clone offset */ if (ps->tool == PAINT_TOOL_CLONE) { float projCo[4]; - copy_v3_v3(projCo, give_cursor(ps->scene, ps->v3d)); + copy_v3_v3(projCo, ED_view3d_cursor3d_get(ps->scene, ps->v3d)); mul_m4_v3(ps->ob->imat, projCo); projCo[3] = 1.0f; @@ -4163,7 +4163,7 @@ void paint_proj_stroke(bContext *C, void *pps, const float prev_pos[2], const fl if (ps->tool == PAINT_TOOL_CLONE && ps->mode == BRUSH_STROKE_INVERT) { Scene *scene = ps->scene; View3D *v3d = ps->v3d; - float *cursor = give_cursor(scene, v3d); + float *cursor = ED_view3d_cursor3d_get(scene, v3d); int mval_i[2] = {(int)pos[0], (int)pos[1]}; view3d_operator_needs_opengl(C); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index a37d98e416d..8b7d5756429 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -567,7 +567,7 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d) int co[2]; /* we don't want the clipping for cursor */ - if (ED_view3d_project_int_global(ar, give_cursor(scene, v3d), co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) { + if (ED_view3d_project_int_global(ar, ED_view3d_cursor3d_get(scene, v3d), co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) { const float f5 = 0.25f * U.widget_unit; const float f10 = 0.5f * U.widget_unit; const float f20 = U.widget_unit; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 67c9ea4599c..bb41e727d90 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2476,7 +2476,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in if (center) { /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */ - curs = give_cursor(scene, v3d); + curs = ED_view3d_cursor3d_get(scene, v3d); zero_v3(min); zero_v3(max); zero_v3(curs); @@ -2757,7 +2757,7 @@ static int viewcenter_cursor_exec(bContext *C, wmOperator *op) /* non camera center */ float new_ofs[3]; - negate_v3_v3(new_ofs, give_cursor(scene, v3d)); + negate_v3_v3(new_ofs, ED_view3d_cursor3d_get(scene, v3d)); ED_view3d_smooth_view(C, v3d, ar, NULL, NULL, new_ofs, NULL, NULL, NULL, smooth_viewtx); @@ -4172,7 +4172,7 @@ static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), const wmE { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); - float *fp = give_cursor(scene, v3d); + float *fp = ED_view3d_cursor3d_get(scene, v3d); ED_view3d_cursor3d_position(C, fp, event->mval); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 7c29ab01c24..8a099c7198b 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -687,7 +687,7 @@ static int snap_sel_to_curs_exec(bContext *C, wmOperator *op) const bool use_offset = RNA_boolean_get(op->ptr, "use_offset"); - cursor_global = give_cursor(scene, v3d); + cursor_global = ED_view3d_cursor3d_get(scene, v3d); if (use_offset) { snap_curs_to_sel_ex(C, center_global); @@ -852,7 +852,7 @@ static int snap_curs_to_grid_exec(bContext *C, wmOperator *UNUSED(op)) float gridf, *curs; gridf = rv3d->gridview; - curs = give_cursor(scene, v3d); + curs = ED_view3d_cursor3d_get(scene, v3d); curs[0] = gridf * floorf(0.5f + curs[0] / gridf); curs[1] = gridf * floorf(0.5f + curs[1] / gridf); @@ -1035,7 +1035,7 @@ static int snap_curs_to_sel_exec(bContext *C, wmOperator *UNUSED(op)) View3D *v3d = CTX_wm_view3d(C); float *curs; - curs = give_cursor(scene, v3d); + curs = ED_view3d_cursor3d_get(scene, v3d); if (snap_curs_to_sel_ex(C, curs)) { WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); @@ -1072,7 +1072,7 @@ static int snap_curs_to_active_exec(bContext *C, wmOperator *UNUSED(op)) View3D *v3d = CTX_wm_view3d(C); float *curs; - curs = give_cursor(scene, v3d); + curs = ED_view3d_cursor3d_get(scene, v3d); if (obedit) { if (obedit->type == OB_MESH) { @@ -1127,7 +1127,7 @@ static int snap_curs_to_center_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); float *curs; - curs = give_cursor(scene, v3d); + curs = ED_view3d_cursor3d_get(scene, v3d); zero_v3(curs); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 61c6d5c00dd..e321e7c9c4b 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -104,7 +104,7 @@ void view3d_region_operator_needs_opengl(wmWindow *win, ARegion *ar) } } -float *give_cursor(Scene *scene, View3D *v3d) +float *ED_view3d_cursor3d_get(Scene *scene, View3D *v3d) { if (v3d && v3d->localvd) return v3d->cursor; else return scene->cursor; @@ -847,7 +847,7 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d) } else if (v3d->ob_centre_cursor) { float vec[3]; - copy_v3_v3(vec, give_cursor(scene, v3d)); + copy_v3_v3(vec, ED_view3d_cursor3d_get(scene, v3d)); translate_m4(rv3d->viewmat, -vec[0], -vec[1], -vec[2]); use_lock_ofs = true; } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c0fb959d6b5..9909f438734 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2711,14 +2711,14 @@ static void initWarp(TransInfo *t) t->flag |= T_NO_CONSTRAINT; - //copy_v3_v3(t->center, give_cursor(t->scene, t->view)); + //copy_v3_v3(t->center, ED_view3d_cursor3d_get(t->scene, t->view)); calculateCenterCursor(t); t->val = 0.0f; data = MEM_callocN(sizeof(*data), __func__); - curs = give_cursor(t->scene, t->view); + curs = ED_view3d_cursor3d_get(t->scene, t->view); copy_v3_v3(data->warp_sta, curs); ED_view3d_win_to_3d(t->ar, curs, mval_fl, data->warp_end); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index a8248cc73e1..33eca0d6b89 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1500,7 +1500,7 @@ void calculateCenterCursor(TransInfo *t) { const float *cursor; - cursor = give_cursor(t->scene, t->view); + cursor = ED_view3d_cursor3d_get(t->scene, t->view); copy_v3_v3(t->center, cursor); /* If edit or pose mode, move cursor in local space */ diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index f667a98812b..132a46441e6 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1635,7 +1635,7 @@ void BIF_draw_manipulator(const bContext *C) copy_v3_v3(rv3d->twmat[3], scene->twcent); break; case V3D_CURSOR: - copy_v3_v3(rv3d->twmat[3], give_cursor(scene, v3d)); + copy_v3_v3(rv3d->twmat[3], ED_view3d_cursor3d_get(scene, v3d)); break; } diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 87cc42001d6..0f42808b2d0 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -890,7 +890,7 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result, } case V3D_CURSOR: /* cursor center */ { - const float *curs = give_cursor(scene, v3d); + const float *curs = ED_view3d_cursor3d_get(scene, v3d); /* shift to objects world */ sub_v3_v3v3(result, curs, ob->obmat[3]); break; -- cgit v1.2.3