Defines: replace ELEM3-16 with ELEM(...), that can take varargs
authorCampbell Barton <ideasman42@gmail.com>
Sat, 19 Jul 2014 15:30:29 +0000 (01:30 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 19 Jul 2014 15:33:40 +0000 (01:33 +1000)
142 files changed:
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/bpath.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_mapping.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/report.c
source/blender/blenkernel/intern/rigidbody.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenlib/BLI_utildefines.h
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/polyfill2d.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_260.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/operators/bmo_connect_pair.c
source/blender/bmesh/tools/bmesh_beautify.c
source/blender/bmesh/tools/bmesh_decimate_collapse.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/pose_lib.c
source/blender/editors/armature/pose_select.c
source/blender/editors/armature/pose_slide.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editmesh_knife_project.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_bake_api.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_transform.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/ed_transverts.c
source/blender/editors/util/numinput.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/DNA_vfont_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_weightvg_util.c
source/blender/modifiers/intern/MOD_weightvgproximity.c
source/blender/nodes/intern/node_exec.c
source/blender/python/generic/bgl.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_Euler.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/render/intern/source/bake.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/volumetric.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.cpp

index 8f1382dacc3048106779b6e6db3c5403709da36a..c6dcca576fb3be6d4377eafb057a17fd98b69aae 100644 (file)
@@ -315,7 +315,7 @@ bActionGroup *action_groups_add_new(bAction *act, const char name[])
 void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
 {      
        /* sanity checks */
-       if (ELEM3(NULL, act, agrp, fcurve))
+       if (ELEM(NULL, act, agrp, fcurve))
                return;
        
        /* if no channels anywhere, just add to two lists at the same time */
@@ -417,7 +417,7 @@ void action_groups_remove_channel(bAction *act, FCurve *fcu)
 bActionGroup *BKE_action_group_find_name(bAction *act, const char name[])
 {
        /* sanity checks */
-       if (ELEM3(NULL, act, act->groups.first, name) || (name[0] == 0))
+       if (ELEM(NULL, act, act->groups.first, name) || (name[0] == 0))
                return NULL;
                
        /* do string comparisons */
@@ -526,7 +526,7 @@ bPoseChannel *BKE_pose_channel_active(Object *ob)
        bArmature *arm = (ob) ? ob->data : NULL;
        bPoseChannel *pchan;
 
-       if (ELEM3(NULL, ob, ob->pose, arm)) {
+       if (ELEM(NULL, ob, ob->pose, arm)) {
                return NULL;
        }
 
index 995b2ac5321e8fb2407749afdb052fe49ffc9b07..c7e2bb8c6c7e2dff5f576d9a69aa5310760c76f7 100644 (file)
@@ -405,7 +405,7 @@ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const cha
        FCurve *fcu, *fcn = NULL;
        
        /* sanity checks */
-       if (ELEM3(NULL, srcAct, dstAct, basepath)) {
+       if (ELEM(NULL, srcAct, dstAct, basepath)) {
                if (G.debug & G_DEBUG) {
                        printf("ERROR: action_partition_fcurves_by_basepath(%p, %p, %p) has insufficient info to work with\n",
                               (void *)srcAct, (void *)dstAct, (void *)basepath);
@@ -1062,7 +1062,7 @@ KS_Path *BKE_keyingset_find_path(KeyingSet *ks, ID *id, const char group_name[],
        KS_Path *ksp;
        
        /* sanity checks */
-       if (ELEM3(NULL, ks, rna_path, id))
+       if (ELEM(NULL, ks, rna_path, id))
                return NULL;
        
        /* loop over paths in the current KeyingSet, finding the first one where all settings match 
index 95f8426872d063006bbd6b2d22d00e9e138e5e53..7a16cffa6d406121ae4d65e69e1d2f7adf5ce48a 100644 (file)
@@ -1881,7 +1881,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
                 */
 
                /* only happens on reload file, but violates depsgraph still... fix! */
-               if (ELEM3(NULL,  ikData->tar->curve_cache, ikData->tar->curve_cache->path, ikData->tar->curve_cache->path->data)) {
+               if (ELEM(NULL,  ikData->tar->curve_cache, ikData->tar->curve_cache->path, ikData->tar->curve_cache->path->data)) {
                        BKE_displist_make_curveTypes(scene, ikData->tar, 0);
                        
                        /* path building may fail in EditMode after removing verts [#33268]*/
index dc2d0924bbada515c8007640d4484b297d4538c2..378579934006301334392e0e0828f8cfa341b935 100644 (file)
@@ -422,7 +422,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
                        Image *ima;
                        ima = (Image *)id;
                        if (ima->packedfile == NULL || (flag & BKE_BPATH_TRAVERSE_SKIP_PACKED) == 0) {
-                               if (ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+                               if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
                                        if (rewrite_path_fixed(ima->name, visit_cb, absbase, bpath_user_data)) {
                                                if (!ima->packedfile) {
                                                        BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
index d072088ac8e9c4f35b339233daaec9eec0e4d31d..f6da41252a79705e5a257269658f0e6d3105fa31 100644 (file)
@@ -559,7 +559,7 @@ void defgroup_unique_name(bDeformGroup *dg, Object *ob)
 
 static bool is_char_sep(const char c)
 {
-       return ELEM4(c, '.', ' ', '-', '_');
+       return ELEM(c, '.', ' ', '-', '_');
 }
 
 /* based on BLI_split_dirfile() / os.path.splitext(), "a.b.c" -> ("a.b", ".c") */
index 95e608a5d4db1a48997fb4cd9de2d35febf91d44..136ca0098cb3bb1e7038ac255c570254293f7254 100644 (file)
@@ -524,7 +524,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                                                                        if (ct->tar->type == OB_MESH)
                                                                                node3->customdata_mask |= CD_MASK_MDEFORMVERT;
                                                                }
-                                                               else if (ELEM3(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))
+                                                               else if (ELEM(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))
                                                                        dag_add_relation(dag, node3, node, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, cti->name);
                                                                else
                                                                        dag_add_relation(dag, node3, node, DAG_RL_OB_DATA, cti->name);
@@ -803,7 +803,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        continue;
 
                /* special case for camera tracking -- it doesn't use targets to define relations */
-               if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
+               if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
                        int depends_on_camera = 0;
 
                        if (cti->type == CONSTRAINT_TYPE_FOLLOWTRACK) {
@@ -843,7 +843,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                                if (ELEM(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO))
                                        dag_add_relation(dag, node2, node, DAG_RL_DATA_OB | DAG_RL_OB_OB, cti->name);
                                else {
-                                       if (ELEM3(obt->type, OB_ARMATURE, OB_MESH, OB_LATTICE) && (ct->subtarget[0])) {
+                                       if (ELEM(obt->type, OB_ARMATURE, OB_MESH, OB_LATTICE) && (ct->subtarget[0])) {
                                                dag_add_relation(dag, node2, node, DAG_RL_DATA_OB | DAG_RL_OB_OB, cti->name);
                                                if (obt->type == OB_MESH)
                                                        node2->customdata_mask |= CD_MASK_MDEFORMVERT;
@@ -1386,7 +1386,7 @@ static bool check_object_needs_evaluation(Object *object)
        if (object->type == OB_MESH) {
                return object->derivedFinal == NULL;
        }
-       else if (ELEM5(object->type, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
+       else if (ELEM(object->type, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
                return object->curve_cache == NULL;
        }
 
@@ -1400,7 +1400,7 @@ static bool check_object_tagged_for_update(Object *object)
                return true;
        }
 
-       if (ELEM6(object->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
+       if (ELEM(object->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
                ID *data_id = object->data;
                return (data_id->flag & (LIB_ID_RECALC_DATA | LIB_ID_RECALC)) != 0;
        }
@@ -1983,7 +1983,7 @@ static void dag_object_time_update_flags(Main *bmain, Scene *scene, Object *ob)
                        
                        if (cti) {
                                /* special case for camera tracking -- it doesn't use targets to define relations */
-                               if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
+                               if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
                                        ob->recalc |= OB_RECALC_OB;
                                }
                                else if (cti->get_constraint_targets) {
@@ -2272,7 +2272,7 @@ static void dag_group_on_visible_update(Group *group)
        group->id.flag |= LIB_DOIT;
 
        for (go = group->gobject.first; go; go = go->next) {
-               if (ELEM6(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
+               if (ELEM(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
                        go->ob->recalc |= OB_RECALC_DATA;
                        go->ob->id.flag |= LIB_DOIT;
                        lib_id_recalc_tag(G.main, &go->ob->id);
@@ -2319,7 +2319,7 @@ void DAG_on_visible_update(Main *bmain, const bool do_time)
                        oblay = (node) ? node->lay : ob->lay;
 
                        if ((oblay & lay) & ~scene->lay_updated) {
-                               if (ELEM6(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
+                               if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
                                        ob->recalc |= OB_RECALC_DATA;
                                        lib_id_recalc_tag(bmain, &ob->id);
                                }
@@ -2481,7 +2481,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
                                bConstraint *con;
                                for (con = obt->constraints.first; con; con = con->next) {
                                        bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
-                                       if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER,
+                                       if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER,
                                                  CONSTRAINT_TYPE_OBJECTSOLVER))
                                        {
                                                obt->recalc |= OB_RECALC_OB;
@@ -2759,7 +2759,7 @@ void DAG_id_tag_update_ex(Main *bmain, ID *id, short flag)
                                if (ob->type == OB_FONT) {
                                        Curve *cu = ob->data;
 
-                                       if (ELEM4((struct VFont *)id, cu->vfont, cu->vfontb, cu->vfonti, cu->vfontbi)) {
+                                       if (ELEM((struct VFont *)id, cu->vfont, cu->vfontb, cu->vfonti, cu->vfontbi)) {
                                                ob->recalc |= (flag & OB_RECALC_ALL);
                                        }
                                }
index d494115821a43de63745a9d2fbc1d70f1211bc15..0224f5f280e7fe284314eda5b6c653c769728505 100644 (file)
@@ -122,7 +122,7 @@ bool BKE_displist_has_faces(ListBase *lb)
        DispList *dl;
 
        for (dl = lb->first; dl; dl = dl->next) {
-               if (ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) {
+               if (ELEM(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) {
                        return true;
                }
        }
@@ -766,7 +766,7 @@ static ModifierData *curve_get_tessellate_point(Scene *scene, Object *ob,
                if (mti->type == eModifierTypeType_Constructive)
                        return pretessellatePoint;
 
-               if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
+               if (ELEM(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
                        pretessellatePoint = md;
 
                        /* this modifiers are moving point of tessellation automatically
@@ -1566,7 +1566,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
        Curve *cu = ob->data;
 
        /* we do allow duplis... this is only displist on curve level */
-       if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
+       if (!ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
 
        if (ob->type == OB_SURF) {
                BKE_displist_make_surf(scene, ob, dispbase, r_dm_final, for_render, for_orco, use_render_resolution);
@@ -1809,7 +1809,7 @@ void BKE_displist_make_curveTypes(Scene *scene, Object *ob, const bool for_orco)
        /* The same check for duplis as in do_makeDispListCurveTypes.
         * Happens when curve used for constraint/bevel was converted to mesh.
         * check there is still needed for render displist and orco displists. */
-       if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT))
+       if (!ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT))
                return;
 
        BKE_object_free_derived_caches(ob);
@@ -1894,7 +1894,7 @@ void BKE_displist_minmax(ListBase *dispbase, float min[3], float max[3])
 /* this is confusing, there's also min_max_object, appplying the obmat... */
 static void boundbox_displist_object(Object *ob)
 {
-       if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+       if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                /* Curve's BB is already calculated as a part of modifier stack,
                 * here we only calculate object BB based on final display list.
                 */
index e28152dbc1aabbca1e06f2e361e58ec3802819a5..4859aa8f79106d8cc42dbf3c10bde3fb71398db5 100644 (file)
@@ -935,7 +935,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
        if (pd->flag & PFIELD_DO_LOCATION) {
                madd_v3_v3fl(total_force, force, 1.0f/point->vel_to_sec);
 
-               if (ELEM3(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG, PFIELD_SMOKEFLOW)==0 && pd->f_flow != 0.0f) {
+               if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG, PFIELD_SMOKEFLOW)==0 && pd->f_flow != 0.0f) {
                        madd_v3_v3fl(total_force, point->vel, -pd->f_flow * efd->falloff);
                }
        }
index a8de9b69fbef56bb1b241cdfef3b670d12eba99a..daf872ef4cc3eeab23b50b6d03d14bfcf0db9c9c 100644 (file)
@@ -276,7 +276,7 @@ int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix,
        int matches = 0;
        
        /* sanity checks */
-       if (ELEM4(NULL, dst, src, dataPrefix, dataName))
+       if (ELEM(NULL, dst, src, dataPrefix, dataName))
                return 0;
        else if ((dataPrefix[0] == 0) || (dataName[0] == 0))
                return 0;
index c381084cfd26daa6ae70b92eb351c281cc924cae..e226e9d97973fb5802b9d4adc02bdd577f9ca5e9 100644 (file)
@@ -506,7 +506,7 @@ void gpencil_layer_setactive(bGPdata *gpd, bGPDlayer *active)
        bGPDlayer *gpl;
        
        /* error checking */
-       if (ELEM3(NULL, gpd, gpd->layers.first, active))
+       if (ELEM(NULL, gpd, gpd->layers.first, active))
                return;
                
        /* loop over layers deactivating all */
index db5c212d1db4a8e490265ffe40b10e289ff0b104..805c1250c5dd3d9ce2de34e30432d3d40938a98f 100644 (file)
@@ -1257,7 +1257,7 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
                        extension = extension_test;
        }
 #endif
-       else if (ELEM5(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
+       else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
                if (!BLI_testextensie(string, extension_test = ".png"))
                        extension = extension_test;
        }
@@ -1900,7 +1900,7 @@ int BKE_imbuf_write(ImBuf *ibuf, const char *name, ImageFormatData *imf)
                ibuf->ftype = RADHDR;
        }
 #endif
-       else if (ELEM5(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
+       else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
                ibuf->ftype = PNG;
 
                if (imtype == R_IMF_IMTYPE_PNG) {
index 7385322ddeb247d69f304a1eef19be18f8ef153e..51cf26063c79291b2cae9acfba7ce3ea9d278de9 100644 (file)
@@ -1308,8 +1308,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
                                 *      - they were degrees/10 
                                 *      - we need radians for RNA to do the right thing
                                 */
-                               if ( ((icu->blocktype == ID_OB) && ELEM3(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) ||
-                                    ((icu->blocktype == ID_PO) && ELEM3(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z)) )
+                               if ( ((icu->blocktype == ID_OB) && ELEM(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) ||
+                                    ((icu->blocktype == ID_PO) && ELEM(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z)) )
                                {
                                        const float fac = (float)M_PI / 18.0f; //10.0f * M_PI/180.0f;
                                        
@@ -1341,7 +1341,7 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
                                        DriverVar *dvar = fcu->driver->variables.first;
                                        DriverTarget *dtar = &dvar->targets[0];
                                        
-                                       if (ELEM3(dtar->transChan, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ)) {
+                                       if (ELEM(dtar->transChan, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ)) {
                                                const float fac = (float)M_PI / 18.0f;
                                                
                                                dst->vec[0][0] *= fac;
@@ -1388,7 +1388,7 @@ static void ipo_to_animato(ID *id, Ipo *ipo, char actname[], char constname[], S
        IpoCurve *icu;
        
        /* sanity check */
-       if (ELEM3(NULL, ipo, anim, drivers))
+       if (ELEM(NULL, ipo, anim, drivers))
                return;
                
        if (G.debug & G_DEBUG) printf("ipo_to_animato\n");
index 971db1997ded82a6783895cacc854d176810e9c3..b8788a2bffb58fa83d4ab4c69f67bb3f78332f94 100644 (file)
@@ -467,7 +467,7 @@ Material ***give_matarar(Object *ob)
                me = ob->data;
                return &(me->mat);
        }
-       else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
+       else if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
                cu = ob->data;
                return &(cu->mat);
        }
@@ -488,7 +488,7 @@ short *give_totcolp(Object *ob)
                me = ob->data;
                return &(me->totcol);
        }
-       else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
+       else if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
                cu = ob->data;
                return &(cu->totcol);
        }
@@ -1291,7 +1291,7 @@ bool object_remove_material_slot(Object *ob)
        }
 
        /* check indices from mesh */
-       if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
+       if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
                material_data_index_remove_id((ID *)ob->data, actcol - 1);
                if (ob->curve_cache) {
                        BKE_displist_free(&ob->curve_cache->disp);
index 2bf33b97a7018a4302887bf0ce5fc7926200620d..66c383ef0d3d93bf2b37808b3b997926b2c6b513 100644 (file)
@@ -115,16 +115,16 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
        int i, i1 = 0, i2 = 0, tot, j;
        
        for (i = 0; i < c1->totlayer; i++) {
-               if (ELEM7(c1->layers[i].type, CD_MVERT, CD_MEDGE, CD_MPOLY,
-                         CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
+               if (ELEM(c1->layers[i].type, CD_MVERT, CD_MEDGE, CD_MPOLY,
+                        CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
                {
                        i1++;
                }
        }
 
        for (i = 0; i < c2->totlayer; i++) {
-               if (ELEM7(c2->layers[i].type, CD_MVERT, CD_MEDGE, CD_MPOLY,
-                         CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
+               if (ELEM(c2->layers[i].type, CD_MVERT, CD_MEDGE, CD_MPOLY,
+                        CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
                {
                        i2++;
                }
@@ -135,16 +135,16 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
        
        l1 = c1->layers; l2 = c2->layers;
        tot = i1;
-       i1 = 0; i2 = 0; 
+       i1 = 0; i2 = 0;
        for (i = 0; i < tot; i++) {
-               while (i1 < c1->totlayer && !ELEM7(l1->type, CD_MVERT, CD_MEDGE, CD_MPOLY, 
-                                                  CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
+               while (i1 < c1->totlayer && !ELEM(l1->type, CD_MVERT, CD_MEDGE, CD_MPOLY,
+                                                 CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
                {
                        i1++, l1++;
                }
 
-               while (i2 < c2->totlayer && !ELEM7(l2->type, CD_MVERT, CD_MEDGE, CD_MPOLY,
-                                                  CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
+               while (i2 < c2->totlayer && !ELEM(l2->type, CD_MVERT, CD_MEDGE, CD_MPOLY,
+                                                 CD_MLOOPUV, CD_MLOOPCOL, CD_MTEXPOLY, CD_MDEFORMVERT))
                {
                        i2++, l2++;
                }
@@ -2041,7 +2041,7 @@ int BKE_mesh_mselect_find(Mesh *me, int index, int type)
 {
        int i;
 
-       BLI_assert(ELEM3(type, ME_VSEL, ME_ESEL, ME_FSEL));
+       BLI_assert(ELEM(type, ME_VSEL, ME_ESEL, ME_FSEL));
 
        for (i = 0; i < me->totselect; i++) {
                if ((me->mselect[i].index == index) &&
@@ -2059,7 +2059,7 @@ int BKE_mesh_mselect_find(Mesh *me, int index, int type)
  */
 int BKE_mesh_mselect_active_get(Mesh *me, int type)
 {
-       BLI_assert(ELEM3(type, ME_VSEL, ME_ESEL, ME_FSEL));
+       BLI_assert(ELEM(type, ME_VSEL, ME_ESEL, ME_FSEL));
 
        if (me->totselect) {
                if (me->mselect[me->totselect - 1].type == type) {
index 65c576dd6a053fcc76a43a67b1e978389df87611..82065750791c9f9d7004903424af6f16f3f95d61 100644 (file)
@@ -442,7 +442,7 @@ int *BKE_mesh_calc_smoothgroups(const MEdge *medge, const int totedge,
                                        /* Find contiguous smooth groups already assigned, these are the values we can't reuse! */
                                        for (; i--; p++) {
                                                int bit = poly_groups[*p];
-                                               if (!ELEM3(bit, 0, poly_group_id, poly_group_id_overflowed) &&
+                                               if (!ELEM(bit, 0, poly_group_id, poly_group_id_overflowed) &&
                                                    !(bit_poly_group_mask & bit))
                                                {
                                                        bit_poly_group_mask |= bit;
index d0114d52a06e77de1d544892b2d33bd5dbd6114e..9790394cd99cd7258e8a0280a7c279a00e841cd2 100644 (file)
@@ -1637,7 +1637,7 @@ bool BKE_nla_tweakmode_enter(AnimData *adt)
                }
        }
        
-       if (ELEM3(NULL, activeTrack, activeStrip, activeStrip->act)) {
+       if (ELEM(NULL, activeTrack, activeStrip, activeStrip->act)) {
                if (G.debug & G_DEBUG) {
                        printf("NLA tweakmode enter - neither active requirement found\n");
                        printf("\tactiveTrack = %p, activeStrip = %p\n", (void *)activeTrack, (void *)activeStrip);
@@ -1744,7 +1744,7 @@ static void UNUSED_FUNCTION(BKE_nla_bake) (Scene *scene, ID *UNUSED(id), AnimDat
         *      1) Scene and AnimData must be provided 
         *      2) there must be tracks to merge...
         */
-       if (ELEM3(NULL, scene, adt, adt->nla_tracks.first))
+       if (ELEM(NULL, scene, adt, adt->nla_tracks.first))
                return;
        
        /* if animdata currently has an action, 'push down' this onto the stack first */
index 42128a9b3649b1a8f7935780f1a8b29d4648cbb5..5281b0b9b74c631cb8d240939e009b5a9464dfb6 100644 (file)
@@ -246,7 +246,7 @@ void BKE_object_link_modifiers(struct Object *ob_dst, struct Object *ob_src)
        ModifierData *md;
        BKE_object_free_modifiers(ob_dst);
 
-       if (!ELEM5(ob_dst->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
+       if (!ELEM(ob_dst->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
                /* only objects listed above can have modifiers and linking them to objects
                 * which doesn't have modifiers stack is quite silly */
                return;
@@ -255,11 +255,11 @@ void BKE_object_link_modifiers(struct Object *ob_dst, struct Object *ob_src)
        for (md = ob_src->modifiers.first; md; md = md->next) {
                ModifierData *nmd = NULL;
 
-               if (ELEM4(md->type,
-                         eModifierType_Hook,
-                         eModifierType_Softbody,
-                         eModifierType_ParticleInstance,
-                         eModifierType_Collision))
+               if (ELEM(md->type,
+                        eModifierType_Hook,
+                        eModifierType_Softbody,
+                        eModifierType_ParticleInstance,
+                        eModifierType_Collision))
                {
                        continue;
                }
@@ -296,7 +296,7 @@ void BKE_object_free_derived_caches(Object *ob)
                        me->bb->flag |= BOUNDBOX_DIRTY;
                }
        }
-       else if (ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
+       else if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
                Curve *cu = ob->data;
 
                if (cu->bb) {
@@ -977,7 +977,7 @@ Object *BKE_object_add_only_object(Main *bmain, int type, const char *name)
        ob->empty_drawtype = OB_PLAINAXES;
        ob->empty_drawsize = 1.0;
 
-       if (ELEM3(type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
+       if (ELEM(type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
                ob->trackflag = OB_NEGZ;
                ob->upflag = OB_POSY;
        }
@@ -1978,7 +1978,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[4][4])
        unit_m4(mat);
        
        cu = par->data;
-       if (ELEM3(NULL, par->curve_cache, par->curve_cache->path, par->curve_cache->path->data)) /* only happens on reload file, but violates depsgraph still... fix! */
+       if (ELEM(NULL, par->curve_cache, par->curve_cache->path, par->curve_cache->path->data)) /* only happens on reload file, but violates depsgraph still... fix! */
                BKE_displist_make_curveTypes(scene, par, 0);
        if (par->curve_cache->path == NULL) return;
        
@@ -2473,7 +2473,7 @@ BoundBox *BKE_object_boundbox_get(Object *ob)
        if (ob->type == OB_MESH) {
                bb = BKE_mesh_boundbox_get(ob);
        }
-       else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+       else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                bb = BKE_curve_boundbox_get(ob);
        }
        else if (ob->type == OB_MBALL) {
index 5237eeda1082a911f958b0c84fb79509608d7cb2..82818baaed099d7cd22db00e496c91257df4f983 100644 (file)
@@ -117,7 +117,7 @@ static int particles_are_dynamic(ParticleSystem *psys)
        if (psys->part->type == PART_HAIR)
                return psys->flag & PSYS_HAIR_DYNAMICS;
        else
-               return ELEM3(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID);
+               return ELEM(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID);
 }
 
 float psys_get_current_display_percentage(ParticleSystem *psys)
@@ -1079,7 +1079,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
        float *element_weight=NULL,*element_sum=NULL,*jitter_offset=NULL, *vweight=NULL;
        float cur, maxweight=0.0, tweight, totweight, inv_totweight, co[3], nor[3], orco[3];
        
-       if (ELEM3(NULL, ob, psys, psys->part))
+       if (ELEM(NULL, ob, psys, psys->part))
                return 0;
 
        part=psys->part;
@@ -3153,7 +3153,7 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
                extrotfac = 0.0f;
        }
 
-       if ((part->flag & PART_ROT_DYN) && ELEM3(part->avemode, PART_AVE_VELOCITY, PART_AVE_HORIZONTAL, PART_AVE_VERTICAL)) {
+       if ((part->flag & PART_ROT_DYN) && ELEM(part->avemode, PART_AVE_VELOCITY, PART_AVE_HORIZONTAL, PART_AVE_VERTICAL)) {
                float angle;
                float len1 = len_v3(pa->prev_state.vel);
                float len2 = len_v3(pa->state.vel);
@@ -4846,13 +4846,13 @@ void psys_changed_type(Object *ob, ParticleSystem *psys)
                psys->flag &= ~PSYS_KEYED;
 
        if (part->type == PART_HAIR) {
-               if (ELEM4(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR)==0)
+               if (ELEM(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR)==0)
                        part->ren_as = PART_DRAW_PATH;
 
                if (part->distr == PART_DISTR_GRID)
                        part->distr = PART_DISTR_JIT;
 
-               if (ELEM3(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0)
+               if (ELEM(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0)
                        part->draw_as = PART_DRAW_REND;
 
                CLAMP(part->path_start, 0.0f, 100.0f);
index 90b5d8cf1a17ac19ec1694382528dc356c4d5b8b..b2178fe69b3491cab2d1273c9801e09f9eb93d62 100644 (file)
@@ -284,7 +284,7 @@ Report *BKE_reports_last_displayable(ReportList *reports)
        Report *report;
        
        for (report = reports->list.last; report; report = report->prev) {
-               if (ELEM3(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO))
+               if (ELEM(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO))
                        return report;
        }
        
index 98bcdfabad3a03c04e00118c665c604b70c570fe..3d61b0bdefbf3cb5fab73d2e396faa9dedaf9a20 100644 (file)
@@ -395,7 +395,7 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
        }
        mul_v3_fl(size, 0.5f);
 
-       if (ELEM3(rbo->shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) {
+       if (ELEM(rbo->shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) {
                /* take radius as largest x/y dimension, and height as z-dimension */
                radius = MAX2(size[0], size[1]);
                height = size[2];
@@ -477,7 +477,7 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol)
        // XXX: all dimensions are auto-determined now... later can add stored settings for this
        BKE_object_dimensions_get(ob, size);
 
-       if (ELEM3(rbo->shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) {
+       if (ELEM(rbo->shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) {
                /* take radius as largest x/y dimension, and height as z-dimension */
                radius = MAX2(size[0], size[1]) * 0.5f;
                height = size[2];
@@ -720,7 +720,7 @@ static void rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, b
                return;
        }
 
-       if (ELEM4(NULL, rbc->ob1, rbc->ob1->rigidbody_object, rbc->ob2, rbc->ob2->rigidbody_object)) {
+       if (ELEM(NULL, rbc->ob1, rbc->ob1->rigidbody_object, rbc->ob2, rbc->ob2->rigidbody_object)) {
                if (rbc->physics_constraint) {
                        RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
                        RB_constraint_delete(rbc->physics_constraint);
index f5efe04951f7abea48c92facac288cf78caefc15..b3ad591bf2827764ecff34a81ee75c5fc44f93db 100644 (file)
@@ -758,7 +758,7 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, const bool lock_r
        int prev_startdisp = 0, prev_enddisp = 0;
        /* note: don't rename the strip, will break animation curves */
 
-       if (ELEM7(seq->type,
+       if (ELEM(seq->type,
                  SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM,
                  SEQ_TYPE_SCENE, SEQ_TYPE_META, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK) == 0)
        {
@@ -2808,7 +2808,7 @@ static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, floa
        float nr = give_stripelem_index(seq, cfra);
        /* all effects are handled similarly with the exception of speed effect */
        int type = (seq->type & SEQ_TYPE_EFFECT && seq->type != SEQ_TYPE_SPEED) ? SEQ_TYPE_EFFECT : seq->type;
-       bool is_preprocessed = !ELEM3(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE);
+       bool is_preprocessed = !ELEM(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE);
 
        ibuf = BKE_sequencer_cache_get(context, seq, cfra, SEQ_STRIPELEM_IBUF);
 
@@ -2875,7 +2875,7 @@ static bool seq_must_swap_input_in_blend_mode(Sequence *seq)
        /* bad hack, to fix crazy input ordering of 
         * those two effects */
 
-       if (ELEM3(seq->blend_mode, SEQ_TYPE_ALPHAOVER, SEQ_TYPE_ALPHAUNDER, SEQ_TYPE_OVERDROP)) {
+       if (ELEM(seq->blend_mode, SEQ_TYPE_ALPHAOVER, SEQ_TYPE_ALPHAUNDER, SEQ_TYPE_OVERDROP)) {
                swap_input = true;
        }
        
@@ -2960,7 +2960,7 @@ static ImBuf *seq_render_strip_stack(const SeqRenderData *context, ListBase *seq
                /* Some of the blend modes are unclear how to apply with only single input,
                 * or some of them will just produce an empty result..
                 */
-               if (ELEM3(seq->blend_mode, SEQ_BLEND_REPLACE, SEQ_TYPE_CROSS, SEQ_TYPE_ALPHAOVER)) {
+               if (ELEM(seq->blend_mode, SEQ_BLEND_REPLACE, SEQ_TYPE_CROSS, SEQ_TYPE_ALPHAOVER)) {
                        int early_out;
                        if (seq->blend_mode == SEQ_BLEND_REPLACE) {
                                early_out = EARLY_NO_INPUT;
@@ -3688,7 +3688,7 @@ Sequence *BKE_sequencer_foreground_frame_get(Scene *scene, int frame)
                if (seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame)
                        continue;
                /* only use elements you can see - not */
-               if (ELEM5(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_META, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIE, SEQ_TYPE_COLOR)) {
+               if (ELEM(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_META, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIE, SEQ_TYPE_COLOR)) {
                        if (seq->machine > best_machine) {
                                best_seq = seq;
                                best_machine = seq->machine;
index 90687ef99164975858067c419f3c12c2063d3332..47b615c2573bf9fa1ef79ff37359287dd728d4f7 100644 (file)
@@ -2697,7 +2697,7 @@ void txt_indent(Text *text)
        /* hardcoded: TXT_TABSIZE = 4 spaces: */
        int spaceslen = TXT_TABSIZE;
 
-       if (ELEM3(NULL, text, text->curl, text->sell)) {
+       if (ELEM(NULL, text, text->curl, text->sell)) {
                return;
        }
 
@@ -2764,7 +2764,7 @@ void txt_unindent(Text *text)
        /* hardcoded: TXT_TABSIZE = 4 spaces: */
        int spaceslen = TXT_TABSIZE;
 
-       if (ELEM3(NULL, text, text->curl, text->sell)) {
+       if (ELEM(NULL, text, text->curl, text->sell)) {
                return;
        }
 
index a9f040b865056c1479469c5d474006219fd72b5c..aef4499391262c99b1875add3d195b3f745109e2 100644 (file)
@@ -110,7 +110,7 @@ bMovieHandle *BKE_movie_handle_get(const char imtype)
        }
 #endif
 #ifdef WITH_FFMPEG
-       if (ELEM4(imtype, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_XVID, R_IMF_IMTYPE_THEORA)) {
+       if (ELEM(imtype, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_XVID, R_IMF_IMTYPE_THEORA)) {
                mh.start_movie = BKE_ffmpeg_start;
                mh.append_movie = BKE_ffmpeg_append;
                mh.end_movie = BKE_ffmpeg_end;
index 2e657a2e4d6cca52f061c33c2539099db2e0a2bd..564b31f974ab0f60850636c3dcce9408f14a04d0 100644 (file)
 #include <stdio.h>
 #endif
 
+
+/* varargs macros (keep first so others can use) */
+/* --- internal helpers --- */
+#define _VA_NARGS_GLUE(x, y) x y
+#define _VA_NARGS_RETURN_COUNT(\
+       _1_, _2_, _3_, _4_, _5_, _6_, _7_, _8_, _9_, _10_, _11_, _12_, _13_, _14_, _15_, _16_, \
+       _17_, _18_, _19_, _20_, _21_, _22_, _23_, _24_, _25_, _26_, _27_, _28_, _29_, _30_, _31_, _32_, \
+       count, ...) count
+#define _VA_NARGS_EXPAND(args) _VA_NARGS_RETURN_COUNT args
+#define _VA_NARGS_COUNT_MAX16(...) _VA_NARGS_EXPAND((__VA_ARGS__, \
+       32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, \
+       15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
+#define _VA_NARGS_OVERLOAD_MACRO2(name, count) name##count
+#define _VA_NARGS_OVERLOAD_MACRO1(name, count) _VA_NARGS_OVERLOAD_MACRO2(name, count)
+#define _VA_NARGS_OVERLOAD_MACRO(name,  count) _VA_NARGS_OVERLOAD_MACRO1(name, count)
+/* --- expose for re-use --- */
+#define VA_NARGS_CALL_OVERLOAD(name, ...) \
+       _VA_NARGS_GLUE(_VA_NARGS_OVERLOAD_MACRO(name, _VA_NARGS_COUNT_MAX16(__VA_ARGS__)), (__VA_ARGS__))
+
+
 /* useful for finding bad use of min/max */
 #if 0
 /* gcc only */
        (b) = (tval);                 \
 } (void)0
 
-
 /* ELEM#(v, ...): is the first arg equal any others? */
-#define ELEM(v, a, b) \
+/* internal helpers*/
+#define _VA_ELEM3(v, a, b) \
        (((v) == (a)) || ((v) == (b)))
-#define ELEM3(v, a, b, c) \
-        (ELEM(v, a, b) || ((v) == (c)))
-#define ELEM4(v, a, b, c, d) \
-       (ELEM3(v, a, b, c) || ((v) == (d)))
-#define ELEM5(v, a, b, c, d, e) \
-       (ELEM4(v, a, b, c, d) || ((v) == (e)))
-#define ELEM6(v, a, b, c, d, e, f) \
-       (ELEM5(v, a, b, c, d, e) || ((v) == (f)))
-#define ELEM7(v, a, b, c, d, e, f, g) \
-       (ELEM6(v, a, b, c, d, e, f) || ((v) == (g)))
-#define ELEM8(v, a, b, c, d, e, f, g, h) \
-       (ELEM7(v, a, b, c, d, e, f, g) || ((v) == (h)))
-#define ELEM9(v, a, b, c, d, e, f, g, h, i) \
-       (ELEM8(v, a, b, c, d, e, f, g, h) || ((v) == (i)))
-#define ELEM10(v, a, b, c, d, e, f, g, h, i, j) \
-        (ELEM9(v, a, b, c, d, e, f, g, h, i) || ((v) == (j)))
-#define ELEM11(v, a, b, c, d, e, f, g, h, i, j, k) \
-       (ELEM10(v, a, b, c, d, e, f, g, h, i, j) || ((v) == (k)))
-#define ELEM12(v, a, b, c, d, e, f, g, h, i, j, k, l) \
-       (ELEM11(v, a, b, c, d, e, f, g, h, i, j, k) || ((v) == (l)))
-#define ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l, m) \
-       (ELEM12(v, a, b, c, d, e, f, g, h, i, j, k, l) || ((v) == (m)))
-#define ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
-       (ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l, m) || ((v) == (n)))
-#define ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) \
-       (ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) || ((v) == (o)))
-#define ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
-       (ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) || ((v) == (p)))
+#define _VA_ELEM4(v, a, b, c) \
+       (_VA_ELEM3(v, a, b) || ((v) == (c)))
+#define _VA_ELEM5(v, a, b, c, d) \
+       (_VA_ELEM4(v, a, b, c) || ((v) == (d)))
+#define _VA_ELEM6(v, a, b, c, d, e) \
+       (_VA_ELEM5(v, a, b, c, d) || ((v) == (e)))
+#define _VA_ELEM7(v, a, b, c, d, e, f) \
+       (_VA_ELEM6(v, a, b, c, d, e) || ((v) == (f)))
+#define _VA_ELEM8(v, a, b, c, d, e, f, g) \
+       (_VA_ELEM7(v, a, b, c, d, e, f) || ((v) == (g)))
+#define _VA_ELEM9(v, a, b, c, d, e, f, g, h) \
+       (_VA_ELEM8(v, a, b, c, d, e, f, g) || ((v) == (h)))
+#define _VA_ELEM10(v, a, b, c, d, e, f, g, h, i) \
+       (_VA_ELEM9(v, a, b, c, d, e, f, g, h) || ((v) == (i)))
+#define _VA_ELEM11(v, a, b, c, d, e, f, g, h, i, j) \
+       (_VA_ELEM10(v, a, b, c, d, e, f, g, h, i) || ((v) == (j)))
+#define _VA_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) \
+       (_VA_ELEM11(v, a, b, c, d, e, f, g, h, i, j) || ((v) == (k)))
+#define _VA_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) \
+       (_VA_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) || ((v) == (l)))
+#define _VA_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) \
+       (_VA_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) || ((v) == (m)))
+#define _VA_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
+       (_VA_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) || ((v) == (n)))
+#define _VA_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) \
+       (_VA_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) || ((v) == (o)))
+#define _VA_ELEM17(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
+       (_VA_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) || ((v) == (p)))
+
+/* reusable ELEM macro */
+#define ELEM(...) VA_NARGS_CALL_OVERLOAD(_VA_ELEM, __VA_ARGS__)
 
 
 /* shift around elements */
index 0b89ec1f0d0fd547276a42d24cf3403864451bc9..1a48212789f49e72f657ccc4df4f55cc5115bc98 100644 (file)
@@ -1415,7 +1415,7 @@ const char *BLI_get_folder_create(int folder_id, const char *subfolder)
        const char *path;
 
        /* only for user folders */
-       if (!ELEM4(folder_id, BLENDER_USER_DATAFILES, BLENDER_USER_CONFIG, BLENDER_USER_SCRIPTS, BLENDER_USER_AUTOSAVE))
+       if (!ELEM(folder_id, BLENDER_USER_DATAFILES, BLENDER_USER_CONFIG, BLENDER_USER_SCRIPTS, BLENDER_USER_AUTOSAVE))
                return NULL;
        
        path = BLI_get_folder(folder_id, subfolder);
@@ -1783,7 +1783,7 @@ bool BLI_replace_extension(char *path, size_t maxlen, const char *ext)
        ssize_t a;
 
        for (a = path_len - 1; a >= 0; a--) {
-               if (ELEM3(path[a], '.', '/', '\\')) {
+               if (ELEM(path[a], '.', '/', '\\')) {
                        break;
                }
        }
index 71cda92842a5d8a9f12718ddde0545b62d15811b..dd829e5d80a5194084318c0be659f2fc11834341 100644 (file)
@@ -387,7 +387,7 @@ static bool kdtree2d_isect_tri_recursive(
                            (span_tri_v2_sign(tri_coords[1], tri_coords[2], co) != CONCAVE) &&
                            (span_tri_v2_sign(tri_coords[2], tri_coords[0], co) != CONCAVE))
                        {
-                               if (!ELEM3(node->index, tri_index[0], tri_index[1], tri_index[2])) {
+                               if (!ELEM(node->index, tri_index[0], tri_index[1], tri_index[2])) {
                                        return true;
                                }
                        }
index 91753158d026b5e5859ae7d58b8cd25312be3bf7..419f72b5fd6762ea91e680d6c57d60fc575dc82b 100644 (file)
@@ -2664,9 +2664,9 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
                                }
                        }
                        else if (ntree->type==NTREE_COMPOSIT) {
-                               if (ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
+                               if (ELEM(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
                                        direct_link_curvemapping(fd, node->storage);
-                               else if (ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
+                               else if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
                                        ((ImageUser *)node->storage)->ok = 1;
                        }
                        else if ( ntree->type==NTREE_TEXTURE) {
@@ -5355,7 +5355,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
                        if (seq->strip && seq->strip->done==0) {
                                seq->strip->done = true;
                                
-                               if (ELEM4(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
+                               if (ELEM(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
                                        seq->strip->stripdata = newdataadr(fd, seq->strip->stripdata);
                                }
                                else {
index 3890e07bb65f9cc3183aed4d9d6e0bdc2db976ac..7c6b6ec7249129010f6e11163a8ee9f7b85ea597 100644 (file)
@@ -2454,9 +2454,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                                        if (sl->spacetype == SPACE_OUTLINER) {
                                                SpaceOops *so = (SpaceOops *)sl;
 
-                                               if (!ELEM11(so->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_SELECTED, SO_ACTIVE,
-                                                                           SO_SAME_TYPE, SO_GROUPS, SO_LIBRARIES, SO_SEQUENCE, SO_DATABLOCKS,
-                                                                           SO_USERDEF))
+                                               if (!ELEM(so->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_SELECTED, SO_ACTIVE,
+                                                                         SO_SAME_TYPE, SO_GROUPS, SO_LIBRARIES, SO_SEQUENCE, SO_DATABLOCKS,
+                                                                         SO_USERDEF))
                                                {
                                                        so->outlinevis = SO_ALL_SCENES;
                                                }
index 572c6d0a02d82a7ae07fcd1f34491a322d057527..b73e1feb0c1db382c25a18b8087fb53f2eaf6102 100644 (file)
@@ -473,7 +473,7 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
 
        if (ntree->type == NTREE_COMPOSIT) {
                for (node = ntree->nodes.first; node; node = node->next) {
-                       if (ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
+                       if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
                                /* only image had storage */
                                if (node->storage) {
                                        NodeImageAnim *nia = node->storage;
index a0198a687a25b494b1709a520301fa09716d926d..63ca7bf0a065806478a31ea509e0970e41b640ea 100644 (file)
@@ -767,7 +767,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
                                        writedata(wd, DATA, strlen(nss->bytecode)+1, nss->bytecode);
                                writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage);
                        }
-                       else if (ntree->type==NTREE_COMPOSIT && ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
+                       else if (ntree->type==NTREE_COMPOSIT && ELEM(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
                                write_curvemapping(wd, node->storage);
                        else if (ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
                                write_curvemapping(wd, node->storage);
index a9e6dad7fd09ea3ec7bbef1fa021ef2df621772b..c154ac8b2daf764aca0509e44e2b2bb3a44970c4 100644 (file)
@@ -802,7 +802,7 @@ void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
        }
 
        /* skip if we only need to operate on one element */
-#pragma omp parallel sections if ((!ELEM5(htype_needed, BM_VERT, BM_EDGE, BM_FACE, BM_LOOP, BM_FACE | BM_LOOP)) && \
+#pragma omp parallel sections if ((!ELEM(htype_needed, BM_VERT, BM_EDGE, BM_FACE, BM_LOOP, BM_FACE | BM_LOOP)) && \
                                      (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT))
        {
 #pragma omp section
@@ -1056,7 +1056,7 @@ void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
        }
 
        /* skip if we only need to operate on one element */
-#pragma omp parallel sections if ((!ELEM3(htype_needed, BM_VERT, BM_EDGE, BM_FACE)) && \
+#pragma omp parallel sections if ((!ELEM(htype_needed, BM_VERT, BM_EDGE, BM_FACE)) && \
                                      (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT))
        {
 #pragma omp section
index b497ab2f693794afbc49daebbf7d94c358e1a42a..426e20939cabd458701a3d7cce58a49c3e9566e3 100644 (file)
@@ -134,7 +134,7 @@ static void state_calc_co_pair(const PathContext *pc,
 static bool state_link_find(PathLinkState *state, BMElem *ele)
 {
        PathLink *link = state->link_last;
-       BLI_assert(ELEM3(ele->head.htype, BM_VERT, BM_EDGE, BM_FACE));
+       BLI_assert(ELEM(ele->head.htype, BM_VERT, BM_EDGE, BM_FACE));
        if (link) {
                do {
                        if (link->ele == ele) {
index 90d26a775d3c01b4cdada6e7da31a643f54b604c..b9bd7a381beaf6922fa0bc16a737e60261b68331 100644 (file)
@@ -142,10 +142,10 @@ static float bm_edge_calc_rotate_beauty__area(
                        float axis_mat[3][3];
 
                        // printf("%p %p %p %p - %p %p\n", v1, v2, v3, v4, e->l->f, e->l->radial_next->f);
-                       BLI_assert((ELEM3(v1, v2, v3, v4) == false) &&
-                                  (ELEM3(v2, v1, v3, v4) == false) &&
-                                  (ELEM3(v3, v1, v2, v4) == false) &&
-                                  (ELEM3(v4, v1, v2, v3) == false));
+                       BLI_assert((ELEM(v1, v2, v3, v4) == false) &&
+                                  (ELEM(v2, v1, v3, v4) == false) &&
+                                  (ELEM(v3, v1, v2, v4) == false) &&
+                                  (ELEM(v4, v1, v2, v3) == false));
 
                        is_zero_a = (normal_tri_v3(no_a, v2, v3, v4) <= FLT_EPSILON);
                        is_zero_b = (normal_tri_v3(no_b, v2, v4, v1) <= FLT_EPSILON);
index 4b6209fc4eb8222fcb023e5b861c7b89de3441b9..ef1783cc69322d8cf18bdec3b6ab3546ceee9ec4 100644 (file)
@@ -414,10 +414,10 @@ static void bm_decim_triangulate_end(BMesh *bm)
                                                                BM_vert_in_edge(e, l_b->next->v) ? l_b->prev->v : l_b->next->v,
                                                        };
 
-                                                       BLI_assert(ELEM3(vquad[0], vquad[1], vquad[2], vquad[3]) == false);
-                                                       BLI_assert(ELEM3(vquad[1], vquad[0], vquad[2], vquad[3]) == false);
-                                                       BLI_assert(ELEM3(vquad[2], vquad[1], vquad[0], vquad[3]) == false);
-                                                       BLI_assert(ELEM3(vquad[3], vquad[1], vquad[2], vquad[0]) == false);
+                                                       BLI_assert(ELEM(vquad[0], vquad[1], vquad[2], vquad[3]) == false);
+                                                       BLI_assert(ELEM(vquad[1], vquad[0], vquad[2], vquad[3]) == false);
+                                                       BLI_assert(ELEM(vquad[2], vquad[1], vquad[0], vquad[3]) == false);
+                                                       BLI_assert(ELEM(vquad[3], vquad[1], vquad[2], vquad[0]) == false);
 
                                                        if (is_quad_convex_v3(vquad[0]->co, vquad[1]->co, vquad[2]->co, vquad[3]->co)) {
                                                                /* highly unlikely to fail, but prevents possible double-ups */
index 3530857266d7b53b4a5e07d1e8277be5135ad8cd..7d8e278f0cfe6eb4ff87896266d9aade1704db9a 100644 (file)
@@ -3846,7 +3846,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
        short offset;
        
        /* sanity checks - don't draw anything */
-       if (ELEM3(NULL, acf, ale, block))
+       if (ELEM(NULL, acf, ale, block))
                return;
        
        /* get initial offset */
index 9997cc07c19a1112e049d71c154e6ac8a72f9e56..f578a57c707a2bd3f5f127cd734cd4197ad68458 100644 (file)
@@ -605,7 +605,7 @@ static int animedit_poll_channels_active(bContext *C)
        if (ELEM(NULL, sa, CTX_wm_region(C)))
                return 0;
        /* animation editor test */
-       if (ELEM3(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0)
+       if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0)
                return 0;
 
        return 1;
@@ -622,7 +622,7 @@ static int animedit_poll_channels_nla_tweakmode_off(bContext *C)
        if (ELEM(NULL, sa, CTX_wm_region(C)))
                return 0;
        /* animation editor test */
-       if (ELEM3(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0)
+       if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0)
                return 0;
        
        /* NLA TweakMode test */
@@ -2257,7 +2257,7 @@ static int animchannels_find_poll(bContext *C)
                return 0;
        
        /* animation editor with dopesheet */
-       return ELEM3(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA);
+       return ELEM(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA);
 }
 
 /* find_invoke() - Get initial channels */
index 640349199be111358d8ac56d1e1e1e552b0dbcf4..f3b47b168e990a8da97bff47f2a80a6138c36ff8 100644 (file)
@@ -193,7 +193,7 @@ static void animchan_sync_fcurve(bAnimContext *ac, bAnimListElem *ale, FCurve **
        /* major priority is selection status, so refer to the checks done in anim_filter.c 
         * skip_fcurve_selected_data() for reference about what's going on here...
         */
-       if (ELEM3(NULL, fcu, fcu->rna_path, owner_id))
+       if (ELEM(NULL, fcu, fcu->rna_path, owner_id))
                return;
        
        if (GS(owner_id->name) == ID_OB) {
index d3e6d8f474fa31bdbf20e2978beacb346da01d13..57df6d32f0328fed5600e71bdbcc827709cc3ec5 100644 (file)
@@ -63,7 +63,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
        /* sanity checks */
        if (name == NULL)
                return icon;
-       else if (ELEM3(NULL, id, fcu, fcu->rna_path)) {
+       else if (ELEM(NULL, id, fcu, fcu->rna_path)) {
                if (fcu == NULL)
                        strcpy(name, IFACE_("<invalid>"));
                else if (fcu->rna_path == NULL)
index e519fc8bfef86f8e061766d98793d433d8f1154e..08d30b2fa295ab6a728e101142a107f7631c051f 100644 (file)
@@ -204,7 +204,7 @@ void ED_markers_get_minmax(ListBase *markers, short sel, float *first, float *la
        
        /* sanity check */
        //printf("markers = %p -  %p, %p\n", markers, markers->first, markers->last);
-       if (ELEM3(NULL, markers, markers->first, markers->last)) {
+       if (ELEM(NULL, markers, markers->first, markers->last)) {
                *first = 0.0f;
                *last = 0.0f;
                return;
index 88429aa386795674cf7895f889ab666b28332dcf..620bd52e527be72b6a246f5a41659f660624f359 100644 (file)
@@ -72,7 +72,7 @@ static int change_frame_poll(bContext *C)
         * this shouldn't show up in 3D editor (or others without 2D timeline view) via search
         */
        if (sa) {
-               if (ELEM5(sa->spacetype, SPACE_TIME, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) {
+               if (ELEM(sa->spacetype, SPACE_TIME, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) {
                        return true;
                }
                else if (sa->spacetype == SPACE_IPO) {
index ee5039488bd3c07d5326b77f996e8c9d2170e63f..83593faff2204a1f07ad6927d1117c15f7ba4593 100644 (file)
@@ -670,8 +670,8 @@ static short snap_bezier_horizontal(KeyframeEditData *UNUSED(ked), BezTriple *be
        if (bezt->f2 & SELECT) {
                bezt->vec[0][1] = bezt->vec[2][1] = bezt->vec[1][1];
                
-               if (ELEM3(bezt->h1, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) bezt->h1 = HD_ALIGN;
-               if (ELEM3(bezt->h2, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) bezt->h2 = HD_ALIGN;
+               if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) bezt->h1 = HD_ALIGN;
+               if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) bezt->h2 = HD_ALIGN;
        }
        return 0;
 }
@@ -810,9 +810,9 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type)
  */
 #define ENSURE_HANDLES_MATCH(bezt)                                            \
        if (bezt->h1 != bezt->h2) {                                               \
-               if (ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM))                 \
+               if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM))                  \
                        bezt->h1 = HD_FREE;                                               \
-               if (ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM))                 \
+               if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM))                  \
                        bezt->h2 = HD_FREE;                                               \
        } (void)0
 
index 878c9193b233ef30f227cc5b6863070f48e2f459..a68751e9294e6dbea36e01151856973333937ff7 100644 (file)
@@ -652,7 +652,7 @@ static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
        const char *identifier = NULL;
        
        /* validate data */
-       if (ELEM3(NULL, ptr, ptr->data, prop))
+       if (ELEM(NULL, ptr, ptr->data, prop))
                return 0;
        
        /* get first constraint and determine type of keyframe constraints to check for 
@@ -1042,7 +1042,7 @@ short insert_keyframe(ReportList *reports, ID *id, bAction *act, const char grou
                                /* for Loc/Rot/Scale and also Color F-Curves, the color of the F-Curve in the Graph Editor,
                                 * is determined by the array index for the F-Curve
                                 */
-                               if (ELEM5(RNA_property_subtype(prop), PROP_TRANSLATION, PROP_XYZ, PROP_EULER, PROP_COLOR, PROP_COORDS)) {
+                               if (ELEM(RNA_property_subtype(prop), PROP_TRANSLATION, PROP_XYZ, PROP_EULER, PROP_COLOR, PROP_COORDS)) {
                                        fcu->color_mode = FCURVE_COLOR_AUTO_RGB;
                                }
                        }
index 6762ffc17b27159ed8516479ea5aee1010871c5d..27ca30396380affbf7ed6b87d0e0695159637eac 100644 (file)
@@ -1417,7 +1417,7 @@ static void poselib_preview_init_data(bContext *C, wmOperator *op)
                pld->marker = (pld->act) ? BLI_findlink(&pld->act->markers, pose_index) : NULL;
        
        /* check if valid poselib */
-       if (ELEM3(NULL, pld->ob, pld->pose, pld->arm)) {
+       if (ELEM(NULL, pld->ob, pld->pose, pld->arm)) {
                BKE_report(op->reports, RPT_ERROR, "Pose lib is only for armatures in pose mode");
                pld->state = PL_PREVIEW_ERROR;
                return;
index aa741ef9aaf4df63dd51a5421a390a1c5e8244a2..5822974870e673dc8b99f0a4eb17663462763e4b 100644 (file)
@@ -76,7 +76,7 @@ void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select)
 
        /* sanity checks */
        // XXX: actually, we can probably still get away with no object - at most we have no updates
-       if (ELEM4(NULL, ob, ob->pose, pchan, pchan->bone))
+       if (ELEM(NULL, ob, ob->pose, pchan, pchan->bone))
                return;
        
        arm = ob->data;
@@ -644,7 +644,7 @@ static bool pose_select_same_group(bContext *C, Object *ob, bool extend)
        bool changed = false, tagged = false;
        
        /* sanity checks */
-       if (ELEM3(NULL, ob, pose, arm))
+       if (ELEM(NULL, ob, pose, arm))
                return 0;
                
        /* count the number of groups */
@@ -701,7 +701,7 @@ static bool pose_select_same_layer(bContext *C, Object *ob, bool extend)
        bool changed = false;
        int layers = 0;
        
-       if (ELEM3(NULL, ob, pose, arm))
+       if (ELEM(NULL, ob, pose, arm))
                return 0;
        
        /* figure out what bones are selected */
@@ -761,7 +761,7 @@ static bool pose_select_same_keyingset(bContext *C, ReportList *reports, Object
                return false;
        }
                
-       if (ELEM3(NULL, ob, pose, arm))
+       if (ELEM(NULL, ob, pose, arm))
                return false;
                
        /* if not extending selection, deselect all selected first */
index 375cbb0fe2bb43aeed5c8cd759b748ef0871bc94..5f9f24d23a4bbbd1ce383680746869fb102c84d1 100644 (file)
@@ -134,7 +134,7 @@ static int pose_slide_init(bContext *C, wmOperator *op, short mode)
        pso->nextFrame = RNA_int_get(op->ptr, "next_frame");
        
        /* check the settings from the context */
-       if (ELEM4(NULL, pso->ob, pso->arm, pso->ob->adt, pso->ob->adt->action))
+       if (ELEM(NULL, pso->ob, pso->arm, pso->ob->adt, pso->ob->adt->action))
                return 0;
        else
                act = pso->ob->adt->action;
index 11c8b11e31d66649dfe8513f33b26c352182a6ee..b0371b8dd6ceff86e3b9f9d58b8cec7f8665f368 100644 (file)
@@ -7019,7 +7019,7 @@ static int match_texture_space_poll(bContext *C)
 {
        Object *object = CTX_data_active_object(C);
 
-       return object && ELEM3(object->type, OB_CURVE, OB_SURF, OB_FONT);
+       return object && ELEM(object->type, OB_CURVE, OB_SURF, OB_FONT);
 }
 
 static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op))
index b725f5c773afe89591fb79b58bfe5255c3a9eeb4..6e17be046239d5f99ee13fb6cbd49f79cd6602aa 100644 (file)
@@ -1412,7 +1412,7 @@ static void gp_layer_to_curve(bContext *C, ReportList *reports, bGPdata *gpd, bG
        rctf subrect, *subrect_ptr = NULL;
 
        /* error checking */
-       if (ELEM3(NULL, gpd, gpl, gpf))
+       if (ELEM(NULL, gpd, gpl, gpf))
                return;
 
        /* only convert if there are any strokes on this layer's frame to convert */
index 4910396ac6fd3928a06af5e0f35a592f4d977696..afecdd91599eb3bf174ce074be1abaf9dee4ee45 100644 (file)
@@ -1861,7 +1861,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
 
        /* we don't pass on key events, GP is used with key-modifiers - prevents Dkey to insert drivers */
        if (ISKEYBOARD(event->type)) {
-               if (ELEM4(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY)) {
+               if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY)) {
                        /* allow some keys - for frame changing: [#33412] */
                }
                else {
@@ -1874,7 +1874,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
        /* exit painting mode (and/or end current stroke) 
         * NOTE: cannot do RIGHTMOUSE (as is standard for canceling) as that would break polyline [#32647]
         */
-       if (ELEM4(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY)) {
+       if (ELEM(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY)) {
                /* exit() ends the current stroke before cleaning up */
                /* printf("\t\tGP - end of paint op + end of stroke\n"); */
                p->status = GP_STATUS_DONE;
@@ -1949,7 +1949,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
                }
                /* eraser size */
                else if ((p->paintmode == GP_PAINTMODE_ERASER) &&
-                        ELEM4(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, PADPLUSKEY, PADMINUS))
+                        ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, PADPLUSKEY, PADMINUS))
                {
                        /* just resize the brush (local version)
                         * TODO: fix the hardcoded size jumps (set to make a visible difference) and hardcoded keys
index c857150782ede1931e82c9e4ba2c73c2a8f54cd0..dc9dd6183bbdd8b84a9a674903ac9f25c35ae822 100644 (file)
@@ -830,7 +830,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
                 * fun first pass on all buttons so first word chars always get first priority */
 
                for (but = block->buttons.first; but; but = but->next) {
-                       if (!ELEM5(but->type, BUT, BUTM, MENU, BLOCK, PULLDOWN) || (but->flag & UI_HIDDEN)) {
+                       if (!ELEM(but->type, BUT, BUTM, MENU, BLOCK, PULLDOWN) || (but->flag & UI_HIDDEN)) {
                                /* pass */
                        }
                        else if (but->menu_key == '\0') {
@@ -1320,7 +1320,7 @@ int ui_is_but_push_ex(uiBut *but, double *value)
        int is_push = 0;
 
        if (but->bit) {
-               const bool state = ELEM3(but->type, TOGN, ICONTOGN, OPTIONN) ? false : true;
+               const bool state = ELEM(but->type, TOGN, ICONTOGN, OPTIONN) ? false : true;
                int lvalue;
                UI_GET_BUT_VALUE_INIT(but, *value);
                lvalue = (int)*value;
@@ -1630,7 +1630,7 @@ bool ui_is_but_float(const uiBut *but)
 
 bool ui_is_but_bool(const uiBut *but)
 {
-       if (ELEM4(but->type, TOG, TOGN, ICONTOG, ICONTOGN))
+       if (ELEM(but->type, TOG, TOGN, ICONTOG, ICONTOGN))
                return true;
 
        if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_BOOLEAN)
@@ -1843,7 +1843,7 @@ void ui_set_but_val(uiBut *but, double value)
 
 int ui_get_but_string_max_length(uiBut *but)
 {
-       if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK))
+       if (ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK))
                return but->hardmax;
        else
                return UI_MAX_DRAW_STR;
@@ -1958,7 +1958,7 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
  */
 void ui_get_but_string_ex(uiBut *but, char *str, const size_t maxlen, const int float_precision)
 {
-       if (but->rnaprop && ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (but->rnaprop && ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                PropertyType type;
                const char *buf = NULL;
                int buf_len;
@@ -2095,7 +2095,7 @@ bool ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double
 
 bool ui_set_but_string(bContext *C, uiBut *but, const char *str)
 {
-       if (but->rnaprop && ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (but->rnaprop && ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                if (RNA_property_editable(&but->rnapoin, but->rnaprop)) {
                        PropertyType type;
 
@@ -2747,7 +2747,7 @@ void uiBlockEndAlign(uiBlock *block)
 
 bool ui_but_can_align(uiBut *but)
 {
-       return !ELEM5(but->type, LABEL, OPTION, OPTIONN, SEPR, SEPRLINE);
+       return !ELEM(but->type, LABEL, OPTION, OPTIONN, SEPR, SEPRLINE);
 }
 
 static void ui_block_do_align_but(uiBut *first, short nr)
@@ -3029,7 +3029,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
        }
 
        if ((block->flag & UI_BLOCK_LOOP) ||
-           ELEM8(but->type, MENU, TEX, LABEL, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR, SEARCH_MENU_UNLINK))
+           ELEM(but->type, MENU, TEX, LABEL, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR, SEARCH_MENU_UNLINK))
        {
                but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT);
        }
@@ -3048,7 +3048,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
        }
 
        /* keep track of UI_interface.h */
-       if      (ELEM11(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM, SCROLL, SEPR, SEPRLINE, GRIP)) {}
+       if      (ELEM(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM, SCROLL, SEPR, SEPRLINE, GRIP)) {}
        else if (but->type >= SEARCH_MENU) {}
        else but->flag |= UI_BUT_UNDO;
 
@@ -3213,12 +3213,12 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
        int icon = 0;
        uiMenuCreateFunc func = NULL;
 
-       if (ELEM3(type, COLOR, HSVCIRCLE, HSVCUBE)) {
+       if (ELEM(type, COLOR, HSVCIRCLE, HSVCUBE)) {
                BLI_assert(index == -1);
        }
 
        /* use rna values if parameters are not specified */
-       if ((proptype == PROP_ENUM) && ELEM3(type, MENU, ROW, LISTROW)) {
+       if ((proptype == PROP_ENUM) && ELEM(type, MENU, ROW, LISTROW)) {
                /* MENU is handled a little differently here */
                EnumPropertyItem *item;
                int value;
@@ -4339,7 +4339,7 @@ void uiButGetStrInfo(bContext *C, uiBut *but, ...)
                        }
                        tmp = BLI_strdup(_tmp);
                }
-               else if (ELEM3(type, BUT_GET_RNAENUM_IDENTIFIER, BUT_GET_RNAENUM_LABEL, BUT_GET_RNAENUM_TIP)) {
+               else if (ELEM(type, BUT_GET_RNAENUM_IDENTIFIER, BUT_GET_RNAENUM_LABEL, BUT_GET_RNAENUM_TIP)) {
                        PointerRNA *ptr = NULL;
                        PropertyRNA *prop = NULL;
                        int value = 0;
index f821aab8c4de6ed860f84126d0885b6e42624002..15b8494cb342ea26934dd488b5443d465a022702 100644 (file)
@@ -695,11 +695,11 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
                }
 
                /* RGB / YCC (3 channels) */
-               else if (ELEM4(scopes->wavefrm_mode,
-                              SCOPES_WAVEFRM_RGB,
-                              SCOPES_WAVEFRM_YCC_601,
-                              SCOPES_WAVEFRM_YCC_709,
-                              SCOPES_WAVEFRM_YCC_JPEG))
+               else if (ELEM(scopes->wavefrm_mode,
+                             SCOPES_WAVEFRM_RGB,
+                             SCOPES_WAVEFRM_YCC_601,
+                             SCOPES_WAVEFRM_YCC_709,
+                             SCOPES_WAVEFRM_YCC_JPEG))
                {
                        int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
                        
index d37660a0611c8f2f010d8889943f4232ba52a812..7dfb17b3111393a4dfc50e6a1d53160e8c34fb02 100644 (file)
@@ -385,7 +385,7 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
 
 static bool ui_but_editable(uiBut *but)
 {
-       return ELEM6(but->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX, PROGRESSBAR);
+       return ELEM(but->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX, PROGRESSBAR);
 }
 
 static uiBut *ui_but_prev(uiBut *but)
@@ -433,7 +433,7 @@ static uiBut *ui_but_last(uiBlock *block)
 static bool ui_is_a_warp_but(uiBut *but)
 {
        if (U.uiflag & USER_CONTINUOUS_MOUSE) {
-               if (ELEM6(but->type, NUM, NUMSLI, HSVCIRCLE, TRACKPREVIEW, HSVCUBE, BUT_CURVE)) {
+               if (ELEM(but->type, NUM, NUMSLI, HSVCIRCLE, TRACKPREVIEW, HSVCUBE, BUT_CURVE)) {
                        return true;
                }
        }
@@ -463,7 +463,7 @@ bool ui_is_but_utf8(const uiBut *but)
 {
        if (but->rnaprop) {
                const int subtype = RNA_property_subtype(but->rnaprop);
-               return !(ELEM4(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME, PROP_BYTESTRING));
+               return !(ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME, PROP_BYTESTRING));
        }
        else {
                return !(but->flag & UI_BUT_NO_UTF8);
@@ -717,7 +717,7 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
                if (value == 0.0) push = 1;
                else push = 0;
                
-               if (ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) push = !push;
+               if (ELEM(but->type, TOGN, ICONTOGN, OPTIONN)) push = !push;
                ui_set_but_val(but, (double)push);
                if (but->type == ICONTOG || but->type == ICONTOGN) ui_check_but(but);
        }
@@ -1655,7 +1655,7 @@ static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleB
        for (wmd = drags->first; wmd; wmd = wmd->next) {
                if (wmd->type == WM_DRAG_ID) {
                        /* align these types with UI_but_active_drop_name */
-                       if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+                       if (ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                                ID *id = (ID *)wmd->poin;
                                
                                button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
@@ -1802,7 +1802,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
        }
 
        /* text/string and ID data */
-       else if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       else if (ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                uiHandleButtonData *active_data = but->active;
 
                if (but->poin == NULL && but->rnapoin.data == NULL) {
@@ -2009,7 +2009,7 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, con
 
        BLI_strncpy(origstr, but->editstr, data->maxlen);
 
-       if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                if (but->flag & UI_HAS_ICON) {
                        startx += UI_DPI_ICON_SIZE / aspect;
                }
@@ -2461,11 +2461,11 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
        uiBut *but;
 
        /* label and roundbox can overlap real buttons (backdrops...) */
-       if (ELEM5(actbut->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX))
+       if (ELEM(actbut->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX))
                return;
 
        for (but = actbut->next; but; but = but->next) {
-               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2474,7 +2474,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
                }
        }
        for (but = block->buttons.first; but != actbut; but = but->next) {
-               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2489,11 +2489,11 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
        uiBut *but;
 
        /* label and roundbox can overlap real buttons (backdrops...) */
-       if (ELEM5(actbut->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX))
+       if (ELEM(actbut->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX))
                return;
 
        for (but = actbut->prev; but; but = but->prev) {
-               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2502,7 +2502,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
                }
        }
        for (but = block->buttons.last; but != actbut; but = but->prev) {
-               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2803,7 +2803,7 @@ static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
                data->coba = (ColorBand *)but->poin;
                but->editcoba = data->coba;
        }
-       else if (ELEM4(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE, COLOR)) {
+       else if (ELEM(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE, COLOR)) {
                ui_get_but_vectorf(but, data->origvec);
                copy_v3_v3(data->vec, data->origvec);
                but->editvec = data->vec;
@@ -2990,7 +2990,7 @@ static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, cons
 static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        but->drawstr[0] = 0;
                        but->modifier_key = 0;
                        button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
@@ -3053,7 +3053,7 @@ static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data
 static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
                        return WM_UI_HANDLER_BREAK;
                }
@@ -3078,7 +3078,7 @@ static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, c
 static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM4(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        if (ELEM(event->type, PADENTER, RETKEY) && (!ui_is_but_utf8(but))) {
                                /* pass - allow filesel, enter to execute */
                        }
@@ -3106,7 +3106,7 @@ static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        /* unlink icon is on right */
-       if (ELEM4(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS &&
+       if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS &&
            ui_is_but_search_unlink_visible(but))
        {
                ARegion *ar = data->region;
@@ -3156,7 +3156,7 @@ static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, cons
        }
 #endif
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
 #if 0          /* UNUSED */
                        data->togdual = event->ctrl;
                        data->togonly = !event->shift;
@@ -3194,7 +3194,7 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con
                }
 #endif
 
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        int ret = WM_UI_HANDLER_BREAK;
                        /* XXX (a bit ugly) Special case handling for filebrowser drag button */
                        if (but->dragpoin && but->imb && ui_but_mouse_inside_icon(but, data->region, event)) {
@@ -3243,7 +3243,7 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa
 
                        if (bUnit_IsValid(unit->system, unit_type)) {
                                fac = (float)bUnit_BaseScalar(unit->system, unit_type);
-                               if (ELEM3(unit_type, B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME)) {
+                               if (ELEM(unit_type, B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME)) {
                                        fac /= unit->scale_length;
                                }
                        }
@@ -3478,7 +3478,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
                        click = 1;
                }
                else if (event->val == KM_PRESS) {
-                       if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
+                       if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
                                button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
                                retval = WM_UI_HANDLER_BREAK;
                        }
@@ -3767,7 +3767,7 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
                        click = 2;
                }
                else if (event->val == KM_PRESS) {
-                       if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
+                       if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
                                button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
                                retval = WM_UI_HANDLER_BREAK;
                        }
@@ -4024,7 +4024,7 @@ static int ui_do_but_LISTROW(bContext *C, uiBut *but, uiHandleButtonData *data,
                /* hack to pass on ctrl+click and double click to overlapping text
                 * editing field for editing list item names
                 */
-               if ((ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS && event->ctrl) ||
+               if ((ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS && event->ctrl) ||
                    (event->type == LEFTMOUSE && event->val == KM_DBL_CLICK))
                {
                        uiBut *labelbut = ui_but_list_row_text_activate(C, but, data, event, BUTTON_ACTIVATE_TEXT_EDITING);
@@ -4061,7 +4061,7 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, co
                }
 #endif
                /* regular open menu */
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
                        return WM_UI_HANDLER_BREAK;
                }
@@ -4206,11 +4206,11 @@ static bool ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data,
 static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+               if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
                        return WM_UI_HANDLER_BREAK;
                }
-               else if (ELEM3(event->type, MOUSEPAN, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
+               else if (ELEM(event->type, MOUSEPAN, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
                        float *hsv = ui_block_hsv_get(but->block);
                        float col[3];
 
@@ -4412,7 +4412,7 @@ static bool ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data,
        }
 
        if (snap != SNAP_OFF) {
-               if (ELEM3((int)but->a1, UI_GRAD_HV, UI_GRAD_HS, UI_GRAD_H)) {
+               if (ELEM((int)but->a1, UI_GRAD_HV, UI_GRAD_HS, UI_GRAD_H)) {
                        ui_color_snap_hue(snap, &hsv[0]);
                }
        }
@@ -4489,7 +4489,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data,
        }
 
        if (snap != SNAP_OFF) {
-               if (ELEM3((int)but->a1, UI_GRAD_HV, UI_GRAD_HS, UI_GRAD_H)) {
+               if (ELEM((int)but->a1, UI_GRAD_HV, UI_GRAD_HS, UI_GRAD_H)) {
                        ui_color_snap_hue(snap, &hsv[0]);
                }
        }
@@ -6012,7 +6012,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                }
                /* handle drivers */
                else if ((event->type == DKEY) &&
-                        !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) &&
+                        !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) &&
                         (event->val == KM_PRESS))
                {
                        if (event->alt)
@@ -6026,7 +6026,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                }
                /* handle keyingsets */
                else if ((event->type == KKEY) &&
-                        !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) &&
+                        !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) &&
                         (event->val == KM_PRESS))
                {
                        if (event->alt)
@@ -6298,7 +6298,7 @@ bool UI_but_active_drop_name(bContext *C)
        uiBut *but = ui_but_find_activated(ar);
 
        if (but) {
-               if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK))
+               if (ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK))
                        return 1;
        }
        
@@ -6378,7 +6378,7 @@ static bool ui_is_but_interactive(const uiBut *but, const bool labeledit)
        /* note, LABEL is included for highlights, this allows drags */
        if ((but->type == LABEL) && but->dragpoin == NULL)
                return false;
-       if (ELEM4(but->type, ROUNDBOX, SEPR, SEPRLINE, LISTBOX))
+       if (ELEM(but->type, ROUNDBOX, SEPR, SEPRLINE, LISTBOX))
                return false;
        if (but->flag & UI_HIDDEN)
                return false;
@@ -6471,9 +6471,13 @@ static uiBut *ui_list_find_mouse_over(ARegion *ar, int x, int y)
 
 static bool button_modal_state(uiHandleButtonState state)
 {
-       return ELEM6(state, BUTTON_STATE_WAIT_RELEASE, BUTTON_STATE_WAIT_KEY_EVENT,
-                    BUTTON_STATE_NUM_EDITING, BUTTON_STATE_TEXT_EDITING,
-                    BUTTON_STATE_TEXT_SELECTING, BUTTON_STATE_MENU_OPEN);
+       return ELEM(state,
+                   BUTTON_STATE_WAIT_RELEASE,
+                   BUTTON_STATE_WAIT_KEY_EVENT,
+                   BUTTON_STATE_NUM_EDITING,
+                   BUTTON_STATE_TEXT_EDITING,
+                   BUTTON_STATE_TEXT_SELECTING,
+                   BUTTON_STATE_MENU_OPEN);
 }
 
 static void button_timers_tooltip_remove(bContext *C, uiBut *but)
@@ -6664,7 +6668,7 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA
        copy_v2_fl(data->ungrab_mval, FLT_MAX);
 #endif
 
-       if (ELEM3(but->type, BUT_CURVE, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (ELEM(but->type, BUT_CURVE, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                /* XXX curve is temp */
        }
        else {
@@ -7968,7 +7972,7 @@ static int ui_handle_menu_event(
                                                for (but = block->buttons.first; but; but = but->next) {
                                                        bool doit = false;
                                                        
-                                                       if (!ELEM3(but->type, LABEL, SEPR, SEPRLINE))
+                                                       if (!ELEM(but->type, LABEL, SEPR, SEPRLINE))
                                                                count++;
                                                        
                                                        /* exception for rna layer buts */
@@ -8079,7 +8083,7 @@ static int ui_handle_menu_event(
                        if (inside == 0) {
                                uiSafetyRct *saferct = block->saferct.first;
 
-                               if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) &&
+                               if (ELEM(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) &&
                                    ELEM(event->val, KM_PRESS, KM_DBL_CLICK))
                                {
                                        if ((is_parent_menu == false) && (U.uiflag & USER_MENUOPENAUTO) == 0) {
index 789c10d66938c4ef8489ca586362c3c92a2458b2..ec956706fcc90cbd96849373b57026dc831c3f8b 100644 (file)
@@ -1181,7 +1181,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
        if (flag & UI_ITEM_R_ICON_ONLY) {
                /* pass */
        }
-       else if (ELEM4(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_POINTER)) {
+       else if (ELEM(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_POINTER)) {
                name = ui_item_name_add_colon(name, namestr);
        }
        else if (type == PROP_BOOLEAN && is_array && index == RNA_NO_INDEX) {
@@ -1559,7 +1559,7 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna
        }
        
        type = RNA_property_type(prop);
-       if (!ELEM3(type, PROP_POINTER, PROP_STRING, PROP_ENUM)) {
+       if (!ELEM(type, PROP_POINTER, PROP_STRING, PROP_ENUM)) {
                RNA_warning("Property %s must be a pointer, string or enum", propname);
                return;
        }
index 2ccb3740777ce5b72563bb8a152a2a361ad1b716..95fb94b2066c06791a901f563df0a7fdc76ed669 100644 (file)
@@ -120,7 +120,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar)
                return BUT_VERTICAL;
        else if (sa->spacetype == SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW)
                return BUT_VERTICAL;
-       else if (ELEM3(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS))
+       else if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS))
                return BUT_VERTICAL;
        
        return 0;
@@ -1131,7 +1131,7 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
                button = 1;
        else if (event == AKEY)
                button = 1;
-       else if (ELEM3(event, 0, RETKEY, LEFTMOUSE) && shift) {
+       else if (ELEM(event, 0, RETKEY, LEFTMOUSE) && shift) {
                block->panel->flag ^= PNL_PIN;
                button = 2;
        }
@@ -1716,7 +1716,7 @@ int ui_handler_panel_region(bContext *C, const wmEvent *event, ARegion *ar)
                
                /* XXX hardcoded key warning */
                if ((inside || inside_header) && event->val == KM_PRESS) {
-                       if (event->type == AKEY && !ELEM4(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift, event->alt)) {
+                       if (event->type == AKEY && !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift, event->alt)) {
                                
                                if (pa->flag & PNL_CLOSEDY) {
                                        if ((block->rect.ymax <= my) && (block->rect.ymax + PNL_HEADER >= my))
index c32f0de937e521cf6ca109bc87d41521a9a85bcc..85bf15e15cf8f3e03ba6ecd75604a6daa028c9dc 100644 (file)
@@ -392,7 +392,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
                data->totline++;
        }
 
-       if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (ELEM(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                /* better not show the value of a password */
                if ((but->rnaprop && (RNA_property_subtype(but->rnaprop) == PROP_PASSWORD)) == 0) {
                        /* full string */
index 1c5d3ecfd2e92bba37e6a54cb87332701f8a9cfa..33412b4df784fad56b1d5f5cd1d0cb2d93dfcf11 100644 (file)
@@ -489,7 +489,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
        
                if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
                
-               if (id->lib == NULL && !(ELEM5(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
+               if (id->lib == NULL && !(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
                        uiDefButR(block, TOG, 0, "F", 0, 0, UI_UNIT_X, UI_UNIT_Y, &idptr, "use_fake_user", -1, 0, 0, -1, -1, NULL);
                }
        }
@@ -808,7 +808,7 @@ static int modifier_can_delete(ModifierData *md)
 static int modifier_is_simulation(ModifierData *md)
 {
        /* Physic Tab */
-       if (ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke,
+       if (ELEM(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke,
                  eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint))
        {
                return 1;
@@ -906,9 +906,9 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
                                uiBlockSetEmboss(block, UI_EMBOSS);
                        }
                } /* tessellation point for curve-typed objects */
-               else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+               else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                        /* some modifiers could work with pre-tessellated curves only */
-                       if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
+                       if (ELEM(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
                                /* add disabled pre-tessellated button, so users could have
                                 * message for this modifiers */
                                but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0,
@@ -979,7 +979,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
                        uiBlockClearButLock(block);
                        uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE);
                        
-                       if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem,
+                       if (!ELEM(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem,
                                   eModifierType_Cloth, eModifierType_Smoke))
                        {
                                uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE,
@@ -1298,7 +1298,7 @@ void uiTemplatePreview(uiLayout *layout, bContext *C, ID *id, int show_buttons,
 
        char _preview_id[UI_MAX_NAME_STR];
 
-       if (id && !ELEM5(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA, ID_LS)) {
+       if (id && !ELEM(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA, ID_LS)) {
                RNA_warning("Expected ID of type material, texture, lamp, world or line style");
                return;
        }
index 744ed7e5b727f861925f233a2892b8a90a33bcc9..008ea84b607096744142602d8f2fd247d3d175c3 100644 (file)
@@ -151,7 +151,7 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr,
        const char *name;
        int tot = 0;
 
-       assert(ELEM3(label_align, '\0', 'H', 'V'));
+       assert(ELEM(label_align, '\0', 'H', 'V'));
 
        RNA_STRUCT_BEGIN (ptr, prop)
        {
index 6ea0a55729d9feca3823c0bbc13b7d1be4bde31a..e8f8f1541b74d65281e74252f73a9a61c2b80591 100644 (file)
@@ -848,7 +848,7 @@ static void widget_draw_icon(const uiBut *but, BIFIconID icon, float alpha, cons
        height = ICON_DEFAULT_HEIGHT / aspect;
 
        /* calculate blend color */
-       if (ELEM4(but->type, TOG, ROW, TOGN, LISTROW)) {
+       if (ELEM(but->type, TOG, ROW, TOGN, LISTROW)) {
                if (but->flag & UI_SELECT) {}
                else if (but->flag & UI_ACTIVE) {}
                else alpha = 0.5f;
index cc26d6079a94ffce71a2bbf2364b8d51b5ba9eed..553c1faa36a62d23d7e8c918ba8ea992c8da06d1 100644 (file)
@@ -65,7 +65,7 @@ static LinkNode *knifeproject_poly_from_object(ARegion *ar, Scene *scene, Object
                dm = ob->derivedFinal ? ob->derivedFinal : mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
                dm_needsFree = false;
        }
-       else if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
+       else if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
                dm = CDDM_from_curve(ob);
                dm_needsFree = true;
        }
index 55ad303d0e15c81ffb7688e8c29a622adb7708be..233de9cbf8d2a241faa07e09862a1e7baaddeec3 100644 (file)
@@ -2424,7 +2424,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
        float (*screen_vert_coords)[2], (*sco)[2], (*mouse_path)[2];
        
        /* edit-object needed for matrix, and ar->regiondata for projections to work */
-       if (ELEM3(NULL, obedit, ar, ar->regiondata))
+       if (ELEM(NULL, obedit, ar, ar->regiondata))
                return OPERATOR_CANCELLED;
        
        if (bm->totvertsel < 2) {
index 99dd8b75609dc396c34268ed5cc114726e34fbbd..34b4ca2c0f1661c6da080da257c1ef6936266a05 100644 (file)
@@ -1470,7 +1470,7 @@ static void convert_ensure_curve_cache(Main *bmain, Scene *scene, Object *ob)
                /* Force creation. This is normally not needed but on operator
                 * redo we might end up with an object which isn't evaluated yet.
                 */
-               if (ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
+               if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
                        BKE_displist_make_curveTypes(scene, ob, false);
                }
                else if (ob->type == OB_MBALL) {
@@ -2274,7 +2274,7 @@ static int join_poll(bContext *C)
 
        if (!ob || ob->id.lib) return 0;
 
-       if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_ARMATURE))
+       if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_ARMATURE))
                return ED_operator_screenactive(C);
        else
                return 0;
index 94574e81b81a31939e7c31e60a32370e012e0965..2402ecb498dbc9e5289986802442db94fe48a012 100644 (file)
@@ -770,7 +770,7 @@ static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const
 
 static bool is_multires_bake(Scene *scene)
 {
-       if (ELEM4(scene->r.bake_mode, RE_BAKE_NORMALS, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_AO))
+       if (ELEM(scene->r.bake_mode, RE_BAKE_NORMALS, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_AO))
                return scene->r.bake_flag & R_BAKE_MULTIRES;
 
        return 0;
index f57ab220471db055d4491646e1cf3c21def03b99..f26425943bd765024c4bc11b3dd4c16c08be5783 100644 (file)
@@ -335,14 +335,14 @@ static bool write_external_bake_pixels(
 
 static bool is_noncolor_pass(ScenePassType pass_type)
 {
-       return ELEM7(pass_type,
-                    SCE_PASS_Z,
-                    SCE_PASS_NORMAL,
-                    SCE_PASS_VECTOR,
-                    SCE_PASS_INDEXOB,
-                    SCE_PASS_UV,
-                    SCE_PASS_RAYHITS,
-                    SCE_PASS_INDEXMA);
+       return ELEM(pass_type,
+                   SCE_PASS_Z,
+                   SCE_PASS_NORMAL,
+                   SCE_PASS_VECTOR,
+                   SCE_PASS_INDEXOB,
+                   SCE_PASS_UV,
+                   SCE_PASS_RAYHITS,
+                   SCE_PASS_INDEXMA);
 }
 
 /* if all is good tag image and return true */
@@ -429,7 +429,7 @@ static bool bake_objects_check(Main *bmain, Object *ob, ListBase *selected_objec
                        if (ob_iter == ob)
                                continue;
 
-                       if (ELEM5(ob_iter->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL) == false) {
+                       if (ELEM(ob_iter->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL) == false) {
                                BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not a mesh or can't be converted to a mesh (Curve, Text, Surface or Metaball)", ob_iter->id.name + 2);
                                return false;
                        }
index 85e4bbce8dcb91eac57c7663f8031dcce488eaa0..92ed84b7f5e98e247358dbe43f5bcafc1dfdb362 100644 (file)
@@ -485,7 +485,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                        }
                                        
                                        /* target checks for specific constraints */
-                                       if (ELEM3(curcon->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK)) {
+                                       if (ELEM(curcon->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK)) {
                                                if (ct->tar) {
                                                        if (ct->tar->type != OB_CURVE) {
                                                                ct->tar = NULL;
index aba792413af089036c5a440d0d5d81cd7020d990..d416bfffc88ef6209902c2065fae2d3d11fb3163 100644 (file)
@@ -447,7 +447,7 @@ void ED_object_editmode_enter(bContext *C, int flag)
                base = scene->basact;
        }
 
-       if (ELEM3(NULL, base, base->object, base->object->data)) return;
+       if (ELEM(NULL, base, base->object, base->object->data)) return;
 
        ob = base->object;
 
@@ -589,7 +589,7 @@ static int editmode_toggle_poll(bContext *C)
        if ((ob->restrictflag & OB_RESTRICT_VIEW) && !(ob->mode & OB_MODE_EDIT))
                return 0;
 
-       return (ELEM7(ob->type, OB_MESH, OB_ARMATURE, OB_FONT, OB_MBALL, OB_LATTICE, OB_SURF, OB_CURVE));
+       return (ELEM(ob->type, OB_MESH, OB_ARMATURE, OB_FONT, OB_MBALL, OB_LATTICE, OB_SURF, OB_CURVE));
 }
 
 void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
@@ -760,7 +760,7 @@ static void copy_texture_space(Object *to, Object *ob)
                texflag = ((Mesh *)ob->data)->texflag;
                poin2 = ((Mesh *)ob->data)->loc;
        }
-       else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+       else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                texflag = ((Curve *)ob->data)->texflag;
                poin2 = ((Curve *)ob->data)->loc;
        }
@@ -775,7 +775,7 @@ static void copy_texture_space(Object *to, Object *ob)
                ((Mesh *)to->data)->texflag = texflag;
                poin1 = ((Mesh *)to->data)->loc;
        }
-       else if (ELEM3(to->type, OB_CURVE, OB_SURF, OB_FONT)) {
+       else if (ELEM(to->type, OB_CURVE, OB_SURF, OB_FONT)) {
                ((Curve *)to->data)->texflag = texflag;
                poin1 = ((Curve *)to->data)->loc;
        }
@@ -1112,7 +1112,7 @@ void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object)
        /* add/remove modifier as needed */
        if (!md) {
                if (pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield, PFIELD_GUIDE, PFIELD_TEXTURE) == 0)
-                       if (ELEM4(object->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
+                       if (ELEM(object->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
                                ED_object_modifier_add(NULL, bmain, scene, object, NULL, eModifierType_Surface);
        }
        else {
@@ -1453,7 +1453,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, View3D *v3d)
                                                                        BKE_mesh_texspace_get(ob->data, NULL, NULL, size);
                                                                        space = size[0] / size[1];
                                                                }
-                                                               else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
+                                                               else if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
                                                                        float size[3];
                                                                        BKE_curve_texspace_get(ob->data, NULL, NULL, size);
                                                                        space = size[0] / size[1];
@@ -1500,7 +1500,7 @@ static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(
                        if ((input->value == OB_MODE_EDIT && OB_TYPE_SUPPORT_EDITMODE(ob->type)) ||
                            (input->value == OB_MODE_POSE && (ob->type == OB_ARMATURE)) ||
                            (input->value == OB_MODE_PARTICLE_EDIT && use_mode_particle_edit) ||
-                           (ELEM4(input->value, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT,
+                           (ELEM(input->value, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT,
                                   OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT) && (ob->type == OB_MESH)) ||
                            (input->value == OB_MODE_OBJECT))
                        {
index 1249beb4517a708585c7748ab9f2fa60e3263c2d..b05840b5823c7ec8f224ea29924438d074698ebb 100644 (file)
@@ -98,7 +98,7 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
        ModifierTypeInfo *mti = modifierType_getInfo(type);
        
        /* only geometry objects should be able to get modifiers [#25291] */
-       if (!ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
+       if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
                BKE_reportf(reports, RPT_WARNING, "Modifiers cannot be added to object '%s'", ob->id.name + 2);
                return NULL;
        }
@@ -1876,7 +1876,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
                else if (ob->type == OB_MBALL) {
                        BKE_displist_make_mball(CTX_data_main(C)->eval_ctx, scene, ob);
                }
-               else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+               else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                        BKE_displist_make_curveTypes(scene, ob, 0);
                }
 
index 3059d84a085617005f22f93344d57d1d92a52e64..f6d1df4e8d4c6654c0eb5ccd6ad00a48e99f4e7b 100644 (file)
@@ -444,7 +444,7 @@ EnumPropertyItem prop_clear_parent_types[] = {
 /* Helper for ED_object_parent_clear() - Remove deform-modifiers associated with parent */
 static void object_remove_parent_deform_modifiers(Object *ob, const Object *par)
 {
-       if (ELEM3(par->type, OB_ARMATURE, OB_LATTICE, OB_CURVE)) {
+       if (ELEM(par->type, OB_ARMATURE, OB_LATTICE, OB_CURVE)) {
                ModifierData *md, *mdn;
                
                /* assume that we only need to remove the first instance of matching deform modifier here */
@@ -593,7 +593,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                          int partype, bool xmirror, bool keep_transform, const int vert_par[3])
 {
        bPoseChannel *pchan = NULL;
-       int pararm = ELEM4(partype, PAR_ARMATURE, PAR_ARMATURE_NAME, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO);
+       int pararm = ELEM(partype, PAR_ARMATURE, PAR_ARMATURE_NAME, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO);
        
        DAG_id_tag_update(&par->id, OB_RECALC_OB);
        
@@ -678,7 +678,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                                 *   assuming that the parent is selected too...
                                 */
                                // XXX currently this should only happen for meshes, curves, surfaces, and lattices - this stuff isn't available for metas yet
-                               if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
+                               if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
                                        ModifierData *md;
                                        
                                        switch (partype) {
@@ -1128,7 +1128,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
                /* also remove all tracking constraints */
                for (con = ob->constraints.last; con; con = pcon) {
                        pcon = con->prev;
-                       if (ELEM3(con->type, CONSTRAINT_TYPE_TRACKTO, CONSTRAINT_TYPE_LOCKTRACK, CONSTRAINT_TYPE_DAMPTRACK))
+                       if (ELEM(con->type, CONSTRAINT_TYPE_TRACKTO, CONSTRAINT_TYPE_LOCKTRACK, CONSTRAINT_TYPE_DAMPTRACK))
                                BKE_constraint_remove(&ob->constraints, con);
                }
                
@@ -1192,7 +1192,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
                                DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
                                
                                /* Lamp, Camera and Speaker track differently by default */
-                               if (ELEM3(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
+                               if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
                                        data->trackflag = TRACK_nZ;
                                }
                        }
@@ -1213,7 +1213,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
                                DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
                                
                                /* Lamp, Camera and Speaker track differently by default */
-                               if (ELEM3(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
+                               if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
                                        data->reserved1 = TRACK_nZ;
                                        data->reserved2 = UP_Y;
                                }
@@ -1235,7 +1235,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
                                DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
                                
                                /* Lamp, Camera and Speaker track differently by default */
-                               if (ELEM3(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
+                               if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
                                        data->trackflag = TRACK_nZ;
                                        data->lockflag = LOCK_Y;
                                }
index 6e59f9f4aeae032e9b986dc3661b153f4f2a4334..4e61910f665fb49618480a6d35d232d66bc81875 100644 (file)
@@ -385,7 +385,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, bool apply_l
        /* first check if we can execute */
        CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
        {
-               if (ELEM6(ob->type, OB_MESH, OB_ARMATURE, OB_LATTICE, OB_MBALL, OB_CURVE, OB_SURF)) {
+               if (ELEM(ob->type, OB_MESH, OB_ARMATURE, OB_LATTICE, OB_MBALL, OB_CURVE, OB_SURF)) {
                        ID *obdata = ob->data;
                        if (ID_REAL_USERS(obdata) > 1) {
                                BKE_reportf(reports, RPT_ERROR,
index d1375b1b8ab434e037d9db24634b2dc67bf85d1e..11e7174ea98105474d9b9e8074ae5bb8ecc79521 100644 (file)
@@ -931,11 +931,11 @@ static bool region_is_overlap(wmWindow *win, ScrArea *sa, ARegion *ar)
        if (U.uiflag2 & USER_REGION_OVERLAP) {
                if (WM_is_draw_triple(win)) {
                        if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ)) {
-                               if (ELEM3(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS))
+                               if (ELEM(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS))
                                        return 1;
                        }
                        else if (sa->spacetype == SPACE_IMAGE) {
-                               if (ELEM4(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS, RGN_TYPE_PREVIEW))
+                               if (ELEM(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS, RGN_TYPE_PREVIEW))
                                        return 1;
                        }
                }
index 2ddda19fb28e18c7aab0a042e8fee22998060421..3cdf22229346361748f8467296b998b264fda742 100644 (file)
@@ -201,7 +201,7 @@ int ED_operator_animview_active(bContext *C)
 {
        if (ED_operator_areaactive(C)) {
                SpaceLink *sl = (SpaceLink *)CTX_wm_space_data(C);
-               if (sl && (ELEM5(sl->spacetype, SPACE_SEQ, SPACE_ACTION, SPACE_NLA, SPACE_IPO, SPACE_TIME)))
+               if (sl && (ELEM(sl->spacetype, SPACE_SEQ, SPACE_ACTION, SPACE_NLA, SPACE_IPO, SPACE_TIME)))
                        return true;
        }
 
index b1e4696cd0245a8fd298c717cf252789100fe6ac..b5b0ddd6f701244a3b77c9723328220af47927ee 100644 (file)
@@ -756,7 +756,7 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush,
                                      ViewContext *vc, int x, int y, float zoom, PaintMode mode)
 {
        /* color means that primary brush texture is colured and secondary is used for alpha/mask control */
-       bool col = ELEM3(mode, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D, PAINT_VERTEX) ? true : false;
+       bool col = ELEM(mode, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D, PAINT_VERTEX) ? true : false;
        OverlayControlFlags flags = BKE_paint_get_overlay_flags();
        /* save lots of GL state
         * TODO: check on whether all of these are needed? */
@@ -880,7 +880,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
                 * invert key modifier without starting a stroke */
                if ((!(brush->flag & BRUSH_INVERTED) ^
                     !(brush->flag & BRUSH_DIR_IN)) &&
-                   ELEM5(brush->sculpt_tool, SCULPT_TOOL_DRAW,
+                   ELEM(brush->sculpt_tool, SCULPT_TOOL_DRAW,
                          SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
                          SCULPT_TOOL_PINCH, SCULPT_TOOL_CREASE))
                {
index 4f67fc9cc8778d63d4fb7b51172b32306d60c374..85889fe4cb95faaa8accf5c9e2e68d98e9e4466f 100644 (file)
@@ -1005,7 +1005,7 @@ static int paint_2d_canvas_set(ImagePaintState *s, Image *ima)
        /* set masking */
        s->do_masking = (s->brush->flag & BRUSH_AIRBRUSH ||
                         (s->brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
-                        (s->brush->mtex.tex && !ELEM3(s->brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)))
+                        (s->brush->mtex.tex && !ELEM(s->brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)))
                         ? false : true;
        
        return 1;
index 399b5044a0574fa192d361b9ef898bac96726db3..0154960cf40d8732863c95339e8daec6221ffa95 100644 (file)
@@ -4164,7 +4164,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
                /* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */
                ps->do_masking = (brush->flag & BRUSH_AIRBRUSH ||
                                  (brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
-                                 (brush->mtex.tex && !ELEM3(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)))
+                                 (brush->mtex.tex && !ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)))
                                 ? false : true;
                ps->is_texbrush = (brush->mtex.tex && brush->imagepaint_tool == PAINT_TOOL_DRAW) ? true : false;
                ps->is_maskbrush = false;
index 5133f51a6fd21a7650e080b142cb8ff8a87cfd44..dca6dfbcea4dc4e53edd8f06aedb087b3f614a81 100644 (file)
@@ -139,8 +139,8 @@ static bool paint_tool_require_location(Brush *brush, PaintMode mode)
 {
        switch (mode) {
                case PAINT_SCULPT:
-                       if (ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
-                                                     SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB))
+                       if (ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+                                                    SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB))
                        {
                                return false;
                        }
@@ -566,7 +566,7 @@ bool paint_space_stroke_enabled(Brush *br, PaintMode mode)
 
 static bool sculpt_is_grab_tool(Brush *br)
 {
-       return ELEM4(br->sculpt_tool,
+       return ELEM(br->sculpt_tool,
                     SCULPT_TOOL_GRAB,
                     SCULPT_TOOL_THUMB,
                     SCULPT_TOOL_ROTATE,
@@ -613,7 +613,7 @@ bool paint_supports_smooth_stroke(Brush *br, PaintMode mode)
 bool paint_supports_texture(PaintMode mode)
 {
        /* ommit: PAINT_WEIGHT, PAINT_SCULPT_UV, PAINT_INVALID */
-       return ELEM4(mode, PAINT_SCULPT, PAINT_VERTEX, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D);
+       return ELEM(mode, PAINT_SCULPT, PAINT_VERTEX, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D);
 }
 
 /* return true if the brush size can change during paint (normally used for pressure) */
index 12223effcf582e9c969e41713884a99deaa2b0b0..4f9a8182ae9889f5be10c1962d8569b8c283b072 100644 (file)
@@ -359,19 +359,19 @@ static int sculpt_stroke_dynamic_topology(const SculptSession *ss,
                !(brush->flag & BRUSH_ANCHORED) &&
                !(brush->flag & BRUSH_DRAG_DOT) &&
         
-               (!ELEM6(brush->sculpt_tool,
-                       /* These brushes, as currently coded, cannot
-                        * support dynamic topology */
-                       SCULPT_TOOL_GRAB,
-                       SCULPT_TOOL_ROTATE,
-                       SCULPT_TOOL_THUMB,
-                       SCULPT_TOOL_LAYER,
+               (!ELEM(brush->sculpt_tool,
+                      /* These brushes, as currently coded, cannot
+                       * support dynamic topology */
+                      SCULPT_TOOL_GRAB,
+                      SCULPT_TOOL_ROTATE,
+                      SCULPT_TOOL_THUMB,
+                      SCULPT_TOOL_LAYER,
 
-                       /* These brushes could handle dynamic topology,
-                        * but user feedback indicates it's better not
-                        * to */
-                       SCULPT_TOOL_SMOOTH,
-                       SCULPT_TOOL_MASK)));
+                      /* These brushes could handle dynamic topology,
+                       * but user feedback indicates it's better not
+                       * to */
+                      SCULPT_TOOL_SMOOTH,
+                      SCULPT_TOOL_MASK)));
 }
 
 /*** paint mesh ***/
@@ -1236,14 +1236,14 @@ static int brush_needs_sculpt_normal(const Brush *brush)
                      SCULPT_TOOL_SNAKE_HOOK) &&
                 (brush->normal_weight > 0)) ||
 
-               ELEM7(brush->sculpt_tool,
-                     SCULPT_TOOL_BLOB,
-                     SCULPT_TOOL_CREASE,
-                     SCULPT_TOOL_DRAW,
-                     SCULPT_TOOL_LAYER,
-                     SCULPT_TOOL_NUDGE,
-                     SCULPT_TOOL_ROTATE,
-                     SCULPT_TOOL_THUMB) ||
+               ELEM(brush->sculpt_tool,
+                    SCULPT_TOOL_BLOB,
+                    SCULPT_TOOL_CREASE,
+                    SCULPT_TOOL_DRAW,
+                    SCULPT_TOOL_LAYER,
+                    SCULPT_TOOL_NUDGE,
+                    SCULPT_TOOL_ROTATE,
+                    SCULPT_TOOL_THUMB) ||
 
                (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA));
 }
@@ -3030,11 +3030,11 @@ static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush)
        radius = ss->cache->radius * 1.25f;
 
        data.radius_squared = radius * radius;
-       data.original = ELEM4(brush->sculpt_tool,
-                             SCULPT_TOOL_GRAB,
-                             SCULPT_TOOL_ROTATE,
-                             SCULPT_TOOL_THUMB,
-                             SCULPT_TOOL_LAYER) ? true : ss->cache->original;
+       data.original = ELEM(brush->sculpt_tool,
+                            SCULPT_TOOL_GRAB,
+                            SCULPT_TOOL_ROTATE,
+                            SCULPT_TOOL_THUMB,
+                            SCULPT_TOOL_LAYER) ? true : ss->cache->original;
 
        BKE_pbvh_search_gather(ss->pbvh, sculpt_search_sphere_cb, &data, &nodes, &totnode);
 
@@ -3092,11 +3092,11 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush)
        data.ss = ss;
        data.sd = sd;
        data.radius_squared = ss->cache->radius_squared;
-       data.original = ELEM4(brush->sculpt_tool,
-                             SCULPT_TOOL_GRAB,
-                             SCULPT_TOOL_ROTATE,
-                             SCULPT_TOOL_THUMB,
-                             SCULPT_TOOL_LAYER) ? true : ss->cache->original;
+       data.original = ELEM(brush->sculpt_tool,
+                            SCULPT_TOOL_GRAB,
+                            SCULPT_TOOL_ROTATE,
+                            SCULPT_TOOL_THUMB,
+                            SCULPT_TOOL_LAYER) ? true : ss->cache->original;
        BKE_pbvh_search_gather(ss->pbvh, sculpt_search_sphere_cb, &data, &nodes, &totnode);
 
        /* Only act if some verts are inside the brush area */
@@ -3233,8 +3233,8 @@ static void sculpt_combine_proxies(Sculpt *sd, Object *ob)
            ss->cache->supports_gravity)
        {
                /* these brushes start from original coordinates */
-               const bool use_orco = ELEM3(brush->sculpt_tool, SCULPT_TOOL_GRAB,
-                                           SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB);
+               const bool use_orco = ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB,
+                                          SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB);
 
 #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
                for (n = 0; n < totnode; n++) {
@@ -3780,7 +3780,7 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
        mul_m3_v3(mat, viewDir);
        normalize_v3_v3(cache->true_view_normal, viewDir);
 
-       cache->supports_gravity = (!ELEM3(brush->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SIMPLIFY) &&
+       cache->supports_gravity = (!ELEM(brush->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SIMPLIFY) &&
                                   (sd->gravity_factor > 0.0f));
        /* get gravity vector in world space */
        if (cache->supports_gravity) {
@@ -3838,10 +3838,10 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
                cache->original = 1;
        }
 
-       if (ELEM9(brush->sculpt_tool,
-                 SCULPT_TOOL_DRAW, SCULPT_TOOL_CREASE, SCULPT_TOOL_BLOB,
-                 SCULPT_TOOL_LAYER, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
-                 SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_ROTATE, SCULPT_TOOL_FLATTEN))
+       if (ELEM(brush->sculpt_tool,
+                SCULPT_TOOL_DRAW, SCULPT_TOOL_CREASE, SCULPT_TOOL_BLOB,
+                SCULPT_TOOL_LAYER, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
+                SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_ROTATE, SCULPT_TOOL_FLATTEN))
        {
                if (!(brush->flag & BRUSH_ACCUMULATE)) {
                        cache->original = 1;
@@ -3868,10 +3868,10 @@ static void sculpt_update_brush_delta(UnifiedPaintSettings *ups, Object *ob, Bru
        };
        int tool = brush->sculpt_tool;
 
-       if (ELEM5(tool,
-                 SCULPT_TOOL_GRAB, SCULPT_TOOL_NUDGE,
-                 SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_SNAKE_HOOK,
-                 SCULPT_TOOL_THUMB))
+       if (ELEM(tool,
+                SCULPT_TOOL_GRAB, SCULPT_TOOL_NUDGE,
+                SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_SNAKE_HOOK,
+                SCULPT_TOOL_THUMB))
        {
                float grab_location[3], imat[4][4], delta[3], loc[3];
 
@@ -4856,7 +4856,7 @@ static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, co
                bool modifiers = false;
 
                for (i = 0; i < CD_NUMTYPES; i++) {
-                       if (!ELEM7(i, CD_MVERT, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MPOLY, CD_PAINT_MASK, CD_ORIGINDEX) &&
+                       if (!ELEM(i, CD_MVERT, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MPOLY, CD_PAINT_MASK, CD_ORIGINDEX) &&
                            (CustomData_has_layer(&me->vdata, i) ||
                             CustomData_has_layer(&me->edata, i) ||
                             CustomData_has_layer(&me->fdata, i)))
index b2e5508557945f52c555b133e101e9750c31f4b3..335949e8495c7ea4629fface4d021708db52c4d3 100644 (file)
@@ -219,7 +219,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
                                if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
                                        sel = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
                                
-                               if (ELEM3(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
+                               if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
                                        switch (ale->type) {
                                                case ANIMTYPE_SUMMARY:
                                                {
index 8917704b73179e6c6868a0aca53120786aa3461d..524a42ba38864310d8aa0aa1d27b733d4b5c0600 100644 (file)
@@ -200,7 +200,7 @@ static int buttons_context_path_data(ButsContextPath *path, int type)
 
        /* if we already have a data, we're done */
        if (RNA_struct_is_a(ptr->type, &RNA_Mesh) && (type == -1 || type == OB_MESH)) return 1;
-       else if (RNA_struct_is_a(ptr->type, &RNA_Curve) && (type == -1 || ELEM3(type, OB_CURVE, OB_SURF, OB_FONT))) return 1;
+       else if (RNA_struct_is_a(ptr->type, &RNA_Curve) && (type == -1 || ELEM(type, OB_CURVE, OB_SURF, OB_FONT))) return 1;
        else if (RNA_struct_is_a(ptr->type, &RNA_Armature) && (type == -1 || type == OB_ARMATURE)) return 1;
        else if (RNA_struct_is_a(ptr->type, &RNA_MetaBall) && (type == -1 || type == OB_MBALL)) return 1;
        else if (RNA_struct_is_a(ptr->type, &RNA_Lattice) && (type == -1 || type == OB_LATTICE)) return 1;
@@ -230,7 +230,7 @@ static int buttons_context_path_modifier(ButsContextPath *path)
        if (buttons_context_path_object(path)) {
                ob = path->ptr[path->len - 1].data;
 
-               if (ob && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE))
+               if (ob && ELEM(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE))
                        return 1;
        }
 
@@ -638,7 +638,7 @@ static int buttons_shading_context(const bContext *C, int mainb)
 {
        Object *ob = CTX_data_active_object(C);
 
-       if (ELEM3(mainb, BCONTEXT_MATERIAL, BCONTEXT_WORLD, BCONTEXT_TEXTURE))
+       if (ELEM(mainb, BCONTEXT_MATERIAL, BCONTEXT_WORLD, BCONTEXT_TEXTURE))
                return 1;
        if (mainb == BCONTEXT_DATA && ob && ELEM(ob->type, OB_LAMP, OB_CAMERA))
                return 1;
@@ -1120,7 +1120,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
                        name = RNA_struct_name_get_alloc(ptr, namebuf, sizeof(namebuf), NULL);
 
                        if (name) {
-                               if (!ELEM3(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_RENDER_LAYER) && ptr->type == &RNA_Scene)
+                               if (!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_RENDER_LAYER) && ptr->type == &RNA_Scene)
                                        uiItemLDrag(row, ptr, "", icon);  /* save some space */
                                else
                                        uiItemLDrag(row, ptr, name, icon);
index 1c3bad9757d255352da6653450e734d4bdccbd28..8c6bf67c9a8ab4df540b697ecc525e7370d2dc46 100644 (file)
@@ -358,7 +358,7 @@ static void buttons_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *
                case NC_ANIMATION:
                        switch (wmn->data) {
                                case ND_KEYFRAME:
-                                       if (ELEM3(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED))
+                                       if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED))
                                                ED_area_tag_redraw(sa);
                                        break;
                        }
index d3be25050c83653bf392c42f86672d9eea1287ca..a6fbb0c399d0a3e0ae20ab7b214a8950f6837ab0 100644 (file)
@@ -846,7 +846,7 @@ static int clip_context(const bContext *C, const char *member, bContextDataResul
 static int clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
 {
        if (drag->type == WM_DRAG_PATH)
-               if (ELEM4(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
+               if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
                        return true;
 
        return false;
index 1f1aac8c45611cfa37b9f2ea16dec58a82e89716..c8298927f7d9eb4f9cba8ab2cd7b81d5f7a57606 100644 (file)
@@ -1707,7 +1707,7 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
                 */
                if (strstr(fcu->rna_path, "rotation_euler") == NULL)
                        continue;
-               else if (ELEM3(fcu->array_index, 0, 1, 2) == 0) {
+               else if (ELEM(fcu->array_index, 0, 1, 2) == 0) {
                        BKE_reportf(op->reports, RPT_WARNING,
                                    "Euler Rotation F-Curve has invalid index (ID='%s', Path='%s', Index=%d)",
                                    (ale->id) ? ale->id->name : TIP_("<No ID>"), fcu->rna_path, fcu->array_index);
@@ -1750,7 +1750,7 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
                
                /* sanity check: ensure that there are enough F-Curves to work on in this group */
                /* TODO: also enforce assumption that there be a full set of keyframes at each position by ensuring that totvert counts are same? */
-               if (ELEM3(NULL, euf->fcurves[0], euf->fcurves[1], euf->fcurves[2])) {
+               if (ELEM(NULL, euf->fcurves[0], euf->fcurves[1], euf->fcurves[2])) {
                        /* report which components are missing */
                        BKE_reportf(op->reports, RPT_WARNING,
                                    "Missing %s%s%s component(s) of euler rotation for ID='%s' and RNA-Path='%s'",
index 3675282654f7eaba4576b80b0bd51f685dd13b26..7e90008d8d28920f863e14258ccf3e3883f1644f 100644 (file)
@@ -843,14 +843,14 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man
        uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, IFACE_("Color"), ICON_NONE);
 
        /* only display depth setting if multiple depths can be used */
-       if ((ELEM7(depth_ok,
-                  R_IMF_CHAN_DEPTH_1,
-                  R_IMF_CHAN_DEPTH_8,
-                  R_IMF_CHAN_DEPTH_10,
-                  R_IMF_CHAN_DEPTH_12,
-                  R_IMF_CHAN_DEPTH_16,
-                  R_IMF_CHAN_DEPTH_24,
-                  R_IMF_CHAN_DEPTH_32)) == 0)
+       if ((ELEM(depth_ok,
+                 R_IMF_CHAN_DEPTH_1,
+                 R_IMF_CHAN_DEPTH_8,
+                 R_IMF_CHAN_DEPTH_10,
+                 R_IMF_CHAN_DEPTH_12,
+                 R_IMF_CHAN_DEPTH_16,
+                 R_IMF_CHAN_DEPTH_24,
+                 R_IMF_CHAN_DEPTH_32)) == 0)
        {
                row = uiLayoutRow(col, false);
 
index 4ae05d8f64f6c1f1759278c177a60ac6e1c338d7..69c141c2bbb2eeb7b8fc5bf097e2ebe7c9999f9a 100644 (file)
@@ -1383,7 +1383,7 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
                /* sanitize all settings */
 
                /* unlikely but just in case */
-               if (ELEM3(simopts->im_format.planes, R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA) == 0) {
+               if (ELEM(simopts->im_format.planes, R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA) == 0) {
                        simopts->im_format.planes = R_IMF_PLANES_RGBA;
                }
 
index 0fb93ad27ee723750efcb84510a076a12e635d08..03517f5e4d98c14189959a602461d9bd8bb256f2 100644 (file)
@@ -349,7 +349,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
 static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
 {
        if (drag->type == WM_DRAG_PATH)
-               if (ELEM3(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
+               if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
                        return 1;
        return 0;
 }
index 9f3fc53482a3e2962d648b716b254a1f9cd90bcc..dd1520227626f58837adb595a10c92cd018f906b 100644 (file)
@@ -1832,7 +1832,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
                        uiItemR(row, ptr, "offset_rotation", 0, NULL, ICON_NONE);
                        uiItemR(split, ptr, "use_local_rotation", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
                        
-                       if (ELEM3(physics_type, OB_BODY_TYPE_DYNAMIC, OB_BODY_TYPE_RIGID, OB_BODY_TYPE_SOFT)) {
+                       if (ELEM(physics_type, OB_BODY_TYPE_DYNAMIC, OB_BODY_TYPE_RIGID, OB_BODY_TYPE_SOFT)) {
                                uiItemL(layout, IFACE_("Dynamic Object Settings:"), ICON_NONE);
                                split = uiLayoutSplit(layout, 0.9, false);
                                row = uiLayoutRow(split, false);
index 1c41ce9d86d87cc4ba796a34fcfb233327593789..8422df35063d35daf50a58308eb06d9d9150e50b 100644 (file)
@@ -640,10 +640,10 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node)
                /* tree specific activate calls */
                if (ntree->type == NTREE_SHADER) {
                        /* when we select a material, active texture is cleared, for buttons */
-                       if (node->id && ELEM3(GS(node->id->name), ID_MA, ID_LA, ID_WO))
+                       if (node->id && ELEM(GS(node->id->name), ID_MA, ID_LA, ID_WO))
                                nodeClearActiveID(ntree, ID_TE);
                        
-                       if (ELEM4(node->type, SH_NODE_OUTPUT, SH_NODE_OUTPUT_MATERIAL,
+                       if (ELEM(node->type, SH_NODE_OUTPUT, SH_NODE_OUTPUT_MATERIAL,
                                  SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LAMP))
                        {
                                bNode *tnode;
index 1f728b380d64f2b81a12a40efef8f8813ec973a0..7eb90953df48e387a622a176ff0ee12297cc64d3 100644 (file)
@@ -638,7 +638,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
                                
                                layflag++;  /* is lay_xor */
-                               if (ELEM8(passflag, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT,
+                               if (ELEM(passflag, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT,
                                          SCE_PASS_INDIRECT, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT))
                                {
                                        bt = uiDefIconButBitI(block, TOG, passflag, 0, (*layflag & passflag) ? ICON_DOT : ICON_BLANK1,
index 17e1e032bbf5bba155f5b0849ecaf59d9e5e4732..ef621407abdbb2111279a00ca92d40679ffd8e70 100644 (file)
@@ -215,15 +215,15 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot)
 static void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports)
 {
        /* can't rename rna datablocks entries or listbases */
-       if (ELEM4(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE)) {
+       if (ELEM(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE)) {
                /* do nothing */;
        }
-       else if (ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE,
-                       TSE_DRIVER_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
+       else if (ELEM(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE,
+                     TSE_DRIVER_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
        {
                BKE_report(reports, RPT_WARNING, "Cannot edit builtin name");
        }
-       else if (ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
+       else if (ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
                BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
        }
        else if (tselem->id->lib) {
@@ -1654,7 +1654,7 @@ static int outliner_parenting_poll(bContext *C)
        SpaceOops *soops = CTX_wm_space_outliner(C);
 
        if (soops) {
-               return ELEM4(soops->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_GROUPS);
+               return ELEM(soops->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_GROUPS);
        }
 
        return false;
index d7521edd57a3d3ab3d5a13f372a58f2a7469915d..6f5bf712d55dc5fb58ad48d0ef3f879091c10b7c 100644 (file)
@@ -948,7 +948,7 @@ static bool do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Sp
                                        
                                        WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
                                }
-                               else if (ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
+                               else if (ELEM(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
                                        WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL);
                                }
                                else {  // rest of types
index d1e9b3d34b7125bdc8614d3912ab3a83e4c4418a..d09ed1a100e2b16cb413fcad4cf2db22c3c070b4 100644 (file)
@@ -1339,7 +1339,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
                                else if (datalevel == TSE_DRIVER_BASE) {
                                        /* do nothing... no special ops needed yet */
                                }
-                               else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) {
+                               else if (ELEM(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) {
                                        /*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/
                                }
                                else {
index 520cd9a544d639622065d10eefc6e75c53471244..5801dd126e3de9fbdebdfff3972147ac864b397f 100644 (file)
@@ -821,7 +821,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
        TreeStoreElem *tselem;
        ID *id = idv;
        
-       if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+       if (ELEM(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
                id = ((PointerRNA *)idv)->id.data;
                if (!id) id = ((PointerRNA *)idv)->data;
        }
@@ -847,10 +847,10 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
        
        te->parent = parent;
        te->index = index;   // for data arays
-       if (ELEM3(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
+       if (ELEM(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
                /* pass */
        }
-       else if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+       else if (ELEM(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
                /* pass */
        }
        else if (type == TSE_ANIM_DATA) {
@@ -985,7 +985,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                te->directdata = seq;
                te->name = seq->strip->stripdata->name;
        }
-       else if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+       else if (ELEM(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
                PointerRNA pptr, propptr, *ptr = (PointerRNA *)idv;
                PropertyRNA *prop, *iterprop;
                PropertyType proptype;
@@ -1062,7 +1062,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                                else if (tot)
                                        te->flag |= TE_LAZY_CLOSED;
                        }
-                       else if (ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
+                       else if (ELEM(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
                                tot = RNA_property_array_length(ptr, prop);
 
                                if (TSELEM_OPEN(tselem, soops)) {
index 41c5b00b381d74f83713ea5308d14c45d6cc8f88..504d9628d981a502ba4b15c717622a38ebad239a 100644 (file)
@@ -143,7 +143,7 @@ static int outliner_parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *
 
        UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]);
 
-       if (!ELEM4(soops->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_GROUPS)) {
+       if (!ELEM(soops->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_GROUPS)) {
                return false;
        }
 
@@ -156,7 +156,7 @@ static int outliner_parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *
 
                                        switch (te->idcode) {
                                                case ID_SCE:
-                                                       return (ELEM3(tselem->type, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS));
+                                                       return (ELEM(tselem->type, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS));
                                                case ID_OB:
                                                        return (ELEM(tselem->type, TSE_MODIFIER_BASE, TSE_CONSTRAINT_BASE));
                                                /* Other codes to ignore? */
index 9826ef10902b75da981cdc9d42fbac15f21b2c72..8e49d5649f3d109341bf320a066fbb9ec07fba2b 100644 (file)
@@ -912,7 +912,7 @@ static EnumPropertyItem sequencer_prop_select_grouped_types[] = {
 
 #define SEQ_IS_EFFECT(_seq) ((_seq->type & SEQ_TYPE_EFFECT) != 0)
 
-#define SEQ_USE_DATA(_seq) (ELEM3(_seq->type, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK) || SEQ_HAS_PATH(_seq))
+#define SEQ_USE_DATA(_seq) (ELEM(_seq->type, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK) || SEQ_HAS_PATH(_seq))
 
 static bool select_grouped_type(Editing *ed, Sequence *actseq)
 {
@@ -1035,7 +1035,7 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq)
 
        SEQP_BEGIN (ed, seq)
        {
-               if (ELEM3(actseq, seq->seq1, seq->seq2, seq->seq3)) {
+               if (ELEM(actseq, seq->seq1, seq->seq2, seq->seq3)) {
                        effects[seq->type] = true;
                }
        }
index a94b73802b2a49ac8a713652dd204a99bd02df18..11f8ab1806d98c769dd83a451885e7ca928dd9a3 100644 (file)
@@ -396,7 +396,7 @@ static int movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
        int hand;
 
        if (drag->type == WM_DRAG_PATH)
-               if (ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
+               if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
                        if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
                                return 1;
        return 0;
index 6a98fd802f967a2eb19638ff2dd70083a86e03d4..6ca6b2af1fd4f0f70488a89d393f7a64d38475dc 100644 (file)
@@ -1460,7 +1460,7 @@ void text_scroll_to_cursor(SpaceText *st, ScrArea *sa)
        ARegion *ar = NULL;
        int i, x, winx = 0;
 
-       if (ELEM3(NULL, st, st->text, st->text->curl)) return;
+       if (ELEM(NULL, st, st->text, st->text->curl)) return;
 
        text = st->text;
 
index 245cdadc7a2c0314cd79ecbb69dfa37ccf211fe2..37ac7272cb10e31d79eb543262d03ce966f1bbf7 100644 (file)
@@ -93,7 +93,7 @@ static void set_pchan_colorset(Object *ob, bPoseChannel *pchan)
        short color_index = 0;
        
        /* sanity check */
-       if (ELEM4(NULL, ob, arm, pose, pchan)) {
+       if (ELEM(NULL, ob, arm, pose, pchan)) {
                bcolor = NULL;
                return;
        }
index c1689ef06db0e8b5dbefdaa6806b806cbe25febd..e7e92073244e2d4c7d6383124ea409c536dd9cae 100644 (file)
@@ -4868,7 +4868,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                normalize_v3(imat[1]);
        }
 
-       if (ELEM3(draw_as, PART_DRAW_DOT, PART_DRAW_CROSS, PART_DRAW_LINE) &&
+       if (ELEM(draw_as, PART_DRAW_DOT, PART_DRAW_CROSS, PART_DRAW_LINE) &&
            (part->draw_col > PART_DRAW_COL_MAT))
        {
                create_cdata = 1;
@@ -6782,7 +6782,7 @@ static void draw_bounding_volume(Object *ob, char type)
        if (ob->type == OB_MESH) {
                bb = BKE_mesh_boundbox_get(ob);
        }
-       else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+       else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                bb = BKE_curve_boundbox_get(ob);
        }
        else if (ob->type == OB_MBALL) {
@@ -6839,7 +6839,7 @@ static void drawtexspace(Object *ob)
        if (ob->type == OB_MESH) {
                BKE_mesh_texspace_get(ob->data, loc, NULL, size);
        }
-       else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+       else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                BKE_curve_texspace_get(ob->data, loc, NULL, size);
        }
        else if (ob->type == OB_MBALL) {
@@ -6877,7 +6877,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
        glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0f);
        glDepthMask(0);
        
-       if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
+       if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
                DerivedMesh *dm = ob->derivedFinal;
                bool has_faces = false;
 
@@ -6921,7 +6921,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
 
 static void draw_wire_extra(Scene *scene, RegionView3D *rv3d, Object *ob, const unsigned char ob_wire_col[4])
 {
-       if (ELEM4(ob->type, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL)) {
+       if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL)) {
 
                if (scene->obedit == ob) {
                        UI_ThemeColor(TH_WIRE_EDIT);
@@ -6933,7 +6933,7 @@ static void draw_wire_extra(Scene *scene, RegionView3D *rv3d, Object *ob, const
                ED_view3d_polygon_offset(rv3d, 1.0);
                glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
 
-               if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
+               if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
                        if (ED_view3d_boundbox_clip(rv3d, ob->bb)) {
 
                                if (ob->derivedFinal) {
index 77a5ac1f689789e329807faad2de3c6086c85b6d..ce82a96bcf629709894c5e1a4ee32e5afd46a1cf 100644 (file)
@@ -779,7 +779,7 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN
                                        break;
                                case ND_NLA:
                                case ND_KEYFRAME:
-                                       if (ELEM3(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED))
+                                       if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED))
                                                ED_region_tag_redraw(ar);
                                        break;
                                case ND_ANIMCHAN:
@@ -1030,7 +1030,7 @@ static void view3d_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa
                                        break;
                                case ND_NLA:
                                case ND_KEYFRAME:
-                                       if (ELEM3(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED))
+                                       if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED))
                                                ED_region_tag_redraw(ar);
                                        break;
                        }
index dd08339cc940c3265e20a37e3b594b982c3cd6ab..d34b3d8be21ddec3113de98802d01095d2d16a10 100644 (file)
@@ -881,7 +881,7 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
                                }
                        }
                }
-               else if (ELEM3(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) {
+               else if (ELEM(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) {
                        Key *key = NULL;
                        KeyBlock *kb = NULL;
 
index e3260dba4851b85ab7e9964b75f641b1c0f9fac5..888d80b529fac93689799ad7b29a548b486b1002 100644 (file)
@@ -307,12 +307,12 @@ static void view3d_boxview_clip(ScrArea *sa)
        }
 
        for (val = 0; val < 8; val++) {
-               if (ELEM4(val, 0, 3, 4, 7))
+               if (ELEM(val, 0, 3, 4, 7))
                        bb->vec[val][0] = -x1 - ofs[0];
                else
                        bb->vec[val][0] =  x1 - ofs[0];
 
-               if (ELEM4(val, 0, 1, 4, 5))
+               if (ELEM(val, 0, 1, 4, 5))
                        bb->vec[val][1] = -y1 - ofs[1];
                else
                        bb->vec[val][1] =  y1 - ofs[1];
index e3d0e87066b1fb8f3a828629717f7d0c5219ed09..24f29fe9ea96046c9609e41ae3f3eb23aec735c7 100644 (file)
@@ -308,7 +308,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
        /* mode */
        if (ob) {
                modeselect = ob->mode;
-               is_paint = ELEM4(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT);
+               is_paint = ELEM(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT);
        }
        else {
                modeselect = OB_MODE_OBJECT;
index a53b4a75b209c6b375c64e31caf409437244ac23..b046cfaaf11078a4b9ae25b464fb21de75e98cae 100644 (file)
@@ -190,7 +190,7 @@ static bool transdata_check_local_center(TransInfo *t, short around)
 {
        return ((around == V3D_LOCAL) && (
                    (t->flag & (T_OBJECT | T_POSE)) ||
-                   (t->obedit && ELEM4(t->obedit->type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE)) ||
+                   (t->obedit && ELEM(t->obedit->type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE)) ||
                    (t->spacetype == SPACE_IPO) ||
                    (t->options & (CTX_MOVIECLIP | CTX_MASK)))
                );
@@ -646,7 +646,7 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
                allqueue(REDRAWIMAGE, 0);
                allqueue(REDRAWVIEW3D, 0);
        }
-       else if (ELEM3(t->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_IPO)) {
+       else if (ELEM(t->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_IPO)) {
                allqueue(REDRAWVIEW3D, 0);
                allqueue(REDRAWACTION, 0);
                allqueue(REDRAWNLA, 0);
@@ -969,7 +969,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                                break;
                        case TFM_MODAL_TRANSLATE:
                                /* only switch when... */
-                               if (ELEM5(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
+                               if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
                                        resetTransModal(t);
                                        resetTransRestrictions(t);
                                        restoreTransObjects(t);
@@ -1025,7 +1025,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                        case TFM_MODAL_ROTATE:
                                /* only switch when... */
                                if (!(t->options & CTX_TEXTURE) && !(t->options & (CTX_MOVIECLIP | CTX_MASK))) {
-                                       if (ELEM6(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
+                                       if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
                                                resetTransModal(t);
                                                resetTransRestrictions(t);
                                                
@@ -1045,7 +1045,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                                break;
                        case TFM_MODAL_RESIZE:
                                /* only switch when... */
-                               if (ELEM5(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
+                               if (ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
 
                                        /* Scale isn't normally very useful after extrude along normals, see T39756 */
                                        if ((t->con.mode & CON_APPLY) && (t->con.orientation == V3D_MANIP_NORMAL)) {
@@ -1308,7 +1308,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                                break;
                        case GKEY:
                                /* only switch when... */
-                               if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
+                               if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
                                        resetTransModal(t);
                                        resetTransRestrictions(t);
                                        restoreTransObjects(t);
@@ -1320,7 +1320,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                                break;
                        case SKEY:
                                /* only switch when... */
-                               if (ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
+                               if (ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL)) {
                                        resetTransModal(t);
                                        resetTransRestrictions(t);
                                        restoreTransObjects(t);
@@ -1333,7 +1333,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                        case RKEY:
                                /* only switch when... */
                                if (!(t->options & CTX_TEXTURE)) {
-                                       if (ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
+                                       if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION)) {
                                                resetTransModal(t);
                                                resetTransRestrictions(t);
 
@@ -2065,7 +2065,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
                 * moded are available from manipulator and doing such check could
                 * lead to keymap conflicts for other modes (see #31584)
                 */
-               if (ELEM3(mode, TFM_TRANSLATION, TFM_ROTATION, TFM_RESIZE)) {
+               if (ELEM(mode, TFM_TRANSLATION, TFM_ROTATION, TFM_RESIZE)) {
                        wmKeyMapItem *kmi;
 
                        for (kmi = t->keymap->items.first; kmi; kmi = kmi->next) {
@@ -7707,7 +7707,7 @@ bool checkUseAxisMatrix(TransInfo *t)
 {
        /* currently only checks for editmode */
        if (t->flag & T_EDIT) {
-               if ((t->around == V3D_LOCAL) && (ELEM4(t->obedit->type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE))) {
+               if ((t->around == V3D_LOCAL) && (ELEM(t->obedit->type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE))) {
                        /* not all editmode supports axis-matrix */
                        return true;
                }
index 79f266df6078b3eae314a1c4f6bc2f86d4a38756..b5dcdea55f1ccc94eba039261722a195b22c4637 100644 (file)
@@ -663,7 +663,7 @@ void drawConstraint(TransInfo *t)
 {
        TransCon *tc = &(t->con);
 
-       if (!ELEM3(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE, SPACE_NODE))
+       if (!ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE, SPACE_NODE))
                return;
        if (!(tc->mode & CON_APPLY))
                return;
index 316904008956175d5b535a6f8d9e6273380883a6..dc6f0a9da850fbf07dc054ef9f2f75fca11f4626 100644 (file)
 static void transform_around_single_fallback(TransInfo *t)
 {
        if ((t->total == 1) &&
-           (ELEM3(t->around, V3D_CENTER, V3D_CENTROID, V3D_ACTIVE)) &&
-           (ELEM3(t->mode, TFM_RESIZE, TFM_ROTATION, TFM_TRACKBALL)))
+           (ELEM(t->around, V3D_CENTER, V3D_CENTROID, V3D_ACTIVE)) &&
+           (ELEM(t->mode, TFM_RESIZE, TFM_ROTATION, TFM_TRACKBALL)))
        {
                t->around = V3D_LOCAL;
        }
@@ -282,7 +282,7 @@ static void createTransTexspace(TransInfo *t)
        }
 
        id = ob->data;
-       if (id == NULL || !ELEM3(GS(id->name), ID_ME, ID_CU, ID_MB)) {
+       if (id == NULL || !ELEM(GS(id->name), ID_ME, ID_CU, ID_MB)) {
                BKE_report(t->reports, RPT_ERROR, "Unsupported object type for text-space transform");
                t->total = 0;
                return;
@@ -3707,7 +3707,7 @@ static void bezt_to_transdata(TransData *td, TransData2D *td2d, TransDataGraph *
 
 static bool graph_edit_is_translation_mode(TransInfo *t)
 {
-       return ELEM4(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE, TFM_TIME_DUPLICATE);
+       return ELEM(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE, TFM_TIME_DUPLICATE);
 }
 
 static bool graph_edit_use_local_center(TransInfo *t)
@@ -4767,12 +4767,12 @@ static bool constraints_list_needinv(TransInfo *t, ListBase *list)
                        if ((con->flag & CONSTRAINT_DISABLE) == 0 && (con->enforce != 0.0f)) {
                                /* (affirmative) returns for specific constraints here... */
                                /* constraints that require this regardless  */
-                               if (ELEM5(con->type,
-                                         CONSTRAINT_TYPE_CHILDOF,
-                                         CONSTRAINT_TYPE_FOLLOWPATH,
-                                         CONSTRAINT_TYPE_CLAMPTO,
-                                         CONSTRAINT_TYPE_OBJECTSOLVER,
-                                         CONSTRAINT_TYPE_FOLLOWTRACK))
+                               if (ELEM(con->type,
+                                        CONSTRAINT_TYPE_CHILDOF,
+                                        CONSTRAINT_TYPE_FOLLOWPATH,
+                                        CONSTRAINT_TYPE_CLAMPTO,
+                                        CONSTRAINT_TYPE_OBJECTSOLVER,
+                                        CONSTRAINT_TYPE_FOLLOWTRACK))
                                {
                                        return true;
                                }
index 15d1bb75d89b9733c793e9dc9ed6f3e306d1f8f1..882a3ea8f6cc8ef332d273c34ef259de5dd77834 100644 (file)
@@ -262,7 +262,7 @@ static void animrecord_check_state(Scene *scene, ID *id, wmTimer *animtimer)
        ScreenAnimData *sad = (animtimer) ? animtimer->customdata : NULL;
        
        /* sanity checks */
-       if (ELEM3(NULL, scene, id, sad))
+       if (ELEM(NULL, scene, id, sad))
                return;
        
        /* check if we need a new strip if:
@@ -817,7 +817,7 @@ static void recalcData_objects(TransInfo *t)
                                }
                        }
                        
-                       if (!ELEM3(t->mode, TFM_BONE_ROLL, TFM_BONE_ENVELOPE, TFM_BONESIZE)) {
+                       if (!ELEM(t->mode, TFM_BONE_ROLL, TFM_BONE_ENVELOPE, TFM_BONESIZE)) {
                                /* fix roll */
                                for (i = 0; i < t->total; i++, td++) {
                                        if (td->extra) {
@@ -1193,7 +1193,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
 
                /* exceptional case */
                if (t->around == V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) {
-                       if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
+                       if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
                                t->options |= CTX_NO_PET;
                        }
                }
index ba90926df3b1418e71791421d82772a0ae00a6b0..69d135b855076b8699819eaab6d54cf2060bb2d5 100644 (file)
@@ -756,7 +756,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                                        if (flag) {
                                                                float tvec[3];
                                                                if ((v3d->around == V3D_LOCAL) ||
-                                                                   ELEM3(flag, SEL_F2, SEL_F1 | SEL_F3, SEL_F1 | SEL_F2 | SEL_F3))
+                                                                   ELEM(flag, SEL_F2, SEL_F1 | SEL_F3, SEL_F1 | SEL_F2 | SEL_F3))
                                                                {
                                                                        BKE_nurb_bezt_calc_normal(nu, bezt, tvec);
                                                                        add_v3_v3(normal, tvec);
index 451837fd3111d820b8a415f744bdd3d207f779d2..954f34cba4be5486e25a81d2937918d5a3c6eef8 100644 (file)
@@ -117,8 +117,8 @@ int BIF_snappingSupported(Object *obedit)
 {
        int status = 0;
        
-       if (obedit == NULL || ELEM5(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) /* only support object mesh, armature, curves */
-       {
+       /* only support object mesh, armature, curves */
+       if (obedit == NULL || ELEM(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) {
                status = 1;
        }
        
@@ -505,7 +505,7 @@ static void initSnappingMode(TransInfo *t)
 
                /* Edit mode */
                if (t->tsnap.applySnap != NULL && // A snapping function actually exist
-                   (obedit != NULL && ELEM5(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) ) // Temporary limited to edit mode meshes, armature, curves, mballs
+                   (obedit != NULL && ELEM(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) ) // Temporary limited to edit mode meshes, armature, curves, mballs
                {
                        /* Exclude editmesh if using proportional edit */
                        if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT)) {
@@ -588,7 +588,7 @@ void initSnapping(TransInfo *t, wmOperator *op)
        }
        /* use scene defaults only when transform is modal */
        else if (t->flag & T_MODAL) {
-               if (ELEM3(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE, SPACE_NODE)) {
+               if (ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE, SPACE_NODE)) {
                        if (ts->snap_flag & SCE_SNAP) {
                                t->modifiers |= MOD_SNAP;
                        }
index 3bd927e5b25062205175407eb4b3f71a6bd36d0d..104b628c25afcfbff8b98601ec9e5f3d32aa5982 100644 (file)
@@ -192,7 +192,7 @@ static void set_mapped_co(void *vuserdata, int index, const float co[3],
 
 bool ED_transverts_check_obedit(Object *obedit)
 {
-       return (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL));
+       return (ELEM(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL));
 }
 
 void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const int mode)
index a618ab8419bbaf199f59703e662c7bd47000fc2f..2c3dff5ea6a5783740eedce740277ad74592e7ad 100644 (file)
@@ -98,7 +98,7 @@ void outputNumInput(NumInput *n, char *str, const float scale_length)
                const short i = (n->flag & NUM_AFFECT_ALL && n->idx != j && !(n->val_flag[j] & NUM_EDITED)) ? 0 : j;
 
                /* Use scale_length if needed! */
-               const float fac = ELEM3(n->unit_type[j], B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME) ? scale_length : 1.0f;
+               const float fac = ELEM(n->unit_type[j], B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME) ? scale_length : 1.0f;
 
                if (n->val_flag[i] & NUM_EDITED) {
                        /* Get the best precision, allows us to draw '10.0001' as '10' instead! */
@@ -480,7 +480,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
                        default_unit = "r";
 
                /* Use scale_length if needed! */
-               if (ELEM3(n->unit_type[idx], B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME))
+               if (ELEM(n->unit_type[idx], B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME))
                        fac /= sce->unit.scale_length;
 
                BLI_strncpy(str_unit_convert, n->str, sizeof(str_unit_convert));
index b3155f0ad50718b89f4685e531eb959a5aad824c..d60525dd34ab894423e8674ad1fea59b38ebd858 100644 (file)
@@ -97,7 +97,7 @@ static char *gpu_str_skip_token(char *str, char *token, int max)
 
        /* skip a variable/function name */
        while (*str) {
-               if (ELEM7(*str, ' ', '(', ')', ',', '\t', '\n', '\r'))
+               if (ELEM(*str, ' ', '(', ')', ',', '\t', '\n', '\r'))
                        break;
                else {
                        if (token && len < max-1) {
@@ -115,7 +115,7 @@ static char *gpu_str_skip_token(char *str, char *token, int max)
        /* skip the next special characters:
         * note the missing ')' */
        while (*str) {
-               if (ELEM6(*str, ' ', '(', ',', '\t', '\n', '\r'))
+               if (ELEM(*str, ' ', '(', ',', '\t', '\n', '\r'))
                        str++;
                else
                        break;
index 68b8492926b65b3d18e28397b812ddd89d7a7a37..fae24465e17e74fc151c44f50401a0a7143cc8e6 100644 (file)
@@ -1548,7 +1548,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
                        /* setting 'do_alpha_after = true' indicates this object needs to be
                         * drawn in a second alpha pass for improved blending */
                        if (do_alpha_after && !GMS.is_alpha_pass)
-                               if (ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
+                               if (ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
                                        *do_alpha_after = true;
 
                        GMS.alphablend[a]= alphablend;
index 2dca3114765afc2921184758c93976016c200fd7..b8b7d15bf285a96b950ce13d5bcfa401bfcb8682 100644 (file)
@@ -896,7 +896,7 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
                echan->chan_id = name[0];
                layname[0] = '\0';
 
-               if (ELEM4(name[0], 'R', 'G', 'B', 'A'))
+               if (ELEM(name[0], 'R', 'G', 'B', 'A'))
                        strcpy(passname, "Combined");
                else if (name[0] == 'Z')
                        strcpy(passname, "Depth");
@@ -927,9 +927,9 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
                         *
                         * Here we do some magic to distinguish such cases.
                         */
-                       if (ELEM3(token[1], 'X', 'Y', 'Z') ||
-                           ELEM3(token[1], 'R', 'G', 'B') ||
-                           ELEM3(token[1], 'U', 'V', 'A'))
+                       if (ELEM(token[1], 'X', 'Y', 'Z') ||
+                           ELEM(token[1], 'R', 'G', 'B') ||
+                           ELEM(token[1], 'U', 'V', 'A'))
                        {
                                echan->chan_id = token[1];
                                ok = true;
index 2e3cd878900c07d326557e1ce6042e0eb4635b2c..e576cbc018fd34db0e1a38a7e53173be2cc9c2e9 100644 (file)
@@ -361,13 +361,13 @@ enum {
 #define OB_TYPE_SUPPORT_VGROUP(_type) \
        (ELEM(_type, OB_MESH, OB_LATTICE))
 #define OB_TYPE_SUPPORT_EDITMODE(_type) \
-       (ELEM7(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
+       (ELEM(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
 #define OB_TYPE_SUPPORT_PARVERT(_type) \
-       (ELEM4(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE))
+       (ELEM(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE))
 
 /* is this ID type used as object data */
 #define OB_DATA_SUPPORT_ID(_id_type) \
-       (ELEM8(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_CA, ID_LT, ID_AR))
+       (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_CA, ID_LT, ID_AR))
 
 #define OB_DATA_SUPPORT_ID_CASE \
        ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_CA: case ID_LT: case ID_AR
index 69d4693ab053c8907c033a337bdf3a03de60d8fd..bd2d39ff1f0411e85b6d4e15b91b30f7be823f8c 100644 (file)
@@ -434,7 +434,7 @@ enum {
  */
 
 
-#define SEQ_HAS_PATH(_seq) (ELEM4((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
+#define SEQ_HAS_PATH(_seq) (ELEM((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
 
 /* modifiers */
 
index 1906f71a230fd5c5f2c4133a880767f47e20e283..dc891f8d9714ba0a1b1fd17fd8793aee9ad87f11 100644 (file)
@@ -585,7 +585,7 @@ typedef struct ColorMapping {
 #define TEX_VD_IMAGE_SEQUENCE  3
 #define TEX_VD_SMOKE                   4
 /* for voxels which use VoxelData->source_path */
-#define TEX_VD_IS_SOURCE_PATH(_format) (ELEM3(_format, TEX_VD_BLENDERVOXEL, TEX_VD_RAW_8BIT, TEX_VD_RAW_16BIT))
+#define TEX_VD_IS_SOURCE_PATH(_format) (ELEM(_format, TEX_VD_BLENDERVOXEL, TEX_VD_RAW_8BIT, TEX_VD_RAW_16BIT))
 
 /* smoke data types */
 #define TEX_VD_SMOKEDENSITY            0
index 14ec6c9b3126522affcb788067bfa3166e28267b..7025a5767c4b5980aa966a0e926c183853c9c403 100644 (file)
@@ -66,7 +66,7 @@ typedef struct VFont {
 #define FO_SELCHANGE   10
 
 /* BKE_vfont_to_curve will move the cursor in these cases */
-#define FO_CURS_IS_MOTION(mode) (ELEM4(mode, FO_CURSUP, FO_CURSDOWN, FO_PAGEUP, FO_PAGEDOWN))
+#define FO_CURS_IS_MOTION(mode) (ELEM(mode, FO_CURSUP, FO_CURSDOWN, FO_PAGEUP, FO_PAGEDOWN))
 
 #define FO_BUILTIN_NAME "<builtin>"
 
index ded0278b44d7c40a4d77c9cf14ffa73ac18aec77..271f90791626131380c4150414026282794338a4 100644 (file)
@@ -359,12 +359,12 @@ static bool rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDPr
 
                        if (idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT)
                                return false;
-                       if (idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+                       if (idprop->subtype == IDP_INT && !ELEM(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
                                return false;
 
                        break;
                case IDP_INT:
-                       if (!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+                       if (!ELEM(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
                                return false;
                        break;
                case IDP_FLOAT:
@@ -872,8 +872,8 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
        if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) {
                return quatitem[index];
        }
-       else if ((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
-                                     PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS))
+       else if ((index < 4) && ELEM(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
+                                    PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS))
        {
                return vectoritem[index];
        }
@@ -902,7 +902,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
                                return 3;
                }
        }
-       else if (ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
+       else if (ELEM(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
                       PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
        {
                switch (name) {
@@ -3329,7 +3329,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
                /* check type */
                itemtype = RNA_property_type(itemprop);
 
-               if (!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
+               if (!ELEM(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
                        BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported");
                        return 0;
                }
@@ -3409,7 +3409,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
                                                break;
                                        }
 
-                                       if (!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
+                                       if (!ELEM(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
                                                BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported");
                                                err = 1;
                                                break;
index 956077055a960a74cf35964966bafb848592bc6f..0114ffa35c01cd4db0083e241089304a77560791 100644 (file)
@@ -150,7 +150,7 @@ static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value)
                switch (ca->type) {
                        case ACT_CONST_TYPE_ORI:
                                /* negative axis not supported in the orientation mode */
-                               if (ELEM3(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
+                               if (ELEM(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
                                        ca->mode = ACT_CONST_NONE;
                                break;
 
index 893cad2b76a2045ac4da09715cb30e5f6b385e7e..05cb29bcf27b65f0229e31fc8fbce329e91802c1 100644 (file)
@@ -120,9 +120,9 @@ EnumPropertyItem brush_image_tool_items[] = {
 static int rna_SculptToolCapabilities_has_accumulate_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return ELEM6(br->sculpt_tool,
-                    SCULPT_TOOL_BLOB, SCULPT_TOOL_CLAY, SCULPT_TOOL_CREASE,
-                    SCULPT_TOOL_DRAW, SCULPT_TOOL_INFLATE, SCULPT_TOOL_LAYER);
+       return ELEM(br->sculpt_tool,
+                   SCULPT_TOOL_BLOB, SCULPT_TOOL_CLAY, SCULPT_TOOL_CREASE,
+                   SCULPT_TOOL_DRAW, SCULPT_TOOL_INFLATE, SCULPT_TOOL_LAYER);
 }
 
 static int rna_SculptToolCapabilities_has_auto_smooth_get(PointerRNA *ptr)
@@ -142,9 +142,9 @@ static int rna_SculptToolCapabilities_has_jitter_get(PointerRNA *ptr)
        Brush *br = (Brush *)ptr->data;
        return (!(br->flag & BRUSH_ANCHORED) &&
                !(br->flag & BRUSH_DRAG_DOT) &&
-               !ELEM4(br->sculpt_tool,
-                      SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
-                      SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+               !ELEM(br->sculpt_tool,
+                     SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+                     SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
 }
 
 static int rna_SculptToolCapabilities_has_normal_weight_get(PointerRNA *ptr)
@@ -156,7 +156,7 @@ static int rna_SculptToolCapabilities_has_normal_weight_get(PointerRNA *ptr)
 static int rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return ELEM3(br->mtex.brush_map_mode,
+       return ELEM(br->mtex.brush_map_mode,
                    MTEX_MAP_MODE_VIEW,
                    MTEX_MAP_MODE_TILED,
                    MTEX_MAP_MODE_STENCIL);
@@ -177,22 +177,22 @@ static int rna_SculptToolCapabilities_has_pinch_factor_get(PointerRNA *ptr)
 static int rna_SculptToolCapabilities_has_plane_offset_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return ELEM5(br->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
-                    SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_SCRAPE);
+       return ELEM(br->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
+                   SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_SCRAPE);
 }
 
 static int rna_SculptToolCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return (!ELEM4(br->sculpt_tool,
-                      SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
-                      SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+       return (!ELEM(br->sculpt_tool,
+                     SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+                     SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
 }
 
 static int rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return (ELEM3(br->mtex.brush_map_mode,
+       return (ELEM(br->mtex.brush_map_mode,
                     MTEX_MAP_MODE_VIEW,
                     MTEX_MAP_MODE_AREA,
                     MTEX_MAP_MODE_RANDOM) &&
@@ -202,19 +202,19 @@ static int rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
 static int rna_SculptToolCapabilities_has_sculpt_plane_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return !ELEM4(br->sculpt_tool, SCULPT_TOOL_INFLATE,
-                     SCULPT_TOOL_MASK, SCULPT_TOOL_PINCH,
-                     SCULPT_TOOL_SMOOTH);
+       return !ELEM(br->sculpt_tool, SCULPT_TOOL_INFLATE,
+                    SCULPT_TOOL_MASK, SCULPT_TOOL_PINCH,
+                    SCULPT_TOOL_SMOOTH);
 }
 
 static int rna_SculptToolCapabilities_has_secondary_color_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return ELEM10(br->sculpt_tool,
-                     SCULPT_TOOL_BLOB, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
-                     SCULPT_TOOL_CREASE, SCULPT_TOOL_DRAW, SCULPT_TOOL_FILL,
-                     SCULPT_TOOL_FLATTEN, SCULPT_TOOL_INFLATE, SCULPT_TOOL_PINCH,
-                     SCULPT_TOOL_SCRAPE);
+       return ELEM(br->sculpt_tool,
+                   SCULPT_TOOL_BLOB, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
+                   SCULPT_TOOL_CREASE, SCULPT_TOOL_DRAW, SCULPT_TOOL_FILL,
+                   SCULPT_TOOL_FLATTEN, SCULPT_TOOL_INFLATE, SCULPT_TOOL_PINCH,
+                   SCULPT_TOOL_SCRAPE);
 }
 
 static int rna_SculptToolCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
@@ -222,17 +222,17 @@ static int rna_SculptToolCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
        Brush *br = (Brush *)ptr->data;
        return (!(br->flag & BRUSH_ANCHORED) &&
                !(br->flag & BRUSH_DRAG_DOT) &&
-               !ELEM4(br->sculpt_tool,
-                      SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
-                      SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+               !ELEM(br->sculpt_tool,
+                     SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+                     SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
 }
 
 static int rna_SculptToolCapabilities_has_space_attenuation_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
        return ((br->flag & BRUSH_SPACE) &&
-               !ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
-                      SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK));
+               !ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+                     SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK));
 }
 
 static int rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
@@ -250,12 +250,12 @@ static int rna_SculptToolCapabilities_has_strength_get(PointerRNA *ptr)
 static int rna_BrushCapabilities_has_texture_angle_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return ELEM5(br->mtex.brush_map_mode,
-                    MTEX_MAP_MODE_VIEW,
-                    MTEX_MAP_MODE_AREA,
-                    MTEX_MAP_MODE_TILED,
-                    MTEX_MAP_MODE_STENCIL,
-                    MTEX_MAP_MODE_RANDOM);
+       return ELEM(br->mtex.brush_map_mode,
+                   MTEX_MAP_MODE_VIEW,
+                   MTEX_MAP_MODE_AREA,
+                   MTEX_MAP_MODE_TILED,
+                   MTEX_MAP_MODE_STENCIL,
+                   MTEX_MAP_MODE_RANDOM);
 }
 
 static int rna_SculptToolCapabilities_has_gravity_get(PointerRNA *ptr)
@@ -267,7 +267,7 @@ static int rna_SculptToolCapabilities_has_gravity_get(PointerRNA *ptr)
 static int rna_BrushCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return ELEM3(br->mtex.brush_map_mode,
+       return ELEM(br->mtex.brush_map_mode,
                    MTEX_MAP_MODE_VIEW,
                    MTEX_MAP_MODE_AREA,
                    MTEX_MAP_MODE_RANDOM);
index fdba76e9aa228059cc8ab5007c28a21f4298c4ee..4db873423f67f6657551afbefdde87a64a2ecad0 100644 (file)
@@ -176,7 +176,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
                                char *node_path;
                                
                                for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
+                                       if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
                                                if (node->storage == ptr->data) {
                                                        /* all node color ramp properties called 'color_ramp'
                                                         * prepend path from ID to the node
@@ -265,7 +265,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
                                bNode *node;
                                
                                for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
+                                       if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
                                                RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr);
                                                COLRAMP_GETPATH;
                                        }
@@ -324,7 +324,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
                                bNode *node;
 
                                for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
+                                       if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
                                                ED_node_tag_update_nodetree(bmain, ntree);
                                        }
                                }
index 120992cffe8a512d314c59bf94d99a0cd7ac8a1f..eb38c58d8efed585d2db26b2ad29d6dabaf8680b 100644 (file)
@@ -351,7 +351,7 @@ static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float
        bActionConstraint *acon = (bActionConstraint *)con->data;
 
        /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
-       if (ELEM3(acon->type, 0, 1, 2)) {
+       if (ELEM(acon->type, 0, 1, 2)) {
                *min = -180.0f;
                *max = 180.0f;
        }
index 7ae15b0b06c2548fe46a371431af40c43a3ba12d..0a4799937cdd4aa5a8814ddd1c90a1e2bebd64aa 100644 (file)
@@ -307,7 +307,7 @@ static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED
        if (ma->material_type == MA_TYPE_VOLUME) {
                
        }
-       else if (ELEM3(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) {
+       else if (ELEM(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) {
                RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_UV);
                RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRAND);
                RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_WINDOW);
index 0f37575146b884b6fa1dca04d656701d9565629c..ea25530e63493376eef1395634cac28ed037ec39 100644 (file)
@@ -733,7 +733,7 @@ static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRN
 
                return curve_shape_items;
        }
-       else if (ELEM3(ob->type, OB_MESH, OB_SURF, OB_FONT)) {
+       else if (ELEM(ob->type, OB_MESH, OB_SURF, OB_FONT)) {
                if (ob->pd->forcefield == PFIELD_VORTEX)
                        return vortex_shape_items;
 
index 13349446168138a9bf1aa8987198b890421d2ab0..0d85cfa24351de1c6b850009ac07b84789c7c01b 100644 (file)
@@ -880,7 +880,7 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *UNU
        }
        else {
                const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
-               const int is_float = ELEM3(imf->imtype, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
+               const int is_float = ELEM(imf->imtype, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
 
                EnumPropertyItem *item_8bit =  &image_color_depth_items[0];
                EnumPropertyItem *item_10bit = &image_color_depth_items[1];
@@ -1316,7 +1316,7 @@ static void object_simplify_update(Object *ob)
        ob->id.flag &= ~LIB_DOIT;
 
        for (md = ob->modifiers.first; md; md = md->next) {
-               if (ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem)) {
+               if (ELEM(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem)) {
                        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
                }
        }
index 7f21376ef481d654200c3d5919dc5d0f5a613795..838336a8f8abca9fe0302037ba2270a79613a095 100644 (file)
@@ -153,7 +153,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                const int defbase_tot = BLI_countlist(&ob->defbase);
                
                /* check that there is armature object with bones to use, otherwise return original mesh */
-               if (ELEM3(NULL, oba, oba->pose, ob->defbase.first))
+               if (ELEM(NULL, oba, oba->pose, ob->defbase.first))
                        return dm;
                
                /* determine whether each vertexgroup is associated with a selected bone or not 
index 386d6d985fbdee9f3397cab9fcac63f2780d2162..829c2b889951b8b5600f8ded0af9d0af89ceb1aa 100644 (file)
@@ -198,7 +198,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm,
                        DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, BKE_mesh_orco_verts_get(ob));
                }
        }
-       else if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
+       else if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
                dm = CDDM_from_curve(ob);
        }
 
index 12ecae8ad4f6523d5996dbaf50469eb7884e4b24..744b6b62c2a5646b8e09efe78fff1f054c594181 100644 (file)
@@ -66,9 +66,9 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
        /* Return immediately, if we have nothing to do! */
        /* Also security checks... */
        if (((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == NULL)) ||
-           !ELEM7(falloff_type, MOD_WVG_MAPPING_CURVE, MOD_WVG_MAPPING_SHARP, MOD_WVG_MAPPING_SMOOTH,
-                  MOD_WVG_MAPPING_ROOT, MOD_WVG_MAPPING_SPHERE, MOD_WVG_MAPPING_RANDOM,
-                  MOD_WVG_MAPPING_STEP))
+           !ELEM(falloff_type, MOD_WVG_MAPPING_CURVE, MOD_WVG_MAPPING_SHARP, MOD_WVG_MAPPING_SMOOTH,
+                 MOD_WVG_MAPPING_ROOT, MOD_WVG_MAPPING_SPHERE, MOD_WVG_MAPPING_RANDOM,
+                 MOD_WVG_MAPPING_STEP))
        {
                return;
        }
index f5ae8561300f9f74dd2a9430adc64131dcae6a4e..06b29d15f2ec8fd1f63c8bed6691f439176eedf8 100644 (file)
@@ -465,7 +465,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                        DerivedMesh *target_dm = obr->derivedFinal;
                        bool free_target_dm = false;
                        if (!target_dm) {
-                               if (ELEM3(obr->type, OB_CURVE, OB_SURF, OB_FONT))
+                               if (ELEM(obr->type, OB_CURVE, OB_SURF, OB_FONT))
                                        target_dm = CDDM_from_curve(obr);
                                else if (obr->type == OB_MESH) {
                                        Mesh *me = (Mesh *)obr->data;
index 0e5f72c831b79615eac1869edbb1af14528e4447..ec481839a160e9e378c678cd9995e733bb8b7ac0 100644 (file)
@@ -47,7 +47,7 @@
 /* supported socket types in old nodes */
 int node_exec_socket_use_stack(bNodeSocket *sock)
 {
-       return ELEM4(sock->type, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_SHADER);
+       return ELEM(sock->type, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_SHADER);
 }
 
 /* for a given socket, find the actual stack entry */
index 9b81997734524a5c093ba2d42fed06fdc5822458..e77a528bb09601ffbdf728a1b7a129696b630828 100644 (file)
@@ -301,7 +301,7 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
        if (!PyArg_ParseTuple(args, "iO|O: bgl.Buffer", &type, &length_ob, &init)) {
                return NULL;
        }
-       if (!ELEM5(type, GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, GL_DOUBLE)) {
+       if (!ELEM(type, GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, GL_DOUBLE)) {
                PyErr_SetString(PyExc_AttributeError,
                                "invalid first argument type, should be one of "
                                "GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT or GL_DOUBLE");
index 440af035bcda33fbd0dde1ed8aba41f87d20c87c..3fdc3641173622d935570965fe59cbc23a10cdcc 100644 (file)
@@ -1363,7 +1363,7 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
                        if (subtype == PROP_BYTESTRING) {
                                ret = PyBytes_FromStringAndSize(buf, buf_len);
                        }
-                       else if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+                       else if (ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
                                ret = PyC_UnicodeFromByteAndSize(buf, buf_len);
                        }
                        else {
@@ -1629,7 +1629,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
                                        /* Unicode String */
 #ifdef USE_STRING_COERCE
                                        PyObject *value_coerce = NULL;
-                                       if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+                                       if (ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
                                                /* TODO, get size */
                                                param = PyC_UnicodeAsByte(value, &value_coerce);
                                        }
@@ -4894,7 +4894,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
                                if (subtype == PROP_BYTESTRING) {
                                        ret = PyBytes_FromString(data_ch);
                                }
-                               else if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+                               else if (ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
                                        ret = PyC_UnicodeFromByte(data_ch);
                                }
                                else {
index 5d8252d3c729987a55f1246f74c930a2d1851f28..56ed4e157d6945d2b40509ab20ee926f4d00cf94 100644 (file)
@@ -203,7 +203,7 @@ static PyObject *Euler_rotate_axis(EulerObject *self, PyObject *args)
                return NULL;
        }
 
-       if (!(ELEM3(axis, 'X', 'Y', 'Z'))) {
+       if (!(ELEM(axis, 'X', 'Y', 'Z'))) {
                PyErr_SetString(PyExc_ValueError,
                                "Euler.rotate_axis(): "
                                "expected axis to be 'X', 'Y' or 'Z'");
index 139764abb00a6dd50627f4f9d9a84930738c473e..9ec84baf872c7f46209f2993c3e93109640915fb 100644 (file)
@@ -597,7 +597,7 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
                return NULL;
        }
 
-       if (ELEM4(2, line_a->size, line_b->size, plane_co->size, plane_no->size)) {
+       if (ELEM(2, line_a->size, line_b->size, plane_co->size, plane_no->size)) {
                PyErr_SetString(PyExc_ValueError,
                                "geometry.intersect_line_plane(...): "
                                " can't use 2D Vectors");
@@ -654,7 +654,7 @@ static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObje
                return NULL;
        }
 
-       if (ELEM4(2, plane_a_co->size, plane_a_no->size, plane_b_co->size, plane_b_no->size)) {
+       if (ELEM(2, plane_a_co->size, plane_a_no->size, plane_b_co->size, plane_b_no->size)) {
                PyErr_SetString(PyExc_ValueError,
                                "geometry.intersect_plane_plane(...): "
                                " can't use 2D Vectors");
@@ -726,7 +726,7 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
                return NULL;
        }
 
-       if (ELEM3(2, line_a->size, line_b->size, sphere_co->size)) {
+       if (ELEM(2, line_a->size, line_b->size, sphere_co->size)) {
                PyErr_SetString(PyExc_ValueError,
                                "geometry.intersect_line_sphere(...): "
                                " can't use 2D Vectors");
index f2793a9bc5bc4a3085c19592ef7f3ef00d54316d..15634c9349189842560f562c4765bee28e27ecc3 100644 (file)
@@ -174,7 +174,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
                
                /* only do AO for a full bake (and obviously AO bakes)
                 * AO for light bakes is a leftover and might not be needed */
-               if (ELEM3(bs->type, RE_BAKE_ALL, RE_BAKE_AO, RE_BAKE_LIGHT))
+               if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_AO, RE_BAKE_LIGHT))
                        shade_samples_do_AO(ssamp);
                
                if (shi->mat->nodetree && shi->mat->use_nodes) {
@@ -303,7 +303,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
                        rgb_float_to_uchar(col, shr.combined);
                }
                
-               if (ELEM3(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE, RE_BAKE_VERTEX_COLORS)) {
+               if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE, RE_BAKE_VERTEX_COLORS)) {
                        col[3] = FTOCHAR(shr.alpha);
                }
                else {
index 5c44f1cd0c18b3783b48ebc58610fbe9a656c273..db34698dc9238cba8ef59903b3d2a4125859588e 100644 (file)
@@ -3704,8 +3704,8 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
        
        /* Annoying, lamp UI does this, but the UI might not have been used? - add here too.
         * make sure this matches buttons_shading.c's logic */
-       if (ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && (la->mode & LA_SHAD_RAY))
-               if (ELEM3(la->type, LA_SPOT, LA_SUN, LA_LOCAL))
+       if (ELEM(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && (la->mode & LA_SHAD_RAY))
+               if (ELEM(la->type, LA_SPOT, LA_SUN, LA_LOCAL))
                        if (la->ray_samp_method == LA_SAMP_CONSTANT) la->ray_samp_method = LA_SAMP_HALTON;
        
        lar->ray_samp_method= la->ray_samp_method;
@@ -4831,7 +4831,7 @@ static int allow_render_dupli_instance(Render *UNUSED(re), DupliObject *dob, Obj
        }
 
        for (psys=obd->particlesystem.first; psys; psys=psys->next)
-               if (!ELEM5(psys->part->ren_as, PART_DRAW_BB, PART_DRAW_LINE, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR))
+               if (!ELEM(psys->part->ren_as, PART_DRAW_BB, PART_DRAW_LINE, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR))
                        return 0;
 
        /* don't allow lamp, animated duplis, or radio render */
@@ -5833,8 +5833,8 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
        Object *camera;
        float mat[4][4];
        float amb[3];
-       const short onlyselected= !ELEM5(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW, RE_BAKE_AO, RE_BAKE_VERTEX_COLORS);
-       const short nolamps= ELEM5(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_VERTEX_COLORS);
+       const short onlyselected= !ELEM(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW, RE_BAKE_AO, RE_BAKE_VERTEX_COLORS);
+       const short nolamps= ELEM(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_VERTEX_COLORS);
 
        re->main= bmain;
        re->scene= scene;
@@ -5858,7 +5858,7 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
        if (type==RE_BAKE_VERTEX_COLORS)
                re->flag |=  R_NEED_VCOL;
 
-       if (!actob && ELEM6(type, RE_BAKE_LIGHT, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_VERTEX_COLORS)) {
+       if (!actob && ELEM(type, RE_BAKE_LIGHT, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_VERTEX_COLORS)) {
                re->r.mode &= ~R_SHADOW;
                re->r.mode &= ~R_RAYTRACE;
        }
index 253f8a1383fa082d2fc25324d89ecc39a2ebf98c..dd14c2495e85af446cb073b61c6583c0a4294887 100644 (file)
@@ -3564,7 +3564,7 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
 
                        /* depending of material type, strip non-compatible mapping modes */
                        if (mat->material_type == MA_TYPE_SURFACE) {
-                               if (!ELEM4(mtex->texco, TEXCO_ORCO, TEXCO_OBJECT, TEXCO_GLOB, TEXCO_UV)) {
+                               if (!ELEM(mtex->texco, TEXCO_ORCO, TEXCO_OBJECT, TEXCO_GLOB, TEXCO_UV)) {
                                        /* ignore this texture */
                                        mtex->texco = 0;
                                        continue;
@@ -3573,7 +3573,7 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
                                mtex->mapto = (mtex->mapto & MAP_COL) | (mtex->mapto & MAP_ALPHA);
                        }
                        else if (mat->material_type == MA_TYPE_VOLUME) {
-                               if (!ELEM3(mtex->texco, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_GLOB)) {
+                               if (!ELEM(mtex->texco, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_GLOB)) {
                                        /* ignore */
                                        mtex->texco = 0;
                                        continue;
index 9d337e542a17813dda2f3268a01fdb6689286c93..aa420d7e7c8251bd34a63781db8e337eda19660e 100644 (file)
@@ -784,7 +784,7 @@ void makeshadowbuf(Render *re, LampRen *lar)
        perspective_m4(shb->winmat, -wsize, wsize, -wsize, wsize, shb->d, shb->clipend);
        mul_m4_m4m4(shb->persmat, shb->winmat, shb->viewmat);
 
-       if (ELEM3(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP)) {
+       if (ELEM(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP)) {
                shb->totbuf= lar->buffers;
 
                /* jitter, weights - not threadsafe! */
index fe3af5b840e31aea9633fdcb8673d7ea057a96bf..d5c4c407bf65366233d91c8aeb1c15c8b9793dbd 100644 (file)
@@ -499,7 +499,7 @@ static void vol_shade_one_lamp(struct ShadeInput *shi, const float co[3], const
        if (shi->mat->vol.shade_type == MA_VOL_SHADE_SHADOWED) {
                mul_v3_fl(lacol, vol_get_shadow(shi, lar, co));
        }
-       else if (ELEM3(shi->mat->vol.shade_type, MA_VOL_SHADE_SHADED, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE)) {
+       else if (ELEM(shi->mat->vol.shade_type, MA_VOL_SHADE_SHADED, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE)) {
                Isect is;
                
                if (shi->mat->vol.shadeflag & MA_VOL_RECV_EXT_SHADOW) {
index 9f1359dfb9b1cdc2da5937811ef6269a9e00b0e7..256f456a7a43d7198a26fb8b0fd4125ebcd778cd 100644 (file)
@@ -289,7 +289,7 @@ void wm_event_do_notifiers(bContext *C)
                                                do_anim = true;
                                }
                        }
-                       if (ELEM5(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE, NC_WM)) {
+                       if (ELEM(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE, NC_WM)) {
                                ED_info_stats_clear(win->screen->scene);
                                WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL);
                        }
@@ -393,7 +393,7 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve
        ARegion *region = CTX_wm_region(C);
        ARegion *menu = CTX_wm_menu(C);
        static bool do_wheel_ui = true;
-       const bool is_wheel = ELEM3(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, MOUSEPAN);
+       const bool is_wheel = ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, MOUSEPAN);
        int retval;
        
        /* UI code doesn't handle return values - it just always returns break. 
@@ -2010,7 +2010,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
        if (CTX_wm_window(C) == NULL)
                return action;
 
-       if (!ELEM3(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE, EVENT_NONE) && !ISTIMER(event->type)) {
+       if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE, EVENT_NONE) && !ISTIMER(event->type)) {
 
                /* test for CLICK events */
                if (wm_action_not_handled(action)) {
@@ -2694,7 +2694,7 @@ bool WM_modal_tweak_exit(const wmEvent *event, int tweak_event)
                else {
                        /* if the initial event wasn't a tweak event then
                         * ignore USER_RELEASECONFIRM setting: see [#26756] */
-                       if (ELEM3(tweak_event, EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R) == 0) {
+                       if (ELEM(tweak_event, EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R) == 0) {
                                return 1;
                        }
                }
index c9ef473a442617c48e22d86ce18002ee22e479f8..3e287a3907b781321b36a5f80bcda92dfca85160 100644 (file)
@@ -74,7 +74,7 @@ wmGesture *WM_gesture_new(bContext *C, const wmEvent *event, int type)
        
        wm_subwindow_origin_get(window, gesture->swinid, &sx, &sy);
        
-       if (ELEM5(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK,
+       if (ELEM(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK,
                  WM_GESTURE_CIRCLE, WM_GESTURE_STRAIGHTLINE))
        {
                rcti *rect = MEM_callocN(sizeof(rcti), "gesture rect new");
index 0163517545f191335281d31d7a15a12112a913ee..a95f2af1a8f125a74d7c957f4ce05209aa2d413e 100644 (file)
@@ -1108,9 +1108,9 @@ int WM_keymap_item_compare(wmKeyMapItem *k1, wmKeyMapItem *k2)
 
        if (k1->val != KM_ANY && k2->val != KM_ANY) {
                /* take click, press, release conflict into account */
-               if (k1->val == KM_CLICK && ELEM3(k2->val, KM_PRESS, KM_RELEASE, KM_CLICK) == 0)
+               if (k1->val == KM_CLICK && ELEM(k2->val, KM_PRESS, KM_RELEASE, KM_CLICK) == 0)
                        return 0;
-               if (k2->val == KM_CLICK && ELEM3(k1->val, KM_PRESS, KM_RELEASE, KM_CLICK) == 0)
+               if (k2->val == KM_CLICK && ELEM(k1->val, KM_PRESS, KM_RELEASE, KM_CLICK) == 0)
                        return 0;
                if (k1->val != k2->val)
                        return 0;
index ba454bb1818cd2f0262a3c44cf6b8a483414ae72..38335b55781ee5a3f3ec9d020a3f17ad79c715bc 100644 (file)
@@ -3291,7 +3291,7 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
        if (win->tweak == NULL) {
                if (CTX_wm_region(C)) {
                        if (event->val == KM_PRESS) {
-                               if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) {
+                               if (ELEM(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) {
                                        win->tweak = WM_gesture_new(C, event, WM_GESTURE_TWEAK);
                                }
                        }