Base refactor 1/4
authorDalai Felinto <dfelinto@gmail.com>
Mon, 6 Feb 2017 13:49:26 +0000 (14:49 +0100)
committerDalai Felinto <dfelinto@gmail.com>
Mon, 6 Feb 2017 17:06:47 +0000 (18:06 +0100)
Rename Base.flag > Base.flag_legacy

26 files changed:
source/blender/blenkernel/intern/mball_tessellate.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_280.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/gpencil/gpencil_convert.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw_legacy.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap_object.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_object.c

index 5c0b09f0ff0684503666907429b73dd8421c6889..2ba3ede8c1550d7231845d86565a8b58a24fd24e 100644 (file)
@@ -1102,7 +1102,7 @@ static void init_meta(EvaluationContext *eval_ctx, PROCESS *process, Scene *scen
                        zero_size = 0;
                        ml = NULL;
 
-                       if (bob == ob && (base->flag & OB_FROMDUPLI) == 0) {
+                       if (bob == ob && (base->flag_legacy & OB_FROMDUPLI) == 0) {
                                mb = ob->data;
 
                                if (mb->editelems) ml = mb->editelems->first;
index f7817171220a97ac454173c6ef744ccd690b8a3e..8f7c3f53ca6b00d5c864c1140b8c0eb5d38069d8 100644 (file)
@@ -2549,7 +2549,7 @@ void BKE_scene_foreach_display_point(
        Object *ob;
 
        for (base = FIRSTBASE; base; base = base->next) {
-               if (BASE_VISIBLE_BGMODE(v3d, scene, base) && (base->flag & flag) == flag) {
+               if (BASE_VISIBLE_BGMODE(v3d, scene, base) && (base->flag_legacy & flag) == flag) {
                        ob = base->object;
 
                        if ((ob->transflag & OB_DUPLI) == 0) {
index cc136e8e748afff823f6a2513eba1a12b34b7e2c..8edcac9a72be3c61d786856c02ec17dd73a9da4d 100644 (file)
@@ -1108,7 +1108,7 @@ int BKE_scene_base_iter_next(EvaluationContext *eval_ctx, SceneBaseIter *iter,
                                }
                                /* handle dupli's */
                                if (iter->dupob) {
-                                       (*base)->flag |= OB_FROMDUPLI;
+                                       (*base)->flag_legacy |= OB_FROMDUPLI;
                                        *ob = iter->dupob->ob;
                                        iter->phase = F_DUPLI;
 
@@ -1127,7 +1127,7 @@ int BKE_scene_base_iter_next(EvaluationContext *eval_ctx, SceneBaseIter *iter,
                                }
                                else if (iter->phase == F_DUPLI) {
                                        iter->phase = F_SCENE;
-                                       (*base)->flag &= ~OB_FROMDUPLI;
+                                       (*base)->flag_legacy &= ~OB_FROMDUPLI;
                                        
                                        if (iter->dupli_refob) {
                                                /* Restore last object's real matrix. */
@@ -1272,7 +1272,7 @@ Base *BKE_scene_base_add(Scene *sce, Object *ob)
        BLI_addhead(&sce->base, b);
 
        b->object = ob;
-       b->flag = ob->flag;
+       b->flag_legacy = ob->flag;
        b->lay = ob->lay;
 
        return b;
@@ -1292,17 +1292,17 @@ void BKE_scene_base_deselect_all(Scene *sce)
        Base *b;
 
        for (b = sce->base.first; b; b = b->next) {
-               b->flag &= ~SELECT;
+               b->flag_legacy &= ~SELECT;
                int flag = b->object->flag & (OB_FROMGROUP);
-               b->object->flag = b->flag;
+               b->object->flag = b->flag_legacy;
                b->object->flag |= flag;
        }
 }
 
 void BKE_scene_base_select(Scene *sce, Base *selbase)
 {
-       selbase->flag |= SELECT;
-       selbase->object->flag = selbase->flag;
+       selbase->flag_legacy |= SELECT;
+       selbase->object->flag = selbase->flag_legacy;
 
        sce->basact = selbase;
 }
@@ -1773,13 +1773,13 @@ void BKE_scene_base_flag_sync_from_base(Base *base)
        /* keep the object only flags untouched */
        int flag = ob->flag & OB_FROMGROUP;
 
-       ob->flag = base->flag;
+       ob->flag = base->flag_legacy;
        ob->flag |= flag;
 }
 
 void BKE_scene_base_flag_sync_from_object(Base *base)
 {
-       base->flag = base->object->flag;
+       base->flag_legacy = base->object->flag;
 }
 
 void BKE_scene_object_base_flag_sync_from_base(ObjectBase *base)
index b12f1d410c4262ed42f0609c2419cf683add22ea..8047b8a503c274bc2b342882c1b5d399edf74611 100644 (file)
@@ -9994,7 +9994,7 @@ static void give_base_to_groups(
 
                        /* assign the base */
                        base = BKE_scene_base_add(scene, ob);
-                       base->flag |= SELECT;
+                       base->flag_legacy |= SELECT;
                        BKE_scene_base_flag_sync_from_base(base);
                        DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
                        scene->basact = base;
@@ -10093,11 +10093,11 @@ static void link_object_postprocess(ID *id, Scene *scene, View3D *v3d, const sho
                ob->mode = OB_MODE_OBJECT;
                base->lay = ob->lay;
                base->object = ob;
-               base->flag = ob->flag;
+               base->flag_legacy = ob->flag;
                id_us_plus_no_lib((ID *)ob);
 
                if (flag & FILE_AUTOSELECT) {
-                       base->flag |= SELECT;
+                       base->flag_legacy |= SELECT;
                        BKE_scene_base_flag_sync_from_base(base);
                        /* do NOT make base active here! screws up GUI stuff, if you want it do it on src/ level */
                }
index 92592e9fc62bbd10581278b5e499f14afac88d7b..75d7211d41fe0ac3c2141f1b2f0bb1ad5e10da9d 100644 (file)
@@ -138,7 +138,7 @@ void do_versions_after_linking_280(Main *main)
                                /* convert selected bases */
                                for (Base *base = scene->base.first; base; base = base->next) {
                                        ObjectBase *ob_base = BKE_scene_layer_base_find(sl, base->object);
-                                       if ((base->flag & SELECT) != 0) {
+                                       if ((base->flag_legacy & SELECT) != 0) {
                                                if ((ob_base->flag & BASE_SELECTABLED) != 0) {
                                                        ob_base->flag |= BASE_SELECTED;
                                                }
index 985ef1e13d28d2d31cdc048336c2ad041dea8e89..b2ce46e8f361887ab08694ebe9949616d91678d7 100644 (file)
@@ -2690,7 +2690,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
                        /* set selection status */
                        if (selectmode == SELECT_INVERT) {
                                /* swap select */
-                               base->flag ^= SELECT;
+                               base->flag_legacy ^= SELECT;
                                BKE_scene_base_flag_sync_from_base(base);
                                
                                if (adt) adt->flag ^= ADT_UI_SELECTED;
@@ -2701,13 +2701,13 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
                                /* deselect all */
                                /* TODO: should this deselect all other types of channels too? */
                                for (b = sce->base.first; b; b = b->next) {
-                                       b->flag &= ~SELECT;
+                                       b->flag_legacy &= ~SELECT;
                                        BKE_scene_base_flag_sync_from_base(b);
                                        if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE);
                                }
                                
                                /* select object now */
-                               base->flag |= SELECT;
+                               base->flag_legacy |= SELECT;
                                ob->flag |= SELECT;
                                if (adt) adt->flag |= ADT_UI_SELECTED;
                        }
index 2f73eb6b71c875252fa5d47bf44704f06fc6eb00..1b19e7873cf197b7e31c687076c95b7dcdf442df 100644 (file)
@@ -1714,7 +1714,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, ListBase *anim_data, voi
                                }
                                
                                /* check selection and object type filters */
-                               if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == scene->basact)*/) ) {
+                               if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag_legacy & SELECT) /*|| (base == scene->basact)*/) ) {
                                        /* only selected should be shown */
                                        continue;
                                }
@@ -2629,7 +2629,7 @@ static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, ListBase *anim_data
                if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
                        /* check if filtering by selection */
                        // XXX: double-check on this - most of the time, a lot of tools need to filter out these channels!
-                       if (ANIMCHANNEL_SELOK((base->flag & SELECT))) {
+                       if (ANIMCHANNEL_SELOK((base->flag_legacy & SELECT))) {
                                /* check if filtering by active status */
                                if (ANIMCHANNEL_ACTIVEOK(ob)) {
                                        ANIMCHANNEL_NEW_CHANNEL(base, ANIMTYPE_OBJECT, ob);
@@ -2906,7 +2906,7 @@ static bool animdata_filter_base_is_ok(bDopeSheet *ads, Scene *scene, Base *base
        }
 
        /* check selection and object type filters */
-       if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/)) {
+       if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag_legacy & SELECT) /*|| (base == sce->basact)*/)) {
                /* only selected should be shown */
                return false;
        }
index a004d7806b280cc5b3419a7ac1cfc93b0bf17e1b..6c948b88e6a1866410b1ca7d171231e0460297bf 100644 (file)
@@ -1217,7 +1217,7 @@ static void gp_layer_to_curve(bContext *C, ReportList *reports, bGPdata *gpd, bG
        
        /* set the layer and select */
        base_new->lay  = ob->lay  = base_orig ? base_orig->lay : BKE_screen_view3d_layer_active(v3d, scene);
-       base_new->flag |= SELECT;
+       base_new->flag_legacy |= SELECT;
        BKE_scene_base_flag_sync_from_base(base_new);
 }
 
index 5045c5b1191ad1f45096a16dab3fe2323290e685..0816942bdba68c8e09070a3d427cc38f1edca9d3 100644 (file)
@@ -1710,7 +1710,7 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
 
                /* restore, BKE_object_add sets active */
                BASACT = base;
-               base->flag |= SELECT;
+               base->flag_legacy |= SELECT;
                
                /* make our new target the new object */
                *tar_ob = obt;
index f4731eaec021c48a6d6d0619474344107bfdc7ef..18d4c11785b8dd8ed3c71a7a9475baefcf1258f4 100644 (file)
@@ -1779,7 +1779,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag)
 
        for (base = FIRSTBASE; base; base = base->next) {
                ob = base->object;
-               if (!ID_IS_LINKED_DATABLOCK(ob) && (base->flag & flag) == flag) {
+               if (!ID_IS_LINKED_DATABLOCK(ob) && (base->flag_legacy & flag) == flag) {
                        id = ob->data;
 
                        if (id && id->us > 1 && !ID_IS_LINKED_DATABLOCK(id)) {
@@ -2109,7 +2109,7 @@ static bool make_local_all__instance_indirect_unused(Main *bmain, Scene *scene)
                        id_us_plus(&ob->id);
 
                        base = BKE_scene_base_add(scene, ob);
-                       base->flag |= SELECT;
+                       base->flag_legacy |= SELECT;
                        BKE_scene_base_flag_sync_from_base(base);
                        DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 
index 3d770983681399e31ddc932b19a8975ddfbbb134..2871ec1c4fc8e6b7664bfe01509788d814bce435 100644 (file)
@@ -92,10 +92,10 @@ void ED_base_object_select(Base *base, short mode)
        if (base) {
                if (mode == BA_SELECT) {
                        if (!(base->object->restrictflag & OB_RESTRICT_SELECT))
-                               base->flag |= SELECT;
+                               base->flag_legacy |= SELECT;
                }
                else if (mode == BA_DESELECT) {
-                       base->flag &= ~SELECT;
+                       base->flag_legacy &= ~SELECT;
                }
                BKE_scene_base_flag_sync_from_base(base);
        }
index 8dc6c4229b24cb453029bb3762e09300121f800f..97604ba118fd17841ff8ca0ceef0e5c7dfc43142 100644 (file)
@@ -271,7 +271,7 @@ static void stats_object_sculpt_dynamic_topology(Object *ob, SceneStats *stats)
 
 static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
 {
-       if (base->flag & SELECT) stats->totobjsel++;
+       if (base->flag_legacy & SELECT) stats->totobjsel++;
 
        if (ob->transflag & OB_DUPLIPARTS) {
                /* Dupli Particles */
@@ -300,7 +300,7 @@ static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
                        }
                }
                
-               stats_object(ob, base->flag & SELECT, 1, stats);
+               stats_object(ob, base->flag_legacy & SELECT, 1, stats);
                stats->totobj++;
        }
        else if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) {
@@ -316,23 +316,23 @@ static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
                }
 
                stats->totobj += tot;
-               stats_object(ob, base->flag & SELECT, tot, stats);
+               stats_object(ob, base->flag_legacy & SELECT, tot, stats);
        }
        else if (ob->transflag & OB_DUPLIFRAMES) {
                /* Dupli Frames */
                int tot = count_duplilist(ob);
                stats->totobj += tot;
-               stats_object(ob, base->flag & SELECT, tot, stats);
+               stats_object(ob, base->flag_legacy & SELECT, tot, stats);
        }
        else if ((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
                /* Dupli Group */
                int tot = count_duplilist(ob);
                stats->totobj += tot;
-               stats_object(ob, base->flag & SELECT, tot, stats);
+               stats_object(ob, base->flag_legacy & SELECT, tot, stats);
        }
        else {
                /* No Dupli */
-               stats_object(ob, base->flag & SELECT, 1, stats);
+               stats_object(ob, base->flag_legacy & SELECT, 1, stats);
                stats->totobj++;
        }
 }
index 3de44174d6a615a65ea69add6348f48c8845c59b..8ed80109b3c6eb10cb03609b991107b2daaae792 100644 (file)
@@ -491,7 +491,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
        base= FIRSTBASE;
        while (base) {
                if (base->lay & lay) {
-                       if (base->flag & SELECT) {
+                       if (base->flag_legacy & SELECT) {
                                if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
                                if (scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT;
                                if (scavisflag & BUTS_ACT_SEL) base->object->scavisflag |= OB_VIS_ACT;
index 70dd80540ecbf3a7e525ca33a6df2b725440e638..394653fcebde26b947297702f3ce9f043dd1bdf0 100644 (file)
@@ -134,7 +134,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
                                /* set selection status */
                                if (selectmode == SELECT_INVERT) {
                                        /* swap select */
-                                       base->flag ^= SELECT;
+                                       base->flag_legacy ^= SELECT;
                                        BKE_scene_base_flag_sync_from_base(base);
                                        
                                        if (adt) adt->flag ^= ADT_UI_SELECTED;
@@ -145,13 +145,13 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
                                        /* deselect all */
                                        /* TODO: should this deselect all other types of channels too? */
                                        for (b = sce->base.first; b; b = b->next) {
-                                               b->flag &= ~SELECT;
+                                               b->flag_legacy &= ~SELECT;
                                                BKE_scene_base_flag_sync_from_base(b);
                                                if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE);
                                        }
                                        
                                        /* select object now */
-                                       base->flag |= SELECT;
+                                       base->flag_legacy |= SELECT;
                                        ob->flag |= SELECT;
                                        if (adt) adt->flag |= ADT_UI_SELECTED;
                                }
index 5e189881d34d49a56573523433341a3ec7c9e0e6..8a913df2a0498c0e8e1d4349f967716583fa3ebc 100644 (file)
@@ -170,7 +170,7 @@ static eOLDrawState tree_element_set_active_object(
        if (base) {
                if (set == OL_SETSEL_EXTEND) {
                        /* swap select */
-                       if (base->flag & SELECT)
+                       if (base->flag_legacy & SELECT)
                                ED_base_object_select(base, BA_DESELECT);
                        else 
                                ED_base_object_select(base, BA_SELECT);
index 09dab1508b4bf17216ca93f953c9850481638d6a..f080232b32610fb68edfb8ecb43fad6f9205d0a8 100644 (file)
@@ -528,7 +528,7 @@ static void group_linkobs2scene_cb(
                        id_us_plus(&gob->ob->id);
                }
                base->object->flag |= SELECT;
-               base->flag |= SELECT;
+               base->flag_legacy |= SELECT;
        }
 }
 
index af041e392c593561e986b6c0851e1eb25ff79489..06ba67077e06bd9687b86c20857cc6a507a1b5ea 100644 (file)
@@ -2106,7 +2106,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
        
        /* draw DoFs */
        if (arm->flag & ARM_POSEMODE) {
-               if (((base->flag & OB_FROMDUPLI) == 0) && ((v3d->flag & V3D_HIDE_HELPLINES) == 0)) {
+               if (((base->flag_legacy & OB_FROMDUPLI) == 0) && ((v3d->flag & V3D_HIDE_HELPLINES) == 0)) {
                        draw_pose_dofs(ob);
                }
        }
@@ -2114,7 +2114,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
        /* finally names and axes */
        if ((arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) &&
            (is_outline == 0) &&
-           ((base->flag & OB_FROMDUPLI) == 0))
+           ((base->flag_legacy & OB_FROMDUPLI) == 0))
        {
                /* patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing */
                if ((G.f & G_PICKSEL) == 0) {
@@ -2733,7 +2733,7 @@ bool draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
                        }
 
                        /* drawing posemode selection indices or colors only in these cases */
-                       if (!(base->flag & OB_FROMDUPLI)) {
+                       if (!(base->flag_legacy & OB_FROMDUPLI)) {
                                if (G.f & G_PICKSEL) {
 #if 0
                                        /* nifty but actually confusing to allow bone selection out of posemode */
index d9eeeef017741b9478cd999b8f3b513b2941ebb9..6fccda94da1c2ade8fe9e166ec54ec2906d051c6 100644 (file)
@@ -325,7 +325,7 @@ bool draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, const char dt)
 
 static bool check_alpha_pass(Base *base)
 {
-       if (base->flag & OB_FROMDUPLI)
+       if (base->flag_legacy & OB_FROMDUPLI)
                return false;
 
        if (G.f & G_PICKSEL)
@@ -1247,7 +1247,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base,
                               !(G.f & G_PICKSEL) &&
                               (la->type == LA_SPOT) &&
                               (la->mode & LA_SHOW_CONE) &&
-                              !(base->flag & OB_FROMDUPLI) &&
+                              !(base->flag_legacy & OB_FROMDUPLI) &&
                               !is_view);
 
 #ifdef WITH_GAMEENGINE
@@ -1259,7 +1259,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base,
                ((la->mode & LA_SHAD_BUF) || 
                (la->mode & LA_SHAD_RAY)) &&
                (la->mode & LA_SHOW_SHADOW_BOX) &&
-               !(base->flag & OB_FROMDUPLI) &&
+               !(base->flag_legacy & OB_FROMDUPLI) &&
                !is_view);
 #else
        const bool drawshadowbox = false;
@@ -4254,7 +4254,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
                if ((v3d->flag & V3D_SELECT_OUTLINE) &&
                    ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                   (base->flag & SELECT) &&
+                   (base->flag_legacy & SELECT) &&
                    !(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) &&
                    (draw_wire == OBDRAW_WIRE_OFF))
                {
@@ -4325,7 +4325,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                                /* draw outline */
                                if ((v3d->flag & V3D_SELECT_OUTLINE) &&
                                    ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                                   (base->flag & SELECT) &&
+                                   (base->flag_legacy & SELECT) &&
                                    (draw_wire == OBDRAW_WIRE_OFF) &&
                                    (ob->sculpt == NULL))
                                {
@@ -4349,7 +4349,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
                        if ((v3d->flag & V3D_SELECT_OUTLINE) &&
                            ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                           (base->flag & SELECT) &&
+                           (base->flag_legacy & SELECT) &&
                            (draw_wire == OBDRAW_WIRE_OFF) &&
                            (ob->sculpt == NULL))
                        {
@@ -4541,7 +4541,7 @@ static bool draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3
                }
        }
        
-       if ((dflag & DRAW_PICKING) == 0 && (base->flag & OB_FROMDUPLI) == 0 && (v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
+       if ((dflag & DRAW_PICKING) == 0 && (base->flag_legacy & OB_FROMDUPLI) == 0 && (v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
                /* GPU_begin_object_materials checked if this is needed */
                if (do_alpha_after) {
                        if (ob->dtx & OB_DRAWXRAY) {
@@ -4731,7 +4731,7 @@ static void draw_mesh_fancy_new(Scene *scene, ARegion *ar, View3D *v3d, RegionVi
 
                if ((v3d->flag & V3D_SELECT_OUTLINE) &&
                    ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                   (base->flag & SELECT) &&
+                   (base->flag_legacy & SELECT) &&
                    !(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) &&
                    (draw_wire == OBDRAW_WIRE_OFF))
                {
@@ -4798,7 +4798,7 @@ static void draw_mesh_fancy_new(Scene *scene, ARegion *ar, View3D *v3d, RegionVi
                                /* TODO: move this into a separate pass */
                                if ((v3d->flag & V3D_SELECT_OUTLINE) &&
                                    ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                                   (base->flag & SELECT) &&
+                                   (base->flag_legacy & SELECT) &&
                                    (draw_wire == OBDRAW_WIRE_OFF) &&
                                    (ob->sculpt == NULL))
                                {
@@ -4822,7 +4822,7 @@ static void draw_mesh_fancy_new(Scene *scene, ARegion *ar, View3D *v3d, RegionVi
 
                        if ((v3d->flag & V3D_SELECT_OUTLINE) &&
                            ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                           (base->flag & SELECT) &&
+                           (base->flag_legacy & SELECT) &&
                            (draw_wire == OBDRAW_WIRE_OFF) &&
                            (ob->sculpt == NULL))
                        {
@@ -7548,7 +7548,7 @@ static bool drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
                ml = mb->editelems->first;
        }
        else {
-               if ((base->flag & OB_FROMDUPLI) == 0) {
+               if ((base->flag_legacy & OB_FROMDUPLI) == 0) {
                        drawDispList(scene, v3d, rv3d, base, dt, dflag, ob_wire_col);
                }
                ml = mb->elems.first;
@@ -7982,7 +7982,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
        }
        else if (ob->type == OB_MBALL) {
                if (BKE_mball_is_basis(ob)) {
-                       if ((base->flag & OB_FROMDUPLI) == 0) {
+                       if ((base->flag_legacy & OB_FROMDUPLI) == 0) {
                                glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0f);
                                drawDispListwire(&ob->curve_cache->disp, ob->type);
                        }
@@ -8109,19 +8109,19 @@ void draw_object_wire_color(Scene *scene, Base *base, unsigned char r_ob_wire_co
 
        if ((scene->obedit == NULL) &&
            (G.moving & G_TRANSFORM_OBJ) &&
-           (base->flag & (SELECT + BA_WAS_SEL)))
+           (base->flag_legacy & (SELECT + BA_WAS_SEL)))
        {
                theme_id = TH_TRANSFORM;
        }
        else {
                /* Sets the 'colindex' */
                if (ID_IS_LINKED_DATABLOCK(ob)) {
-                       colindex = (base->flag & (SELECT + BA_WAS_SEL)) ? 2 : 1;
+                       colindex = (base->flag_legacy & (SELECT + BA_WAS_SEL)) ? 2 : 1;
                }
                /* Sets the 'theme_id' or fallback to wire */
                else {
                        if ((ob->flag & OB_FROMGROUP) != 0) {
-                               if (base->flag & (SELECT + BA_WAS_SEL)) {
+                               if (base->flag_legacy & (SELECT + BA_WAS_SEL)) {
                                        /* uses darker active color for non-active + selected */
                                        theme_id = TH_GROUP_ACTIVE;
 
@@ -8134,7 +8134,7 @@ void draw_object_wire_color(Scene *scene, Base *base, unsigned char r_ob_wire_co
                                }
                        }
                        else {
-                               if (base->flag & (SELECT + BA_WAS_SEL)) {
+                               if (base->flag_legacy & (SELECT + BA_WAS_SEL)) {
                                        theme_id = scene->basact == base ? TH_ACTIVE : TH_SELECT;
                                }
                                else {
@@ -8283,7 +8283,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
                }
        }
 
-       if (((base->flag & OB_FROMDUPLI) == 0) &&
+       if (((base->flag_legacy & OB_FROMDUPLI) == 0) &&
            (md = modifiers_findByType(ob, eModifierType_Smoke)) &&
            (modifier_isEnabled(scene, md, eModifierMode_Realtime)))
        {
@@ -8307,7 +8307,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 
 
        /* xray delay? */
-       if ((dflag & DRAW_PICKING) == 0 && (base->flag & OB_FROMDUPLI) == 0 && (v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
+       if ((dflag & DRAW_PICKING) == 0 && (base->flag_legacy & OB_FROMDUPLI) == 0 && (v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
                /* don't do xray in particle mode, need the z-buffer */
                if (!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
                        /* xray and transp are set when it is drawing the 2nd/3rd pass */
@@ -8805,7 +8805,7 @@ afterdraw:
                glDisable(GL_DEPTH_TEST);
        }
 
-       if ((base->flag & OB_FROMDUPLI) || render_override) {
+       if ((base->flag_legacy & OB_FROMDUPLI) || render_override) {
                ED_view3d_clear_mats_rv3d(rv3d);
                return;
        }
@@ -8819,7 +8819,7 @@ afterdraw:
                }
                else if (is_obact)
                        do_draw_center = ACTIVE;
-               else if (base->flag & SELECT)
+               else if (base->flag_legacy & SELECT)
                        do_draw_center = SELECT;
                else if (empty_object || (v3d->flag & V3D_DRAW_CENTERS))
                        do_draw_center = DESELECT;
index b3f1804398b4d9c9d083001707cd4e94e5dc10c1..f6133b9cdf2c5eec1f2d6962558187aeeca2bfd1 100644 (file)
@@ -1039,7 +1039,7 @@ typedef struct View3DAfter {
 void ED_view3d_after_add(ListBase *lb, Base *base, const short dflag)
 {
        View3DAfter *v3da = MEM_callocN(sizeof(View3DAfter), "View 3d after");
-       BLI_assert((base->flag & OB_FROMDUPLI) == 0);
+       BLI_assert((base->flag_legacy & OB_FROMDUPLI) == 0);
        BLI_addtail(lb, v3da);
        v3da->base = base;
        v3da->dflag = dflag;
@@ -1160,7 +1160,7 @@ static void draw_dupli_objects_color(
                UI_GetThemeColorBlend3ubv(color, TH_BACK, 0.5f, color_rgb);
        }
 
-       tbase.flag = OB_FROMDUPLI | base->flag;
+       tbase.flag_legacy = OB_FROMDUPLI | base->flag_legacy;
        lb = object_duplilist(G.main->eval_ctx, scene, base->object);
        // BLI_listbase_sort(lb, dupli_ob_sort); /* might be nice to have if we have a dupli list with mixed objects. */
 
@@ -1298,7 +1298,7 @@ void draw_dupli_objects(Scene *scene, ARegion *ar, View3D *v3d, Base *base)
        /* define the color here so draw_dupli_objects_color can be called
         * from the set loop */
        
-       int color = (base->flag & SELECT) ? TH_SELECT : TH_WIRE;
+       int color = (base->flag_legacy & SELECT) ? TH_SELECT : TH_WIRE;
        /* debug */
        if (base->object->dup_group && base->object->dup_group->id.us < 1)
                color = TH_REDALERT;
@@ -1834,7 +1834,7 @@ static void view3d_draw_objects(
                                if (base->object->transflag & OB_DUPLI) {
                                        draw_dupli_objects(scene, ar, v3d, base);
                                }
-                               if ((base->flag & SELECT) == 0) {
+                               if ((base->flag_legacy & SELECT) == 0) {
                                        if (base->object != scene->obedit)
                                                draw_object(scene, ar, v3d, base, 0);
                                }
@@ -1847,7 +1847,7 @@ static void view3d_draw_objects(
                /* draw selected and editmode */
                for (base = scene->base.first; base; base = base->next) {
                        if (v3d->lay & base->lay) {
-                               if (base->object == scene->obedit || (base->flag & SELECT)) {
+                               if (base->object == scene->obedit || (base->flag_legacy & SELECT)) {
                                        draw_object(scene, ar, v3d, base, 0);
                                }
                        }
index cf82ab4f23e0f366eabdd0352a0260b19721262b..f64e0c2559c38c109791004a2c59dcc028a6c1eb 100644 (file)
@@ -1080,7 +1080,7 @@ static void deselectall_except(Scene *scene, Base *b)   /* deselect all except b
        Base *base;
        
        for (base = FIRSTBASE; base; base = base->next) {
-               if (base->flag & SELECT) {
+               if (base->flag_legacy & SELECT) {
                        if (b != base) {
                                ED_base_object_select(base, BA_DESELECT);
                        }
@@ -1317,7 +1317,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
                }
                else {
                        /* only exclude active object when it is selected... */
-                       if (BASACT && (BASACT->flag & SELECT) && hits > 1) notcol = BASACT->selcol;
+                       if (BASACT && (BASACT->flag_legacy & SELECT) && hits > 1) notcol = BASACT->selcol;
                        
                        for (a = 0; a < hits; a++) {
                                if (min > buffer[4 * a + 1] && notcol != (buffer[4 * a + 3] & 0xFFFF)) {
@@ -1538,8 +1538,8 @@ static bool ed_object_select_pick(
                                                                                changed = true;
                                                                }
 
-                                                               basact->flag |= SELECT;
-                                                               basact->object->flag = basact->flag;
+                                                               basact->flag_legacy |= SELECT;
+                                                               basact->object->flag = basact->flag_legacy;
 
                                                                retval = true;
 
@@ -1562,8 +1562,8 @@ static bool ed_object_select_pick(
                                
                                        /* we make the armature selected: 
                                         * not-selected active object in posemode won't work well for tools */
-                                       basact->flag |= SELECT;
-                                       basact->object->flag = basact->flag;
+                                       basact->flag_legacy |= SELECT;
+                                       basact->object->flag = basact->flag_legacy;
                                        
                                        retval = true;
                                        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object);
@@ -1604,7 +1604,7 @@ static bool ed_object_select_pick(
                                ED_base_object_select(basact, BA_DESELECT);
                        }
                        else if (toggle) {
-                               if (basact->flag & SELECT) {
+                               if (basact->flag_legacy & SELECT) {
                                        if (basact == oldbasact) {
                                                ED_base_object_select(basact, BA_DESELECT);
                                        }
@@ -2813,7 +2813,7 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
 
        Base *base;
        for (base = FIRSTBASE; base; base = base->next) {
-               if (BASE_SELECTABLE(vc->v3d, base) && ((base->flag & SELECT) != select_flag)) {
+               if (BASE_SELECTABLE(vc->v3d, base) && ((base->flag_legacy & SELECT) != select_flag)) {
                        float screen_co[2];
                        if (ED_view3d_project_float_global(vc->ar, base->object->obmat[3], screen_co,
                                                           V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
index 8582952d1a070ef788b5bfd334677f99607c3545..a73a4bf354d332b31b28029f3b81943e6835ca9e 100644 (file)
@@ -1130,7 +1130,7 @@ static void view3d_select_loop(ViewContext *vc, Scene *scene, View3D *v3d, ARegi
                                                        DupliObject *dob;
                                                        Base tbase;
 
-                                                       tbase.flag = OB_FROMDUPLI;
+                                                       tbase.flag_legacy = OB_FROMDUPLI;
                                                        lb = object_duplilist(G.main->eval_ctx, scene, base->object);
 
                                                        for (dob = lb->first; dob; dob = dob->next) {
@@ -1422,7 +1422,7 @@ static bool view3d_localview_init(
                        if (base->lay & locallay) {
                                base->lay -= locallay;
                                if (base->lay == 0) base->lay = v3d->layact;
-                               if (base->object != scene->obedit) base->flag |= SELECT;
+                               if (base->object != scene->obedit) base->flag_legacy |= SELECT;
                                base->object->lay = base->lay;
                        }
                }
@@ -1510,7 +1510,7 @@ static bool view3d_localview_exit(
                                base->lay -= locallay;
                                if (base->lay == 0) base->lay = v3d->layact;
                                if (base->object != scene->obedit) {
-                                       base->flag |= SELECT;
+                                       base->flag_legacy |= SELECT;
                                        base->object->flag |= SELECT;
                                }
                                base->object->lay = base->lay;
index 87e720c448412f66273d32537c0825fec762f591..be6996bdc65fed83d030001435fe8b854d41c4da 100644 (file)
@@ -5374,7 +5374,7 @@ static void set_trans_object_base_flags(TransInfo *t)
        }
 
        for (base = scene->base.first; base; base = base->next) {
-               base->flag &= ~BA_WAS_SEL;
+               base->flag_legacy &= ~BA_WAS_SEL;
 
                if (TESTBASELIB_BGMODE(v3d, scene, base)) {
                        Object *ob = base->object;
@@ -5398,11 +5398,11 @@ static void set_trans_object_base_flags(TransInfo *t)
                                if ((t->around == V3D_AROUND_LOCAL_ORIGINS) &&
                                    (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL))
                                {
-                                       base->flag |= BA_TRANSFORM_CHILD;
+                                       base->flag_legacy |= BA_TRANSFORM_CHILD;
                                }
                                else {
-                                       base->flag &= ~SELECT;
-                                       base->flag |= BA_WAS_SEL;
+                                       base->flag_legacy &= ~SELECT;
+                                       base->flag_legacy |= BA_WAS_SEL;
                                }
                        }
                        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
@@ -5413,9 +5413,9 @@ static void set_trans_object_base_flags(TransInfo *t)
        /* this because after doing updates, the object->recalc is cleared */
        for (base = scene->base.first; base; base = base->next) {
                if (base->object->recalc & OB_RECALC_OB)
-                       base->flag |= BA_HAS_RECALC_OB;
+                       base->flag_legacy |= BA_HAS_RECALC_OB;
                if (base->object->recalc & OB_RECALC_DATA)
-                       base->flag |= BA_HAS_RECALC_DATA;
+                       base->flag_legacy |= BA_HAS_RECALC_DATA;
        }
 }
 
@@ -5491,9 +5491,9 @@ static int count_proportional_objects(TransInfo *t)
        /* this because after doing updates, the object->recalc is cleared */
        for (base = scene->base.first; base; base = base->next) {
                if (base->object->recalc & OB_RECALC_OB)
-                       base->flag |= BA_HAS_RECALC_OB;
+                       base->flag_legacy |= BA_HAS_RECALC_OB;
                if (base->object->recalc & OB_RECALC_DATA)
-                       base->flag |= BA_HAS_RECALC_DATA;
+                       base->flag_legacy |= BA_HAS_RECALC_DATA;
        }
 
        return total;
@@ -5505,10 +5505,10 @@ static void clear_trans_object_base_flags(TransInfo *t)
        Base *base;
 
        for (base = sce->base.first; base; base = base->next) {
-               if (base->flag & BA_WAS_SEL)
-                       base->flag |= SELECT;
+               if (base->flag_legacy & BA_WAS_SEL)
+                       base->flag_legacy |= SELECT;
 
-               base->flag &= ~(BA_WAS_SEL | BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA | BA_TEMP_TAG | BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT);
+               base->flag_legacy &= ~(BA_WAS_SEL | BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA | BA_TEMP_TAG | BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT);
        }
 }
 
index 85209b07677a0632c30d02b7d0625f9f5d3e4925..3a2e6334cb1b899fd6e9ba8118bcc16c1be51f45 100644 (file)
@@ -1824,9 +1824,9 @@ static bool snapObjectsRay(
        }
        for (Base *base = sctx->scene->base.first; base != NULL; base = base->next) {
                if ((BASE_VISIBLE_BGMODE(sctx->v3d_data.v3d, sctx->scene, base)) &&
-                   (base->flag & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
+                   (base->flag_legacy & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
 
-                   !((ignore_object_selected && (base->flag & (SELECT | BA_WAS_SEL))) ||
+                   !((ignore_object_selected && (base->flag_legacy & (SELECT | BA_WAS_SEL))) ||
                      (ignore_object_active && base == base_act)))
                {
                        Object *ob = base->object;
index 5c5e84ee5f0c156bffa5d0ee9148c7864bea7b3b..2084f6bb5a6dd1d7cf7c42277d7e3ed71746d419 100644 (file)
@@ -477,7 +477,7 @@ static void draw_uvs_other(Scene *scene, Object *obedit, const Image *curimage,
        for (base = scene->base.first; base; base = base->next) {
                Object *ob = base->object;
 
-               if (!(base->flag & SELECT)) continue;
+               if (!(base->flag_legacy & SELECT)) continue;
                if (!(base->lay & scene->lay)) continue;
                if (ob->restrictflag & OB_RESTRICT_VIEW) continue;
 
index 9345129a5048dad66eeb6c7bee220ebeb9a29ddd..6365f75f1e7d5122072aa3cad2ce208852bbd274 100644 (file)
@@ -76,7 +76,7 @@ struct SceneCollection;
 typedef struct Base {
        struct Base *next, *prev;
        unsigned int lay, selcol;
-       int flag;
+       int flag_legacy;
        short sx, sy;
        struct Object *object;
 } Base;
@@ -1968,16 +1968,16 @@ extern const char *RE_engine_id_CYCLES;
 
 /* depricate this! */
 #define TESTBASE(v3d, base)  (                                                \
-       ((base)->flag & SELECT) &&                                                \
+       ((base)->flag_legacy & SELECT) &&                                         \
        ((base)->lay & v3d->lay) &&                                               \
        (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
 #define TESTBASELIB(v3d, base)  (                                             \
-       ((base)->flag & SELECT) &&                                                \
+       ((base)->flag_legacy & SELECT) &&                                         \
        ((base)->lay & v3d->lay) &&                                               \
        ((base)->object->id.lib == NULL) &&                                       \
        (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
 #define TESTBASELIB_BGMODE(v3d, scene, base)  (                               \
-       ((base)->flag & SELECT) &&                                                \
+       ((base)->flag_legacy & SELECT) &&                                         \
        ((base)->lay & (v3d ? v3d->lay : scene->lay)) &&                          \
        ((base)->object->id.lib == NULL) &&                                       \
        (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
@@ -2016,7 +2016,7 @@ extern const char *RE_engine_id_CYCLES;
 #define TIME2FRA(a)     ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
 #define FPS              (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base)
 
-/* base->flag is in DNA_object_types.h */
+/* base->legacy_flag is in DNA_object_types.h */
 
 /* toolsettings->snap_flag */
 #define SCE_SNAP                               1
index f1ee226fae70dcc37fe16e80e765546dd1d3d447..23ad0cb9917020f8aba41317a180f3825c82a323 100644 (file)
@@ -300,7 +300,7 @@ static void rna_Object_dependency_update(Main *bmain, Scene *UNUSED(scene), Poin
 static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        Base *base = (Base *)ptr->data;
-       short mode = (base->flag & BA_SELECT) ? BA_SELECT : BA_DESELECT;
+       short mode = (base->flag_legacy & BA_SELECT) ? BA_SELECT : BA_DESELECT;
        ED_base_object_select(base, mode);
 }
 
@@ -2910,7 +2910,7 @@ static void rna_def_object_base_legacy(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Local View Layers", "3D local view layers the object base is on");
        
        prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_SELECT);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag_legacy", BA_SELECT);
        RNA_def_property_ui_text(prop, "Select", "Object base selection state");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Base_select_update");