diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-28 19:14:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-28 19:14:16 +0400 |
commit | ef054e165cad35715a5b2388aac3db68a65ea275 (patch) | |
tree | 0726e9c5a28962839a8d36ba4647f0b76fff7ad2 /source/blender/editors/armature/poseobject.c | |
parent | 887d1533f81b0ee89975efd8162a011b99c976af (diff) |
style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros.
Diffstat (limited to 'source/blender/editors/armature/poseobject.c')
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 57 |
1 files changed, 19 insertions, 38 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 043383d79a3..f54cdb330e3 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -216,8 +216,7 @@ 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); } @@ -324,8 +323,7 @@ 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); @@ -387,8 +385,7 @@ 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) { @@ -505,8 +502,7 @@ 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; @@ -522,8 +518,7 @@ 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]) { @@ -552,8 +547,7 @@ 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; @@ -567,8 +561,7 @@ 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; @@ -598,8 +591,7 @@ 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; } @@ -1403,8 +1395,7 @@ 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; } @@ -1457,8 +1448,7 @@ 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; @@ -1660,8 +1650,7 @@ 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) @@ -1765,8 +1754,7 @@ 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); @@ -1812,8 +1800,7 @@ 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); @@ -1862,8 +1849,7 @@ 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; @@ -2046,8 +2032,7 @@ 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 */ @@ -2080,8 +2065,7 @@ 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); @@ -2121,8 +2105,7 @@ 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 */ @@ -2152,8 +2135,7 @@ 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); @@ -2195,8 +2177,7 @@ 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 */ |