diff options
Diffstat (limited to 'source')
51 files changed, 438 insertions, 220 deletions
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c2d101f9d3b..48763382f2a 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1906,7 +1906,8 @@ void do_versions_ipos_to_animato(Main *main) AnimData *adt= BKE_id_add_animdata(id); - SEQ_BEGIN (ed, seq) { + SEQ_BEGIN (ed, seq) + { IpoCurve *icu = (seq->ipo) ? seq->ipo->curve.first : NULL; short adrcode = SEQ_FAC1; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 830184513d1..2cfacbcf034 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -626,7 +626,8 @@ void unlink_object(Object *ob) #endif if (sce->ed) { Sequence *seq; - SEQ_BEGIN (sce->ed, seq) { + SEQ_BEGIN (sce->ed, seq) + { if (seq->scene_camera == ob) { seq->scene_camera = NULL; } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 9291cb90dff..395214b1609 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -259,7 +259,8 @@ void seq_free_editing(Scene *scene) if (ed == NULL) return; - SEQ_BEGIN (ed, seq) { + SEQ_BEGIN (ed, seq) + { seq_free_sequence(scene, seq); } SEQ_END diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 8534621ccf1..739c4e00cc7 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -510,7 +510,8 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla if (scene->ed) { Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { + SEQ_BEGIN (scene->ed, seq) + { if (SEQ_HAS_PATH(seq)) { if (ELEM(seq->type, SEQ_MOVIE, SEQ_SOUND)) { rewrite_path_fixed_dirfile(seq->strip->dir, seq->strip->stripdata->name, diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d4d2918f686..1dbdf7c9876 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4842,7 +4842,8 @@ static void lib_link_scene(FileData *fd, Main *main) } } - SEQ_BEGIN (sce->ed, seq) { + SEQ_BEGIN (sce->ed, seq) + { if (seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo); seq->scene_sound = NULL; if (seq->scene) { @@ -4973,7 +4974,8 @@ static void direct_link_scene(FileData *fd, Scene *sce) /* recursive link sequences, lb will be correctly initialized */ link_recurs_seq(fd, &ed->seqbase); - SEQ_BEGIN (ed, seq) { + SEQ_BEGIN (ed, seq) + { seq->seq1= newdataadr(fd, seq->seq1); seq->seq2= newdataadr(fd, seq->seq2); seq->seq3= newdataadr(fd, seq->seq3); @@ -9012,7 +9014,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) while (sce) { ed= sce->ed; if (ed) { - SEQ_BEGIN (sce->ed, seq) { + SEQ_BEGIN (sce->ed, seq) + { if (seq->type==SEQ_IMAGE || seq->type==SEQ_MOVIE) seq->flag |= SEQ_MAKE_PREMUL; } @@ -10427,7 +10430,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Sequence *seq; for (sce=main->scene.first; sce; sce=sce->id.next) { - SEQ_BEGIN (sce->ed, seq) { + SEQ_BEGIN (sce->ed, seq) + { if (seq->blend_mode == 0) seq->blend_opacity = 100.0f; } @@ -10780,7 +10784,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) while (sce) { ed= sce->ed; if (ed) { - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->strip && seq->strip->proxy) { seq->strip->proxy->quality =90; } @@ -10849,7 +10854,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (scene = main->scene.first; scene; scene = scene->id.next) { if (scene->ed && scene->ed->seqbasep) { - SEQ_BEGIN (scene->ed, seq) { + SEQ_BEGIN (scene->ed, seq) + { if (seq->type == SEQ_HD_SOUND) { char str[FILE_MAX]; BLI_join_dirfile(str, sizeof(str), seq->strip->dir, seq->strip->stripdata->name); @@ -11819,7 +11825,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if ((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0) sce->r.ffcodecdata.audio_codec = 0x0; // CODEC_ID_NONE - SEQ_BEGIN (sce->ed, seq) { + SEQ_BEGIN (sce->ed, seq) + { seq->volume = 1.0f; } SEQ_END @@ -12088,7 +12095,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (scene= main->scene.first; scene; scene=scene->id.next) { if (scene) { Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { + SEQ_BEGIN (scene->ed, seq) + { if (seq->sat==0.0f) { seq->sat= 1.0f; } @@ -12563,7 +12571,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (scene=main->scene.first; scene; scene=scene->id.next) { scene->r.ffcodecdata.audio_channels = 2; scene->audio.volume = 1.0f; - SEQ_BEGIN (scene->ed, seq) { + SEQ_BEGIN (scene->ed, seq) + { seq->pitch = 1.0f; } SEQ_END @@ -14293,7 +14302,8 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) if (sce->ed) { Sequence *seq; - SEQ_BEGIN (sce->ed, seq) { + SEQ_BEGIN (sce->ed, seq) + { if (seq->scene) expand_doit(fd, mainvar, seq->scene); if (seq->scene_camera) expand_doit(fd, mainvar, seq->scene_camera); if (seq->sound) expand_doit(fd, mainvar, seq->sound); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 5580c9efc9b..7947d6f8f71 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2108,13 +2108,15 @@ static void write_scenes(WriteData *wd, ListBase *scebase) /* reset write flags too */ - SEQ_BEGIN (ed, seq) { + SEQ_BEGIN (ed, seq) + { if (seq->strip) seq->strip->done= 0; writestruct(wd, DATA, "Sequence", 1, seq); } SEQ_END - SEQ_BEGIN (ed, seq) { + SEQ_BEGIN (ed, seq) + { if (seq->strip && seq->strip->done==0) { /* write strip with 'done' at 0 because readfile */ diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 0df68c3775c..4dd3406dafc 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1353,7 +1353,8 @@ static int delete_key_v3d_exec (bContext *C, wmOperator *op) float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap // XXX more comprehensive tests will be needed - CTX_DATA_BEGIN (C, Object*, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object*, ob, selected_objects) + { ID *id= (ID *)ob; FCurve *fcu, *fcn; short success= 0; 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 */ diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 15e2ad77fa9..58c091dec11 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -6071,7 +6071,8 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op)) /* trasnform all selected curves inverse in obact */ invert_m4_m4(imat, ob->obmat); - CTX_DATA_BEGIN (C, Base*, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base*, base, selected_editable_bases) + { if (base->object->type==ob->type) { if (base->object != ob) { diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 262d75a37b3..9f9d941f523 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1611,7 +1611,8 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) /* loop over the stroke RNA elements recorded (i.e. progress of mouse movement), * setting the relevant values in context at each step, then applying */ - RNA_BEGIN (op->ptr, itemptr, "stroke") { + RNA_BEGIN (op->ptr, itemptr, "stroke") + { float mousef[2]; //printf("\t\tGP - stroke elem\n"); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index d848798cc63..4cc478aa7c4 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -781,7 +781,8 @@ static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to) act_to = (bActuator *)(to->poin); /* (1) get the object */ - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { for (sens_iter = ob_iter->sensors.first; sens_iter; sens_iter = sens_iter->next) { if (&(sens_iter->links) == sens_from_links) { ob = ob_iter; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 79b46fee359..3c913b26dec 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1265,7 +1265,8 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s const int skip_filter = !but->changed; /* build a temporary list of relevant items first */ - RNA_PROP_BEGIN (&but->rnasearchpoin, itemptr, but->rnasearchprop) { + RNA_PROP_BEGIN (&but->rnasearchpoin, itemptr, but->rnasearchprop) + { if (flag & PROP_ID_SELF_CHECK) if (itemptr.data == but->rnapoin.id.data) continue; @@ -1333,7 +1334,8 @@ static void search_id_collection(StructRNA *ptype, PointerRNA *ptr, PropertyRNA *prop = NULL; - RNA_STRUCT_BEGIN (ptr, iprop) { + RNA_STRUCT_BEGIN (ptr, iprop) + { /* if it's a collection and has same pointer type, we've got it */ if (RNA_property_type(iprop) == PROP_COLLECTION) { srna = RNA_property_pointer_type(ptr, iprop); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index bafd85e9451..bc6753be557 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2362,7 +2362,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * if (ptr->data && prop) { /* create list items */ - RNA_PROP_BEGIN (ptr, itemptr, prop) { + RNA_PROP_BEGIN (ptr, itemptr, prop) + { /* create button */ if (!(i % 9)) row = uiLayoutRow(col, 0); @@ -2384,7 +2385,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * if (ptr->data && prop) { /* create list items */ - RNA_PROP_BEGIN (ptr, itemptr, prop) { + RNA_PROP_BEGIN (ptr, itemptr, prop) + { found = (activei == i); if (found) { @@ -2446,7 +2448,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * if (ptr->data && prop) { /* create list items */ - RNA_PROP_BEGIN (ptr, itemptr, prop) { + RNA_PROP_BEGIN (ptr, itemptr, prop) + { if (i >= pa->list_scroll && i < pa->list_scroll + items) list_item_row(C, col, ptr, &itemptr, i, rnaicon, activeptr, activeprop, prop_list); @@ -2703,7 +2706,8 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title, flow = uiLayoutColumnFlow(layout, 2, 0); - RNA_STRUCT_BEGIN (ptr, prop) { + RNA_STRUCT_BEGIN (ptr, prop) + { int flag = RNA_property_flag(prop); if (flag & PROP_HIDDEN) diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 9220491a60c..a0b83b5fef4 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -139,7 +139,8 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int (*check_prop)(Pointe assert(ELEM3(label_align, '\0', 'H', 'V')); - RNA_STRUCT_BEGIN (ptr, prop) { + RNA_STRUCT_BEGIN (ptr, prop) + { flag = RNA_property_flag(prop); if (flag & PROP_HIDDEN || (check_prop && check_prop(ptr, prop) == FALSE)) continue; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 898e82c0660..8fe0a364ad3 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -2680,7 +2680,8 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op) } /* get the cut curve */ - RNA_BEGIN (op->ptr, itemptr, "path") { + RNA_BEGIN (op->ptr, itemptr, "path") + { RNA_float_get_array(&itemptr, "loc", (float *)&curve[len]); len++; if (len >= MAX_CUTS) { diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c index 43cd89af3ac..c234cf44aec 100644 --- a/source/blender/editors/mesh/mesh_navmesh.c +++ b/source/blender/editors/mesh/mesh_navmesh.c @@ -430,7 +430,8 @@ static int navmesh_create_exec(bContext *C, wmOperator *op) LinkNode *obs = NULL; Base *navmeshBase = NULL; - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { if (base->object->type == OB_MESH) { if (base->object->body_type == OB_BODY_TYPE_NAVMESH) { if (!navmeshBase || base == scene->basact) { diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 1ebeea13782..e41807787f1 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -122,7 +122,8 @@ int join_mesh_exec(bContext *C, wmOperator *op) } /* count & check */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { if (base->object->type == OB_MESH) { me = base->object->data; @@ -198,7 +199,8 @@ int join_mesh_exec(bContext *C, wmOperator *op) } /* first pass over objects - copying materials and vertexgroups across */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { /* only act if a mesh, and not the one we're joining to */ if ((ob != base->object) && (base->object->type == OB_MESH)) { me = base->object->data; @@ -298,7 +300,8 @@ int join_mesh_exec(bContext *C, wmOperator *op) /* inverse transform for all selected meshes in this object */ invert_m4_m4(imat, ob->obmat); - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { /* only join if this is a mesh */ if (base->object->type == OB_MESH) { me = base->object->data; @@ -567,7 +570,8 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op) KeyBlock *kb; int ok = 0, nonequal_verts = 0; - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { if (base->object == ob) continue; if (base->object->type == OB_MESH) { @@ -599,7 +603,8 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op) } /* now ready to add new keys from selected meshes */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { if (base->object == ob) continue; if (base->object->type == OB_MESH) { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 9635b1b9b62..52d14b9d374 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -906,7 +906,8 @@ static int object_delete_exec(bContext *C, wmOperator *op) if (CTX_data_edit_object(C)) return OPERATOR_CANCELLED; - CTX_DATA_BEGIN (C, Base *, base, selected_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_bases) + { /* if (base->object->type==OB_LAMP) islamp= 1; */ @@ -972,7 +973,8 @@ static void copy_object_set_idnew(bContext *C, int dupflag) int a; /* XXX check object pointers */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { object_relink(ob); } CTX_DATA_END; @@ -1189,7 +1191,8 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) clear_id_newpoins(); - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { make_object_duplilist_real(C, scene, base, use_base_parent, use_hierarchy); /* dependencies were changed */ @@ -1295,7 +1298,8 @@ static int convert_exec(bContext *C, wmOperator *op) /* don't forget multiple users! */ /* reset flags */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { ob = base->object; ob->flag &= ~OB_DONE; @@ -1306,7 +1310,8 @@ static int convert_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { ob = base->object; if (ob->flag & OB_DONE || !IS_TAGGED(ob->data)) { @@ -1880,7 +1885,8 @@ static int duplicate_exec(bContext *C, wmOperator *op) clear_id_newpoins(); clear_sca_new_poins(); /* sensor/contr/act */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { Base *basen = object_add_duplicate_internal(bmain, scene, base, dupflag); /* note that this is safe to do with this context iterator, diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 9e8381a72c6..593a5b6f1fe 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -922,7 +922,8 @@ static int multiresbake_check(bContext *C, wmOperator *op) MultiresModifierData *mmd; int ok = 1, a; - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { ob = base->object; if (ob->type != OB_MESH) { @@ -1079,7 +1080,8 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if (scene->r.bake_flag & R_BAKE_CLEAR) { /* clear images */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { Mesh *me; ob = base->object; @@ -1090,7 +1092,8 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op) CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { MultiresBakeRender bkr = {0}; ob = base->object; @@ -1139,7 +1142,8 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj) bkj->use_lores_mesh = scene->r.bake_flag & R_BAKE_LORES_MESH; bkj->bake_clear = scene->r.bake_flag & R_BAKE_CLEAR; - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { MultiresBakerJobData *data; DerivedMesh *lores_dm; int lvl; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index a865b1d015d..e63e0e34934 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1150,7 +1150,8 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = object_pose_armature_get(CTX_data_active_object(C)); /* free constraints for all selected bones */ - CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) { + CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) + { free_constraints(&pchan->constraints); pchan->constflag &= ~(PCHAN_HAS_IK | PCHAN_HAS_SPLINEIK | PCHAN_HAS_CONST); } @@ -1187,7 +1188,8 @@ static int object_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); /* do freeing */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { free_constraints(&ob->constraints); DAG_id_tag_update(&ob->id, OB_RECALC_OB); } @@ -1229,7 +1231,8 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) } /* copy all constraints from active posebone to all selected posebones */ - CTX_DATA_BEGIN (C, bPoseChannel *, chan, selected_pose_bones) { + CTX_DATA_BEGIN (C, bPoseChannel *, chan, selected_pose_bones) + { /* if we're not handling the object we're copying from, copy all constraints over */ if (pchan != chan) { copy_constraints(&chan->constraints, &pchan->constraints, TRUE); @@ -1269,7 +1272,8 @@ static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op)) Object *obact = ED_object_active_context(C); /* copy all constraints from active object to all selected objects */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { /* if we're not handling the object we're copying from, copy all constraints over */ if (obact != ob) { copy_constraints(&ob->constraints, &obact->constraints, TRUE); @@ -1359,7 +1363,8 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o /* if the active Object is Armature, and we can search for bones, do so... */ if ((obact->type == OB_ARMATURE) && (only_ob == 0)) { /* search in list of selected Pose-Channels for target */ - CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) { + CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) + { /* just use the first one that we encounter, as long as it is not the active one */ if (pchan != pchanact) { *tar_ob = obact; @@ -1375,7 +1380,8 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o /* if not yet found, try selected Objects... */ if (found == 0) { /* search in selected objects context */ - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { /* just use the first object we encounter (that isn't the active object) * and which fulfills the criteria for the object-target that we've got */ @@ -1770,7 +1776,8 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = object_pose_armature_get(CTX_data_active_object(C)); /* only remove IK Constraints */ - CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) { + CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) + { bConstraint *con, *next; // TODO: should we be checking if these contraints were local before we try and remove them? diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index d5385d00c8a..8e5ab3fc9e8 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -181,7 +181,8 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) short changed = 0; const int unselected = RNA_boolean_get(op->ptr, "unselected"); - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (!unselected) { if (base->flag & SELECT) { base->flag &= ~SELECT; @@ -237,7 +238,8 @@ static int object_hide_render_clear_exec(bContext *C, wmOperator *UNUSED(op)) short changed = 0; /* XXX need a context loop to handle such cases */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->restrictflag & OB_RESTRICT_RENDER) { ob->restrictflag &= ~OB_RESTRICT_RENDER; changed = 1; @@ -271,7 +273,8 @@ static int object_hide_render_set_exec(bContext *C, wmOperator *op) { const int unselected = RNA_boolean_get(op->ptr, "unselected"); - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (!unselected) { if (base->flag & SELECT) { base->object->restrictflag |= OB_RESTRICT_RENDER; @@ -1109,7 +1112,8 @@ void ED_objects_recalculate_paths(bContext *C, Scene *scene) ListBase targets = {NULL, NULL}; /* loop over objects in scene */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { /* set flag to force recalc, then grab the relevant bones to target */ ob->avs.recalc |= ANIMVIZ_RECALC_PATHS; animviz_get_object_motionpaths(ob, &targets); @@ -1215,7 +1219,8 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) int clear = (strcmp(op->idname, "OBJECT_OT_shade_flat") == 0); int done = 0; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->type == OB_MESH) { mesh_set_smooth_flag(ob, !clear); @@ -1632,7 +1637,8 @@ static int game_property_copy_exec(bContext *C, wmOperator *op) prop = BLI_findlink(&ob->prop, propid - 1); if (prop) { - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { if (ob != ob_iter) set_ob_property(ob_iter, prop); } CTX_DATA_END; @@ -1640,7 +1646,8 @@ static int game_property_copy_exec(bContext *C, wmOperator *op) } else { - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { if (ob != ob_iter) { if (type == COPY_PROPERTIES_REPLACE) copy_properties(&ob_iter->prop, &ob->prop); @@ -1679,7 +1686,8 @@ void OBJECT_OT_game_property_copy(wmOperatorType *ot) static int game_property_clear_exec(bContext *C, wmOperator *UNUSED(op)) { - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { free_properties(&ob_iter->prop); } CTX_DATA_END; @@ -1707,7 +1715,8 @@ static int logicbricks_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_active_context(C); - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { if (ob != ob_iter) { /* first: free all logic */ free_sensors(&ob_iter->sensors); @@ -1763,7 +1772,8 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_active_context(C); - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { if (ob != ob_iter) { ob_iter->gameflag = ob->gameflag; ob_iter->gameflag2 = ob->gameflag2; diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index 702671d8d9b..dd6c08a2247 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -75,7 +75,8 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) for (group = bmain->group.first; group; group = group->id.next) { if (object_in_group(ob, group)) { /* Assign groups to selected objects */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { if (base->object->dup_group != group) add_to_group(group, base->object, scene, base); else @@ -127,7 +128,8 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) for (group = bmain->group.first; group; group = group->id.next) { if (object_in_group(ob, group)) { /* Assign groups to selected objects */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { rem_from_group(group, base->object, scene, base); ok = 1; } @@ -164,7 +166,8 @@ static int group_objects_remove_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); Group *group = NULL; - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { group = NULL; while ((group = find_group(base->object, group))) rem_from_group(group, base->object, scene, base); @@ -203,7 +206,8 @@ static int group_create_exec(bContext *C, wmOperator *op) group = add_group(name); - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { add_to_group(group, base->object, scene, base); } CTX_DATA_END; diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 4ffc3e8c19f..0aec83610b8 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -483,7 +483,8 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); Object *obsel = NULL; - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { if (ob != obedit) { obsel = ob; break; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index f2d682cd0cb..281ca7e59b6 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1119,7 +1119,8 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - CTX_DATA_BEGIN (C, Object *, selob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, selob, selected_editable_objects) + { if (selob->type == OB_MESH && selob != ob) { secondob = selob; break; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 751cd751224..35b3b0a0407 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -211,7 +211,8 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob != obedit) { ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; par = obedit->parent; @@ -428,7 +429,8 @@ void ED_object_parent_clear(bContext *C, int type) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->parent == NULL) continue; @@ -673,7 +675,8 @@ static int parent_set_exec(bContext *C, wmOperator *op) int partype = RNA_enum_get(op->ptr, "type"); int ok = 1; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (!ED_object_parent_set(op->reports, bmain, scene, ob, par, partype)) { ok = 0; break; @@ -754,7 +757,8 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op) par->recalc |= OB_RECALC_OB; /* context iterator */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob != par) { if (BKE_object_parent_loop_check(par, ob)) { BKE_report(op->reports, RPT_ERROR, "Loop in parents"); @@ -805,7 +809,8 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->parent) { if (ob->partype & PARSLOW) { ob->partype -= PARSLOW; @@ -847,7 +852,8 @@ static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->parent) ob->partype |= PARSLOW; @@ -898,7 +904,8 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode"); return OPERATOR_CANCELLED; } - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { bConstraint *con, *pcon; /* remove track-object for old track */ @@ -964,7 +971,8 @@ static int track_set_exec(bContext *C, wmOperator *op) bConstraint *con; bDampTrackConstraint *data; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob != obact) { con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_DAMPTRACK); @@ -983,7 +991,8 @@ static int track_set_exec(bContext *C, wmOperator *op) bConstraint *con; bTrackToConstraint *data; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob != obact) { con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_TRACKTO); @@ -1004,7 +1013,8 @@ static int track_set_exec(bContext *C, wmOperator *op) bConstraint *con; bLockTrackConstraint *data; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob != obact) { con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_LOCKTRACK); @@ -1058,7 +1068,8 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op) if (!RNA_struct_property_is_set(op->ptr, "layers")) { /* note: layers are set in bases, library objects work for this */ - CTX_DATA_BEGIN (C, Base *, base, selected_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_bases) + { lay |= base->lay; } CTX_DATA_END; @@ -1107,7 +1118,8 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) if (v3d && v3d->localvd) { /* now we can move out of localview. */ /* note: layers are set in bases, library objects work for this */ - CTX_DATA_BEGIN (C, Base *, base, selected_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_bases) + { lay = base->lay & ~v3d->lay; base->lay = lay; base->object->lay = lay; @@ -1120,7 +1132,8 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) else { /* normal non localview operation */ /* note: layers are set in bases, library objects work for this */ - CTX_DATA_BEGIN (C, Base *, base, selected_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_bases) + { /* upper byte is used for local view */ local = base->lay & 0xFF000000; base->lay = lay + local; @@ -1202,7 +1215,8 @@ static int make_links_scene_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - CTX_DATA_BEGIN (C, Base *, base, selected_bases) { + CTX_DATA_BEGIN (C, Base *, base, selected_bases) + { if (!object_in_scene(base->object, scene_to)) { Base *nbase = MEM_mallocN(sizeof(Base), "newbase"); *nbase = *base; @@ -1262,7 +1276,8 @@ static int make_links_data_exec(bContext *C, wmOperator *op) ob = ED_object_active_context(C); - CTX_DATA_BEGIN (C, Object *, obt, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, obt, selected_editable_objects) + { if (ob != obt) { if (allow_make_links_data(event, ob, obt)) { switch (event) { @@ -1725,21 +1740,24 @@ static int make_local_exec(bContext *C, wmOperator *op) clear_id_newpoins(); - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { if (ob->id.lib) id_make_local(&ob->id, 0); } CTX_DATA_END; /* maybe object pointers */ - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { if (ob->id.lib == NULL) { ID_NEW(ob->parent); } } CTX_DATA_END; - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { id = ob->data; if (id && mode > 1) { @@ -1767,7 +1785,8 @@ static int make_local_exec(bContext *C, wmOperator *op) CTX_DATA_END; if (mode > 1) { - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { if (ob->type == OB_LAMP) { la = ob->data; diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 7a4db175ee4..ed53e4a9b91 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -144,13 +144,15 @@ static int object_select_by_type_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (base->object->type == obtype) { ED_base_object_select(base, BA_SELECT); } @@ -218,7 +220,8 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; @@ -263,7 +266,8 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) else return OPERATOR_CANCELLED; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (nr == 1) { // XXX old animation system //if (base->object->ipo==ipo) base->flag |= SELECT; @@ -386,7 +390,8 @@ static short select_grouped_children(bContext *C, Object *ob, int recursive) { short changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (ob == base->object->parent) { if (!(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); @@ -444,7 +449,8 @@ static short select_grouped_group(bContext *C, Object *ob) /* Select objects in return 0; else if (group_count == 1) { group = ob_groups[0]; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (!(base->flag & SELECT) && object_in_group(base->object, group)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -498,7 +504,8 @@ static short select_grouped_siblings(bContext *C, Object *ob) { short changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->object->parent == ob->parent) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -512,7 +519,8 @@ static short select_grouped_type(bContext *C, Object *ob) { short changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->object->type == ob->type) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -526,7 +534,8 @@ static short select_grouped_layer(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->lay & ob->lay) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -540,7 +549,8 @@ static short select_grouped_index_object(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->object->index == ob->index) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -554,7 +564,8 @@ static short select_grouped_color(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (!(base->flag & SELECT) && (compare_v3v3(base->object->col, ob->col, 0.005f))) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -580,7 +591,8 @@ static short select_grouped_gameprops(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (!(base->flag & SELECT) && (objects_share_gameprop(base->object, ob))) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -602,7 +614,8 @@ static short select_grouped_keyingset(bContext *C, Object *UNUSED(ob)) /* select each object that Keying Set refers to */ // TODO: perhaps to be more in line with the rest of these, we should only take objects // if the passed in object is included in this too - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { /* only check for this object if it isn't selected already, to limit time wasted */ if ((base->flag & SELECT) == 0) { KS_Path *ksp; @@ -635,7 +648,8 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); changed = 1; } @@ -700,13 +714,15 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op) layernum = RNA_int_get(op->ptr, "layers"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (base->lay == (1 << (layernum - 1))) ED_base_object_select(base, BA_SELECT); } @@ -749,7 +765,8 @@ static int object_select_all_exec(bContext *C, wmOperator *op) if (action == SEL_TOGGLE) { action = SEL_SELECT; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (base->flag & SELECT) { action = SEL_DESELECT; break; @@ -758,7 +775,8 @@ static int object_select_all_exec(bContext *C, wmOperator *op) CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { switch (action) { case SEL_SELECT: ED_base_object_select(base, BA_SELECT); @@ -821,7 +839,8 @@ static int object_select_same_group_exec(bContext *C, wmOperator *op) if (!group) return OPERATOR_PASS_THROUGH; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (!(base->flag & SELECT) && object_in_group(base->object, group)) ED_base_object_select(base, BA_SELECT); } @@ -858,7 +877,8 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); - CTX_DATA_BEGIN (C, Base *, primbase, selected_bases) { + CTX_DATA_BEGIN (C, Base *, primbase, selected_bases) + { char tmpname[MAXBONENAME]; flip_side_name(tmpname, primbase->object->id.name + 2, TRUE); @@ -914,14 +934,16 @@ static int object_select_random_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; } percent = RNA_float_get(op->ptr, "percent") / 100.0f; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (BLI_frand() < percent) { ED_base_object_select(base, BA_SELECT); } diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index e416bd5b762..b8a7ce999f1 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -227,7 +227,8 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op, /* operate on selected objects only if they aren't in weight-paint mode * (so that object-transform clearing won't be applied at same time as bone-clearing) */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (!(ob->mode & OB_MODE_WEIGHT_PAINT)) { /* run provided clearing function */ clear_func(ob); @@ -319,7 +320,8 @@ static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op)) float *v1, *v3; float mat[3][3]; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->parent) { /* vectors pointed to by v1 and v3 will get modified */ v1 = ob->loc; @@ -383,7 +385,8 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo int a, change = 0; /* first check if we can execute */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->type == OB_MESH) { if (ID_REAL_USERS(ob->data) > 1) { @@ -426,7 +429,8 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo CTX_DATA_END; /* now execute */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { /* calculate rotation/scale matrix */ if (apply_scale && apply_rot) @@ -567,7 +571,8 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); int change = 0; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { where_is_object(scene, ob); object_apply_mat4(ob, ob->obmat, TRUE, TRUE); where_is_object(scene, ob); @@ -709,7 +714,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) } /* reset flags */ - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { ob->flag &= ~OB_DONE; } CTX_DATA_END; @@ -721,7 +727,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) ((ID *)tob->dup_group)->flag &= ~LIB_DOIT; } - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if ((ob->flag & OB_DONE) == 0) { int do_inverse_offset = FALSE; ob->flag |= OB_DONE; @@ -894,7 +901,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) ignore_parent_tx(bmain, scene, ob); /* other users? */ - CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects) + { if ((ob_other->flag & OB_DONE) == 0 && ((ob->data && (ob->data == ob_other->data)) || (ob->dup_group == ob_other->dup_group && diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 6443f45ebf0..b4d5d2c1c79 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2713,7 +2713,8 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) int change = 0; int fail = 0; - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (obact != ob) { if (ED_vgroup_copy_array(ob, obact)) change++; else fail++; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index b541529e4c0..ba80fd83de7 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3671,7 +3671,8 @@ static int brush_edit_exec(bContext *C, wmOperator *op) if (!brush_edit_init(C, op)) return OPERATOR_CANCELLED; - RNA_BEGIN (op->ptr, itemptr, "stroke") { + RNA_BEGIN (op->ptr, itemptr, "stroke") + { brush_edit_apply(C, op, &itemptr); } RNA_END; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index b648dac6343..0b8408c698c 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -329,7 +329,8 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op)) if (!ob || !(matar = give_matarar(ob))) return OPERATOR_CANCELLED; - CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) + { if (ob != ob_iter && give_matarar(ob_iter)) { if (ob->data != ob_iter->data) assign_matarar(ob_iter, matar, ob->totcol); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index a83c7ffaba5..dcf4efeff13 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5034,7 +5034,8 @@ static int paint_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - RNA_BEGIN (op->ptr, itemptr, "stroke") { + RNA_BEGIN (op->ptr, itemptr, "stroke") + { paint_apply(C, op, &itemptr); } RNA_END; diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 9fe941253f6..448fb37ef54 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -377,7 +377,8 @@ int paint_stroke_exec(bContext *C, wmOperator *op) stroke->stroke_started = 1; } - RNA_BEGIN (op->ptr, itemptr, "stroke") { + RNA_BEGIN (op->ptr, itemptr, "stroke") + { stroke->update_step(C, stroke, &itemptr); } RNA_END; diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 73dfde8fd6f..aa3ae0077a9 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -221,7 +221,8 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op) struct FCurve* fcu; char driven; - SEQ_BEGIN (scene->ed, seq) { + SEQ_BEGIN (scene->ed, seq) + { fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "volume", 0, &driven); if (fcu || driven) seq->flag |= SEQ_AUDIO_VOLUME_ANIMATED; diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index 22df7432ecb..71aef18666b 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -104,7 +104,8 @@ static int cut_links_exec(bContext *C, wmOperator *op) float mcoords[256][2]; int i= 0; - RNA_BEGIN (op->ptr, itemptr, "path") { + RNA_BEGIN (op->ptr, itemptr, "path") + { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index f38e3e0d272..b63770ef049 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2651,7 +2651,8 @@ static int cut_links_exec(bContext *C, wmOperator *op) float mcoords[256][2]; int i= 0; - RNA_BEGIN (op->ptr, itemptr, "path") { + RNA_BEGIN (op->ptr, itemptr, "path") + { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 09d974fe4b8..4bc08242020 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -188,7 +188,8 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) else if (RNA_struct_find_property(op->ptr, "files")) { /* used for image strip */ /* best guess, first images name */ - RNA_BEGIN (op->ptr, itemptr, "files") { + RNA_BEGIN (op->ptr, itemptr, "files") + { char *name = RNA_string_get_alloc(&itemptr, "name", NULL, 0); BLI_strncpy(seq_load->name, name, sizeof(seq_load->name)); MEM_freeN(name); @@ -420,7 +421,8 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad BLI_split_dir_part(seq_load.path, dir_only, sizeof(dir_only)); - RNA_BEGIN (op->ptr, itemptr, "files") { + RNA_BEGIN (op->ptr, itemptr, "files") + { RNA_string_get(&itemptr, "name", file_only); BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only); @@ -594,7 +596,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) strip = seq->strip; se = strip->stripdata; - RNA_BEGIN (op->ptr, itemptr, "files") { + RNA_BEGIN (op->ptr, itemptr, "files") + { char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0); BLI_strncpy(se->name, filename, sizeof(se->name)); MEM_freeN(filename); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index d2b1cccfefc..5766099aabb 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -201,7 +201,8 @@ static void seq_proxy_build_job(const bContext *C) WM_jobs_callbacks(steve, proxy_startjob, NULL, NULL, proxy_endjob); } - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if ((seq->flag & SELECT)) { context = seq_proxy_rebuild_context(pj->main, pj->scene, seq); link = BLI_genericNodeN(context); @@ -461,7 +462,8 @@ void deselect_all_seq(Scene *scene) if (ed == NULL) return; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { seq->flag &= ~SEQ_ALLSEL; } SEQ_END @@ -844,7 +846,8 @@ static int insert_gap(Scene *scene, int gap, int cfra) if (ed == NULL) return 0; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->startdisp >= cfra) { seq->start += gap; calc_sequence(scene, seq); @@ -870,7 +873,8 @@ static void UNUSED_FUNCTION(touch_seq_files) (Scene * scene) WM_cursor_wait(1); - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->flag & SELECT) { if (seq->type == SEQ_MOVIE) { if (seq->strip && seq->strip->stripdata) { @@ -897,7 +901,8 @@ static void set_filter_seq(Scene *scene) if (okee("Set Deinterlace") == 0) return; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->flag & SELECT) { if (seq->type == SEQ_MOVIE) { seq->flag |= SEQ_FILTERY; @@ -932,7 +937,8 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene * scene) if (strcmp(to, from) == 0) return; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->flag & SELECT) { if (strncmp(seq->strip->dir, from, strlen(from)) == 0) { printf("found %s\n", seq->strip->dir); @@ -1477,7 +1483,8 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) BLI_movelisttolist(ed->seqbasep, &newlist); if (cut_side != SEQ_SIDE_BOTH) { - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (cut_side == SEQ_SIDE_LEFT) { if (seq->startdisp >= cut_frame) { seq->flag &= ~SEQ_ALLSEL; @@ -3010,7 +3017,8 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) } seq->strip->stripdata = se = MEM_callocN(len * sizeof(StripElem), "stripelem"); - RNA_BEGIN (op->ptr, itemptr, "files") { + RNA_BEGIN (op->ptr, itemptr, "files") + { char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0); BLI_strncpy(se->name, filename, sizeof(se->name)); MEM_freeN(filename); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index f326052ea60..677bab37163 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -940,7 +940,8 @@ static short select_grouped_type(Editing *ed, Sequence *actseq) Sequence *seq; short changed = FALSE; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->type == actseq->type) { seq->flag |= SELECT; changed = TRUE; @@ -957,7 +958,8 @@ static short select_grouped_type_basic(Editing *ed, Sequence *actseq) short changed = FALSE; short is_sound = SEQ_IS_SOUND(actseq); - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq)) { seq->flag |= SELECT; changed = TRUE; @@ -974,7 +976,8 @@ static short select_grouped_type_effect(Editing *ed, Sequence *actseq) short changed = FALSE; short is_effect = SEQ_IS_EFFECT(actseq); - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq)) { seq->flag |= SELECT; changed = TRUE; @@ -995,7 +998,8 @@ static short select_grouped_data(Editing *ed, Sequence *actseq) return changed; if (SEQ_HAS_PATH(actseq) && dir) { - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (SEQ_HAS_PATH(seq) && seq->strip && strcmp(seq->strip->dir, dir) == 0) { seq->flag |= SELECT; changed = TRUE; @@ -1005,7 +1009,8 @@ static short select_grouped_data(Editing *ed, Sequence *actseq) } else if (actseq->type == SEQ_SCENE) { Scene *sce = actseq->scene; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->type == SEQ_SCENE && seq->scene == sce) { seq->flag |= SELECT; changed = TRUE; @@ -1015,7 +1020,8 @@ static short select_grouped_data(Editing *ed, Sequence *actseq) } else if (actseq->type == SEQ_MOVIECLIP) { MovieClip *clip = actseq->clip; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (seq->type == SEQ_MOVIECLIP && seq->clip == clip) { seq->flag |= SELECT; changed = TRUE; @@ -1037,14 +1043,16 @@ static short select_grouped_effect(Editing *ed, Sequence *actseq) for (i = 0; i <= SEQ_EFFECT_MAX; i++) effects[i] = FALSE; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (ELEM3(actseq, seq->seq1, seq->seq2, seq->seq3)) { effects[seq->type] = TRUE; } } SEQ_END; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (effects[seq->type]) { if (seq->seq1) seq->seq1->flag |= SELECT; if (seq->seq2) seq->seq2->flag |= SELECT; @@ -1062,7 +1070,8 @@ static short select_grouped_time_overlap(Editing *ed, Sequence *actseq) Sequence *seq; short changed = FALSE; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { if (!((seq->startdisp >= actseq->enddisp) || (seq->enddisp < actseq->startdisp))) { seq->flag |= SELECT; changed = TRUE; @@ -1083,7 +1092,8 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) int machine = actseq->machine; SeqIterator iter; - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { seq->tmp= NULL; } SEQ_END; @@ -1153,7 +1163,8 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op) } if (extend == 0) { - SEQP_BEGIN (ed, seq) { + SEQP_BEGIN (ed, seq) + { seq->flag &= ~SELECT; changed = TRUE; } diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 674dd670cf7..43a4a9a1de9 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -357,7 +357,8 @@ static void time_draw_keyframes(const bContext *C, SpaceTime *stime, ARegion *ar short active_done = 0; /* draw keyframes from all selected objects */ - CTX_DATA_BEGIN (C, Object*, obsel, selected_objects) { + CTX_DATA_BEGIN (C, Object*, obsel, selected_objects) + { /* last arg is 0, since onlysel doesn't apply here... */ time_draw_idblock_keyframes(v2d, (ID *)obsel, 0); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index e1bbc0e1545..8a211c6a22e 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -830,7 +830,8 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op) int i = 0; int mcords[1024][2]; - RNA_BEGIN (op->ptr, itemptr, "path") { + RNA_BEGIN (op->ptr, itemptr, "path") + { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); @@ -975,7 +976,8 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) const char *name = object_mouse_select_menu_data[name_index].idname; if (!extend) { - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (base->flag & SELECT) { ED_base_object_select(base, BA_DESELECT); changed = 1; @@ -984,7 +986,8 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { /* this is a bit dodjy, there should only be ONE object with this name, but library objects can mess this up */ if (strcmp(name, base->object->id.name + 2) == 0) { ED_base_object_activate(C, base); @@ -1051,7 +1054,8 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int short ok; LinkNode *linklist = NULL; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { ok = FALSE; /* two selection methods, the CTRL select uses max dist of 15 */ @@ -1829,7 +1833,8 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i if (extend == 0 && select) { if (bone_only) { - 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 | BONE_TIPSEL | BONE_ROOTSEL); } diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 988d0a00601..87edf6a37a0 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -557,7 +557,8 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) else { struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan; bArmature *arm = ob->data; @@ -691,7 +692,8 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op)) else { struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) + { if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan; bArmature *arm = ob->data; @@ -928,7 +930,8 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) } } else { - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) + { copy_v3_v3(vec, ob->obmat[3]); /* special case for camera -- snap to bundles */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ecd69f0d10c..75bd0de5d1a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5204,7 +5204,8 @@ static void createTransObject(bContext *C, TransInfo *t) td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransOb"); tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransObExtension"); - CTX_DATA_BEGIN (C, Base*, base, selected_bases) { + CTX_DATA_BEGIN (C, Base*, base, selected_bases) + { Object *ob= base->object; td->flag = TD_SELECTED; diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 1f36522d3c4..1073369a36d 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2709,7 +2709,8 @@ static int uv_lasso_select_exec(bContext *C, wmOperator *op) int i = 0; int mcords[1024][2]; - RNA_BEGIN (op->ptr, itemptr, "path") { + RNA_BEGIN (op->ptr, itemptr, "path") + { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index e1b2d87c4f2..183f75c6b42 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1162,7 +1162,8 @@ static int stitch_init(bContext *C, wmOperator *op) EDBM_index_arrays_init(em, 0, 0, 1); - RNA_BEGIN (op->ptr, itemptr, "selection") { + RNA_BEGIN (op->ptr, itemptr, "selection") + { faceIndex = RNA_int_get(&itemptr, "face_index"); elementIndex = RNA_int_get(&itemptr, "element_index"); efa = EDBM_face_at_index(em, faceIndex); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 18edcf1344f..73e046f0d63 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -615,7 +615,8 @@ PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna) { PropertyRNA *prop = NULL; - RNA_STRUCT_BEGIN (ptr, iprop) { + RNA_STRUCT_BEGIN (ptr, iprop) + { /* This assumes that there can only be one user of this nested struct */ if (RNA_property_pointer_type(ptr, iprop) == srna) { prop = iprop; @@ -637,7 +638,8 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test) iterprop = RNA_struct_iterator_property(ptr->type); - RNA_PROP_BEGIN (ptr, itemptr, iterprop) { + RNA_PROP_BEGIN (ptr, itemptr, iterprop) + { /* PropertyRNA *prop= itemptr.data; */ if (prop_test == (PropertyRNA *)itemptr.data) { found = TRUE; @@ -684,7 +686,8 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier) func = NULL; - RNA_PROP_BEGIN (&tptr, funcptr, iterprop) { + RNA_PROP_BEGIN (&tptr, funcptr, iterprop) + { if (strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) { func = funcptr.data; break; @@ -3128,7 +3131,8 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } /* no item property pointer, can still be id property, or * property of a type derived from the collection pointer type */ - RNA_PROP_BEGIN (ptr, itemptr, prop) { + RNA_PROP_BEGIN (ptr, itemptr, prop) + { if (itemptr.data) { if (itemprop) { /* we got the property already */ @@ -4499,7 +4503,8 @@ char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr) BLI_dynstr_append(dynstr, "{"); - RNA_STRUCT_BEGIN (ptr, prop) { + RNA_STRUCT_BEGIN (ptr, prop) + { propname = RNA_property_identifier(prop); if (strcmp(propname, "rna_type") == 0) @@ -4542,7 +4547,8 @@ char *RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, PointerRNA PropertyRNA *prop_default; char *buf_default; - RNA_PROP_BEGIN (ptr, propptr, iterprop) { + RNA_PROP_BEGIN (ptr, propptr, iterprop) + { prop = propptr.data; flag = RNA_property_flag(prop); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 7c8f28d0979..12f0d45396d 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1424,7 +1424,8 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha totkw = kw ? PyDict_Size(kw) : 0; - RNA_STRUCT_BEGIN (ptr, prop) { + RNA_STRUCT_BEGIN (ptr, prop) + { arg_name = RNA_property_identifier(prop); if (strcmp(arg_name, "rna_type") == 0) continue; @@ -2203,7 +2204,8 @@ int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *self, PyOb /* lib is either a valid poniter or NULL, * either way can do direct comparison with id.lib */ - RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { + RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) + { ID *id = itemptr.data; /* always an ID */ if (id->lib == lib && (strncmp(keyname, id->name + 2, sizeof(id->name) - 2) == 0)) { found = TRUE; @@ -3346,7 +3348,8 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr) RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr); iterprop = RNA_struct_find_property(&tptr, "functions"); - RNA_PROP_BEGIN (&tptr, itemptr, iterprop) { + RNA_PROP_BEGIN (&tptr, itemptr, iterprop) + { idname = RNA_function_identifier(itemptr.data); pystring = PyUnicode_FromString(idname); @@ -3365,7 +3368,8 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr) iterprop = RNA_struct_iterator_property(ptr->type); - RNA_PROP_BEGIN (ptr, itemptr, iterprop) { + RNA_PROP_BEGIN (ptr, itemptr, iterprop) + { nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen); if (nameptr) { @@ -3980,7 +3984,8 @@ static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self) char name[256], *nameptr; int namelen; - RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { + RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) + { nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen); if (nameptr) { @@ -4017,7 +4022,8 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self) int namelen; int i = 0; - RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { + RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) + { if (itemptr.data) { /* add to python list */ item = PyTuple_New(2); @@ -4189,7 +4195,8 @@ static PyObject *pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key PYRNA_PROP_CHECK_OBJ(self); - RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { + RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) + { nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen); if (nameptr) { @@ -4220,7 +4227,8 @@ static void foreach_attr_type(BPy_PropertyRNA *self, const char *attr, *attr_signed = FALSE; /* note: this is fail with zero length lists, so don't let this get caled in that case */ - RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { + RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) + { prop = RNA_struct_find_property(&itemptr, attr); *raw_type = RNA_property_raw_type(prop); *attr_tot = RNA_property_array_length(&itemptr, prop); @@ -6401,7 +6409,8 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self) PyObject *ret = PyList_New(0); PyObject *item; - RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { + RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) + { StructRNA *srna = itemptr.data; StructRNA *srna_base = RNA_struct_base(itemptr.data); /* skip own operators, these double up [#29666] */ @@ -7189,7 +7198,8 @@ void pyrna_alloc_types(void) RNA_blender_rna_pointer_create(&ptr); prop = RNA_struct_find_property(&ptr, "structs"); - RNA_PROP_BEGIN (&ptr, itemptr, prop) { + RNA_PROP_BEGIN (&ptr, itemptr, prop) + { PyObject *item = pyrna_struct_Subtype(&itemptr); if (item == NULL) { if (PyErr_Occurred()) { @@ -7217,7 +7227,8 @@ void pyrna_free_types(void) prop = RNA_struct_find_property(&ptr, "structs"); - RNA_PROP_BEGIN (&ptr, itemptr, prop) { + RNA_PROP_BEGIN (&ptr, itemptr, prop) + { StructRNA *srna = srna_from_ptr(&itemptr); void *py_ptr = RNA_struct_py_type_get(srna); @@ -7475,9 +7486,9 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla prop_rna = RNA_struct_find_property(&ptr_rna, "structs"); - /* loop over all structs */ - RNA_PROP_BEGIN (&ptr_rna, itemptr, prop_rna) { + RNA_PROP_BEGIN (&ptr_rna, itemptr, prop_rna) + { srna_iter = itemptr.data; if (pyrna_srna_contains_pointer_prop_srna(srna_iter, srna, &prop_identifier)) { break; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 9ff71c72e7e..56a7ff30ad8 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -691,7 +691,8 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P if (properties) { otmacro = ot->macro.first; - RNA_STRUCT_BEGIN (properties, prop) { + RNA_STRUCT_BEGIN (properties, prop) + { if (otmacro == NULL) break; @@ -760,7 +761,8 @@ int WM_operator_last_properties_init(wmOperator *op) iterprop = RNA_struct_iterator_property(op->type->srna); - RNA_PROP_BEGIN (op->ptr, itemptr, iterprop) { + RNA_PROP_BEGIN (op->ptr, itemptr, iterprop) + { PropertyRNA *prop = itemptr.data; if ((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) { if (!RNA_property_is_set(op->ptr, prop)) { /* don't override a setting already set */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 9ae0a88151c..1de8c95fcce 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -589,7 +589,8 @@ void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, con void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context) { - RNA_STRUCT_BEGIN (ptr, prop) { + RNA_STRUCT_BEGIN (ptr, prop) + { switch (RNA_property_type(prop)) { case PROP_ENUM: if (no_context) @@ -622,7 +623,8 @@ void WM_operator_properties_reset(wmOperator *op) PropertyRNA *iterprop; iterprop = RNA_struct_iterator_property(op->type->srna); - RNA_PROP_BEGIN (op->ptr, itemptr, iterprop) { + RNA_PROP_BEGIN (op->ptr, itemptr, iterprop) + { PropertyRNA *prop = itemptr.data; if ((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) { @@ -1796,7 +1798,8 @@ static int wm_link_append_exec(bContext *C, wmOperator *op) BLO_library_append_named_part_ex(C, mainl, &bh, name, idcode, flag); } else { - RNA_BEGIN (op->ptr, itemptr, "files") { + RNA_BEGIN (op->ptr, itemptr, "files") + { RNA_string_get(&itemptr, "name", name); BLO_library_append_named_part_ex(C, mainl, &bh, name, idcode, flag); } @@ -2774,7 +2777,8 @@ int WM_gesture_lines_cancel(bContext *C, wmOperator *op) static int gesture_lasso_exec(bContext *C, wmOperator *op) { - RNA_BEGIN (op->ptr, itemptr, "path") { + RNA_BEGIN (op->ptr, itemptr, "path") + { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); |