diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-15 15:24:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-15 15:30:31 +0300 |
commit | b8e8c0e325d213f2dcf4adad5506989fa224716e (patch) | |
tree | adb3d7fa8735426ea856a929f562655b2eaf64cb /source/blender/editors/transform | |
parent | 4226ee0b71fec6f08897dacf3d6632526618acca (diff) |
Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
Diffstat (limited to 'source/blender/editors/transform')
8 files changed, 155 insertions, 75 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 53943eb830e..10082eaa6ef 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -382,7 +382,8 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr if (t->spacetype == SPACE_VIEW3D) { if (t->ar->regiontype == RGN_TYPE_WINDOW) { if (ED_view3d_project_int_global(t->ar, vec, adr, flag) != V3D_PROJ_RET_OK) { - adr[0] = (int)2140000000.0f; /* this is what was done in 2.64, perhaps we can be smarter? */ + /* this is what was done in 2.64, perhaps we can be smarter? */ + adr[0] = (int)2140000000.0f; adr[1] = (int)2140000000.0f; } } @@ -1055,7 +1056,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) copy_v2_v2_int(t->mval, event->mval); - // t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */ + /* Use this for soft redraw. Might cause flicker in object mode */ + // t->redraw |= TREDRAW_SOFT; t->redraw |= TREDRAW_HARD; if (t->state == TRANS_STARTING) { @@ -1381,7 +1383,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) } else { if (event->shift) { - /* bit hackish... but it prevents mmb select to print the orientation from menu */ + /* bit hackish... but it prevents mmb select to print the + * orientation from menu */ float mati[3][3]; strcpy(t->spacename, "global"); unit_m3(mati); @@ -1985,7 +1988,8 @@ static void drawTransformView(const struct bContext *C, ARegion *ar, void *arg) } } -/* just draw a little warning message in the top-right corner of the viewport to warn that autokeying is enabled */ +/* just draw a little warning message in the top-right corner of the viewport + * to warn that autokeying is enabled */ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar) { rcti rect; @@ -2183,7 +2187,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) const int orientation_index_custom = BKE_scene_transform_orientation_get_index( t->scene, t->orientation.custom); - /* Maybe we need a t->con.custom_orientation? Seems like it would always match t->orientation.custom. */ + /* Maybe we need a t->con.custom_orientation? + * Seems like it would always match t->orientation.custom. */ orientation = V3D_MANIP_CUSTOM + orientation_index_custom; BLI_assert(orientation >= V3D_MANIP_CUSTOM); } @@ -2378,9 +2383,13 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve initSnapSpatial(t, t->snap_spatial); - /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */ + /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. + * will be removed (ton) */ + /* EVIL2: we gave as argument also texture space context bit... was cleared */ - /* EVIL3: extend mode for animation editors also switches modes... but is best way to avoid duplicate code */ + + /* EVIL3: extend mode for animation editors also switches modes... + * but is best way to avoid duplicate code */ mode = t->mode; calculatePropRatio(t); @@ -2615,8 +2624,10 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve BMEditMesh *em = NULL;// BKE_editmesh_from_object(t->obedit); bool do_skip = false; - /* Currently only used for two of three most frequent transform ops, can include more ops. - * Note that scaling cannot be included here, non-uniform scaling will affect normals. */ + /* Currently only used for two of three most frequent transform ops, + * can include more ops. + * Note that scaling cannot be included here, + * non-uniform scaling will affect normals. */ if (ELEM(t->mode, TFM_TRANSLATION, TFM_ROTATION)) { if (em->bm->totvertsel == em->bm->totvert) { /* No need to invalidate if whole mesh is selected. */ @@ -4301,7 +4312,7 @@ static void ElementRotation_ex(TransInfo *t, TransDataContainer *tc, TransData * mul_m3_m3m3(smat, td->smtx, totmat); /* calculate the total rotatation in eulers */ - add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */ + add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* correct for delta rot */ eulO_to_mat3(obmat, eul, td->ext->rotOrder); /* mat = transform, obmat = object rotation */ mul_m3_m3m3(fmat, smat, obmat); @@ -4543,7 +4554,8 @@ void freeCustomNormalArray(TransInfo *t, TransDataContainer *tc, TransCustomData BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); BMesh *bm = em->bm; - for (int i = 0; i < lnors_ed_arr->totloop; i++, lnor_ed++) { /* Restore custom loop normal on cancel */ + /* Restore custom loop normal on cancel */ + for (int i = 0; i < lnors_ed_arr->totloop; i++, lnor_ed++) { BKE_lnor_space_custom_normal_to_data( bm->lnor_spacearr->lspacearr[lnor_ed->loop_index], lnor_ed->niloc, lnor_ed->clnors_data); } @@ -6107,9 +6119,12 @@ static void slide_origdata_interp_data_vert( bool co_next_ok; - /* In the unlikely case that we're next to a zero length edge - walk around the to the next. + /* In the unlikely case that we're next to a zero length edge - + * walk around the to the next. + * * Since we only need to check if the vertex is in this corner, - * its not important _which_ loop - as long as its not overlapping 'sv->co_orig_3d', see: T45096. */ + * its not important _which_ loop - as long as its not overlapping + * 'sv->co_orig_3d', see: T45096. */ project_plane_normalized_v3_v3v3(v_proj[0], co_prev, v_proj_axis); while (UNLIKELY(((co_prev_ok = (len_squared_v3v3(v_proj[1], v_proj[0]) > eps)) == false) && ((l_prev = l_prev->prev) != l->next))) @@ -6947,7 +6962,9 @@ static bool createEdgeSlideVerts_double_side(TransInfo *t, TransDataContainer *t else if (l_b == NULL && l_a && (l_a->radial_next != l_a)) l_b = l_a->radial_next; } else if (e->l != NULL) { - /* if there are non-contiguous faces, we can still recover the loops of the new edges faces */ + /* if there are non-contiguous faces, we can still recover + * the loops of the new edges faces */ + /* note!, the behavior in this case means edges may move in opposite directions, * this could be made to work more usefully. */ @@ -8547,7 +8564,8 @@ static void initSeqSlide(TransInfo *t) copy_v3_fl(t->num.val_inc, t->snap[1]); t->num.unit_sys = t->scene->unit.system; - /* Would be nice to have a time handling in units as well (supporting frames in addition to "natural" time...). */ + /* Would be nice to have a time handling in units as well + * (supporting frames in addition to "natural" time...). */ t->num.unit_type[0] = B_UNIT_NONE; t->num.unit_type[1] = B_UNIT_NONE; } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 869cccd0c94..ce41aa85da1 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -997,14 +997,16 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) data = con->data; if (data->tar == NULL || (data->tar->type == OB_ARMATURE && data->subtarget[0] == '\0')) { - /* make reference to constraint to base things off later (if it's the last targetless constraint encountered) */ + /* make reference to constraint to base things off later + * (if it's the last targetless constraint encountered) */ targetless = (bKinematicConstraint *)con->data; /* but, if this is a targetless IK, we make it auto anyway (for the children loop) */ if (con->enforce != 0.0f) { data->flag |= CONSTRAINT_IK_AUTO; - /* if no chain length has been specified, just make things obey standard rotation locks too */ + /* if no chain length has been specified, + * just make things obey standard rotation locks too */ if (data->rootbone == 0) { for (; pchan; pchan = pchan->parent) { /* here, we set ik-settings for bone from pchan->protectflag */ @@ -1025,7 +1027,10 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) } con = BKE_constraint_add_for_pose(NULL, pchan, "TempConstraint", CONSTRAINT_TYPE_KINEMATIC); - pchan->constflag |= (PCHAN_HAS_IK | PCHAN_HAS_TARGET); /* for draw, but also for detecting while pose solving */ + + /* for draw, but also for detecting while pose solving */ + pchan->constflag |= (PCHAN_HAS_IK | PCHAN_HAS_TARGET); + data = con->data; if (targetless) { /* if exists, use values from last targetless (but disabled) IK-constraint as base */ @@ -1035,7 +1040,10 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) data->flag = CONSTRAINT_IK_TIP; data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO | CONSTRAINT_IK_POS; copy_v3_v3(data->grabtarget, pchan->pose_tail); - data->rootbone = 0; /* watch-it! has to be 0 here, since we're still on the same bone for the first time through the loop [#25885] */ + + /* watch-it! has to be 0 here, since we're still on the + * same bone for the first time through the loop T25885. */ + data->rootbone = 0; /* we only include bones that are part of a continual connected chain */ do { @@ -1096,7 +1104,8 @@ static short pose_grab_with_ik(Main *bmain, Object *ob) arm = ob->data; - /* Rule: allow multiple Bones (but they must be selected, and only one ik-solver per chain should get added) */ + /* Rule: allow multiple Bones + * (but they must be selected, and only one ik-solver per chain should get added) */ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->bone->layer & arm->layer) { if (pchan->bone->flag & BONE_SELECTED) { @@ -1856,7 +1865,8 @@ static void createTransCurveVerts(TransInfo *t) else td->flag = 0; td->ext = NULL; - if (t->mode == TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */ + /* TODO - make points scale */ + if (t->mode == TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ td->val = &(bezt->radius); td->ival = bezt->radius; } @@ -1876,7 +1886,8 @@ static void createTransCurveVerts(TransInfo *t) if ((bezt_tx & SEL_F1) == 0 && (bezt_tx & SEL_F3) == 0) /* If the middle is selected but the sides arnt, this is needed */ - if (hdata == NULL) { /* if the handle was not saved by the previous handle */ + if (hdata == NULL) { + /* if the handle was not saved by the previous handle */ hdata = initTransDataCurveHandles(td, bezt); } @@ -1900,7 +1911,8 @@ static void createTransCurveVerts(TransInfo *t) td->ext = NULL; td->val = NULL; - if (hdata == NULL) { /* if the handle was not saved by the previous handle */ + if (hdata == NULL) { + /* if the handle was not saved by the previous handle */ hdata = initTransDataCurveHandles(td, bezt); } @@ -1927,7 +1939,8 @@ static void createTransCurveVerts(TransInfo *t) /* 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 */ + /* sets the handles based on their selection, + * do this after the data is copied to the TransData */ BKE_nurb_handles_test(nu, !hide_handles); } } @@ -2455,7 +2468,8 @@ static struct TransIslandData *editmesh_islands_info_calc( vert_map = MEM_mallocN(sizeof(*vert_map) * bm->totvert, __func__); /* we shouldn't need this, but with incorrect selection flushing - * its possible we have a selected vertex that's not in a face, for now best not crash in that case. */ + * its possible we have a selected vertex that's not in a face, + * for now best not crash in that case. */ copy_vn_i(vert_map, bm->totvert, -1); BM_mesh_elem_table_ensure(bm, htype); @@ -2667,10 +2681,12 @@ static void createTransEditVerts(TransInfo *t) int island_info_tot; int *island_vert_map = NULL; - /* Snap rotation along normal needs a common axis for whole islands, otherwise one get random crazy results, - * see T59104. However, we do not want to use the island center for the pivot/translation reference... */ + /* Snap rotation along normal needs a common axis for whole islands, + * otherwise one get random crazy results, see T59104. + * However, we do not want to use the island center for the pivot/translation reference. */ const bool is_snap_rotate = ((t->mode == TFM_TRANSLATION) && - /* There is not guarantee that snapping is initialized yet at this point... */ + /* There is not guarantee that snapping + * is initialized yet at this point... */ (usingSnappingNormal(t) || (t->settings->snap_flag & SCE_SNAP_ROTATE) != 0) && (t->around != V3D_AROUND_LOCAL_ORIGINS)); /* Even for translation this is needed because of island-orientation, see: T51651. */ @@ -2969,7 +2985,8 @@ BLI_INLINE void trans_update_seq(Scene *sce, Sequence *seq, int old_start, int s void flushTransSeq(TransInfo *t) { - ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep; /* Editing null check already done */ + /* Editing null check already done */ + ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep; int a, new_frame; TransData *td = NULL; @@ -2996,11 +3013,15 @@ void flushTransSeq(TransInfo *t) switch (tdsq->sel_flag) { case SELECT: #ifdef SEQ_TX_NESTED_METAS - if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) /* for meta's, their children move */ + if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) { + /* for meta's, their children move */ seq->start = new_frame - tdsq->start_offset; + } #else - if (seq->type != SEQ_TYPE_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */ + if (seq->type != SEQ_TYPE_META && (seq->depth != 0 || seq_tx_test(seq))) { + /* for meta's, their children move */ seq->start = new_frame - tdsq->start_offset; + } #endif if (seq->depth == 0) { seq->machine = round_fl_to_int(td2d->loc[1]); @@ -3010,12 +3031,16 @@ void flushTransSeq(TransInfo *t) case SEQ_LEFTSEL: /* no vertical transform */ BKE_sequence_tx_set_final_left(seq, new_frame); BKE_sequence_tx_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); - BKE_sequence_single_fix(seq); /* todo - move this into aftertrans update? - old seq tx needed it anyway */ + + /* todo - move this into aftertrans update? - old seq tx needed it anyway */ + BKE_sequence_single_fix(seq); break; case SEQ_RIGHTSEL: /* no vertical transform */ BKE_sequence_tx_set_final_right(seq, new_frame); BKE_sequence_tx_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); - BKE_sequence_single_fix(seq); /* todo - move this into aftertrans update? - old seq tx needed it anyway */ + + /* todo - move this into aftertrans update? - old seq tx needed it anyway */ + BKE_sequence_single_fix(seq); break; } @@ -3042,8 +3067,8 @@ void flushTransSeq(TransInfo *t) trans_update_seq(t->scene, seq_prev, old_start_prev, sel_flag_prev); } - - if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { /* originally TFM_TIME_EXTEND, transform changes */ + /* originally TFM_TIME_EXTEND, transform changes */ + if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { /* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */ /* calc all meta's then effects [#27953] */ @@ -3575,7 +3600,8 @@ static void createTransNlaData(bContext *C, TransInfo *t) td++; } if (FrameOnMouseSide(t->frame_side, strip->end, (float)CFRA)) { - /* if tdn is already holding the start handle, then we're doing both, otherwise, only end */ + /* if tdn is already holding the start handle, + * then we're doing both, otherwise, only end */ tdn->handle = (tdn->handle) ? 2 : 1; /* now, link the transform data up to this data */ @@ -3994,7 +4020,8 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { /* only add selected keyframes (for now, proportional edit is not enabled) */ - if (is_prop_edit || (bezt->f2 & SELECT)) { /* note this MUST match count_fcurve_keys(), so can't use BEZT_ISSEL_ANY() macro */ + if (is_prop_edit || (bezt->f2 & SELECT)) { /* note this MUST match count_fcurve_keys(), + * so can't use BEZT_ISSEL_ANY() macro */ /* only add if on the right 'side' of the current frame */ if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { TimeToTransData(td, bezt->vec[1], adt, ypos); @@ -4647,7 +4674,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) unit_scale = ANIM_unit_mapping_get_factor(ac.scene, ale->id, ale->key_data, anim_map_flag, &offset); - /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */ + /* only include BezTriples whose 'keyframe' occurs on the same side + * of the current frame as mouse (if applicable) */ 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; @@ -4751,7 +4779,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 (if applicable) */ + /* only include BezTriples whose 'keyframe' occurs on the + * same side of the current frame as mouse (if applicable) */ 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; @@ -5014,7 +5043,9 @@ void flushTransGraphData(TransInfo *t) a < tc->data_len; a++, td++, td2d++, tdg++) { - AnimData *adt = (AnimData *)td->extra; /* pointers to relevant AnimData blocks are stored in the td->extra pointers */ + /* pointers to relevant AnimData blocks are stored in the td->extra pointers */ + AnimData *adt = (AnimData *)td->extra; + float inv_unit_scale = 1.0f / tdg->unit_scale; /* handle snapping for time values @@ -5434,8 +5465,8 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c } } else { - /* Tag seq with a non zero value, - * used by BKE_sequence_base_shuffle_time to identify the ones to shuffle */ + /* Tag seq with a non zero value, used by + * BKE_sequence_base_shuffle_time to identify the ones to shuffle */ if (seq->depth == 0) { seq->tmp = (void *)1; } @@ -5707,7 +5738,8 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) float rot[3][3], scale[3]; float ctime = BKE_scene_frame_get(scene); - /* only use rigid body transform if simulation is running, avoids problems with initial setup of rigid bodies */ + /* only use rigid body transform if simulation is running, + * avoids problems with initial setup of rigid bodies */ if (BKE_rigidbody_check_sim_running(scene->rigidbody_world, ctime)) { /* save original object transform */ @@ -6555,9 +6587,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) FCurve *fcu = (FCurve *)ale->key_data; /* 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)) ) @@ -6586,9 +6620,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } /* 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))) @@ -6599,9 +6635,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (ac.datatype == ANIMCONT_GPENCIL) { /* 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))) @@ -6687,9 +6725,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) FCurve *fcu = (FCurve *)ale->key_data; /* 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 ((sipo->flag & SIPO_NOTRANSKEYCULL) == 0 && ((canceled == 0) || (duplicate))) @@ -6761,7 +6801,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } else if (t->flag & T_POSE && (t->mode == TFM_BONESIZE)) { /* Handle the exception where for TFM_BONESIZE in edit mode we pretend to be - * in pose mode (to use bone orientation matrix), in that case we don't do operations like autokeyframing. */ + * in pose mode (to use bone orientation matrix), + * in that case we don't do operations like autokeyframing. */ FOREACH_TRANS_DATA_CONTAINER (t, tc) { ob = tc->poseobj; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); @@ -6806,7 +6847,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) if (t->mode == TFM_TRANSLATION) pose_grab_with_ik_clear(bmain, ob); - /* automatic inserting of keys and unkeyed tagging - only if transform wasn't canceled (or TFM_DUMMY) */ + /* automatic inserting of keys and unkeyed tagging - + * only if transform wasn't canceled (or TFM_DUMMY) */ if (!canceled && (t->mode != TFM_DUMMY)) { autokeyframe_pose(C, t->scene, ob, t->mode, targetless_ik); DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); @@ -6871,8 +6913,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* flag object caches as outdated */ BKE_ptcache_ids_from_object(&pidlist, ob, t->scene, MAX_DUPLI_RECUR); for (pid = pidlist.first; pid; pid = pid->next) { - if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */ + if (pid->type != PTCACHE_TYPE_PARTICLES) { + /* particles don't need reset on geometry change */ pid->cache->flag |= PTCACHE_OUTDATED; + } } BLI_freelistN(&pidlist); @@ -6989,7 +7033,8 @@ static void createTransObject(bContext *C, TransInfo *t) for (base = view_layer->object_bases.first; base; base = base->next) { Object *ob = base->object; - /* if base is not selected, not a parent of selection or not a child of selection and it is editable */ + /* if base is not selected, not a parent of selection + * or not a child of selection and it is editable */ if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 && (base->flag & BASE_SELECTED) == 0 && BASE_EDITABLE(v3d, base)) @@ -8450,7 +8495,8 @@ static void createTransGPencil(bContext *C, TransInfo *t) if (point_ok) { copy_v3_v3(td->iloc, &pt->x); /* only copy center in local origins. - * This allows get interesting effects also when move using proportional editing */ + * This allows get interesting effects also when move + * using proportional editing */ if ((gps->flag & GP_STROKE_SELECT) && (ts->transform_pivot_point == V3D_AROUND_LOCAL_ORIGINS)) { @@ -8492,7 +8538,8 @@ static void createTransGPencil(bContext *C, TransInfo *t) copy_m3_m4(td->mtx, diff_mat); /* display position */ copy_m3_m4(td->axismtx, diff_mat); /* axis orientation */ - /* Triangulation must be calculated again, so save the stroke for recalc function */ + /* Triangulation must be calculated again, + * so save the stroke for recalc function */ td->extra = gps; /* save pointer to object */ @@ -8647,7 +8694,8 @@ void createTransData(bContext *C, TransInfo *t) if (t->data_len_all && (t->flag & T_PROP_EDIT)) { sort_trans_data(t); // makes selected become first in array - //set_prop_dist(t, false); /* don't do that, distance has been set in createTransActionData already */ + /* don't do that, distance has been set in createTransActionData already */ + //set_prop_dist(t, false); sort_trans_data_dist(t); } } @@ -8662,7 +8710,7 @@ void createTransData(bContext *C, TransInfo *t) t->flag |= T_POINTS | T_2D_EDIT; t->obedit_type = -1; - t->num.flag |= NUM_NO_FRACTION; /* sequencer has no use for floating point transformations */ + t->num.flag |= NUM_NO_FRACTION; /* sequencer has no use for floating point trasnform */ createTransSeqData(C, t); countAndCleanTransDataContainer(t); } @@ -8674,8 +8722,12 @@ void createTransData(bContext *C, TransInfo *t) countAndCleanTransDataContainer(t); if (t->data_len_all && (t->flag & T_PROP_EDIT)) { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, false); /* don't do that, distance has been set in createTransGraphEditData already */ + /* makes selected become first in array */ + sort_trans_data(t); + + /* don't do that, distance has been set in createTransGraphEditData already */ + set_prop_dist(t, false); + sort_trans_data_dist(t); } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 5f7d3ec5bde..ed16d943f5d 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -280,7 +280,8 @@ static void animrecord_check_state(Scene *scene, ID *id, wmTimer *animtimer) * - the option to add new actions for each round is not enabled */ if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL) == 0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) { - /* if playback has just looped around, we need to add a new NLA track+strip to allow a clean pass to occur */ + /* if playback has just looped around, + * we need to add a new NLA track+strip to allow a clean pass to occur */ if ((sad) && (sad->flag & ANIMPLAY_FLAG_JUMPED)) { AnimData *adt = BKE_animdata_from_id(id); const bool is_first = (adt) && (adt->nla_tracks.first == NULL); @@ -573,7 +574,8 @@ static void recalcData_nla(TransInfo *t) if (t->state != TRANS_CANCEL) { switch (snla->autosnap) { case SACTSNAP_FRAME: /* snap to nearest frame */ - case SACTSNAP_STEP: /* frame step - this is basically the same, since we don't have any remapping going on */ + case SACTSNAP_STEP: /* frame step - this is basically the same, + * since we don't have any remapping going on */ { tdn->h1[0] = floorf(tdn->h1[0] + 0.5f); tdn->h2[0] = floorf(tdn->h2[0] + 0.5f); @@ -581,7 +583,8 @@ static void recalcData_nla(TransInfo *t) } case SACTSNAP_SECOND: /* snap to nearest second */ - case SACTSNAP_TSTEP: /* second step - this is basically the same, since we don't have any remapping going on */ + case SACTSNAP_TSTEP: /* second step - this is basically the same, + * since we don't have any remapping going on */ { /* This case behaves differently from the rest, since lengths of strips * may not be multiples of a second. If we just naively resize adjust @@ -779,7 +782,8 @@ static void recalcData_objects(TransInfo *t) if (t->state == TRANS_CANCEL) { while (nu) { - BKE_nurb_handles_calc(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */ + /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */ + BKE_nurb_handles_calc(nu); nu = nu->next; } } diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 0bfe3582d04..03851e5f0cf 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -2265,7 +2265,8 @@ static void WIDGETGROUP_xform_shear_draw_prepare(const bContext *C, wmGizmoGroup LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) { /* Since we have two pairs of each axis, * bias the values so gizmos that are orthogonal to the view get priority. - * This means we never default to shearing along the view axis in the case of an overlap. */ + * This means we never default to shearing along + * the view axis in the case of an overlap. */ float axis_order[3], axis_bias[3]; copy_v3_v3(axis_order, gz->matrix_basis[2]); copy_v3_v3(axis_bias, gz->matrix_basis[1]); diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 190bc57fcfd..75606b84ea0 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -197,7 +197,8 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2 double dx3 = mval[0] - data->mval_prev[0]; double dy3 = mval[1] - data->mval_prev[1]; - /* use doubles here, to make sure a "1.0" (no rotation) doesn't become 9.999999e-01, which gives 0.02 for acos */ + /* use doubles here, to make sure a "1.0" (no rotation) + * doesn't become 9.999999e-01, which gives 0.02 for acos */ double deler = (((dx1 * dx1 + dy1 * dy1) + (dx2 * dx2 + dy2 * dy2) - (dx3 * dx3 + dy3 * dy3)) / (2.0 * (((A * B) != 0.0) ? (A * B) : 1.0))); diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 6bef5e4671a..1c53978ebaf 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -409,7 +409,8 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event) /* XXX, workaround: active needs to be calculated before transforming, * since we're not reading from 'td->center' in this case. see: T40241 */ if (t->tsnap.target == SCE_SNAP_TARGET_ACTIVE) { - /* In camera view, tsnap callback is not set (see initSnappingMode() in transfrom_snap.c, and T40348). */ + /* In camera view, tsnap callback is not set + * (see initSnappingMode() in transfrom_snap.c, and T40348). */ if (t->tsnap.targetSnap && ((t->tsnap.status & TARGET_INIT) == 0)) { t->tsnap.targetSnap(t); } @@ -589,7 +590,8 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) RNA_def_enum(ot->srna, "proportional", rna_enum_proportional_editing_items, 0, "Proportional Editing", ""); prop = RNA_def_enum(ot->srna, "proportional_edit_falloff", rna_enum_proportional_falloff_items, 0, "Proportional Falloff", "Falloff type for proportional editing mode"); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */ + /* Abusing id_curve :/ */ + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); RNA_def_float(ot->srna, "proportional_size", 1, T_PROP_SIZE_MIN, T_PROP_SIZE_MAX, "Proportional Size", "", 0.001f, 100.0f); } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 9cf71dc4cf4..677da81127d 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1590,7 +1590,8 @@ static void applyGridIncrement(TransInfo *t, float *val, int max_index, const fl float grid_p = iter_fac * roundf(pos_on_axis[j] / iter_fac); float dist_p = fabs((grid_p - pos_on_axis[j]) / local_axis[j]); - /* The amount of distance needed to travel along the local axis to snap to the closest grid point */ + /* The amount of distance needed to travel along the + * local axis to snap to the closest grid point */ /* in the global j axis direction */ float move_dist = (grid_p - center_global[j]) / local_axis[j]; diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 94766262711..b954aa27d74 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -995,7 +995,8 @@ static bool test_projected_edge_dist( typedef void (*Nearest2DGetVertCoCallback)(const int index, const float **co, void *data); typedef void (*Nearest2DGetEdgeVertsCallback)(const int index, int v_index[2], void *data); typedef void (*Nearest2DGetTriVertsCallback)(const int index, int v_index[3], void *data); -typedef void (*Nearest2DGetTriEdgesCallback)(const int index, int e_index[3], void *data); /* Equal the previous one */ +/* Equal the previous one */ +typedef void (*Nearest2DGetTriEdgesCallback)(const int index, int e_index[3], void *data); typedef void (*Nearest2DCopyVertNoCallback)(const int index, float r_no[3], void *data); typedef struct Nearest2dUserData { |