From b8e8c0e325d213f2dcf4adad5506989fa224716e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2019 23:24:20 +1100 Subject: Cleanup: comment line length (editors) Prevents clang-format wrapping text before comments. --- source/blender/editors/space_view3d/drawobject.c | 2 +- source/blender/editors/space_view3d/space_view3d.c | 9 ++++-- .../blender/editors/space_view3d/view3d_buttons.c | 7 +++-- .../editors/space_view3d/view3d_camera_control.c | 6 ++-- source/blender/editors/space_view3d/view3d_draw.c | 17 +++++++---- .../editors/space_view3d/view3d_draw_legacy.c | 3 +- source/blender/editors/space_view3d/view3d_edit.c | 29 +++++++++++-------- source/blender/editors/space_view3d/view3d_fly.c | 33 ++++++++++++++-------- .../space_view3d/view3d_gizmo_navigate_type.c | 3 +- .../blender/editors/space_view3d/view3d_project.c | 7 +++-- .../blender/editors/space_view3d/view3d_select.c | 19 +++++++++---- source/blender/editors/space_view3d/view3d_snap.c | 10 +++++-- source/blender/editors/space_view3d/view3d_utils.c | 9 ++++-- source/blender/editors/space_view3d/view3d_view.c | 13 +++++---- source/blender/editors/space_view3d/view3d_walk.c | 6 ++-- 15 files changed, 114 insertions(+), 59 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index ea19c734940..e0e8ae0c04e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -80,7 +80,7 @@ static bool check_ob_drawface_dot(Scene *sce, View3D *vd, char dt) return true; } -/* ----------------- OpenGL Circle Drawing - Tables for Optimized Drawing Speed ------------------ */ +/* OpenGL Circle Drawing - Tables for Optimized Drawing Speed */ /* 32 values of sin function (still same result!) */ #define CIRCLE_RESOL 32 diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 79e5026c7c5..7b3d1ac6072 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -568,7 +568,8 @@ static bool view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEven static bool view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip)) { if (drag->type == WM_DRAG_PATH) { - return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE)); /* rule might not work? */ + /* rule might not work? */ + return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE)); } else { return WM_drag_ID(drag, ID_IM) != NULL; @@ -1368,7 +1369,8 @@ const char *view3d_context_dir[] = { static int view3d_context(const bContext *C, const char *member, bContextDataResult *result) { - /* fallback to the scene layer, allows duplicate and other object operators to run outside the 3d view */ + /* fallback to the scene layer, + * allows duplicate and other object operators to run outside the 3d view */ if (CTX_data_dir(member)) { CTX_data_dir_set(result, view3d_context_dir); @@ -1436,7 +1438,8 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i if (is_local == false) { if ((ID *)v3d->ob_centre == old_id) { v3d->ob_centre = (Object *)new_id; - /* Otherwise, bonename may remain valid... We could be smart and check this, too? */ + /* Otherwise, bonename may remain valid... + * We could be smart and check this, too? */ if (new_id == NULL) { v3d->ob_centre_bone[0] = '\0'; } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 87bbb347bd0..e13e28c892c 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -708,7 +708,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float apply_raw_diff(&bezt->alfa, tot, ve_median->tilt, median->tilt); } } - else if (apply_vcos) { /* Handles can only have their coordinates changed here. */ + else if (apply_vcos) { + /* Handles can only have their coordinates changed here. */ if (bezt->f1 & SELECT) { apply_raw_diff_v3(bezt->vec[0], tot, ve_median->location, median->location); } @@ -1232,7 +1233,7 @@ void view3d_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object"); strcpy(pt->idname, "VIEW3D_PT_transform"); - strcpy(pt->label, N_("Transform")); /* XXX C panels not available through RNA (bpy.types)! */ + strcpy(pt->label, N_("Transform")); /* XXX C panels unavailable through RNA bpy.types! */ strcpy(pt->category, "View"); strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_transform; @@ -1241,7 +1242,7 @@ void view3d_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup"); strcpy(pt->idname, "VIEW3D_PT_vgroup"); - strcpy(pt->label, N_("Vertex Weights")); /* XXX C panels are not available through RNA (bpy.types)! */ + strcpy(pt->label, N_("Vertex Weights")); /* XXX C panels unavailable through RNA bpy.types! */ strcpy(pt->category, "View"); strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_vgroup; diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c index d2239b9b8ba..dc9144a4f5a 100644 --- a/source/blender/editors/space_view3d/view3d_camera_control.c +++ b/source/blender/editors/space_view3d/view3d_camera_control.c @@ -223,7 +223,8 @@ void ED_view3d_cameracontrol_update( const bool use_autokey, struct bContext *C, const bool do_rotate, const bool do_translate) { - /* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to the view */ + /* we are in camera view so apply the view ofs and quat to the view matrix and set the camera + * to the view */ Scene *scene = vctrl->ctx_scene; View3D *v3d = vctrl->ctx_v3d; @@ -309,7 +310,8 @@ void ED_view3d_cameracontrol_release( DEG_id_tag_update(&ob_back->id, ID_RECALC_TRANSFORM); } else { - /* Non Camera we need to reset the view back to the original location because the user canceled*/ + /* Non Camera we need to reset the view back + * to the original location because the user canceled. */ copy_qt_qt(rv3d->viewquat, vctrl->rot_backup); rv3d->persp = vctrl->persp_backup; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 92fb64964aa..9d6eb6f76e7 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -718,7 +718,10 @@ void ED_view3d_draw_depth( /* temp set drawtype to solid */ /* Setting these temporarily is not nice */ v3d->flag &= ~V3D_SELECT_OUTLINE; - U.glalphaclip = alphaoverride ? 0.5f : glalphaclip; /* not that nice but means we wont zoom into billboards */ + + /* not that nice but means we wont zoom into billboards */ + U.glalphaclip = alphaoverride ? 0.5f : glalphaclip; + U.obcenter_dia = 0; /* Tools may request depth outside of regular drawing code. */ @@ -814,7 +817,8 @@ float ED_view3d_grid_view_scale( static void draw_view_axis(RegionView3D *rv3d, const rcti *rect) { const float k = U.rvisize * U.pixelsize; /* axis size */ - const int bright = - 20 * (10 - U.rvibright); /* axis alpha offset (rvibright has range 0-10) */ + /* axis alpha offset (rvibright has range 0-10) */ + const int bright = - 20 * (10 - U.rvibright); /* Axis center in screen coordinates. * @@ -1211,12 +1215,15 @@ static void draw_selected_name(Scene *scene, ViewLayer *view_layer, Object *ob, } /* color depends on whether there is a keyframe */ - if (id_frame_has_keyframe((ID *)ob, /* BKE_scene_frame_get(scene) */ (float)cfra, ANIMFILTER_KEYS_LOCAL)) + if (id_frame_has_keyframe((ID *)ob, /* BKE_scene_frame_get(scene) */ (float)cfra, ANIMFILTER_KEYS_LOCAL)) { UI_FontThemeColor(font_id, TH_TIME_KEYFRAME); - else if (ED_gpencil_has_keyframe_v3d(scene, ob, cfra)) + } + else if (ED_gpencil_has_keyframe_v3d(scene, ob, cfra)) { UI_FontThemeColor(font_id, TH_TIME_GP_KEYFRAME); - else + } + else { UI_FontThemeColor(font_id, TH_TEXT_HI); + } } else { /* no object */ diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index 04e19efdb20..734e4471a19 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -563,7 +563,8 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph, if (ibuf == NULL) continue; - if ((ibuf->rect == NULL && ibuf->rect_float == NULL) || ibuf->channels != 4) { /* invalid image format */ + if ((ibuf->rect == NULL && ibuf->rect_float == NULL) || ibuf->channels != 4) { + /* invalid image format */ if (freeibuf) IMB_freeImBuf(freeibuf); if (releaseibuf) diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 070e02074ff..7a368d2ca02 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -457,8 +457,8 @@ static void viewops_data_create( negate_v3_v3(my_origin, rv3d->ofs); /* ofs is flipped */ - /* Set the dist value to be the distance from this 3d point - * this means youll always be able to zoom into it and panning wont go bad when dist was zero */ + /* Set the dist value to be the distance from this 3d point this means youll + * always be able to zoom into it and panning wont go bad when dist was zero */ /* remove dist value */ upvec[0] = upvec[1] = 0; @@ -469,7 +469,8 @@ static void viewops_data_create( sub_v3_v3v3(my_pivot, rv3d->ofs, upvec); negate_v3(my_pivot); /* ofs is flipped */ - /* find a new ofs value that is along the view axis (rather than the mouse location) */ + /* find a new ofs value that is along the view axis + * (rather than the mouse location) */ closest_to_line_v3(dvec, vod->dyn_ofs, my_pivot, my_origin); vod->init.dist = rv3d->dist = len_v3v3(my_pivot, dvec); @@ -1224,7 +1225,8 @@ void view3d_ndof_fly( } if (!is_zero_v3(trans)) { - /* move center of view opposite of hand motion (this is camera mode, not object mode) */ + /* move center of view opposite of hand motion + * (this is camera mode, not object mode) */ sub_v3_v3(rv3d->ofs, trans); has_translate = true; } @@ -2819,7 +2821,8 @@ static int viewselected_exec(bContext *C, wmOperator *op) if (ob_eval && (ob_eval->mode & OB_MODE_WEIGHT_PAINT)) { /* hard-coded exception, we look for the one selected armature */ - /* this is weak code this way, we should make a generic active/selection callback interface once... */ + /* this is weak code this way, we should make a generic + * active/selection callback interface once... */ Base *base_eval; for (base_eval = view_layer_eval->object_bases.first; base_eval; base_eval = base_eval->next) { if (BASE_SELECTED_EDITABLE(v3d, base_eval)) { @@ -2896,8 +2899,10 @@ static int viewselected_exec(bContext *C, wmOperator *op) } /* account for duplis */ - if (BKE_object_minmax_dupli(depsgraph, scene, base_eval->object, min, max, false) == 0) - BKE_object_minmax(base_eval->object, min, max, false); /* use if duplis not found */ + if (BKE_object_minmax_dupli(depsgraph, scene, base_eval->object, min, max, false) == 0) { + /* use if duplis not found */ + BKE_object_minmax(base_eval->object, min, max, false); + } ok = 1; } @@ -3136,7 +3141,7 @@ void VIEW3D_OT_view_center_pick(wmOperatorType *ot) /** \name View Camera Center Operator * \{ */ -static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */ +static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) { Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -3188,7 +3193,7 @@ void VIEW3D_OT_view_center_camera(wmOperatorType *ot) /** \name View Lock Center Operator * \{ */ -static int view3d_center_lock_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */ +static int view3d_center_lock_exec(bContext *C, wmOperator *UNUSED(op)) { RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -4560,7 +4565,8 @@ void ED_view3d_clipping_local(RegionView3D *rv3d, float mat[4][4]) calc_local_clipping(rv3d->clip_local, rv3d->clipbb, mat); } -#if 0 /* TODO Missing from 2.8 drawing code. Find a solution to support clip border then uncomment it. */ +#if 0 /* TODO Missing from 2.8 drawing code. + * Find a solution to support clip border then uncomment it. */ static int view3d_clipping_exec(bContext *C, wmOperator *op) { @@ -4788,7 +4794,8 @@ void ED_view3d_cursor3d_update( } } else { - /* Cursor may be outside of the view, prevent it getting 'lost', see: T40353 & T45301 */ + /* Cursor may be outside of the view, + * prevent it getting 'lost', see: T40353 & T45301 */ zero_v2(rv3d->ofs_lock); } } diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index b27de9d70c2..69f32c8eada 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -92,11 +92,12 @@ typedef enum eFlyPanState { /* disabled */ FLY_AXISLOCK_STATE_OFF = 0, - /* enabled but not checking because mouse hasn't moved outside the margin since locking was checked an not needed - * when the mouse moves, locking is set to 2 so checks are done. */ + /* enabled but not checking because mouse hasn't moved outside the margin since locking was + * checked an not needed when the mouse moves, locking is set to 2 so checks are done. */ FLY_AXISLOCK_STATE_IDLE = 1, - /* mouse moved and checking needed, if no view altering is done its changed back to #FLY_AXISLOCK_STATE_IDLE */ + /* mouse moved and checking needed, + * if no view altering is done its changed back to #FLY_AXISLOCK_STATE_IDLE */ FLY_AXISLOCK_STATE_ACTIVE = 2 } eFlyPanState; @@ -533,7 +534,8 @@ static void flyEvent(bContext *C, wmOperator *op, FlyInfo *fly, const wmEvent *e time_wheel = (float)(time_currwheel - fly->time_lastwheel); fly->time_lastwheel = time_currwheel; /* Mouse wheel delays range from (0.5 == slow) to (0.01 == fast) */ - time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ + /* 0-0.5 -> 0-5.0 */ + time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); if (fly->speed < 0.0f) { fly->speed = 0.0f; @@ -557,7 +559,8 @@ static void flyEvent(bContext *C, wmOperator *op, FlyInfo *fly, const wmEvent *e time_currwheel = PIL_check_seconds_timer(); time_wheel = (float)(time_currwheel - fly->time_lastwheel); fly->time_lastwheel = time_currwheel; - time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ + /* 0-0.5 -> 0-5.0 */ + time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); if (fly->speed > 0.0f) { fly->speed = 0; @@ -577,7 +580,8 @@ static void flyEvent(bContext *C, wmOperator *op, FlyInfo *fly, const wmEvent *e /* implement WASD keys, * comments only for 'forward '*/ case FLY_MODAL_DIR_FORWARD: - if (fly->axis == 2 && fly->speed < 0.0f) { /* reverse direction stops, tap again to continue */ + if (fly->axis == 2 && fly->speed < 0.0f) { + /* reverse direction stops, tap again to continue */ fly->axis = -1; } else { @@ -696,14 +700,17 @@ static int flyApply(bContext *C, FlyInfo *fly) */ RegionView3D *rv3d = fly->rv3d; - float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */ - float dvec[3] = {0, 0, 0}; /* this is the direction that's added to the view offset per redraw */ + /* 3x3 copy of the view matrix so we can move along the view axis */ + float mat[3][3]; + /* this is the direction that's added to the view offset per redraw */ + float dvec[3] = {0, 0, 0}; /* Camera Uprighting variables */ float moffset[2]; /* mouse offset from the views center */ float tmp_quat[4]; /* used for rotating the view */ - int xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */ + /* x and y margin are define the safe area where the mouses movement wont rotate the view */ + int xmargin, ymargin; #ifdef NDOF_FLY_DEBUG { @@ -765,7 +772,10 @@ static int flyApply(bContext *C, FlyInfo *fly) #endif time_current = PIL_check_seconds_timer(); time_redraw = (float)(time_current - fly->time_lastdraw); - time_redraw_clamped = min_ff(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */ + + /* clamp redraw time to avoid jitter in roll correction */ + time_redraw_clamped = min_ff(0.05f, time_redraw); + fly->time_lastdraw = time_current; /* Scale the time to use shift to scale the speed down- just like @@ -855,7 +865,8 @@ static int flyApply(bContext *C, FlyInfo *fly) fly->zlock_momentum += FLY_ZUP_CORRECT_ACCEL; } else { - fly->zlock = FLY_AXISLOCK_STATE_IDLE; /* don't check until the view rotates again */ + /* don't check until the view rotates again */ + fly->zlock = FLY_AXISLOCK_STATE_IDLE; fly->zlock_momentum = 0.0f; } } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c index f57ff4464e0..d71cd68c2c0 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c @@ -485,7 +485,8 @@ static int gizmo_axis_test_select( bool ok = true; - /* Check if we're viewing on an axis, there is no point to clicking on the current axis so show the reverse. */ + /* Check if we're viewing on an axis, + * there is no point to clicking on the current axis so show the reverse. */ if (len_squared_v2(co) < 1e-6f && (gz->matrix_offset[i][2] > 0.0f) == is_pos) { ok = false; } diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index 718f3cd40f1..e8e3d620d48 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -116,9 +116,10 @@ eV3DProjStatus ED_view3d_project_base(const struct ARegion *ar, struct Base *bas * - 'rv3d->perspmat', is_local == false * - 'rv3d->persmatob', is_local == true */ -static eV3DProjStatus ed_view3d_project__internal(const ARegion *ar, - float perspmat[4][4], const bool is_local, /* normally hidden */ - const float co[3], float r_co[2], const eV3DProjTest flag) +static eV3DProjStatus ed_view3d_project__internal( + const ARegion *ar, + float perspmat[4][4], const bool is_local, /* normally hidden */ + const float co[3], float r_co[2], const eV3DProjTest flag) { float vec4[4]; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index c976803065e..e10075cabb5 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -169,7 +169,8 @@ static void object_deselect_all_visible(ViewLayer *view_layer, View3D *v3d) } } -static void object_deselect_all_except(ViewLayer *view_layer, Base *b) /* deselect all except b */ +/* deselect all except b */ +static void object_deselect_all_except(ViewLayer *view_layer, Base *b) { for (Base *base = view_layer->object_bases.first; base; base = base->next) { if (base->flag & BASE_SELECTED) { @@ -941,7 +942,8 @@ static void do_lasso_select_paintface(ViewContext *vc, const int mcords[][2], sh return; if (SEL_OP_USE_PRE_DESELECT(sel_op)) { - paintface_deselect_all_visible(vc->C, ob, SEL_DESELECT, false); /* flush selection at the end */ + /* flush selection at the end */ + paintface_deselect_all_visible(vc->C, ob, SEL_DESELECT, false); } bm_vertoffs = me->totpoly + 1; /* max index array */ @@ -1155,7 +1157,8 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { - /* this is a bit dodjy, there should only be ONE object with this name, but library objects can mess this up */ + /* this is a bit dodjy, there should only be ONE object with this name, + * but library objects can mess this up */ if (STREQ(name, base->object->id.name + 2)) { ED_object_base_activate(C, base); ED_object_base_select(base, BA_SELECT); @@ -1610,7 +1613,9 @@ static bool ed_object_select_pick( startbase = FIRSTBASE(view_layer); if (BASACT(view_layer) && BASACT(view_layer)->next) startbase = BASACT(view_layer)->next; - /* This block uses the control key to make the object selected by its center point rather than its contents */ + /* This block uses the control key to make the object selected + * by its center point rather than its contents */ + /* in editmode do not activate */ if (obcenter) { @@ -1699,7 +1704,8 @@ static bool ed_object_select_pick( } /* index of bundle is 1<<16-based. if there's no "bone" index - * in height word, this buffer value belongs to camera. not to bundle */ + * in height word, this buffer value belongs to camera. not to bundle + */ if (buffer[4 * i + 3] & 0xFFFF0000) { MovieClip *clip = BKE_object_movieclip_get(scene, basact->object, false); MovieTracking *tracking = &clip->tracking; @@ -1758,7 +1764,8 @@ static bool ed_object_select_pick( WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object); - /* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */ + /* in weightpaint, we use selected bone to select vertexgroup, + * so no switch to new active object */ if (BASACT(view_layer) && (BASACT(view_layer)->object->mode & OB_MODE_WEIGHT_PAINT)) { /* prevent activating */ basact = NULL; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 9729598b022..636d46aa5d0 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -551,7 +551,10 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot) /* **************************************************** */ -/** Returns the center position of a tracking marker visible on the viewport (useful to snap to). **/ +/** + * Returns the center position of a tracking marker visible on the viewport + * (useful to snap to). + */ static void bundle_midpoint(Scene *scene, Object *ob, float r_vec[3]) { MovieClip *clip = BKE_object_movieclip_get(scene, ob, false); @@ -830,7 +833,10 @@ void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot) /* **************************************************** */ -/** Calculates the bounding box corners (min and max) for \a obedit. The returned values are in global space. **/ +/** + * Calculates the bounding box corners (min and max) for \a obedit. + * The returned values are in global space. + */ bool ED_view3d_minmax_verts(Object *obedit, float r_min[3], float r_max[3]) { TransVertStore tvs = {NULL}; diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 96f18ade149..57a8f2e46d7 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -106,7 +106,8 @@ void ED_view3d_cursor3d_calc_mat4(const Scene *scene, float mat[4][4]) Camera *ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d) { - /* establish the camera object, so we can default to view mapping if anything is wrong with it */ + /* establish the camera object, + * so we can default to view mapping if anything is wrong with it */ if ((rv3d->persp == RV3D_CAMOB) && v3d->camera && (v3d->camera->type == OB_CAMERA)) { return v3d->camera->data; } @@ -438,7 +439,8 @@ bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *ar if (rv3d->persp != RV3D_PERSP) { if (rv3d->persp == RV3D_CAMOB) { - /* If autopersp and previous view was an axis one, switch back to PERSP mode, else reuse previous mode. */ + /* If autopersp and previous view was an axis one, + * switch back to PERSP mode, else reuse previous mode. */ char persp = (autopersp && RV3D_VIEW_IS_AXIS(rv3d->lview)) ? RV3D_PERSP : rv3d->lpersp; ED_view3d_persp_switch_from_camera(depsgraph, v3d, rv3d, persp); } @@ -1114,7 +1116,8 @@ float ED_view3d_radius_to_dist( angle = focallength_to_fov(lens, sensor_size); - /* zoom influences lens, correct this by scaling the angle as a distance (by the zoom-level) */ + /* zoom influences lens, correct this by scaling the angle as a distance + * (by the zoom-level) */ angle = atanf(tanf(angle / 2.0f) * zoom) * 2.0f; dist = ED_view3d_radius_to_dist_persp(angle, radius); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 48caace5fd3..6945ba27109 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -212,7 +212,8 @@ void ED_view3d_smooth_view_ex( } /* grid draw as floor */ if ((rv3d->viewlock & RV3D_LOCKED) == 0) { - /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */ + /* use existing if exists, means multiple calls to smooth view + * wont loose the original 'view' setting */ rv3d->view = RV3D_VIEW_USER; } @@ -224,7 +225,8 @@ void ED_view3d_smooth_view_ex( * this means small rotations wont lag */ if (sview->quat && !sview->ofs && !sview->dist) { /* scale the time allowed by the rotation */ - sms.time_allowed *= (double)fabsf(angle_signed_normalized_qtqt(sms.dst.quat, sms.src.quat)) / M_PI; /* 180deg == 1.0 */ + /* 180deg == 1.0 */ + sms.time_allowed *= (double)fabsf(angle_signed_normalized_qtqt(sms.dst.quat, sms.src.quat)) / M_PI; } /* ensure it shows correct */ @@ -239,8 +241,8 @@ void ED_view3d_smooth_view_ex( rv3d->rflag |= RV3D_NAVIGATING; - /* not essential but in some cases the caller will tag the area for redraw, - * and in that case we can get a flicker of the 'org' user view but we want to see 'src' */ + /* not essential but in some cases the caller will tag the area for redraw, and in that + * case we can get a flicker of the 'org' user view but we want to see 'src' */ view3d_smooth_view_state_restore(&sms.src, v3d, rv3d); /* keep track of running timer! */ @@ -252,7 +254,8 @@ void ED_view3d_smooth_view_ex( WM_event_remove_timer(wm, win, rv3d->smooth_timer); } /* TIMER1 is hardcoded in keymap */ - rv3d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0); /* max 30 frs/sec */ + /* max 30 frs/sec */ + rv3d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0); ok = true; } diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index c19a1965a56..973f76a8b53 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -947,8 +947,10 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) RegionView3D *rv3d = walk->rv3d; ARegion *ar = walk->ar; - float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */ - float dvec[3] = {0.0f, 0.0f, 0.0f}; /* this is the direction that's added to the view offset per redraw */ + /* 3x3 copy of the view matrix so we can move along the view axis */ + float mat[3][3]; + /* this is the direction that's added to the view offset per redraw */ + float dvec[3] = {0.0f, 0.0f, 0.0f}; int moffset[2]; /* mouse offset from the views center */ float tmp_quat[4]; /* used for rotating the view */ -- cgit v1.2.3