Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-30 20:22:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-30 20:22:40 +0400
commita5af5e8f50b740720609342671347ae229422212 (patch)
tree540dcff42cf737f5d8cbf093427171ba837f974f /source/blender/editors/armature
parentf111131ca68359e928056eff09a03d0eee8c681a (diff)
style cleanup: re - http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Braces_with_Macros
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c45
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c3
-rw-r--r--source/blender/editors/armature/poseUtils.c6
-rw-r--r--source/blender/editors/armature/poseobject.c57
4 files changed, 74 insertions, 37 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index e983b89e3d8..eb821ffc147 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -756,7 +756,8 @@ static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op)
*
* TODO, loop over children before parents if multiple bones
* at once are to be predictable*/
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
+ {
float delta_mat[4][4];
/* chan_mat already contains the delta transform from rest pose to pose-mode pose
@@ -922,7 +923,8 @@ int join_armature_exec(bContext *C, wmOperator *UNUSED(op))
pose= ob->pose;
ob->mode &= ~OB_MODE_POSE;
- CTX_DATA_BEGIN (C, Base*, base, selected_editable_bases) {
+ CTX_DATA_BEGIN (C, Base*, base, selected_editable_bases)
+ {
if ((base->object->type==OB_ARMATURE) && (base->object!=ob)) {
bArmature *curarm= base->object->data;
@@ -1193,7 +1195,8 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op))
/* 1) only edit-base selected */
// TODO: use context iterators for this?
- CTX_DATA_BEGIN (C, Base *, base, visible_bases) {
+ CTX_DATA_BEGIN (C, Base *, base, visible_bases)
+ {
if (base->object==obedit) base->flag |= 1;
else base->flag &= ~1;
}
@@ -2816,7 +2819,8 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* loop over all bones, and only consider if visible */
- CTX_DATA_BEGIN (C, EditBone *, ebone, visible_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, visible_bones)
+ {
if (!(ebone->flag & BONE_CONNECTED) && (ebone->flag & BONE_ROOTSEL))
fill_add_joint(ebone, 0, &points);
if (ebone->flag & BONE_TIPSEL)
@@ -3529,7 +3533,8 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op)
/* loop over all editable bones */
// XXX the old code did this in reverse order though!
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
for (i=numcuts+1; i>1; i--) {
/* compute cut ratio first */
float cutratio= 1.0f / (float)i;
@@ -3817,7 +3822,8 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op)
*/
/* parent selected bones to the active one */
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
if (ELEM(ebone, actbone, actmirb) == 0) {
if (ebone->flag & BONE_SELECTED)
bone_connect_to_new_parent(arm->edbo, ebone, actbone, val);
@@ -3842,7 +3848,8 @@ static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEve
uiLayout *layout= uiPupMenuLayout(pup);
int allchildbones = 0;
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
if (ebone != actbone) {
if (ebone->parent != actbone) allchildbones= 1;
}
@@ -3901,7 +3908,8 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op)
bArmature *arm= (bArmature *)ob->data;
int val = RNA_enum_get(op->ptr, "type");
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
editbone_clear_parent(ebone, val);
}
CTX_DATA_END;
@@ -3937,7 +3945,8 @@ void ARMATURE_OT_parent_clear(wmOperatorType *ot)
static int armature_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{
/* Set the flags */
- CTX_DATA_BEGIN (C, EditBone *, ebone, visible_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, visible_bones)
+ {
/* ignore bone if selection can't change */
if ((ebone->flag & BONE_UNSELECTABLE) == 0) {
/* select bone */
@@ -3979,7 +3988,8 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
}
/* Set the flags */
- CTX_DATA_BEGIN (C, EditBone *, ebone, visible_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, visible_bones)
+ {
/* ignore bone if selection can't change */
if ((ebone->flag & BONE_UNSELECTABLE) == 0) {
switch (action) {
@@ -4398,7 +4408,8 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
*/
/* align selected bones to the active one */
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
if (ELEM(ebone, actbone, actmirb) == 0) {
if (ebone->flag & BONE_SELECTED)
bone_align_to_bone(arm->edbo, ebone, actbone);
@@ -5087,7 +5098,8 @@ static int pose_clear_transform_generic_exec(bContext *C, wmOperator *op,
}
/* only clear relevant transforms for selected bones */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
/* run provided clearing function */
clear_func(pchan);
@@ -5228,7 +5240,8 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op)
}
/* Set the flags */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
/* select pchan only if selectable, but deselect works always */
switch (action) {
case SEL_SELECT:
@@ -5617,7 +5630,8 @@ static int armature_flip_names_exec (bContext *C, wmOperator *UNUSED(op))
arm= ob->data;
/* loop through selected bones, auto-naming them */
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
flip_side_name(newname, ebone->name, TRUE); // 1 = do strip off number extensions
ED_armature_bone_rename(arm, ebone->name, newname);
}
@@ -5661,7 +5675,8 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
arm= ob->data;
/* loop through selected bones, auto-naming them */
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
BLI_strncpy(newname, ebone->name, sizeof(newname));
if (bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
ED_armature_bone_rename(arm, ebone->name, newname);
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index 77b035024a9..a97823ebcc8 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -2555,7 +2555,8 @@ void BIF_retargetArmature(bContext *C)
printf("Reeb Graph created\n");
- CTX_DATA_BEGIN (C, Base*, base, selected_editable_bases) {
+ CTX_DATA_BEGIN (C, Base*, base, selected_editable_bases)
+ {
Object *ob = base->object;
if (ob->type==OB_ARMATURE) {
diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c
index c32655fb680..3c855ff96e6 100644
--- a/source/blender/editors/armature/poseUtils.c
+++ b/source/blender/editors/armature/poseUtils.c
@@ -131,7 +131,8 @@ void poseAnim_mapping_get(bContext *C, ListBase *pfLinks, Object *ob, bAction *a
/* for each Pose-Channel which gets affected, get the F-Curves for that channel
* and set the relevant transform flags...
*/
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
fcurves_to_pchan_links_get(pfLinks, ob, act, pchan);
}
CTX_DATA_END;
@@ -140,7 +141,8 @@ void poseAnim_mapping_get(bContext *C, ListBase *pfLinks, Object *ob, bAction *a
* i.e. if nothing selected, do whole pose
*/
if (pfLinks->first == NULL) {
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, visible_pose_bones)
+ {
fcurves_to_pchan_links_get(pfLinks, ob, act, pchan);
}
CTX_DATA_END;
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 817a2da8325..1bc6bc0bf07 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -216,7 +216,8 @@ static int pose_calculate_paths_exec (bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* set up path data for bones being calculated */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
/* verify makes sure that the selected bone has a bone with the appropriate settings */
animviz_verify_motionpaths(op->reports, scene, ob, pchan);
}
@@ -323,7 +324,8 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
bConstraint *con;
int found= 0;
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
if (pchan->bone->flag & BONE_SELECTED) {
for (con= pchan->constraints.first; con; con= con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
@@ -385,7 +387,8 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
int add_to_sel = RNA_boolean_get(op->ptr, "extend");
int found= 0;
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
curbone= pchan->bone;
if ((curbone->flag & BONE_UNSELECTABLE)==0) {
@@ -502,7 +505,8 @@ static short pose_select_same_group (bContext *C, Object *ob, short extend)
*/
group_flags= MEM_callocN(numGroups+1, "pose_select_same_group");
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
/* keep track of group as group to use later? */
if (pchan->bone->flag & BONE_SELECTED) {
group_flags[pchan->agrp_index] = 1;
@@ -518,7 +522,8 @@ static short pose_select_same_group (bContext *C, Object *ob, short extend)
/* small optimization: only loop through bones a second time if there are any groups tagged */
if (tagged) {
/* only if group matches (and is not selected or current bone) */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
if ((pchan->bone->flag & BONE_UNSELECTABLE)==0) {
/* check if the group used by this bone is counted */
if (group_flags[pchan->agrp_index]) {
@@ -547,7 +552,8 @@ static short pose_select_same_layer (bContext *C, Object *ob, short extend)
return 0;
/* figure out what bones are selected */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
/* keep track of layers to use later? */
if (pchan->bone->flag & BONE_SELECTED)
layers |= pchan->bone->layer;
@@ -561,7 +567,8 @@ static short pose_select_same_layer (bContext *C, Object *ob, short extend)
return 0;
/* select bones that are on same layers as layers flag */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
/* if bone is on a suitable layer, and the bone can have its selection changed, select it */
if ((layers & pchan->bone->layer) && (pchan->bone->flag & BONE_UNSELECTABLE)==0) {
pchan->bone->flag |= BONE_SELECTED;
@@ -591,7 +598,8 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
/* if not extending selection, deselect all selected first */
if (extend == 0) {
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+ {
if ((pchan->bone->flag & BONE_UNSELECTABLE)==0)
pchan->bone->flag &= ~BONE_SELECTED;
}
@@ -1395,7 +1403,8 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
pose_add_group(ob);
/* add selected bones to group then */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
pchan->agrp_index= pose->active_group;
done= 1;
}
@@ -1448,7 +1457,8 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
/* find selected bones to remove from all bone groups */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
if (pchan->agrp_index) {
pchan->agrp_index= 0;
done= 1;
@@ -1650,7 +1660,8 @@ static void pose_group_select(bContext *C, Object *ob, int select)
{
bPose *pose= ob->pose;
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, visible_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, visible_pose_bones)
+ {
if ((pchan->bone->flag & BONE_UNSELECTABLE)==0) {
if (select) {
if (pchan->agrp_index == pose->active_group)
@@ -1754,7 +1765,8 @@ static int pose_flip_names_exec (bContext *C, wmOperator *UNUSED(op))
arm= ob->data;
/* loop through selected bones, auto-naming them */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
char newname[MAXBONENAME];
flip_side_name(newname, pchan->name, TRUE);
ED_armature_bone_rename(arm, pchan->name, newname);
@@ -1800,7 +1812,8 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
arm= ob->data;
/* loop through selected bones, auto-naming them */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
BLI_strncpy(newname, pchan->name, sizeof(newname));
if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
ED_armature_bone_rename(arm, pchan->name, newname);
@@ -1849,7 +1862,8 @@ static int pose_bone_rotmode_exec (bContext *C, wmOperator *op)
int mode = RNA_enum_get(op->ptr, "type");
/* set rotation mode of selected bones */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
+ {
pchan->rotmode = mode;
}
CTX_DATA_END;
@@ -2032,7 +2046,8 @@ static int pose_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt)
int layers[32]= {0}; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
/* get layers that are active already */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
+ {
short bit;
/* loop over the bits for this pchan's layers, adding layers where they're needed */
@@ -2065,7 +2080,8 @@ static int pose_bone_layers_exec (bContext *C, wmOperator *op)
RNA_boolean_get_array(op->ptr, "layers", layers);
/* set layers of pchans based on the values set in the operator props */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
+ {
/* get pointer for pchan, and write flags this way */
RNA_pointer_create((ID *)ob->data, &RNA_Bone, pchan->bone, &ptr);
RNA_boolean_set_array(&ptr, "layers", layers);
@@ -2105,7 +2121,8 @@ static int armature_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *ev
int layers[32]= {0}; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
/* get layers that are active already */
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
short bit;
/* loop over the bits for this pchan's layers, adding layers where they're needed */
@@ -2135,7 +2152,8 @@ static int armature_bone_layers_exec (bContext *C, wmOperator *op)
RNA_boolean_get_array(op->ptr, "layers", layers);
/* set layers of pchans based on the values set in the operator props */
- CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones) {
+ CTX_DATA_BEGIN (C, EditBone *, ebone, selected_editable_bones)
+ {
/* get pointer for pchan, and write flags this way */
RNA_pointer_create((ID *)arm, &RNA_EditBone, ebone, &ptr);
RNA_boolean_set_array(&ptr, "layers", layers);
@@ -2177,7 +2195,8 @@ static int pose_flip_quats_exec (bContext *C, wmOperator *UNUSED(op))
KeyingSet *ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOC_ROT_SCALE_ID);
/* loop through all selected pchans, flipping and keying (as needed) */
- CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones) {
+ CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
+ {
/* only if bone is using quaternion rotation */
if (pchan->rotmode == ROT_MODE_QUAT) {
/* quaternions have 720 degree range */