From 84bf3e48c098d6971bab0ac55b4f413adc04708e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Jul 2012 23:56:59 +0000 Subject: style cleanup: use c style comments in C code --- source/blender/editors/armature/armature_ops.c | 6 +++--- source/blender/editors/armature/editarmature.c | 12 ++++++------ source/blender/editors/armature/poseSlide.c | 24 ++++++++++++------------ source/blender/editors/armature/poselib.c | 22 +++++++++++----------- source/blender/editors/armature/poseobject.c | 14 +++++++------- source/blender/editors/armature/reeb.c | 26 +++++++++++++------------- 6 files changed, 52 insertions(+), 52 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 59ee90c553b..173f74a1db7 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -191,8 +191,8 @@ void ED_operatormacros_armature(void) RNA_enum_set(otmacro->ptr, "proportional", 0); } - // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? - // that would require fixing a properties bug 19733 + /* XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? + * that would require fixing a properties bug 19733 */ ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", "Create new bones from the selected joints and move them", OPTYPE_UNDO | OPTYPE_REGISTER); @@ -321,7 +321,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0); - // TODO: clear pose + /* TODO: clear pose */ WM_keymap_add_item(keymap, "POSE_OT_rot_clear", RKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 6cef843d828..d4c28b2fb6d 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -657,12 +657,12 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature"); //error_libdata(); return OPERATOR_CANCELLED; } - + /* helpful warnings... */ - // TODO: add warnings to be careful about actions, applying deforms first, etc. - if (ob->adt && ob->adt->action) + /* TODO: add warnings to be careful about actions, applying deforms first, etc. */ + if (ob->adt && ob->adt->action) BKE_report(op->reports, RPT_WARNING, "Actions on this armature will be destroyed by this new rest pose as the transforms stored are relative to the old rest pose"); - + /* Get editbones of active armature to alter */ ED_armature_to_edit(ob); @@ -1192,9 +1192,9 @@ static int separate_armature_exec(bContext *C, wmOperator *UNUSED(op)) * 4. fix constraint links * 5. make original armature active and enter editmode */ - + /* 1) only edit-base selected */ - // TODO: use context iterators for this? + /* TODO: use context iterators for this? */ CTX_DATA_BEGIN(C, Base *, base, visible_bases) { if (base->object == obedit) base->flag |= 1; diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index 51700793791..cdcb3ab4683 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -243,32 +243,32 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *val) * - numerator should be larger than denominator to 'expand' the result * - perform this weighting a number of times given by the percentage... */ - int iters = (int)ceil(10.0f * pso->percentage); // TODO: maybe a sensitivity ctrl on top of this is needed - + int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */ + while (iters-- > 0) { (*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f) ) / 5.0f; } } break; - + case POSESLIDE_RELAX: /* make the current pose more like its surrounding ones */ { /* perform a weighted average here, favoring the middle pose * - numerator should be smaller than denominator to 'relax' the result * - perform this weighting a number of times given by the percentage... */ - int iters = (int)ceil(10.0f * pso->percentage); // TODO: maybe a sensitivity ctrl on top of this is needed - + int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */ + while (iters-- > 0) { (*val) = ( ((sVal * w2) + (eVal * w1)) + ((*val) * 5.0f) ) / 6.0f; } } break; - + case POSESLIDE_BREAKDOWN: /* make the current pose slide around between the endpoints */ { /* perform simple linear interpolation - coefficient for start must come from pso->percentage... */ - // TODO: make this use some kind of spline interpolation instead? + /* TODO: make this use some kind of spline interpolation instead? */ (*val) = ((sVal * w2) + (eVal * w1)); } break; @@ -415,11 +415,11 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl) } else if (pso->mode == POSESLIDE_PUSH) { float quat_diff[4], quat_orig[4]; - + /* calculate the delta transform from the previous to the current */ - // TODO: investigate ways to favour one transform more? + /* TODO: investigate ways to favour one transform more? */ sub_qt_qtqt(quat_diff, pchan->quat, quat_prev); - + /* make a copy of the original rotation */ copy_qt_qt(quat_orig, pchan->quat); @@ -428,8 +428,8 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl) } else { float quat_interp[4], quat_orig[4]; - int iters = (int)ceil(10.0f * pso->percentage); // TODO: maybe a sensitivity ctrl on top of this is needed - + int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */ + /* perform this blending several times until a satisfactory result is reached */ while (iters-- > 0) { /* calculate the interpolation between the endpoints */ diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index ee54fc2c6fe..4c19161576c 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -306,11 +306,11 @@ static int poselib_sanitize_exec(bContext *C, wmOperator *op) BLI_dlrbTree_init(&keys); action_to_keylist(NULL, act, &keys, NULL); BLI_dlrbTree_linkedlist_sync(&keys); - + /* for each key, make sure there is a corresponding pose */ for (ak = keys.first; ak; ak = ak->next) { /* check if any pose matches this */ - // TODO: don't go looking through the list like this every time... + /* TODO: don't go looking through the list like this every time... */ for (marker = act->markers.first; marker; marker = marker->next) { if (IS_EQ(marker->frame, (double)ak->cfra)) { marker->flag = -1; @@ -819,12 +819,12 @@ static void poselib_backup_restore(tPoseLib_PreviewData *pld) for (plb = pld->backups.first; plb; plb = plb->next) { /* copy most of data straight back */ memcpy(plb->pchan, &plb->olddata, sizeof(bPoseChannel)); - + /* just overwrite values of properties from the stored copies (there should be some) */ if (plb->oldprops) IDP_SyncGroupValues(plb->pchan->prop, plb->oldprops); - - // TODO: constraints settings aren't restored yet, even though these could change (though not that likely) + + /* TODO: constraints settings aren't restored yet, even though these could change (though not that likely) */ } } @@ -832,10 +832,10 @@ static void poselib_backup_restore(tPoseLib_PreviewData *pld) static void poselib_backup_free_data(tPoseLib_PreviewData *pld) { tPoseLib_Backup *plb, *plbn; - + for (plb = pld->backups.first; plb; plb = plbn) { plbn = plb->next; - + /* free custom data */ if (plb->oldprops) { IDP_FreeProperty(plb->oldprops); @@ -1658,11 +1658,11 @@ void POSELIB_OT_apply_pose(wmOperatorType *ot) /* callbacks */ ot->exec = poselib_preview_exec; ot->poll = has_poselib_pose_data_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - /* properties */ - // TODO: make the pose_index into a proper enum instead of a cryptic int... + + /* properties */ + /* TODO: make the pose_index into a proper enum instead of a cryptic int... */ ot->prop = RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX); } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 9bcbf313f13..f837d8a726e 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -103,7 +103,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base) return; } - // XXX: disabled as this would otherwise cause a nasty loop... + /* XXX: disabled as this would otherwise cause a nasty loop... */ //ED_object_toggle_modes(C, ob->mode); } @@ -253,14 +253,14 @@ static int pose_calculate_paths_exec(bContext *C, wmOperator *op) animviz_verify_motionpaths(op->reports, scene, ob, pchan); } CTX_DATA_END; - + /* calculate the bones that now have motionpaths... */ - // TODO: only make for the selected bones? + /* TODO: only make for the selected bones? */ ED_pose_recalculate_paths(scene, ob); - + /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); - + return OPERATOR_FINISHED; } @@ -299,9 +299,9 @@ static int pose_update_paths_exec(bContext *C, wmOperator *UNUSED(op)) if (ELEM(NULL, ob, scene)) return OPERATOR_CANCELLED; - + /* calculate the bones that now have motionpaths... */ - // TODO: only make for the selected bones? + /* TODO: only make for the selected bones? */ ED_pose_recalculate_paths(scene, ob); /* notifiers for updates */ diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 20b95ea55d6..af252ffe60c 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -1753,18 +1753,18 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) #endif arc->angle = avg_angle; - + if (avg_angle > threshold) merging = 1; - + if (merging) { ReebNode *terminalNode = NULL; ReebNode *middleNode = NULL; ReebNode *newNode = NULL; ReebNode *removedNode = NULL; int merging = 0; - - // Assign terminal and middle nodes + + /* Assign terminal and middle nodes */ if (arc->head->degree == 1) { terminalNode = arc->head; middleNode = arc->tail; @@ -1773,31 +1773,31 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) terminalNode = arc->tail; middleNode = arc->head; } - - // If middle node is a normal node, merge to terminal node + + /* If middle node is a normal node, merge to terminal node */ if (middleNode->degree == 2) { merging = 1; newNode = terminalNode; removedNode = middleNode; } - // Otherwise, just plain remove of the arc + /* Otherwise, just plain remove of the arc */ else { merging = 0; newNode = middleNode; removedNode = terminalNode; } - - // Merging arc + + /* Merging arc */ if (merging) { filterArc(rg, newNode, removedNode, arc, 1); } else { - // removing arc, so we need to decrease the degree of the remaining node - //newNode->degree--; + /* removing arc, so we need to decrease the degree of the remaining node + *newNode->degree--; */ NodeDegreeDecrement(rg, newNode); } - - // Reset nextArc, it might have changed + + /* Reset nextArc, it might have changed */ nextArc = arc->next; BLI_remlink(&rg->arcs, arc); -- cgit v1.2.3