diff options
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/armature_add.c | 3 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_naming.c | 14 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_ops.c | 5 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_relations.c | 22 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_skinning.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_utils.c | 10 | ||||
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/armature/pose_lib.c | 9 | ||||
-rw-r--r-- | source/blender/editors/armature/pose_slide.c | 15 | ||||
-rw-r--r-- | source/blender/editors/armature/pose_transform.c | 11 |
11 files changed, 65 insertions, 42 deletions
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index b5d7975a0c5..40526eb82fe 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -1206,6 +1206,7 @@ void ARMATURE_OT_subdivide(wmOperatorType *ot) /* Properties */ prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, 1000, "Number of Cuts", "", 1, 10); - /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */ + /* Avoid re-using last var because it can cause + * _very_ high poly meshes and annoy users (or worse crash) */ RNA_def_property_flag(prop, PROP_SKIP_SAVE); } diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 0e6a3eb5695..ad563e569c3 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -917,17 +917,17 @@ static void bones_merge( newbone->flag = start->flag & (BONE_HINGE | BONE_NO_DEFORM | BONE_NO_SCALE | BONE_NO_CYCLICOFFSET | BONE_NO_LOCAL_LOCATION | BONE_DONE); - /* step 2a: reparent any side chains which may be parented to any bone in the chain of bones to merge - * - potentially several tips for side chains leading to some tree exist... + /* Step 2a: reparent any side chains which may be parented to any bone in the chain + * of bones to merge - potentially several tips for side chains leading to some tree exist. */ for (chain = chains->first; chain; chain = chain->next) { - /* traverse down chain until we hit the bottom or if we run into the tip of the chain of bones we're - * merging (need to stop in this case to avoid corrupting this chain too!) + /* Traverse down chain until we hit the bottom or if we run into the tip of the chain of bones + * we're merging (need to stop in this case to avoid corrupting this chain too!). */ for (ebone = chain->data; (ebone) && (ebone != end); ebone = ebone->parent) { short found = 0; - /* check if this bone is parented to one in the merging chain + /* Check if this bone is parented to one in the merging chain * ! WATCHIT: must only go check until end of checking chain */ for (ebo = end; (ebo) && (ebo != start->parent); ebo = ebo->parent) { diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index b1f0297bb29..6bf289c1b95 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -318,8 +318,9 @@ void ED_armature_bone_rename(Main *bmain, DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE); } - /* Fix all animdata that may refer to this bone - we can't just do the ones attached to objects, since - * other ID-blocks may have drivers referring to this bone [#29822] + /* Fix all animdata that may refer to this bone - + * we can't just do the ones attached to objects, + * since other ID-blocks may have drivers referring to this bone T29822. */ // XXX: the ID here is for armatures, but most bone drivers are actually on the object instead... { @@ -376,8 +377,8 @@ void ED_armature_bones_flip_names(Main *bmain, BoneFlipNameData *bfn; /* First pass: generate flip names, and blindly rename. - * If rename did not yield expected result, store both bone's name and expected flipped one into temp list - * for second pass. */ + * If rename did not yield expected result, + * store both bone's name and expected flipped one into temp list for second pass. */ for (LinkData *link = bones_names->first; link; link = link->next) { char name_flip[MAXBONENAME]; char *name = link->data; @@ -397,8 +398,9 @@ void ED_armature_bones_flip_names(Main *bmain, } /* Second pass to handle the bones that have naming conflicts with other bones. - * Note that if the other bone was not selected, its name was not flipped, so conflict remains and that second - * rename simply generates a new numbered alternative name. */ + * Note that if the other bone was not selected, its name was not flipped, + * so conflict remains and that second rename simply generates a new numbered alternative name. + */ for (bfn = bones_names_conflicts.first; bfn; bfn = bfn->next) { ED_armature_bone_rename(bmain, arm, bfn->name, bfn->name_flip); } diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index c820077fbf9..3401c6ed157 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -172,8 +172,9 @@ void ED_operatormacros_armature(void) otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); 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 T19733. */ ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", "Create new bones from the selected joints and move them", diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index 6226059e794..5d193c56c06 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -116,9 +116,10 @@ typedef struct tJoinArmature_AdtFixData { GHash *names_map; } tJoinArmature_AdtFixData; -/* Callback to pass to BKE_animdata_main_cb() for fixing driver ID's to point to the new ID */ -/* FIXME: For now, we only care about drivers here. When editing rigs, it's very rare to have animation - * on the rigs being edited already, so it should be safe to skip these. +/* Callback to pass to BKE_animdata_main_cb() for fixing driver ID's to point to the new ID. */ +/* FIXME: For now, we only care about drivers here. + * When editing rigs, it's very rare to have animation on the rigs being edited already, + * so it should be safe to skip these. */ static void joined_armature_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data) { @@ -591,12 +592,13 @@ static int separate_armature_exec(bContext *C, wmOperator *op) Object *oldob, *newob; Base *oldbase, *newbase; - /* we are going to do this as follows (unlike every other instance of separate): - * 1. exit editmode +posemode for active armature/base. Take note of what this is. - * 2. duplicate base - BASACT is the new one now - * 3. for each of the two armatures, enter editmode -> remove appropriate bones -> exit editmode + recalc - * 4. fix constraint links - * 5. make original armature active and enter editmode + /* We are going to do this as follows (unlike every other instance of separate): + * 1. Exit editmode +posemode for active armature/base. Take note of what this is. + * 2. Duplicate base - BASACT is the new one now + * 3. For each of the two armatures, + * enter editmode -> remove appropriate bones -> exit editmode + recalc. + * 4. Fix constraint links + * 5. Make original armature active and enter editmode */ /* 1) only edit-base selected */ @@ -672,7 +674,7 @@ void ARMATURE_OT_separate(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************************************** Parenting ************************************************* */ +/* ********************************* Parenting ************************************************* */ /* armature parenting options */ #define ARM_PAR_CONNECT 1 diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c index afbeb8e4377..c267485d553 100644 --- a/source/blender/editors/armature/armature_skinning.c +++ b/source/blender/editors/armature/armature_skinning.c @@ -55,7 +55,7 @@ #include "armature_intern.h" #include "meshlaplacian.h" -/* ********************************** Bone Skinning *********************************************** */ +/* ******************************* Bone Skinning *********************************************** */ static int bone_skinnable_cb(Object *UNUSED(ob), Bone *bone, void *datap) { diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 1afcfaca8aa..ebb0b6b4c22 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -551,9 +551,11 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, struct Bone *actBone) /** * This function: * - Sets local head/tail rest locations using parent bone's arm_mat. - * - Calls #BKE_armature_where_is_bone() which uses parent's transform (arm_mat) to define this bone's transform. + * - Calls #BKE_armature_where_is_bone() which uses parent's transform (arm_mat) + * to define this bone's transform. * - Fixes (converts) EditBone roll into Bone roll. - * - Calls again #BKE_armature_where_is_bone(), since roll fiddling may have changed things for our bone... + * - Calls again #BKE_armature_where_is_bone(), + * since roll fiddling may have changed things for our bone. * * \note The order is crucial here, we can only handle child * if all its parents in chain have already been handled (this is ensured by recursive process). @@ -565,8 +567,8 @@ static void armature_finalize_restpose(ListBase *bonelist, ListBase *editbonelis for (curBone = bonelist->first; curBone; curBone = curBone->next) { /* Set bone's local head/tail. - * Note that it's important to use final parent's restpose (arm_mat) here, instead of setting those values - * from editbone's matrix (see T46010). */ + * Note that it's important to use final parent's restpose (arm_mat) here, + * instead of setting those values from editbone's matrix (see T46010). */ if (curBone->parent) { float parmat_inv[4][4]; diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 9c31b66a3d1..0a886074f42 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -78,7 +78,8 @@ Object *ED_pose_object_from_context(bContext *C) ScrArea *sa = CTX_wm_area(C); Object *ob; - /* since this call may also be used from the buttons window, we need to check for where to get the object */ + /* Since this call may also be used from the buttons window, + * we need to check for where to get the object. */ if (sa && sa->spacetype == SPACE_PROPERTIES) { ob = ED_object_context(C); } @@ -790,7 +791,8 @@ static int armature_layers_invoke(bContext *C, wmOperator *op, const wmEvent *ev if (arm == NULL) return OPERATOR_CANCELLED; - /* get RNA pointer to armature data to use that to retrieve the layers as ints to init the operator */ + /* Get RNA pointer to armature data to use that to retrieve the layers as ints + * to init the operator. */ RNA_id_pointer_create((ID *)arm, &ptr); RNA_boolean_get_array(&ptr, "layers", layers); RNA_boolean_set_array(op->ptr, "layers", layers); diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index ce809bee71e..f373f775079 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -677,7 +677,8 @@ static int poselib_rename_invoke(bContext *C, wmOperator *op, const wmEvent *eve return OPERATOR_CANCELLED; } else { - /* use the existing name of the marker as the name, and use the active marker as the one to rename */ + /* Use the existing name of the marker as the name, + * and use the active marker as the one to rename. */ RNA_enum_set(op->ptr, "pose", act->active_marker - 1); RNA_string_set(op->ptr, "name", marker->name); } @@ -1359,7 +1360,11 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con /* only accept 'press' event, and ignore 'release', so that we don't get double actions */ if (ELEM(event->val, KM_PRESS, KM_NOTHING) == 0) { - //printf("PoseLib: skipping event with type '%s' and val %d\n", WM_key_event_string(event->type, false), event->val); +#if 0 + printf("PoseLib: skipping event with type '%s' and val %d\n", + WM_key_event_string(event->type, false), + event->val); +#endif return ret; } diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index cb9cfa64181..7bc934e07a2 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -397,7 +397,8 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, Object *ob, flo } case POSESLIDE_BREAKDOWN: /* make the current pose slide around between the endpoints */ { - /* perform simple linear interpolation - coefficient for start must come from pso->percentage... */ + /* Perform simple linear interpolation - + * coefficient for start must come from pso->percentage. */ /* TODO: make this use some kind of spline interpolation instead? */ (*val) = ((sVal * w2) + (eVal * w1)); break; @@ -583,7 +584,8 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl) /* perform blending */ if (pso->mode == POSESLIDE_BREAKDOWN) { - /* just perform the interpol between quat_prev and quat_next using pso->percentage as a guide */ + /* Just perform the interpol between quat_prev and + * quat_next using pso->percentage as a guide. */ interp_qt_qtqt(quat_final, quat_prev, quat_next, pso->percentage); } else if (pso->mode == POSESLIDE_PUSH) { @@ -1109,7 +1111,8 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) } } - /* perform pose updates - in response to some user action (e.g. pressing a key or moving the mouse) */ + /* Perform pose updates - in response to some user action + * (e.g. pressing a key or moving the mouse). */ if (do_pose_update) { /* update percentage indicator in header */ pose_slide_draw_status(pso); @@ -1396,7 +1399,8 @@ typedef enum ePosePropagate_Termination { POSE_PROPAGATE_SELECTED_MARKERS, } ePosePropagate_Termination; -/* termination data needed for some modes - assumes only one of these entries will be needed at a time */ +/* Termination data needed for some modes - + * assumes only one of these entries will be needed at a time. */ typedef union tPosePropagate_ModeData { /* smart holds + before frame: frame number to stop on */ float end_frame; @@ -1656,7 +1660,8 @@ static int pose_propagate_exec(bContext *C, wmOperator *op) poseAnim_mapping_get(C, &pflinks); if (BLI_listbase_is_empty(&pflinks)) { - /* There is a change the reason the list is empty is that there is no valid object to propagate poses for. + /* There is a change the reason the list is empty is + * that there is no valid object to propagate poses for. * This is very unlikely though, so we focus on the most likely issue. */ BKE_report(op->reports, RPT_ERROR, "No keyframed poses to propagate to"); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index 3a4413f8c1d..824e8b1a327 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -244,8 +244,9 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op)) * new raw-transform components, don't recalc the poses yet, otherwise IK result will * change, thus changing the result we may be trying to record. */ - /* XXX For some reason, we can't use pchan->chan_mat here, gives odd rotation/offset (see T38251). - * Using pchan->pose_mat and bringing it back in bone space seems to work as expected! + /* XXX For some reason, we can't use pchan->chan_mat here, gives odd rotation/offset + * (see T38251). + * Using pchan->pose_mat and bringing it back in bone space seems to work as expected! */ BKE_armature_mat_pose_to_bone(pchan_eval, pchan_eval->pose_mat, delta_mat); @@ -326,7 +327,8 @@ static bPoseChannel *pose_bone_do_paste(Object *ob, /* only copy when: * 1) channel exists - poses are not meant to add random channels to anymore - * 2) if selection-masking is on, channel is selected - only selected bones get pasted on, allowing making both sides symmetrical + * 2) if selection-masking is on, channel is selected - + * only selected bones get pasted on, allowing making both sides symmetrical. */ pchan = BKE_pose_channel_find_name(ob->pose, name); @@ -667,7 +669,8 @@ static void pchan_clear_rot(bPoseChannel *pchan) if ((pchan->protectflag & OB_LOCK_ROTZ) == 0) pchan->rotAxis[2] = 0.0f; - /* check validity of axis - axis should never be 0,0,0 (if so, then we make it rotate about y) */ + /* check validity of axis - axis should never be 0,0,0 + * (if so, then we make it rotate about y). */ if (IS_EQF(pchan->rotAxis[0], pchan->rotAxis[1]) && IS_EQF(pchan->rotAxis[1], pchan->rotAxis[2])) pchan->rotAxis[1] = 1.0f; |