diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-02-06 16:49:26 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-02-06 20:06:47 +0300 |
commit | d4eace74794ea5b20d0fb871c7270ff040f8c3bc (patch) | |
tree | 4b717d1ffaa2e9bd8325702308af7a36fa7b5074 | |
parent | 73bb3d4d77ff4f72d08b423d93e997e10475371f (diff) |
Base refactor 1/4
Rename Base.flag > Base.flag_legacy
26 files changed, 99 insertions, 99 deletions
diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index 5c0b09f0ff0..2ba3ede8c15 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -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; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index f7817171220..8f7c3f53ca6 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index cc136e8e748..8edcac9a72b 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -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) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b12f1d410c4..8047b8a503c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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 */ } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 92592e9fc62..75d7211d41f 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -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; } diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 985ef1e13d2..b2ce46e8f36 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -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; } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 2f73eb6b71c..1b19e7873cf 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index a004d7806b2..6c948b88e6a 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -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); } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 5045c5b1191..0816942bdba 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -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; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index f4731eaec02..18d4c11785b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -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); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 3d770983681..2871ec1c4fc 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -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); } diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 8dc6c4229b2..97604ba118f 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -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++; } } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 3de44174d6a..8ed80109b3c 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -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; diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 70dd80540ec..394653fcebd 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -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; } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 5e189881d34..8a913df2a04 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -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); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 09dab1508b4..f080232b326 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -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; } } diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index af041e392c5..06ba67077e0 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -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 */ diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index d9eeeef0177..6fccda94da1 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -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; diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index b3f1804398b..f6133b9cdf2 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -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); } } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index cf82ab4f23e..f64e0c2559c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -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) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 8582952d1a0..a73a4bf354d 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -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; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 87e720c4484..be6996bdc65 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -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); } } diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 85209b07677..3a2e6334cb1 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -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; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 5c5e84ee5f0..2084f6bb5a6 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -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; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 9345129a504..6365f75f1e7 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -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 diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f1ee226fae7..23ad0cb9917 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -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"); |