From 223f9310955f6b0d6f1089c16802a57e20fcadb3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Apr 2019 08:44:58 +0200 Subject: Cleanup: comment length in transform --- source/blender/editors/transform/transform.c | 49 +++++----- source/blender/editors/transform/transform.h | 5 +- .../editors/transform/transform_constraints.c | 3 +- .../editors/transform/transform_conversions.c | 105 +++++++++++++-------- .../blender/editors/transform/transform_generics.c | 37 +++++--- .../blender/editors/transform/transform_gizmo_3d.c | 3 +- source/blender/editors/transform/transform_snap.c | 3 +- .../editors/transform/transform_snap_object.c | 9 +- 8 files changed, 134 insertions(+), 80 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 76bd66f87b5..d4837084a5f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -96,7 +96,8 @@ #include "transform.h" -/* Disabling, since when you type you know what you are doing, and being able to set it to zero is handy. */ +/* Disabling, since when you type you know what you are doing, + * and being able to set it to zero is handy. */ // #define USE_NUM_NO_ZERO static void drawTransformApply(const struct bContext *C, ARegion *ar, void *arg); @@ -2341,8 +2342,9 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve /* Needed to translate tweak events to mouse buttons. */ t->launch_event = event ? WM_userdef_event_type_from_keymap_type(event->type) : -1; - // XXX Remove this when wm_operator_call_internal doesn't use window->eventstate (which can have type = 0) - // For gizmo only, so assume LEFTMOUSE + /* XXX Remove this when wm_operator_call_internal doesn't use window->eventstate + * (which can have type = 0) */ + /* For gizmo only, so assume LEFTMOUSE. */ if (t->launch_event == 0) { t->launch_event = LEFTMOUSE; } @@ -2365,7 +2367,6 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve else if (t->spacetype == SPACE_IMAGE) { t->draw_handle_view = ED_region_draw_cb_activate( t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); - //t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL); t->draw_handle_cursor = WM_paint_cursor_activate( CTX_wm_manager(C), SPACE_TYPE_ANY, RGN_TYPE_ANY, helpline_poll, drawHelpline, t); } @@ -2376,7 +2377,6 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve CTX_wm_manager(C), SPACE_TYPE_ANY, RGN_TYPE_ANY, helpline_poll, drawHelpline, t); } else if (t->spacetype == SPACE_NODE) { - /*t->draw_handle_apply = ED_region_draw_cb_activate(t->ar->type, drawTransformApply, t, REGION_DRAW_PRE_VIEW);*/ t->draw_handle_view = ED_region_draw_cb_activate( t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); t->draw_handle_cursor = WM_paint_cursor_activate( @@ -2385,14 +2385,12 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve else if (t->spacetype == SPACE_GRAPH) { t->draw_handle_view = ED_region_draw_cb_activate( t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); - //t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL); t->draw_handle_cursor = WM_paint_cursor_activate( CTX_wm_manager(C), SPACE_TYPE_ANY, RGN_TYPE_ANY, helpline_poll, drawHelpline, t); } else if (t->spacetype == SPACE_ACTION) { t->draw_handle_view = ED_region_draw_cb_activate( t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); - //t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL); t->draw_handle_cursor = WM_paint_cursor_activate( CTX_wm_manager(C), SPACE_TYPE_ANY, RGN_TYPE_ANY, helpline_poll, drawHelpline, t); } @@ -2678,7 +2676,8 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } } - /* Don't write into the values when non-modal because they are already set from operator redo values. */ + /* Don't write into the values when non-modal because they are already set from operator redo + * values. */ if (t->flag & T_MODAL) { /* Setup the mouse input with initial values. */ applyMouseInput(t, &t->mouse, t->mouse.imval, t->values); @@ -2875,7 +2874,8 @@ static void protectedAxisAngleBits( eulO_to_axis_angle(axis, angle, eul, EULER_ORDER_DEFAULT); - /* when converting to axis-angle, we need a special exception for the case when there is no axis */ + /* When converting to axis-angle, + * we need a special exception for the case when there is no axis. */ if (IS_EQF(axis[0], axis[1]) && IS_EQF(axis[1], axis[2])) { /* for now, rotate around y-axis then (so that it simply becomes the roll) */ axis[1] = 1.0f; @@ -4562,7 +4562,8 @@ static void applyRotation(TransInfo *t, const int UNUSED(mval[2])) applySnapping(t, &final); - /* Used to clamp final result in [-PI, PI[ range, no idea why, inheritance from 2.4x area, see T48998. */ + /* Used to clamp final result in [-PI, PI[ range, no idea why, + * inheritance from 2.4x area, see T48998. */ applyNumInput(&t->num, &final); t->values[0] = final; @@ -6365,7 +6366,8 @@ static void slide_origdata_create_data(TransDataContainer *tc, for (i = 0; i < tc->data_len; i++, td++) { BMVert *eve = td->extra; - /* Check the vertex has been used since both sides of the mirror may be selected & sliding. */ + /* Check the vertex has been used since both sides + * of the mirror may be selected & sliding. */ if (eve && !BLI_ghash_haskey(sod->origverts, eve)) { sv_mirror->v = eve; copy_v3_v3(sv_mirror->co_orig_3d, eve->co); @@ -7897,12 +7899,14 @@ static void doEdgeSlide(TransInfo *t, float perc) } else { /** - * Implementation note, even mode ignores the starting positions and uses only the - * a/b verts, this could be changed/improved so the distance is still met but the verts are moved along - * their original path (which may not be straight), however how it works now is OK and matches 2.4x - Campbell + * Implementation note, even mode ignores the starting positions and uses + * only the a/b verts, this could be changed/improved so the distance is + * still met but the verts are moved along their original path (which may not be straight), + * however how it works now is OK and matches 2.4x - Campbell * - * \note len_v3v3(curr_sv->dir_side[0], curr_sv->dir_side[1]) - * is the same as the distance between the original vert locations, same goes for the lines below. + * \note `len_v3v3(curr_sv->dir_side[0], curr_sv->dir_side[1])` + * is the same as the distance between the original vert locations, + * same goes for the lines below. */ TransDataEdgeSlideVert *curr_sv = &sld_active->sv[sld_active->curr_sv_index]; const float curr_length_perc = curr_sv->edge_len * @@ -9123,9 +9127,10 @@ static void doAnimEdit_SnapFrame( *(td->val) = val; } - /* if the handles are to be moved too (as side-effect of keyframes moving, to keep the general effect) - * offset them by the same amount so that the general angles are maintained (i.e. won't change while - * handles are free-to-roam and keyframes are snap-locked) + /* If the handles are to be moved too + * (as side-effect of keyframes moving, to keep the general effect) + * offset them by the same amount so that the general angles are maintained + * (i.e. won't change while handles are free-to-roam and keyframes are snap-locked). */ if ((td->flag & TD_MOVEHANDLE1) && td2d->h1) { td2d->h1[0] = td2d->ih1[0] + *td->val - td->ival; @@ -9230,7 +9235,8 @@ static void applyTimeTranslateValue(TransInfo *t) { TransData *td = tc->data; TransData2D *td2d = tc->data_2d; - /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ + /* It doesn't matter whether we apply to t->data or + * t->data2d, but t->data2d is more convenient. */ for (i = 0; i < tc->data_len; i++, td++, td2d++) { /* it is assumed that td->extra is a pointer to the AnimData, * whose active action is where this keyframe comes from @@ -9416,7 +9422,8 @@ static void applyTimeSlideValue(TransInfo *t, float sval) saction->timeslide = cvalf; } - /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ + /* It doesn't matter whether we apply to t->data or + * t->data2d, but t->data2d is more convenient. */ FOREACH_TRANS_DATA_CONTAINER(t, tc) { TransData *td = tc->data; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 6451d82e45c..50fc1a276b9 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -824,9 +824,10 @@ enum { TD_BEZTRIPLE = 1 << 12, /** when this is set, don't apply translation changes to this element */ TD_NO_LOC = 1 << 13, - /** for Graph Editor autosnap, indicates that point should not undergo autosnapping */ + /** For Graph Editor autosnap, indicates that point should not undergo autosnapping */ TD_NOTIMESNAP = 1 << 14, - /** for Graph Editor - curves that can only have int-values need their keyframes tagged with this */ + /** For Graph Editor - curves that can only have int-values + * need their keyframes tagged with this. */ TD_INTVALUES = 1 << 15, /** For editmode mirror, clamp to x = 0 */ TD_MIRROR_EDGE = 1 << 16, diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 27d6e597931..a3b579342fe 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -219,7 +219,8 @@ static void axisProjection(const TransInfo *t, if (angle < DEG2RADF(5.0f)) { project_v3_v3v3(vec, in, t->viewinv[1]); factor = dot_v3v3(t->viewinv[1], vec) * 2.0f; - /* since camera distance is quite relative, use quadratic relationship. holding shift can compensate */ + /* Since camera distance is quite relative, use quadratic relationship. + * holding shift can compensate. */ if (factor < 0.0f) factor *= -factor; else diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ef8089b8225..3f16d2bcfee 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2004,8 +2004,8 @@ static void createTransCurveVerts(TransInfo *t) if (is_prop_edit && head != tail) calc_distanceCurveVerts(head, tail - 1); - /* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles - * but for now just don't change handle types */ + /* TODO - in the case of tilt and radius we can also avoid allocating the + * initTransDataCurveHandles but for now just don't change handle types */ if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT, TFM_DUMMY) == 0) { /* sets the handles based on their selection, * do this after the data is copied to the TransData */ @@ -2784,7 +2784,8 @@ static void createTransEditVerts(TransInfo *t) /** * Quick check if we can transform. * - * \note ignore modes here, even in edge/face modes, transform data is created by selected vertices. + * \note ignore modes here, even in edge/face modes, + * transform data is created by selected vertices. * \note in prop mode we need at least 1 selected. */ if (bm->totvertsel == 0) { @@ -2838,7 +2839,8 @@ static void createTransEditVerts(TransInfo *t) } if (is_island_center) { - /* In this specific case, near-by vertices will need to know the island of the nearest connected vertex. */ + /* In this specific case, near-by vertices will need to know + * the island of the nearest connected vertex. */ const bool calc_single_islands = ((prop_mode & T_PROP_CONNECTED) && (t->around == V3D_AROUND_LOCAL_ORIGINS) && (em->selectmode & SCE_SELECT_VERTEX)); @@ -3128,8 +3130,9 @@ void flushTransSeq(TransInfo *t) break; } - /* Update *previous* seq! Else, we would update a seq after its first transform, and if it has more than one - * (like e.g. SEQ_LEFTSEL and SEQ_RIGHTSEL), the others are not updated! See T38469. + /* Update *previous* seq! Else, we would update a seq after its first transform, + * and if it has more than one (like e.g. SEQ_LEFTSEL and SEQ_RIGHTSEL), + * the others are not updated! See T38469. */ if (seq != seq_prev) { if (seq_prev) { @@ -3746,8 +3749,9 @@ static void createTransNlaData(bContext *C, TransInfo *t) td++; } - /* if both handles were used, skip the next tdn (i.e. leave it blank) since the counting code is dumb... - * otherwise, just advance to the next one... + /* If both handles were used, skip the next tdn (i.e. leave it blank) + * since the counting code is dumb. + * Otherwise, just advance to the next one. */ if (tdn->handle == 2) tdn += 2; @@ -4699,7 +4703,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) t->frame_side = 'B'; } - /* loop 1: count how many BezTriples (specifically their verts) are selected (or should be edited) */ + /* Loop 1: count how many BezTriples (specifically their verts) + * are selected (or should be edited). */ for (ale = anim_data.first; ale; ale = ale->next) { AnimData *adt = ANIM_nla_mapping_get(&ac, ale); FCurve *fcu = (FCurve *)ale->key_data; @@ -4719,7 +4724,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) else cfra = (float)CFRA; - /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse */ + /* Only include BezTriples whose 'keyframe' + * occurs on the same side of the current frame as mouse. */ for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) { const bool sel2 = (bezt->f2 & SELECT) != 0; @@ -4771,7 +4777,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) tc->data_len = count; tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransData (Graph Editor)"); - /* for each 2d vert a 3d vector is allocated, so that they can be treated just as if they were 3d verts */ + /* For each 2d vert a 3d vector is allocated, + * so that they can be treated just as if they were 3d verts. */ tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D), "TransData2D (Graph Editor)"); tc->custom.type.data = MEM_callocN(tc->data_len * sizeof(TransDataGraph), "TransDataGraph"); tc->custom.type.use_free = true; @@ -4958,7 +4965,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) unit_scale, offset); } - /* special hack (must be done after initTransDataCurveHandles(), as that stores handle settings to restore...): + /* Special hack (must be done after #initTransDataCurveHandles(), + * as that stores handle settings to restore...): + * * - Check if we've got entire BezTriple selected and we're scaling/rotating that point, * then check if we're using auto-handles. * - If so, change them auto-handles to aligned handles so that handles get affected too @@ -5293,13 +5302,15 @@ void flushTransGraphData(TransInfo *t) else td2d->loc2d[0] = td2d->loc[0]; - /* Time-stepping auto-snapping modes don't get applied for Graph Editor transforms, + /** Time-stepping auto-snapping modes don't get applied for Graph Editor transforms, * as these use the generic transform modes which don't account for this sort of thing. * These ones aren't affected by NLA mapping, so we do this after the conversion... * - * NOTE: We also have to apply to td->loc, as that's what the handle-adjustment step below looks - * to, otherwise we get "swimming handles" - * NOTE: We don't do this when canceling transforms, or else these changes don't go away + * \note We also have to apply to td->loc, + * as that's what the handle-adjustment step below looks to, + * otherwise we get "swimming handles". + * + * \note We don't do this when canceling transforms, or else these changes don't go away. */ if ((t->state != TRANS_CANCEL) && (td->flag & TD_NOTIMESNAP) == 0 && ELEM(sipo->autosnap, SACTSNAP_STEP, SACTSNAP_TSTEP)) { @@ -5474,8 +5485,9 @@ static int SeqTransCount(TransInfo *t, Sequence *parent, ListBase *seqbase, int for (seq = seqbase->first; seq; seq = seq->next) { seq->depth = depth; - /* seq->tmp is used by seq_tx_get_final_{left, right} to check sequence's range and clamp to it if needed. - * it's first place where digging into sequences tree, so store link to parent here */ + /* 'seq->tmp' is used by seq_tx_get_final_{left, right} + * to check sequence's range and clamp to it if needed. + * It's first place where digging into sequences tree, so store link to parent here. */ seq->tmp = parent; SeqTransInfo(t, seq, &recursive, &count, &flag); /* ignore the flag */ @@ -6265,10 +6277,14 @@ static void clear_trans_object_base_flags(TransInfo *t) } } -/* auto-keyframing feature - for objects - * tmode: should be a transform mode +/** + * Auto-keyframing feature - for objects + * + * \param tmode: A transform mode. + * + * \note Context may not always be available, + * so must check before using it as it's a luxury for a few cases. */ -// NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int tmode) { Main *bmain = CTX_data_main(C); @@ -6292,8 +6308,9 @@ void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Objec ANIM_relative_keyingset_add_source(&dsources, id, NULL, NULL); if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) { - /* only insert into active keyingset - * NOTE: we assume here that the active Keying Set does not need to have its iterator overridden + /* Only insert into active keyingset + * NOTE: we assume here that the active Keying Set + * does not need to have its iterator overridden. */ ANIM_apply_keyingset(C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); } @@ -6398,11 +6415,16 @@ bool motionpath_need_update_object(Scene *scene, Object *ob) return false; } -/* auto-keyframing feature - for poses/pose-channels - * tmode: should be a transform mode +/** + * Auto-keyframing feature - for poses/pose-channels + * + * \param tmode: A transform mode. + * * targetless_ik: has targetless ik been done on any channels? + * + * \note Context may not always be available, + * so must check before using it as it's a luxury for a few cases. */ -// NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short targetless_ik) { Main *bmain = CTX_data_main(C); @@ -6484,7 +6506,8 @@ void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short t else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { bool do_loc = false, do_rot = false, do_scale = false; - /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ + /* Filter the conditions when this happens + * (assume that 'curarea->spacetype == SPACE_VIEW3D'). */ if (tmode == TFM_TRANSLATION) { if (targetless_ik) do_rot = true; @@ -6698,10 +6721,11 @@ static void special_aftertrans_update__mesh(bContext *UNUSED(C), TransInfo *t) } /* inserting keys, pointcache, redraw events... */ -/* - * note: sequencer freeing has its own function now because of a conflict with transform's order of freeing (campbell) - * Order changed, the sequencer stuff should go back in here - * */ +/** + * \note Sequencer freeing has its own function now because of a conflict + * with transform's order of freeing (campbell). + * Order changed, the sequencer stuff should go back in here + */ void special_aftertrans_update(bContext *C, TransInfo *t) { Main *bmain = CTX_data_main(t->context); @@ -6908,9 +6932,12 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (ac.datatype == ANIMCONT_MASK) { /* remove duplicate frames and also make sure points are in order! */ /* 3 cases here for curve cleanups: - * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done - * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed - * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these + * 1) NOTRANSKEYCULL on: + * Cleanup of duplicates shouldn't be done. + * 2) canceled == 0: + * User confirmed the transform, so duplicates should be removed. + * 3) Canceled + duplicate: + * User canceled the transform, but we made duplicates, so get rid of these. */ if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 && ((canceled == 0) || (duplicate))) { Mask *mask; @@ -8746,7 +8773,9 @@ static void createTransGPencil(bContext *C, TransInfo *t) /* undo matrix */ invert_m4_m4(inverse_diff_mat, diff_mat); - /* Make a new frame to work on if the layer's frame and the current scene frame don't match up + /* Make a new frame to work on if the layer's frame + * and the current scene frame don't match up. + * * - This is useful when animating as it saves that "uh-oh" moment when you realize you've * spent too much time editing the wrong frame... */ @@ -9188,8 +9217,10 @@ void createTransData(bContext *C, TransInfo *t) } } else if (ob && (ob->mode & OB_MODE_POSE)) { - // XXX this is currently limited to active armature only... - // XXX active-layer checking isn't done as that should probably be checked through context instead + /* XXX this is currently limited to active armature only... */ + + /* XXX active-layer checking isn't done + * as that should probably be checked through context instead. */ /* Multi object editing. */ initTransDataContainers_FromObjectData(t, ob, NULL, 0); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 46e8447efc6..18730d11091 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -374,7 +374,8 @@ static void recalcData_actedit(TransInfo *t) } if (ac.datatype != ANIMCONT_MASK) { - /* get animdata blocks visible in editor, assuming that these will be the ones where things changed */ + /* Get animdata blocks visible in editor, + * assuming that these will be the ones where things changed. */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_ANIMDATA); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); @@ -466,9 +467,9 @@ static void recalcData_nla(TransInfo *t) TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); TransDataNla *tdn = tc->custom.type.data; - /* for each strip we've got, perform some additional validation of the values that got set before - * using RNA to set the value (which does some special operations when setting these values to make - * sure that everything works ok) + /* For each strip we've got, perform some additional validation of the values + * that got set before using RNA to set the value (which does some special + * operations when setting these values to make sure that everything works ok). */ for (i = 0; i < tc->data_len; i++, tdn++) { NlaStrip *strip = tdn->strip; @@ -509,7 +510,8 @@ static void recalcData_nla(TransInfo *t) /* restore to original track (if needed) */ if (tdn->oldTrack != tdn->nlt) { - /* just append to end of list for now, since strips get sorted in special_aftertrans_update() */ + /* Just append to end of list for now, + * since strips get sorted in special_aftertrans_update(). */ BLI_remlink(&tdn->nlt->strips, strip); BLI_addtail(&tdn->oldTrack->strips, strip); } @@ -530,8 +532,9 @@ static void recalcData_nla(TransInfo *t) if ((pExceeded && nExceeded) || (iter == 4)) { /* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise) - * - simply crop strip to fit within the bounds of the strips bounding it - * - if there were no neighbors, clear the transforms (make it default to the strip's current values) + * - Simply crop strip to fit within the bounds of the strips bounding it + * - If there were no neighbors, clear the transforms + * (make it default to the strip's current values). */ if (strip->prev && strip->next) { tdn->h1[0] = strip->prev->end; @@ -621,8 +624,9 @@ static void recalcData_nla(TransInfo *t) /* flush transforms to child strips (since this should be a meta) */ BKE_nlameta_flush_transforms(strip); - /* now, check if we need to try and move track - * - we need to calculate both, as only one may have been altered by transform if only 1 handle moved + /* Now, check if we need to try and move track: + * - we need to calculate both, + * as only one may have been altered by transform if only 1 handle moved. */ delta_y1 = ((int)tdn->h1[1] / NLACHANNEL_STEP(snla) - tdn->trackIndex); delta_y2 = ((int)tdn->h2[1] / NLACHANNEL_STEP(snla) - tdn->trackIndex); @@ -632,8 +636,9 @@ static void recalcData_nla(TransInfo *t) int delta = (delta_y2) ? delta_y2 : delta_y1; int n; - /* move in the requested direction, checking at each layer if there's space for strip to pass through, - * stopping on the last track available or that we're able to fit in + /* Move in the requested direction, + * checking at each layer if there's space for strip to pass through, + * stopping on the last track available or that we're able to fit in. */ if (delta > 0) { for (track = tdn->nlt->next, n = 0; (track) && (n < delta); track = track->next, n++) { @@ -955,7 +960,9 @@ static void recalcData_objects(TransInfo *t) * * context is needed for keying set poll() functions. */ - // TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes? + + /* TODO: autokeyframe calls need some setting to specify to add samples + * (FPoints) instead of keyframes? */ if ((t->animtimer) && (t->context) && IS_AUTOKEY_ON(t->scene)) { int targetless_ik = (t->flag & T_AUTOIK); // XXX this currently doesn't work, since flags aren't set yet! @@ -1018,7 +1025,8 @@ static void recalcData_objects(TransInfo *t) * check if the auto-record feature means that we should record 'samples' * (i.e. uneditable animation values) */ - // TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes? + /* TODO: autokeyframe calls need some setting to specify to add samples + * (FPoints) instead of keyframes? */ if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) { animrecord_check_state(t->scene, &ob->id, t->animtimer); autokeyframe_object(t->context, t->scene, t->view_layer, ob, t->mode); @@ -2160,7 +2168,8 @@ void calculateCenter(TransInfo *t) } if (t->spacetype == SPACE_VIEW3D) { - /* ED_view3d_calc_zfac() defines a factor for perspective depth correction, used in ED_view3d_win_to_delta() */ + /* ED_view3d_calc_zfac() defines a factor for perspective depth correction, + * used in ED_view3d_win_to_delta() */ /* zfac is only used convertViewVec only in cases operator was invoked in RGN_TYPE_WINDOW * and never used in other cases. diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 1fde0006c2b..0bc62b8b962 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -352,7 +352,8 @@ static void gizmo_get_axis_color(const int axis_idx, else { bool is_plane = false; const int axis_idx_norm = gizmo_orientation_axis(axis_idx, &is_plane); - /* get alpha fac based on axis angle, to fade axis out when hiding it because it points towards view */ + /* Get alpha fac based on axis angle, + * to fade axis out when hiding it because it points towards view. */ if (axis_idx_norm < 3) { const float idot_min = g_tw_axis_range[is_plane].min; const float idot_max = g_tw_axis_range[is_plane].max; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index d9cc9e3fcee..d8e80265bec 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -582,7 +582,8 @@ static void initSnappingMode(TransInfo *t) else if (t->tsnap.applySnap != NULL && // A snapping function actually exist (obedit_type == -1)) // Object Mode { - /* In "Edit Strokes" mode, Snap tool can perform snap to selected or active objects (see T49632) + /* In "Edit Strokes" mode, + * snap tool can perform snap to selected or active objects (see T49632) * TODO: perform self snap in gpencil_strokes */ t->tsnap.modeSelect = (((t->options & (CTX_GPENCIL_STROKES | CTX_CURSOR)) != 0) ? SNAP_ALL : diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 93f89c1919e..5d4867f5ef9 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -826,7 +826,8 @@ static void raycast_obj_cb( * Read/Write Args * --------------- * - * \param ray_depth: maximum depth allowed for r_co, elements deeper than this value will be ignored. + * \param ray_depth: maximum depth allowed for r_co, + * elements deeper than this value will be ignored. * * Output Args * ----------- @@ -887,7 +888,8 @@ static bool snap_bound_box_check_dist(float min[3], float mval[2], float dist_px_sq) { - /* In vertex and edges you need to get the pixel distance from ray to BoundBox, see: T46099, T46816 */ + /* In vertex and edges you need to get the pixel distance from ray to BoundBox, + * see: T46099, T46816 */ struct DistProjectedAABBPrecalc data_precalc; dist_squared_to_projected_aabb_precalc(&data_precalc, lpmat, win_size, mval); @@ -1626,7 +1628,8 @@ static short snapCurve(SnapData *snapdata, nu->bezt[u].vec[1], &dist_px_sq, r_loc); - /* don't snap if handle is selected (moving), or if it is aligning to a moving handle */ + /* Don't snap if handle is selected (moving), + * or if it is aligning to a moving handle. */ if (!(nu->bezt[u].f1 & SELECT) && !(nu->bezt[u].h1 & HD_ALIGN && nu->bezt[u].f3 & SELECT)) { has_snap |= test_projected_vert_dist(&neasrest_precalc, -- cgit v1.2.3