Rename Scene macros back to their original _NEW less names
authorDalai Felinto <dfelinto@gmail.com>
Thu, 9 Nov 2017 15:23:01 +0000 (13:23 -0200)
committerDalai Felinto <dfelinto@gmail.com>
Thu, 9 Nov 2017 15:35:46 +0000 (13:35 -0200)
59 files changed:
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_view.c
source/blender/draw/modes/object_mode.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/armature/pose_select.c
source/blender/editors/gpencil/gpencil_utils.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/rigidbody_constraint.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_clip/tracking_ops_orient.c
source/blender/editors/space_image/image_edit.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_logic/logic_window.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_tree.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_draw_legacy.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_manipulator_camera.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/transform/transform_snap_object.c
source/blender/gpu/intern/gpu_draw.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_layer.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_space.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/texture/node_texture_tree.c

index 724b30d0cb1f40ff1d77ae2f1f78393cdb60a21d..728167efa04cd637664381208c2165f6cbddfdb0 100644 (file)
@@ -500,7 +500,7 @@ static int surface_getBrushFlags(DynamicPaintSurface *surface, const SceneLayer
        if (surface->brush_group)
                go = surface->brush_group->gobject.first;
        else
-               base = FIRSTBASE_NEW(sl);
+               base = FIRSTBASE(sl);
 
        while (base || go) {
                brushObj = NULL;
@@ -5793,7 +5793,7 @@ static int dynamicPaint_doStep(const struct EvaluationContext *eval_ctx, Scene *
                if (surface->brush_group)
                        go = surface->brush_group->gobject.first;
                else
-                       base = FIRSTBASE_NEW(sl);
+                       base = FIRSTBASE(sl);
 
                while (base || go) {
                        brushObj = NULL;
index 36f7f6d604ebfc7c44f8f02d9e30632e88e4d074..ce3e7dbf931d50c3785bedf983ef1f9b399ed37a 100644 (file)
@@ -244,7 +244,7 @@ ListBase *pdInitEffectors(
                }
        }
        else {
-               for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+               for (base = FIRSTBASE(sl); base; base = base->next) {
                        if ( base->object->pd && base->object->pd->forcefield )
                                add_object_to_effectors(&effectors, eval_ctx, scene, weights, base->object, ob_src, for_simulation);
 
index 39228891d51316074a8ec0afaefba90b6e4d7a87..972596b0cb140def0276a91022b561a9c9da51be 100644 (file)
@@ -866,7 +866,7 @@ static LodLevel *lod_level_select(Object *ob, const float camera_position[3])
 
 bool BKE_object_lod_is_usable(Object *ob, SceneLayer *sl)
 {
-       bool active = (sl) ? ob == OBACT_NEW(sl) : false;
+       bool active = (sl) ? ob == OBACT(sl) : false;
        return (ob->mode == OB_MODE_OBJECT || !active);
 }
 
@@ -2572,7 +2572,7 @@ void BKE_scene_foreach_display_point(
        Base *base;
        Object *ob;
 
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
                if (((base->flag & BASE_VISIBLED) != 0) && ((base->flag & BASE_SELECTED) != 0)) {
                        ob = base->object;
 
@@ -3389,8 +3389,8 @@ LinkNode *BKE_object_relational_superset(struct SceneLayer *scene_layer, eObject
                        obrel_list_add(&links, ob);
                }
                else {
-                       if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE_NEW(base)) ||
-                           (objectSet == OB_SET_VISIBLE  && BASE_EDITABLE_BGMODE_NEW(base)))
+                       if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE(base)) ||
+                           (objectSet == OB_SET_VISIBLE  && BASE_EDITABLE_BGMODE(base)))
                        {
                                Object *ob = base->object;
 
@@ -3420,7 +3420,7 @@ LinkNode *BKE_object_relational_superset(struct SceneLayer *scene_layer, eObject
                                if (includeFilter & (OB_REL_CHILDREN | OB_REL_CHILDREN_RECURSIVE)) {
                                        Base *local_base;
                                        for (local_base = scene_layer->object_bases.first; local_base; local_base = local_base->next) {
-                                               if (BASE_EDITABLE_BGMODE_NEW(local_base)) {
+                                               if (BASE_EDITABLE_BGMODE(local_base)) {
 
                                                        Object *child = local_base->object;
                                                        if (obrel_list_test(child)) {
index 015d688c1dd8ef98b4860274a3b65c483a842a6c..891aab77b081fb70aa4dabbb51dc876eb10d9f74 100644 (file)
@@ -272,7 +272,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
                /* Now we handle the syncing for visibility, selectability, ... */
                layer_collections_sync_flags(&sl_dst->layer_collections, &sl_src->layer_collections);
 
-               Object *active_ob = OBACT_NEW(sl_src);
+               Object *active_ob = OBACT(sl_src);
                for (Base *base_src = sl_src->object_bases.first, *base_dst = sl_dst->object_bases.first;
                     base_src;
                     base_src = base_src->next, base_dst = base_dst->next)
index 7ea985a311bc28b98dc3d34aed43cf09468d929c..4483914f1a64e55263b43c12572de4c6ec97522c 100644 (file)
@@ -704,7 +704,7 @@ static int get_lamp(SceneLayer *sl, float *light)
        int found_lamp = 0;
 
        // try to find a lamp, preferably local
-       for (base_tmp = FIRSTBASE_NEW(sl); base_tmp; base_tmp = base_tmp->next) {
+       for (base_tmp = FIRSTBASE(sl); base_tmp; base_tmp = base_tmp->next) {
                if (base_tmp->object->type == OB_LAMP) {
                        Lamp *la = base_tmp->object->data;
 
index 1ba8fe83971f3e1a1a997ecff858662e920dd004..4d974a1bbd5f439f9b88abb7f4ed0aea802b4f88 100644 (file)
@@ -532,7 +532,7 @@ static void ccd_build_deflector_hash(SceneLayer *sl, Group *group, Object *verte
                }
        }
        else {
-               for (Base *base = FIRSTBASE_NEW(sl); base; base = base->next) {
+               for (Base *base = FIRSTBASE(sl); base; base = base->next) {
                        /*Only proceed for mesh object in same layer */
                        if (base->object->type == OB_MESH) {
                                ob = base->object;
@@ -578,7 +578,7 @@ static void ccd_update_deflector_hash(SceneLayer *sl, Group *group, Object *vert
                }
        }
        else {
-               for (Base *base = FIRSTBASE_NEW(sl); base; base = base->next) {
+               for (Base *base = FIRSTBASE(sl); base; base = base->next) {
                        /*Only proceed for mesh object in same layer */
                        if (base->object->type == OB_MESH) {
                                ob = base->object;
@@ -988,7 +988,7 @@ static bool are_there_deflectors(SceneLayer *sl, Group *group)
                }
        }
        else {
-               for (Base *base = FIRSTBASE_NEW(sl); base; base = base->next) {
+               for (Base *base = FIRSTBASE(sl); base; base = base->next) {
                        if (base->object->pd) {
                                if (base->object->pd->deflect)
                                        return 1;
index fe489315e971244ee440e6ab68daedfea01cd343..b54d90a56821f58c37ae201e696c204d149f3346 100644 (file)
@@ -441,7 +441,7 @@ typedef struct DRWContextState {
        struct SceneLayer *scene_layer;  /* 'CTX_data_scene_layer(C)' */
 
        /* Use 'scene->obedit' for edit-mode */
-       struct Object *obact;   /* 'OBACT_NEW' */
+       struct Object *obact;   /* 'OBACT' */
 
        struct RenderEngineType *engine;
 
index 5fc7b5128260d27d63e958bda2e903519cdf472e..7061aa640a5477bbd35b3dcc83ccdee008b4b884 100644 (file)
@@ -3049,7 +3049,7 @@ static void DRW_engines_enable_external(void)
 
 static void DRW_engines_enable(const Scene *scene, SceneLayer *scene_layer, RenderEngineType *engine)
 {
-       Object *obact = OBACT_NEW(scene_layer);
+       Object *obact = OBACT(scene_layer);
        const int mode = CTX_data_mode_enum_ex(scene->obedit, obact);
 
        DRW_engines_enable_from_engine(engine);
@@ -3224,7 +3224,7 @@ void DRW_notify_view_update(const bContext *C)
 
        DST.viewport = rv3d->viewport;
        DST.draw_ctx = (DRWContextState){
-               ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, C,
+               ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, C,
        };
 
        DRW_engines_enable(scene, scene_layer, engine);
@@ -3288,7 +3288,7 @@ void DRW_draw_render_loop_ex(
        GPU_viewport_engines_data_validate(DST.viewport, DRW_engines_get_hash());
 
        DST.draw_ctx = (DRWContextState){
-           ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine,
+           ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine,
 
            /* reuse if caller sets */
            DST.draw_ctx.evil_C,
@@ -3503,7 +3503,7 @@ void DRW_draw_select_loop(
 
        /* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */
        DST.draw_ctx = (DRWContextState){
-               ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, (bContext *)NULL,
+               ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, (bContext *)NULL,
        };
 
        DRW_viewport_var_init();
@@ -3600,7 +3600,7 @@ void DRW_draw_depth_loop(
 
        /* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */
        DST.draw_ctx = (DRWContextState){
-               ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, (bContext *)NULL,
+               ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, (bContext *)NULL,
        };
 
        DRW_viewport_var_init();
index 02a07688f170f4ff3dc26281acf405a874d202e7..8ed51fcd7f6baca69302ed0cf9851dc836bb0e45 100644 (file)
@@ -613,7 +613,7 @@ void DRW_draw_background(void)
 
 static bool is_cursor_visible(Scene *scene, SceneLayer *scene_layer)
 {
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        /* don't draw cursor in paint modes, but with a few exceptions */
        if (ob && ob->mode & OB_MODE_ALL_PAINT) {
index d5a6db9abf8d1450c36de22f5da8eaf445dd1738..a981a51a846686ed3b1c158643b29a8bcef2a6c0 100644 (file)
@@ -1633,7 +1633,7 @@ static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, Scene
        const bool is_library = ob->id.us > 1 || ID_IS_LINKED(ob);
        DRWShadingGroup *shgroup;
 
-       if (ob == OBACT_NEW(scene_layer)) {
+       if (ob == OBACT(scene_layer)) {
                shgroup = stl->g_data->center_active;
        }
        else if (ob->base_flag & BASE_SELECTED) {
index b4f5c6e8014d1ce47ccb24f714affc02e9688c79..63c700c6eeab8fdd83e9047ad8fb5e885f0ff902 100644 (file)
@@ -136,7 +136,7 @@ static Key *actedit_get_shapekeys(bAnimContext *ac)
        Object *ob;
        Key *key;
        
-       ob = OBACT_NEW(sl);
+       ob = OBACT(sl);
        if (ob == NULL) 
                return NULL;
        
index 77b19130189dfc935a02dd177d53d40095519895..ba01aab0d000fac6ff4af7556a47e12c43f76e53 100644 (file)
@@ -146,7 +146,7 @@ bool ED_do_pose_selectbuffer(
        
        /* if the bone cannot be affected, don't do anything */
        if ((nearBone) && !(nearBone->flag & BONE_UNSELECTABLE)) {
-               Object *ob_act = OBACT_NEW(sl);
+               Object *ob_act = OBACT(sl);
                bArmature *arm = ob->data;
                
                /* since we do unified select, we don't shift+select a bone if the
index dfefd1aa745ef12a797c41b523665edeaf0b4eb8..96c929e9a922e6077c2a9e3eae847600e3e73498 100644 (file)
@@ -212,7 +212,7 @@ bGPdata *ED_gpencil_data_get_active_v3d(Scene *scene, SceneLayer *scene_layer)
         * to be consistent with ED_gpencil_data_get_active's behavior.
         */
        
-       if (base && TESTBASE_NEW(base)) {
+       if (base && TESTBASE(base)) {
                gpd = base->object->gpd;
        }
        return gpd ? gpd : scene->gpd;
index 2f9dbb657c4e36434ec6e4a4829b5d1fe1ad8344..18b3023e06d997444a254d879f918f84cc5bbcb7 100644 (file)
@@ -2031,11 +2031,11 @@ static int convert_exec(bContext *C, wmOperator *op)
        if (basact) {
                /* active base was changed */
                ED_object_base_activate(C, basact);
-               BASACT_NEW(sl) = basact;
+               BASACT(sl) = basact;
        }
-       else if (BASACT_NEW(sl)->object->flag & OB_DONE) {
-               WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, BASACT_NEW(sl)->object);
-               WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT_NEW(sl)->object);
+       else if (BASACT(sl)->object->flag & OB_DONE) {
+               WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, BASACT(sl)->object);
+               WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT(sl)->object);
        }
 
        DEG_relations_tag_update(bmain);
@@ -2373,7 +2373,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
                }
 
                /* new object becomes active */
-               if (BASACT_NEW(sl) == base)
+               if (BASACT(sl) == base)
                        ED_object_base_activate(C, basen);
 
                if (basen->object->data) {
index b02cb3e02a80eceb4909dc560927dcac4227dea8..0fd1d32c8b8db0f9b2cfe7f16e3bf52fffe2c681 100644 (file)
@@ -625,7 +625,7 @@ static void init_bake_internal(BakeRender *bkr, bContext *C)
        bkr->sa = sc ? BKE_screen_find_big_area(sc, SPACE_IMAGE, 10) : NULL; /* can be NULL */
        bkr->main = CTX_data_main(C);
        bkr->scene = scene;
-       bkr->actob = (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT_NEW(sl) : NULL;
+       bkr->actob = (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT(sl) : NULL;
        bkr->re = RE_NewRender("_Bake View_");
 
        if (scene->r.bake_mode == RE_BAKE_AO) {
@@ -858,7 +858,7 @@ static int bake_image_exec(bContext *C, wmOperator *op)
                        RE_test_break_cb(bkr.re, NULL, thread_break);
                        G.is_break = false;   /* BKE_blender_test_break uses this global */
 
-                       RE_Database_Baking(bkr.re, bmain, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT_NEW(sl) : NULL);
+                       RE_Database_Baking(bkr.re, bmain, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT(sl) : NULL);
 
                        /* baking itself is threaded, cannot use test_break in threads  */
                        BLI_init_threads(&threads, do_bake_render, 1);
index 33ce7b4937af969cb1ae17fced4b9a263cbe2d40..80fd44be364427e4fb1811089cbab058a101b66f 100644 (file)
@@ -1689,14 +1689,14 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
                Main *bmain = CTX_data_main(C);
                Scene *scene = CTX_data_scene(C);
                SceneLayer *sl = CTX_data_scene_layer(C);
-               Base *base = BASACT_NEW(sl), *newbase = NULL;
+               Base *base = BASACT(sl), *newbase = NULL;
                Object *obt;
                
                /* add new target object */
                obt = BKE_object_add(bmain, scene, sl, OB_EMPTY, NULL);
                
                /* set layers OK */
-               newbase = BASACT_NEW(sl);
+               newbase = BASACT(sl);
                newbase->lay = base->lay;
                obt->lay = newbase->lay;
                
@@ -1715,7 +1715,7 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
                }
 
                /* restore, BKE_object_add sets active */
-               BASACT_NEW(sl) = base;
+               BASACT(sl) = base;
                base->flag |= BASE_SELECTED;
                
                /* make our new target the new object */
index bbe5c274537f0ccb3d92c0615b4345cea87996b9..207535dd1d03cdd6084c42572dd44f04d970cb5a 100644 (file)
@@ -545,8 +545,8 @@ static void copymenu_properties(SceneLayer *sl, Object *ob)
        nr = pupmenu(str);
        
        if (nr == 1 || nr == 2) {
-               for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-                       if ((base != BASACT_NEW(sl)) && (TESTBASELIB_NEW(base))) {
+               for (base = FIRSTBASE(sl); base; base = base->next) {
+                       if ((base != BASACT(sl)) && (TESTBASELIB(base))) {
                                if (nr == 1) { /* replace */
                                        BKE_bproperty_copy_list(&base->object->prop, &ob->prop);
                                }
@@ -562,8 +562,8 @@ static void copymenu_properties(SceneLayer *sl, Object *ob)
                prop = BLI_findlink(&ob->prop, nr - 4); /* account for first 3 menu items & menu index starting at 1*/
                
                if (prop) {
-                       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-                               if ((base != BASACT_NEW(sl)) && (TESTBASELIB_NEW(base))) {
+                       for (base = FIRSTBASE(sl); base; base = base->next) {
+                               if ((base != BASACT(sl)) && (TESTBASELIB(base))) {
                                        BKE_bproperty_object_set(base->object, prop);
                                }
                        }
@@ -578,9 +578,9 @@ static void copymenu_logicbricks(SceneLayer *sl, Object *ob)
 //XXX no longer used - to be removed - replaced by logicbricks_copy_exec
        Base *base;
        
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
                if (base->object != ob) {
-                       if (TESTBASELIB_NEW(base)) {
+                       if (TESTBASELIB(base)) {
                                
                                /* first: free all logic */
                                free_sensors(&base->object->sensors);
@@ -669,7 +669,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event)
        
        if (ID_IS_LINKED(scene)) return;
 
-       if (!(ob = OBACT_NEW(sl))) return;
+       if (!(ob = OBACT(sl))) return;
        
        if (scene->obedit) { // XXX get from context
                /* obedit_copymenu(); */
@@ -689,9 +689,9 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event)
                return;
        }
 
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-               if (base != BASACT_NEW(sl)) {
-                       if (TESTBASELIB_NEW(base)) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
+               if (base != BASACT(sl)) {
+                       if (TESTBASELIB(base)) {
                                DEG_id_tag_update(&base->object->id, OB_RECALC_DATA);
                                
                                if (event == 1) {  /* loc */
@@ -916,7 +916,7 @@ static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLay
        short event;
        char str[512];
        
-       if (!(ob = OBACT_NEW(sl))) return;
+       if (!(ob = OBACT(sl))) return;
        
        if (scene->obedit) { /* XXX get from context */
 /*             if (ob->type == OB_MESH) */
@@ -1344,8 +1344,8 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, SceneLayer *sl)
        if (scene->obedit) return;  // XXX get from context
        if (ID_IS_LINKED(scene)) return;
        
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-               if (TESTBASELIB_NEW(base)) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
+               if (TESTBASELIB(base)) {
                        ob = base->object;
                        done = false;
                        
index ef7e48f2d1ae1a4d3f0b7d0e8f62cbccfbd15daa..27c1a03190a819c2c96f30e660ab85465e6fa3f5 100644 (file)
@@ -201,7 +201,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
 {
        Main *bmain = CTX_data_main(C);
        SceneLayer *sl = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        int single_group_index = RNA_enum_get(op->ptr, "group");
        Group *single_group = group_object_active_find_index(ob, single_group_index);
        Group *group;
index e2815bf228276a08b89fcff6fab3ac2e8c457932..b1f06831554dfdc4e94b24bb583ffe9b1f6c5b0d 100644 (file)
@@ -247,7 +247,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
                        else {
                                Object workob;
 
-                               ob->parent = BASACT_NEW(sl)->object;
+                               ob->parent = BASACT(sl)->object;
                                if (v3) {
                                        ob->partype = PARVERT3;
                                        ob->par1 = v1 - 1;
index b87c8500de06769d87938ac6716c95783a2a1a61..8ba86b5cb044cb34df150c574046ae8a7fd5e3f0 100644 (file)
@@ -404,7 +404,7 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
                CTX_DATA_END;
        }
        
-       ob = OBACT_NEW(sl);
+       ob = OBACT(sl);
        if (ob == NULL) {
                BKE_report(op->reports, RPT_ERROR, "No active object");
                return OPERATOR_CANCELLED;
@@ -559,7 +559,7 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel
        baspar = BKE_scene_layer_base_find(sl, basact->object->parent);
 
        /* can be NULL if parent in other scene */
-       if (baspar && BASE_SELECTABLE_NEW(baspar)) {
+       if (baspar && BASE_SELECTABLE(baspar)) {
                ED_object_base_select(baspar, BA_SELECT);
                ED_object_base_activate(C, baspar);
                changed = true;
@@ -628,7 +628,7 @@ static bool select_grouped_object_hooks(bContext *C, Object *ob)
                        hmd = (HookModifierData *) md;
                        if (hmd->object && !(hmd->object->flag & SELECT)) {
                                base = BKE_scene_layer_base_find(sl, hmd->object);
-                               if (base && (BASE_SELECTABLE_NEW(base))) {
+                               if (base && (BASE_SELECTABLE(base))) {
                                        ED_object_base_select(base, BA_SELECT);
                                        changed = true;
                                }
@@ -815,7 +815,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
                CTX_DATA_END;
        }
 
-       ob = OBACT_NEW(sl);
+       ob = OBACT(sl);
        if (ob == NULL) {
                BKE_report(op->reports, RPT_ERROR, "No active object");
                return OPERATOR_CANCELLED;
index e93382435db02b9eb4b4266fa4dbd7f4f0a569eb..a46425a937e3b3c29855e0bb342c43223df26d57 100644 (file)
@@ -4458,7 +4458,7 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
 
 void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str)
 {
-       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
+       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
        PTCacheUndo *undo;
        int nr;
 
@@ -4500,7 +4500,7 @@ void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str)
 
 void PE_undo_step(Scene *scene, SceneLayer *sl, int step)
 {      
-       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
+       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
 
        if (!edit) return;
 
@@ -4531,12 +4531,12 @@ void PE_undo_step(Scene *scene, SceneLayer *sl, int step)
                }
        }
 
-       DEG_id_tag_update(&OBACT_NEW(sl)->id, OB_RECALC_DATA);
+       DEG_id_tag_update(&OBACT(sl)->id, OB_RECALC_DATA);
 }
 
 bool PE_undo_is_valid(Scene *scene, SceneLayer *sl)
 {
-       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
+       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
        
        if (edit) {
                return (edit->undo.last != edit->undo.first);
@@ -4571,7 +4571,7 @@ void PE_redo(Scene *scene, SceneLayer *sl)
 
 void PE_undo_number(Scene *scene, SceneLayer *sl, int nr)
 {
-       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
+       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
        PTCacheUndo *undo;
        int a=0;
        
@@ -4587,7 +4587,7 @@ void PE_undo_number(Scene *scene, SceneLayer *sl, int nr)
 /* if active pointer, set it to 1 if true */
 const char *PE_undo_get_name(Scene *scene, SceneLayer *sl, int nr, bool *r_active)
 {
-       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
+       PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
        PTCacheUndo *undo;
        
        if (r_active) *r_active = false;
@@ -4608,7 +4608,7 @@ const char *PE_undo_get_name(Scene *scene, SceneLayer *sl, int nr, bool *r_activ
 
 int PE_minmax(Scene *scene, SceneLayer *sl, float min[3], float max[3])
 {
-       Object *ob= OBACT_NEW(sl);
+       Object *ob= OBACT(sl);
        PTCacheEdit *edit= PE_get_current(scene, sl, ob);
        ParticleSystem *psys;
        ParticleSystemModifierData *psmd = NULL;
index 071dafe08bb33668af74e603a457d941d7972035..3c4aeaf145fed7dd7ec4f824527e81f47981f6c3 100644 (file)
@@ -350,7 +350,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
        channels->DomainTime = MEM_callocN(length * (CHANNEL_FLOAT+1) * sizeof(float), "channel DomainTime");
        
        /* allocate fluid objects */
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
                Object *ob = base->object;
                FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
                
@@ -587,7 +587,7 @@ static int fluid_validate_scene(ReportList *reports, SceneLayer *sl, Object *fsD
        int channelObjCount = 0;
        int fluidInputCount = 0;
 
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
                Object *ob = base->object;
                FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
 
index 1c9b59268e45cbb84a6f35c2c9d41f37871c33f4..13b2943b6e665049acff4a9f71011f942b6b7af7 100644 (file)
@@ -121,7 +121,7 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op)
        Scene *scene = CTX_data_scene(C);
        SceneLayer *sl = CTX_data_scene_layer(C);
        RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        int type = RNA_enum_get(op->ptr, "type");
        bool changed;
 
@@ -170,7 +170,7 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op)
        Main *bmain = CTX_data_main(C);
        Scene *scene = CTX_data_scene(C);
        SceneLayer *sl = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
 
        /* apply to active object */
        if (ELEM(NULL, ob, ob->rigidbody_constraint)) {
index 31d4ede382d9d265c79dff5acda85bcefe18870e..92ab30f7f3d9d7211b5b12601e3fb5cc5704c2b9 100644 (file)
@@ -766,7 +766,7 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo
        /* initialize from context */
        if (CTX_wm_region_view3d(C)) {
                SceneLayer *sl = CTX_data_scene_layer(C);
-               Object *ob = OBACT_NEW(sl);
+               Object *ob = OBACT(sl);
                bool uvs, mat, tex, stencil;
                if (!BKE_paint_proj_mesh_data_check(scene, ob, &uvs, &mat, &tex, &stencil)) {
                        BKE_paint_data_warning(op->reports, uvs, mat, tex, stencil);
index e4b891ead6990f340adf3a92620a6093be05378e..fb797440791c5d11355888ce9f024c2d5bac5e4f 100644 (file)
@@ -5326,7 +5326,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
        int orig_brush_size;
        IDProperty *idgroup;
        IDProperty *view_data = NULL;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        bool uvs, mat, tex;
 
        if (ob == NULL || ob->type != OB_MESH) {
index bf00ce865e906c1caee6c816b2d7e7dc19afaf53..70a3b7bc1bd80eb178ccdc636c2d558b330eb511 100644 (file)
@@ -453,7 +453,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr
        if (CTX_wm_view3d(C) && texpaint_proj) {
                /* first try getting a colour directly from the mesh faces if possible */
                SceneLayer *sl = CTX_data_scene_layer(C);
-               Object *ob = OBACT_NEW(sl);
+               Object *ob = OBACT(sl);
                bool sample_success = false;
                ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
                bool use_material = (imapaint->mode == IMAGEPAINT_MODE_MATERIAL);
index a7f18a4298c267048f056d2ecd36b6d17975446c..ed2a256912e882bfe4807dadd3ed547c051e41aa 100644 (file)
@@ -364,7 +364,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
                        workspace = CTX_wm_workspace(C);
                }
                SceneLayer *scene_layer = BKE_scene_layer_from_workspace_get(scene, workspace);
-               ob = OBACT_NEW(scene_layer);
+               ob = OBACT(scene_layer);
        }
 
        if (ob && ob->type == OB_LAMP && !la)
index 1abfa0ae2a49ff4f18039849b2bef33170ab61cc..e62b6499dea346670c89306b0590ba59a1f480f1 100644 (file)
@@ -99,7 +99,7 @@ static Object *get_orientation_object(bContext *C)
                object = get_camera_with_movieclip(scene, clip);
        }
        else {
-               object = OBACT_NEW(sl);
+               object = OBACT(sl);
        }
 
        if (object != NULL && object->parent != NULL) {
@@ -122,7 +122,7 @@ static int set_orientation_poll(bContext *C)
                                return true;
                        }
                        else {
-                               return OBACT_NEW(sl) != NULL;
+                               return OBACT(sl) != NULL;
                        }
                }
        }
index fbc67ab8090d4606bb3e4664ab533483428ba442..e47a5427605b9e59b9f57f283a94608a7a63a8e1 100644 (file)
@@ -377,7 +377,7 @@ bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
 bool ED_space_image_check_show_maskedit(SceneLayer *sl, SpaceImage *sima)
 {
        /* check editmode - this is reserved for UV editing */
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        if (ob && ob->mode & OB_MODE_EDIT && ED_space_image_show_uvedit(sima, ob)) {
                return false;
        }
index cd4bfb918b32bea257264aaf6faba671895dad79..fab98a14fc6e407d7c44c8597482772878f0e46b 100644 (file)
@@ -538,7 +538,7 @@ static void image_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn, Sc
                                case ND_MODIFIER:
                                {
                                        SceneLayer *sl = BKE_scene_layer_from_workspace_get(scene, workspace);
-                                       Object *ob = OBACT_NEW(sl);
+                                       Object *ob = OBACT(sl);
                                        if (ob && (ob == wmn->reference) && (ob->mode & OB_MODE_EDIT)) {
                                                if (sima->lock && (sima->flag & SI_DRAWSHADOW)) {
                                                        ED_area_tag_refresh(sa);
index 3fd2805efe0e0895f3fcb7c68ffb73aa361df406..9851dcac2313dc72e0bfb54c1a66ecda8546b518 100644 (file)
@@ -485,7 +485,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                ob= ob->id.next;
        }
        
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
                if ((base->flag & BASE_VISIBLED) && (base->flag & SELECT)) {
                        if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
                        if (scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT;
index 62eda7d512872ca9629f134464770f8fb1a5806a..8a2c2594790fa87b4b673a45003dfd1c1f201cb4 100644 (file)
@@ -362,7 +362,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
                                                BLI_strncpy(newname, ebone->name, sizeof(ebone->name));
                                                BLI_strncpy(ebone->name, oldname, sizeof(ebone->name));
                                                ED_armature_bone_rename(obedit->data, oldname, newname);
-                                               WM_event_add_notifier(C, NC_OBJECT | ND_POSE, OBACT_NEW(sl));
+                                               WM_event_add_notifier(C, NC_OBJECT | ND_POSE, OBACT(sl));
                                        }
                                        break;
                                }
@@ -375,7 +375,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
                                        
                                        /* always make current object active */
                                        tree_element_active(C, scene, sl, soops, te, OL_SETSEL_NORMAL, true);
-                                       ob = OBACT_NEW(sl);
+                                       ob = OBACT(sl);
                                        
                                        /* restore bone name */
                                        BLI_strncpy(newname, bone->name, sizeof(bone->name));
@@ -392,7 +392,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
                                        
                                        /* always make current pose-bone active */
                                        tree_element_active(C, scene, sl, soops, te, OL_SETSEL_NORMAL, true);
-                                       ob = OBACT_NEW(sl);
+                                       ob = OBACT(sl);
 
                                        BLI_assert(ob->type == OB_ARMATURE);
                                        
@@ -1257,7 +1257,7 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Sce
                        /* active blocks get white circle */
                        if (tselem->type == 0) {
                                if (te->idcode == ID_OB) {
-                                       active = (OBACT_NEW(sl) == (Object *)tselem->id) ? OL_DRAWSEL_NORMAL : OL_DRAWSEL_NONE;
+                                       active = (OBACT(sl) == (Object *)tselem->id) ? OL_DRAWSEL_NORMAL : OL_DRAWSEL_NONE;
                                }
                                else if (scene->obedit && scene->obedit->data == tselem->id) {
                                        active = OL_DRAWSEL_NORMAL;
@@ -1363,13 +1363,13 @@ static void outliner_draw_tree_element(
                        else if (te->idcode == ID_OB) {
                                Object *ob = (Object *)tselem->id;
                                
-                               if (ob == OBACT_NEW(sl) || (ob->flag & SELECT)) {
+                               if (ob == OBACT(sl) || (ob->flag & SELECT)) {
                                        char col[4] = {0, 0, 0, 0};
                                        
                                        /* outliner active ob: always white text, circle color now similar to view3d */
                                        
                                        active = OL_DRAWSEL_ACTIVE;
-                                       if (ob == OBACT_NEW(sl)) {
+                                       if (ob == OBACT(sl)) {
                                                if (ob->flag & SELECT) {
                                                        UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col);
                                                        col[3] = alpha;
index 4e0686146fbaac6b7027d702cdff19bc268eb9e6..5d0befece0d44350cf3e2b110bcde761815faf2d 100644 (file)
@@ -985,7 +985,7 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op))
        TreeElement *te;
        int xdelta, ytop;
 
-       Object *obact = OBACT_NEW(sl);
+       Object *obact = OBACT(sl);
 
        if (!obact)
                return OPERATOR_CANCELLED;
index 0ef39fc4c927c890124c69c0c3896fad1bd10435..606cc2fd14a9c711daa06228441742a0306d63f5 100644 (file)
@@ -103,7 +103,7 @@ static void do_outliner_object_select_recursive(SceneLayer *sl, Object *ob_paren
 {
        Base *base;
 
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
                Object *ob = base->object;
                if ((((base->flag & BASE_VISIBLED) == 0) && BKE_object_is_child_recursive(ob_parent, ob))) {
                        ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT);
@@ -151,7 +151,7 @@ static eOLDrawState tree_element_set_active_object(
        }
        else {
                ob = (Object *)outliner_search_back(soops, te, ID_OB);
-               if (ob == OBACT_NEW(sl)) {
+               if (ob == OBACT(sl)) {
                        return OL_DRAWSEL_NONE;
                }
        }
@@ -209,7 +209,7 @@ static eOLDrawState tree_element_active_material(
        /* we search for the object parent */
        ob = (Object *)outliner_search_back(soops, te, ID_OB);
        // note: ob->matbits can be NULL when a local object points to a library mesh.
-       if (ob == NULL || ob != OBACT_NEW(sl) || ob->matbits == NULL) {
+       if (ob == NULL || ob != OBACT(sl) || ob->matbits == NULL) {
                return OL_DRAWSEL_NONE;  /* just paranoia */
        }
        
@@ -258,7 +258,7 @@ static eOLDrawState tree_element_active_texture(
 {
        TreeElement *tep;
        TreeStoreElem /* *tselem,*/ *tselemp;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        SpaceButs *sbuts = NULL;
        
        if (ob == NULL) {
@@ -347,7 +347,7 @@ static eOLDrawState tree_element_active_lamp(
        
        /* we search for the object parent */
        ob = (Object *)outliner_search_back(soops, te, ID_OB);
-       if (ob == NULL || ob != OBACT_NEW(sl)) {
+       if (ob == NULL || ob != OBACT(sl)) {
                /* just paranoia */
                return OL_DRAWSEL_NONE;
        }
@@ -423,7 +423,7 @@ static eOLDrawState tree_element_active_defgroup(
                WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob);
        }
        else {
-               if (ob == OBACT_NEW(sl))
+               if (ob == OBACT(sl))
                        if (ob->actdef == te->index + 1) {
                                return OL_DRAWSEL_NORMAL;
                        }
@@ -443,7 +443,7 @@ static eOLDrawState tree_element_active_posegroup(
                }
        }
        else {
-               if (ob == OBACT_NEW(sl) && ob->pose) {
+               if (ob == OBACT(sl) && ob->pose) {
                        if (ob->pose->active_group == te->index + 1) {
                                return OL_DRAWSEL_NORMAL;
                        }
@@ -487,7 +487,7 @@ static eOLDrawState tree_element_active_posechannel(
                }
        }
        else {
-               if (ob == OBACT_NEW(sl) && ob->pose) {
+               if (ob == OBACT(sl) && ob->pose) {
                        if (pchan->bone->flag & BONE_SELECTED) {
                                return OL_DRAWSEL_NORMAL;
                        }
@@ -504,7 +504,7 @@ static eOLDrawState tree_element_active_bone(
        
        if (set != OL_SETSEL_NONE) {
                if (!(bone->flag & BONE_HIDDEN_P)) {
-                       Object *ob = OBACT_NEW(sl);
+                       Object *ob = OBACT(sl);
                        if (ob) {
                                if (set != OL_SETSEL_EXTEND) {
                                        /* single select forces all other bones to get unselected */
@@ -533,7 +533,7 @@ static eOLDrawState tree_element_active_bone(
                }
        }
        else {
-               Object *ob = OBACT_NEW(sl);
+               Object *ob = OBACT(sl);
                
                if (ob && ob->data == arm) {
                        if (bone->flag & BONE_SELECTED) {
@@ -842,7 +842,7 @@ eOLDrawState tree_element_type_active(
                        if (set != OL_SETSEL_NONE) {
                                tree_element_set_active_object(C, scene, sl, soops, te, set, false);
                        }
-                       else if (tselem->id == (ID *)OBACT_NEW(sl)) {
+                       else if (tselem->id == (ID *)OBACT(sl)) {
                                return OL_DRAWSEL_NORMAL;
                        }
                        break;
index 88c5aa431c93aa09ec30aeff28a5fd8e081516e3..f843c474f984a9de924d25e97da331983d98091f 100644 (file)
@@ -1873,7 +1873,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SceneLayer *sl, SpaceOops
                }
        }
        else if (soops->outlinevis == SO_SAME_TYPE) {
-               Object *ob_active = OBACT_NEW(sl);
+               Object *ob_active = OBACT(sl);
                if (ob_active) {
                        FOREACH_SCENE_OBJECT(scene, ob)
                        {
@@ -1952,8 +1952,8 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SceneLayer *sl, SpaceOops
                outliner_add_collections_master(soops, scene);
        }
        else {
-               ten = outliner_add_element(soops, &soops->tree, OBACT_NEW(sl), NULL, 0, 0);
-               ten->directdata = BASACT_NEW(sl);
+               ten = outliner_add_element(soops, &soops->tree, OBACT(sl), NULL, 0, 0);
+               ten->directdata = BASACT(sl);
        }
 
        if ((soops->flag & SO_SKIP_SORT_ALPHA) == 0) {
index b4bd425b038368a04524c0bb28760c84149c0b46..cff88be70cb376d8ed8d904c0d0d246e340ebd9b 100644 (file)
@@ -2986,10 +2986,10 @@ bool draw_armature(
                                                        draw_ghost_poses(eval_ctx, scene, sl, v3d, ar, base);
                                        }
                                        if ((dflag & DRAW_SCENESET) == 0) {
-                                               if (ob == OBACT_NEW(sl))
+                                               if (ob == OBACT(sl))
                                                        arm->flag |= ARM_POSEMODE;
-                                               else if (OBACT_NEW(sl) && (OBACT_NEW(sl)->mode & OB_MODE_WEIGHT_PAINT)) {
-                                                       if (ob == modifiers_isDeformedByArmature(OBACT_NEW(sl)))
+                                               else if (OBACT(sl) && (OBACT(sl)->mode & OB_MODE_WEIGHT_PAINT)) {
+                                                       if (ob == modifiers_isDeformedByArmature(OBACT(sl)))
                                                                arm->flag |= ARM_POSEMODE;
                                                }
                                                draw_pose_paths(scene, v3d, ar, ob);
index b2fdc62af3c36ec0229b673e3a0b264e8488ea89..ff62578583f0b8f74e31be7f12dd7257fa2fe484 100644 (file)
@@ -320,7 +320,7 @@ bool draw_glsl_material(Scene *scene, SceneLayer *sl, Object *ob, View3D *v3d, c
                return false;
        if (!check_object_draw_texture(scene, v3d, dt))
                return false;
-       if (ob == OBACT_NEW(sl) && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
+       if (ob == OBACT(sl) && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
                return false;
        
        if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
@@ -4312,7 +4312,7 @@ static void draw_mesh_fancy(
        eWireDrawMode draw_wire = OBDRAW_WIRE_OFF;
        bool /* no_verts,*/ no_edges, no_faces;
        DerivedMesh *dm = mesh_get_derived_final(eval_ctx, scene, ob, scene->customdata_mask);
-       const bool is_obact = (ob == OBACT_NEW(sl));
+       const bool is_obact = (ob == OBACT(sl));
        int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0;
 
        if (!dm)
@@ -4728,7 +4728,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
        eWireDrawMode draw_wire = OBDRAW_WIRE_OFF; /* could be bool draw_wire_overlay */
        bool no_edges, no_faces;
        DerivedMesh *dm = mesh_get_derived_final(eval_ctx, scene, ob, scene->customdata_mask);
-       const bool is_obact = (ob == OBACT_NEW(sl));
+       const bool is_obact = (ob == OBACT(sl));
        int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0;
 
        if (!dm)
@@ -4849,7 +4849,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
                    !(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) &&
                    (draw_wire == OBDRAW_WIRE_OFF))
                {
-                       draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
+                       draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl)));
                }
 
                if (draw_glsl_material(scene, sl, ob, v3d, dt) && !(draw_flags & DRAW_MODIFIERS_PREVIEW)) {
@@ -4916,7 +4916,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
                                    (draw_wire == OBDRAW_WIRE_OFF) &&
                                    (ob->sculpt == NULL))
                                {
-                                       draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
+                                       draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl)));
                                }
 
                                /* materials arent compatible with vertex colors */
@@ -4941,7 +4941,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
                            (ob->sculpt == NULL))
                        {
                                /* TODO: move this into a separate pass */
-                               draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
+                               draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl)));
                        }
 
                        glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
@@ -8578,7 +8578,7 @@ void draw_object(
        unsigned char _ob_wire_col[4];            /* dont initialize this */
        const unsigned char *ob_wire_col = NULL;  /* dont initialize this, use NULL crashes as a way to find invalid use */
        bool zbufoff = false, is_paint = false, empty_object = false;
-       const bool is_obact = (ob == OBACT_NEW(sl));
+       const bool is_obact = (ob == OBACT(sl));
        const bool render_override = (v3d->flag2 & V3D_RENDER_OVERRIDE) != 0;
        const bool is_picking = (G.f & G_PICKSEL) != 0;
        const bool has_particles = (ob->particlesystem.first != NULL);
index d5772a8d592eaf7b580995387a2d8eedc056416b..ac808487dd2298bfcd1da515c734f2c099f6bd82 100644 (file)
@@ -788,7 +788,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
 static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
 {
        SceneLayer *sl = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        if (ob && (BKE_object_is_in_editmode_vgroup(ob) ||
                   BKE_object_is_in_wpaint_select_vert(ob)))
        {
@@ -1099,7 +1099,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
 {
        SceneLayer *sl = CTX_data_scene_layer(C);
        View3D *v3d = CTX_wm_view3d(C);
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
 
        switch (event) {
 
index 13d5f5901772edd2e4fc02769df0a045158544a2..1e273462d52e1940286d0fff9eec25125f5f34d6 100644 (file)
@@ -1316,7 +1316,7 @@ float ED_view3d_grid_scale(Scene *scene, View3D *v3d, const char **grid_unit)
 
 static bool is_cursor_visible(Scene *scene, SceneLayer *sl)
 {
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
 
        /* don't draw cursor in paint modes, but with a few exceptions */
        if (ob && ob->mode & OB_MODE_ALL_PAINT) {
@@ -1847,7 +1847,7 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar, const int offset)
 
        if (U.uiflag & USER_DRAWVIEWINFO) {
                SceneLayer *sl = CTX_data_scene_layer(C);
-               Object *ob = OBACT_NEW(sl);
+               Object *ob = OBACT(sl);
                draw_selected_name(scene, ob, &rect);
        }
 #if 0 /* TODO */
index e242b2eef334fe431b5cd7fbffd566fb60b56233..065e86bb5615ad3749ec0792cc078438888c0c1e 100644 (file)
@@ -1285,12 +1285,12 @@ void ED_view3d_draw_select_loop(
        UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
 
        if (vc->obedit && vc->obedit->type == OB_MBALL) {
-               draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
+               draw_object(eval_ctx, scene, sl, ar, v3d, BASACT(sl), dflag);
        }
        else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) {
                /* if not drawing sketch, draw bones */
                if (!BDR_drawSketchNames(vc)) {
-                       draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
+                       draw_object(eval_ctx, scene, sl, ar, v3d, BASACT(sl), dflag);
                }
        }
        else {
@@ -2070,7 +2070,7 @@ static void view3d_main_region_draw_info(const bContext *C, Scene *scene,
                        draw_view_icon(rv3d, &rect);
 
                if (U.uiflag & USER_DRAWVIEWINFO) {
-                       Object *ob = OBACT_NEW(scene_layer);
+                       Object *ob = OBACT(scene_layer);
                        VP_legacy_draw_selected_name(scene, ob, &rect);
                }
        }
index 15ac7ec1174b9031e2a9fc1c907042086c4eff07..dc6d6382d371672cbd1fb7abc070c8b6dd51a5f6 100644 (file)
@@ -625,7 +625,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
 
        Scene *scene = CTX_data_scene(C);
        SceneLayer *sl = CTX_data_scene_layer(C);
-       Object *ob_act = OBACT_NEW(sl);
+       Object *ob_act = OBACT(sl);
 
        if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) &&
            /* with weight-paint + pose-mode, fall through to using calculateTransformCenter */
@@ -667,8 +667,8 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
                float select_center[3];
 
                zero_v3(select_center);
-               for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-                       if (TESTBASE_NEW(base)) {
+               for (base = FIRSTBASE(sl); base; base = base->next) {
+                       if (TESTBASE(base)) {
                                /* use the boundbox if we can */
                                Object *ob = base->object;
 
@@ -3015,7 +3015,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
        }
 
        for (base = sl->object_bases.first; base; base = base->next) {
-               if (BASE_VISIBLE_NEW(base)) {
+               if (BASE_VISIBLE(base)) {
                        changed = true;
 
                        if (skip_camera && base->object == v3d->camera) {
@@ -3080,7 +3080,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
        const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
        const bool is_face_map = ((is_gp_edit == false) && ar->manipulator_map &&
                                  WM_manipulatormap_is_any_selected(ar->manipulator_map));
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        Object *obedit = CTX_data_edit_object(C);
        float min[3], max[3];
        bool ok = false, ok_dist = true;
@@ -3100,7 +3100,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
                /* this is weak code this way, we should make a generic active/selection callback interface once... */
                Base *base;
                for (base = sl->object_bases.first; base; base = base->next) {
-                       if (TESTBASELIB_NEW(base)) {
+                       if (TESTBASELIB(base)) {
                                if (base->object->type == OB_ARMATURE)
                                        if (base->object->mode & OB_MODE_POSE)
                                                break;
@@ -3148,8 +3148,8 @@ static int viewselected_exec(bContext *C, wmOperator *op)
        }
        else {
                Base *base;
-               for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-                       if (TESTBASE_NEW(base)) {
+               for (base = FIRSTBASE(sl); base; base = base->next) {
+                       if (TESTBASE(base)) {
 
                                if (skip_camera && base->object == v3d->camera) {
                                        continue;
@@ -3950,7 +3950,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
                        /* lastview -  */
 
                        if (rv3d->persp != RV3D_CAMOB) {
-                               Object *ob = OBACT_NEW(scene_layer);
+                               Object *ob = OBACT(scene_layer);
 
                                if (!rv3d->smooth_timer) {
                                        /* store settings of current view before allowing overwriting with camera view
index d8599610197a144b96f3987bc3985176c466781c..4f322b8519d1020386788f4dde7908871043837f 100644 (file)
@@ -283,7 +283,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
        SceneLayer *sl = CTX_data_scene_layer(C);
        ToolSettings *ts = CTX_data_tool_settings(C);
        PointerRNA v3dptr, toolsptr, sceneptr;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        Object *obedit = CTX_data_edit_object(C);
        bGPdata *gpd = CTX_data_gpencil_data(C);
        uiBlock *block;
index 7d4a8820c9aeea2852f76d64633db7a7d16de294..e8a1b5cea89791c67d963cf5f9e5e5f7478f249f 100644 (file)
@@ -295,7 +295,7 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmManipulatorGroupTy
         * We could change the rules for when to show. */
        {
                SceneLayer *sl = CTX_data_scene_layer(C);
-               if (scene->camera != OBACT_NEW(sl)) {
+               if (scene->camera != OBACT(sl)) {
                        return false;
                }
        }
index 82147f7af4c87a7a9e79d0206d68017b9d791b7f..9a058598580e4fb8d2331ce5e8ce7e03e983e34a 100644 (file)
@@ -382,7 +382,7 @@ static void object_deselect_all_visible(SceneLayer *sl)
        Base *base;
 
        for (base = sl->object_bases.first; base; base = base->next) {
-               if (BASE_SELECTABLE_NEW(base)) {
+               if (BASE_SELECTABLE(base)) {
                        ED_object_base_select(base, BA_DESELECT);
                }
        }
@@ -397,7 +397,7 @@ static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], cons
                object_deselect_all_visible(vc->scene_layer);
 
        for (base = vc->scene_layer->object_bases.first; base; base = base->next) {
-               if (BASE_SELECTABLE_NEW(base)) { /* use this to avoid un-needed lasso lookups */
+               if (BASE_SELECTABLE(base)) { /* use this to avoid un-needed lasso lookups */
                        if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) {
                                if (BLI_lasso_is_point_inside(mcords, moves, base->sx, base->sy, IS_CLIPPED)) {
 
@@ -1295,8 +1295,8 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
                }
                else {
                        /* only exclude active object when it is selected... */
-                       if (BASACT_NEW(sl) && (BASACT_NEW(sl)->flag & BASE_SELECTED) && hits > 1) {
-                               notcol = BASACT_NEW(sl)->object->select_color;
+                       if (BASACT(sl) && (BASACT(sl)->flag & BASE_SELECTED) && hits > 1) {
+                               notcol = BASACT(sl)->object->select_color;
                        }
                        
                        for (a = 0; a < hits; a++) {
@@ -1307,9 +1307,9 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
                        }
                }
                
-               base = FIRSTBASE_NEW(sl);
+               base = FIRSTBASE(sl);
                while (base) {
-                       if (BASE_SELECTABLE_NEW(base)) {
+                       if (BASE_SELECTABLE(base)) {
                                if (base->object->select_color == selcol) break;
                        }
                        base = base->next;
@@ -1324,11 +1324,11 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
                         * with an un-selectable choice */
                        if ((base->flag & BASE_SELECTABLED) == 0) {
                                base = base->next;
-                               if (base == NULL) base = FIRSTBASE_NEW(sl);
+                               if (base == NULL) base = FIRSTBASE(sl);
                                if (base == startbase) break;
                        }
                        
-                       if (BASE_SELECTABLE_NEW(base)) {
+                       if (BASE_SELECTABLE(base)) {
                                for (a = 0; a < hits; a++) {
                                        if (has_bones) {
                                                /* skip non-bone objects */
@@ -1347,7 +1347,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
                        if (basact) break;
                        
                        base = base->next;
-                       if (base == NULL) base = FIRSTBASE_NEW(sl);
+                       if (base == NULL) base = FIRSTBASE(sl);
                        if (base == startbase) break;
                }
        }
@@ -1429,8 +1429,8 @@ static bool ed_object_select_pick(
        }
        
        /* always start list from basact in wire mode */
-       startbase =  FIRSTBASE_NEW(sl);
-       if (BASACT_NEW(sl) && BASACT_NEW(sl)->next) startbase = BASACT_NEW(sl)->next;
+       startbase =  FIRSTBASE(sl);
+       if (BASACT(sl) && BASACT(sl)->next) startbase = BASACT(sl)->next;
        
        /* This block uses the control key to make the object selected by its center point rather than its contents */
        /* in editmode do not activate */
@@ -1443,13 +1443,13 @@ static bool ed_object_select_pick(
                else {
                        base = startbase;
                        while (base) {
-                               if (BASE_SELECTABLE_NEW(base)) {
+                               if (BASE_SELECTABLE(base)) {
                                        float screen_co[2];
                                        if (ED_view3d_project_float_global(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)
                                        {
                                                float dist_temp = len_manhattan_v2v2(mval_fl, screen_co);
-                                               if (base == BASACT_NEW(sl)) dist_temp += 10.0f;
+                                               if (base == BASACT(sl)) dist_temp += 10.0f;
                                                if (dist_temp < dist) {
                                                        dist = dist_temp;
                                                        basact = base;
@@ -1458,7 +1458,7 @@ static bool ed_object_select_pick(
                                }
                                base = base->next;
                                
-                               if (base == NULL) base = FIRSTBASE_NEW(sl);
+                               if (base == NULL) base = FIRSTBASE(sl);
                                if (base == startbase) break;
                        }
                }
@@ -1488,7 +1488,7 @@ static bool ed_object_select_pick(
                        
                        if (has_bones && basact) {
                                if (basact->object->type == OB_CAMERA) {
-                                       if (BASACT_NEW(sl) == basact) {
+                                       if (BASACT(sl) == basact) {
                                                int i, hitresult;
                                                bool changed = false;
 
@@ -1558,14 +1558,14 @@ static bool ed_object_select_pick(
                                        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object);
                                        
                                        /* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
-                                       if (BASACT_NEW(sl) && (BASACT_NEW(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) {
+                                       if (BASACT(sl) && (BASACT(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) {
                                                /* prevent activating */
                                                basact = NULL;
                                        }
 
                                }
                                /* prevent bone selecting to pass on to object selecting */
-                               if (basact == BASACT_NEW(sl))
+                               if (basact == BASACT(sl))
                                        basact = NULL;
                        }
                }
@@ -1581,9 +1581,9 @@ static bool ed_object_select_pick(
                        ED_object_base_select(basact, BA_SELECT);
                }
                /* also prevent making it active on mouse selection */
-               else if (BASE_SELECTABLE_NEW(basact)) {
+               else if (BASE_SELECTABLE(basact)) {
 
-                       oldbasact = BASACT_NEW(sl);
+                       oldbasact = BASACT(sl);
                        
                        if (extend) {
                                ED_object_base_select(basact, BA_SELECT);
@@ -2095,7 +2095,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b
                 * we can be sure the order remains the same between both.
                 */
                for (base = vc->scene_layer->object_bases.first; base && hits; base = base->next) {
-                       if (BASE_SELECTABLE_NEW(base)) {
+                       if (BASE_SELECTABLE(base)) {
                                while (base->object->select_color == (*col & 0xFFFF)) {   /* we got an object */
                                        if (*col & 0xFFFF0000) {                    /* we got a bone */
                                                bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY));
@@ -2837,8 +2837,8 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
 
 
        Base *base;
-       for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
-               if (BASE_SELECTABLE_NEW(base) && ((base->flag & BASE_SELECTED) != select_flag)) {
+       for (base = FIRSTBASE(sl); base; base = base->next) {
+               if (BASE_SELECTABLE(base) && ((base->flag & BASE_SELECTED) != 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 494cf3459df868fa9faa83f8623774618c9ce6b5..e036ffd526c3634da8a1ea44e9e7b402d1c4e23b 100644 (file)
@@ -1906,7 +1906,7 @@ static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *ar, vo
        TransInfo *t = arg;
        Scene *scene = t->scene;
        SceneLayer *sl = t->scene_layer;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        
        /* draw autokeyframing hint in the corner 
         * - only draw if enabled (advanced users may be distracted/annoyed), 
index 922cae1320d4ae18e221a61328c37f4ecef2c279..29401bc2da142ac6f8b3ed7aa3fb60fa21b22b7a 100644 (file)
@@ -292,7 +292,7 @@ static void createTransTexspace(TransInfo *t)
        ID *id;
        short *texflag;
 
-       ob = OBACT_NEW(sl);
+       ob = OBACT(sl);
 
        if (ob == NULL) { // Shouldn't logically happen, but still...
                t->total = 0;
@@ -2011,7 +2011,7 @@ void flushTransParticles(TransInfo *t)
 {
        Scene *scene = t->scene;
        SceneLayer *sl = t->scene_layer;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        PTCacheEdit *edit = PE_get_current(scene, sl, ob);
        ParticleSystem *psys = edit->psys;
        ParticleSystemModifierData *psmd = NULL;
@@ -2053,7 +2053,7 @@ void flushTransParticles(TransInfo *t)
 
        EvaluationContext eval_ctx;
        CTX_data_eval_ctx(t->context, &eval_ctx);
-       PE_update_object(&eval_ctx, scene, sl, OBACT_NEW(sl), 1);
+       PE_update_object(&eval_ctx, scene, sl, OBACT(sl), 1);
 }
 
 /* ********************* mesh ****************** */
@@ -5576,7 +5576,7 @@ static void set_trans_object_base_flags(TransInfo *t)
        for (base = sl->object_bases.first; base; base = base->next) {
                base->flag_legacy &= ~BA_WAS_SEL;
 
-               if (TESTBASELIB_BGMODE_NEW(base)) {
+               if (TESTBASELIB_BGMODE(base)) {
                        Object *ob = base->object;
                        Object *parsel = ob->parent;
 
@@ -5585,7 +5585,7 @@ static void set_trans_object_base_flags(TransInfo *t)
                                if (parsel->base_flag & BASE_SELECTED) {
                                        Base *parbase = BKE_scene_layer_base_find(sl, parsel);
                                        if (parbase) { /* in rare cases this can fail */
-                                               if (TESTBASELIB_BGMODE_NEW(parbase)) {
+                                               if (TESTBASELIB_BGMODE(parbase)) {
                                                        break;
                                                }
                                        }
@@ -5656,7 +5656,7 @@ static int count_proportional_objects(TransInfo *t)
        {
                /* mark all parents */
                for (base = sl->object_bases.first; base; base = base->next) {
-                       if (TESTBASELIB_BGMODE_NEW(base)) {
+                       if (TESTBASELIB_BGMODE(base)) {
                                Object *parent = base->object->parent;
        
                                /* flag all parents */
@@ -5672,7 +5672,7 @@ static int count_proportional_objects(TransInfo *t)
                        /* all base not already selected or marked that is editable */
                        if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
                            (base->flag & BASE_SELECTED) == 0 &&
-                           (BASE_EDITABLE_BGMODE_NEW(base)))
+                           (BASE_EDITABLE_BGMODE(base)))
                        {
                                mark_children(base->object);
                        }
@@ -5685,7 +5685,7 @@ static int count_proportional_objects(TransInfo *t)
                /* if base is not selected, not a parent of selection or not a child of selection and it is editable */
                if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
                    (base->flag & BASE_SELECTED) == 0 &&
-                   (BASE_EDITABLE_BGMODE_NEW(base)))
+                   (BASE_EDITABLE_BGMODE(base)))
                {
 
                        DEG_id_tag_update(&ob->id, OB_RECALC_OB);
@@ -5778,7 +5778,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, SceneLayer *sl, View3D *
                        }
                        else if (ELEM(tmode, TFM_ROTATION, TFM_TRACKBALL)) {
                                if (v3d->around == V3D_AROUND_ACTIVE) {
-                                       if (ob != OBACT_NEW(sl))
+                                       if (ob != OBACT(sl))
                                                do_loc = true;
                                }
                                else if (v3d->around == V3D_AROUND_CURSOR)
@@ -5789,7 +5789,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, SceneLayer *sl, View3D *
                        }
                        else if (tmode == TFM_RESIZE) {
                                if (v3d->around == V3D_AROUND_ACTIVE) {
-                                       if (ob != OBACT_NEW(sl))
+                                       if (ob != OBACT(sl))
                                                do_loc = true;
                                }
                                else if (v3d->around == V3D_AROUND_CURSOR)
@@ -6643,7 +6643,7 @@ static void createTransObject(bContext *C, TransInfo *t)
                        /* if base is not selected, not a parent of selection or not a child of selection and it is editable */
                        if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
                            (base->flag & BASE_SELECTED) == 0 &&
-                           BASE_EDITABLE_BGMODE_NEW(base))
+                           BASE_EDITABLE_BGMODE(base))
                        {
                                td->protectflag = ob->protectflag;
                                td->ext = tx;
@@ -8091,7 +8091,7 @@ void createTransData(bContext *C, TransInfo *t)
 {
        Scene *scene = t->scene;
        SceneLayer *sl = t->scene_layer;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
 
        /* if tests must match recalcData for correct updates */
        if (t->options & CTX_TEXTURE) {
@@ -8258,7 +8258,7 @@ void createTransData(bContext *C, TransInfo *t)
                if (ob_armature && ob_armature->mode & OB_MODE_POSE) {
                        Base *base_arm = BKE_scene_layer_base_find(t->scene_layer, ob_armature);
                        if (base_arm) {
-                               if (BASE_VISIBLE_NEW(base_arm)) {
+                               if (BASE_VISIBLE(base_arm)) {
                                        createTransPose(t, ob_armature);
                                }
                        }
index 5081b65c215db86d72a4489bc2d3c3188ea91d12..863e0c822dd88595542766fbf9ab322d5b15509d 100644 (file)
@@ -331,7 +331,7 @@ static void recalcData_actedit(TransInfo *t)
        /* NOTE: sync this with the code in ANIM_animdata_get_context() */
        ac.scene = t->scene;
        ac.scene_layer = t->scene_layer;
-       ac.obact = OBACT_NEW(sl);
+       ac.obact = OBACT(sl);
        ac.sa = t->sa;
        ac.ar = t->ar;
        ac.sl = (t->sa) ? t->sa->spacedata.first : NULL;
@@ -381,7 +381,7 @@ static void recalcData_graphedit(TransInfo *t)
        /* NOTE: sync this with the code in ANIM_animdata_get_context() */
        ac.scene = t->scene;
        ac.scene_layer = t->scene_layer;
-       ac.obact = OBACT_NEW(sl);
+       ac.obact = OBACT(sl);
        ac.sa = t->sa;
        ac.ar = t->ar;
        ac.sl = (t->sa) ? t->sa->spacedata.first : NULL;
@@ -1804,7 +1804,7 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3])
        }
        else if (t->flag & T_POSE) {
                SceneLayer *sl = t->scene_layer;
-               Object *ob = OBACT_NEW(sl);
+               Object *ob = OBACT(sl);
                if (ob) {
                        bPoseChannel *pchan = BKE_pose_channel_active(ob);
                        if (pchan && (!select_only || (pchan->bone->flag & BONE_SELECTED))) {
@@ -1824,8 +1824,8 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3])
        else {
                /* object mode */
                SceneLayer *sl = t->scene_layer;
-               Object *ob = OBACT_NEW(sl);
-               Base *base = BASACT_NEW(sl);
+               Object *ob = OBACT(sl);
+               Base *base = BASACT(sl);
                if (ob && ((!select_only) || ((base->flag & BASE_SELECTED) != 0))) {
                        copy_v3_v3(r_center, ob->obmat[3]);
                        ok = true;
index d1f17ac7cb28a1d70b0082d0245797a3de5b6a6c..be33cb85f0e7ad88aeb3a83315618be998c06f04 100644 (file)
@@ -596,7 +596,7 @@ static int calc_manipulator_stats(
        View3D *v3d = sa->spacedata.first;
        RegionView3D *rv3d = ar->regiondata;
        Base *base;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        bGPdata *gpd = CTX_data_gpencil_data(C);
        const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
        int a, totsel = 0;
@@ -998,12 +998,12 @@ static int calc_manipulator_stats(
        else {
 
                /* we need the one selected object, if its not active */
-               base = BASACT_NEW(sl);
-               ob = OBACT_NEW(sl);
+               base = BASACT(sl);
+               ob = OBACT(sl);
                if (base && ((base->flag & BASE_SELECTED) == 0)) ob = NULL;
 
                for (base = sl->object_bases.first; base; base = base->next) {
-                       if (TESTBASELIB_NEW(base)) {
+                       if (TESTBASELIB(base)) {
                                if (ob == NULL)
                                        ob = base->object;
                                if (use_only_center || base->object->bb == NULL) {
@@ -1062,7 +1062,7 @@ static void manipulator_prepare_mat(
                case V3D_AROUND_ACTIVE:
                {
                        bGPdata *gpd = CTX_data_gpencil_data(C);
-                       Object *ob = OBACT_NEW(sl);
+                       Object *ob = OBACT(sl);
 
                        if (((v3d->around == V3D_AROUND_ACTIVE) && (scene->obedit == NULL)) &&
                            ((gpd == NULL) || !(gpd->flag & GP_DATA_STROKE_EDITMODE)) &&
@@ -1591,7 +1591,7 @@ static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmManipulator
        wmManipulator *mpr = xmgroup->manipulator;
 
        SceneLayer *sl = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        if (ob && ob->mode & OB_MODE_EDIT) {
                copy_m4_m4(mpr->matrix_space, ob->obmat);
        }
index e91db762eb1000e284e383bea74a24cb5e33de3a..86f99c4fed25ade819e6dd25a2191da7c8012191 100644 (file)
@@ -581,7 +581,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
        SceneLayer *sl = CTX_data_scene_layer(C);
        Object *obedit = CTX_data_edit_object(C);
        Base *base;
-       Object *ob = OBACT_NEW(sl);
+       Object *ob = OBACT(sl);
        int result = ORIENTATION_NONE;
        const bool activeOnly = (around == V3D_AROUND_ACTIVE);
 
@@ -1044,8 +1044,8 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
        }
        else {
                /* we need the one selected object, if its not active */
-               base = BASACT_NEW(sl);
-               ob = OBACT_NEW(sl);
+               base = BASACT(sl);
+               ob = OBACT(sl);
                if (base && ((base->flag & BASE_SELECTED) != 0)) {
                        /* pass */
                }
@@ -1053,7 +1053,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
                        /* first selected */
                        ob = NULL;
                        for (base = sl->object_bases.first; base; base = base->next) {
-                               if (TESTBASELIB_NEW(base)) {
+                               if (TESTBASELIB(base)) {
                                        ob = base->object;
                                        break;
                                }
index 3aedb53cfcebf474557ee4ea8ee4c497fc1079e7..3a71800e9cd8accd169ca2f40fdaa42d3f97eaed 100644 (file)
@@ -78,7 +78,7 @@
 #include "transform.h"
 
 /* this should be passed as an arg for use in snap functions */
-#undef BASACT_NEW
+#undef BASACT
 
 /* use half of flt-max so we can scale up without an exception */
 
index af3c78f5d895f66428eb627fafb2ad302170c2bc..135ea406d6092dd70c454f329103d4fd08fe0d4a 100644 (file)
@@ -171,7 +171,7 @@ static void iter_snap_objects(
        }
 
        for (Base *base = sctx->eval_ctx.scene_layer->object_bases.first; base != NULL; base = base->next) {
-               if ((BASE_VISIBLE_NEW(base)) && (base->flag_legacy & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
+               if ((BASE_VISIBLE(base)) && (base->flag_legacy & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
                    !((snap_select == SNAP_NOT_SELECTED && ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL))) ||
                      (snap_select == SNAP_NOT_ACTIVE && base == base_act)))
                {
index 88831437b90fe37fcc1718ab786403f07e547704..3d50d3840fb4936ca28a77f00b11f26390989e3b 100644 (file)
@@ -2043,7 +2043,7 @@ int GPU_scene_object_lights(SceneLayer *scene_layer, float viewmat[4][4], int or
 
        int count = 0;
 
-       for (Base *base = FIRSTBASE_NEW(scene_layer); base; base = base->next) {
+       for (Base *base = FIRSTBASE(scene_layer); base; base = base->next) {
                if (base->object->type != OB_LAMP)
                        continue;
 
index f6efca10700ca0f10903c46f301855144df204cf..a7006e0157e803b907c4e5b3e68922e107d52873 100644 (file)
@@ -1912,29 +1912,29 @@ extern const char *RE_engine_id_CYCLES;
 #define MINAFRAMEF     -1048574.0f
 
 /* deprecate this! */
-#define TESTBASE_NEW(base)  (                                                 \
+#define TESTBASE(base)  (                                                     \
        (((base)->flag & BASE_SELECTED) != 0) &&                                  \
        (((base)->flag & BASE_VISIBLED) != 0))
-#define TESTBASELIB_NEW(base)  (                                              \
+#define TESTBASELIB(base)  (                                                  \
        (((base)->flag & BASE_SELECTED) != 0) &&                                  \
        ((base)->object->id.lib == NULL) &&                                       \
        (((base)->flag & BASE_VISIBLED) != 0))
-#define TESTBASELIB_BGMODE_NEW(base)  (                                       \
+#define TESTBASELIB_BGMODE(base)  (                                           \
        (((base)->flag & BASE_SELECTED) != 0) &&                                  \
        ((base)->object->id.lib == NULL) &&                                       \
        (((base)->flag & BASE_VISIBLED) != 0))
-#define BASE_EDITABLE_BGMODE_NEW(base)  (                                     \
+#define BASE_EDITABLE_BGMODE(base)  (                                         \
        ((base)->object->id.lib == NULL) &&                                       \
        (((base)->flag & BASE_VISIBLED) != 0))
-#define BASE_SELECTABLE_NEW(base)                                             \
+#define BASE_SELECTABLE(base)                                                 \
        (((base)->flag & BASE_SELECTABLED) != 0)
-#define BASE_VISIBLE_NEW(base)  (                                             \
+#define BASE_VISIBLE(base)  (                                                 \
        ((base)->flag & BASE_VISIBLED) != 0)
 
-#define FIRSTBASE_NEW(_sl)  ((_sl)->object_bases.first)
-#define LASTBASE_NEW(_sl)   ((_sl)->object_bases.last)
-#define BASACT_NEW(_sl)     ((_sl)->basact)
-#define OBACT_NEW(_sl)      (BASACT_NEW(_sl) ? BASACT_NEW(_sl)->object: NULL)
+#define FIRSTBASE(_sl)  ((_sl)->object_bases.first)
+#define LASTBASE(_sl)   ((_sl)->object_bases.last)
+#define BASACT(_sl)     ((_sl)->basact)
+#define OBACT(_sl)      (BASACT(_sl) ? BASACT(_sl)->object: NULL)
 
 #define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
 #define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
index ea20e4c67862ec1d3a656e69d6c005ad0c486313..b92f06c97a53df3e30db21f80ef6f5b47e639538 100644 (file)
@@ -424,7 +424,7 @@ static void rna_LayerCollectionEngineSettings_wire_update(bContext *C, PointerRN
 {
        Scene *scene = CTX_data_scene(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob != NULL && ob->type == OB_MESH) {
                BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
index 8e469813b36bad1ce5abb9807390682169d28c48..e96ceffe1fc6a30a5efaeb39288f26a3c57ebb58 100644 (file)
@@ -1858,7 +1858,7 @@ static char *rna_MeshStatVis_path(PointerRNA *UNUSED(ptr))
 static void rna_Scene_update_active_object_data(bContext *C, PointerRNA *UNUSED(ptr))
 {
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob) {
                DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
index 8bb0eda9a0b4a2f5bf39e43cc8fa7c4bb420baf9..0c0cfe24d6331de493548e5ffc020d0ed11d4719 100644 (file)
@@ -156,7 +156,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
 {
        Scene *scene = CTX_data_scene(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
        PTCacheEdit *edit = PE_get_current(scene, scene_layer, ob);
 
        if (!edit)
@@ -168,7 +168,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
 static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *UNUSED(scene), bContext *C, PointerRNA *UNUSED(ptr))
 {
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob) DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
 }
@@ -192,7 +192,7 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerR
                                                      PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 #if 0
        Scene *scene = CTX_data_scene(C);
        PTCacheEdit *edit = PE_get_current(scene, ob);
@@ -266,7 +266,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
 {
        Scene *scene = CTX_data_scene(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob) {
                DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -282,7 +282,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
 static void rna_Sculpt_ShowDiffuseColor_update(bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
 {
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob && ob->sculpt) {
                Sculpt *sd = scene->toolsettings->sculpt;
@@ -345,7 +345,7 @@ static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
 {
        Scene *scene = CTX_data_scene(C);\
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob && ob->type == OB_MESH) {
                /* of course we need to invalidate here */
@@ -362,7 +362,7 @@ static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr))
 {
        Scene *scene = CTX_data_scene(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
 
        if (ob && ob->type == OB_MESH) {
                GPU_drawobject_free(ob->derivedFinal);
@@ -376,7 +376,7 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
        Main *bmain = CTX_data_main(C);
        Scene *scene = CTX_data_scene(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
        bScreen *sc;
        Image *ima = scene->toolsettings->imapaint.canvas;
        
index 43fb31f3a4fd20e56227bb9739f2c6f14aeabd38..d908426a9e78eef1e40f769dd66bef11a2ac7e0f 100644 (file)
@@ -1325,7 +1325,7 @@ static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
        SpaceAction *saction = (SpaceAction *)(ptr->data);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
        Main *bmain = CTX_data_main(C);
-       Object *obact = OBACT_NEW(scene_layer);
+       Object *obact = OBACT(scene_layer);
 
        /* we must set this action to be the one used by active object (if not pinned) */
        if (obact /* && saction->pin == 0*/) {
@@ -1401,7 +1401,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
 {
        SpaceAction *saction = (SpaceAction *)(ptr->data);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *obact = OBACT_NEW(scene_layer);
+       Object *obact = OBACT(scene_layer);
 
        /* special exceptions for ShapeKey Editor mode */
        if (saction->mode == SACTCONT_SHAPEKEY) {
index 3d2de295e1bac844df49ad6197ab2304be206257..d05f9316fc4c67699a9f9ceb1b3646c906c1cac6 100644 (file)
@@ -86,7 +86,7 @@ static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tre
        Scene *scene = CTX_data_scene(C);
        WorkSpace *workspace = CTX_wm_workspace(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
        ViewRender *view_render = BKE_viewrender_get(scene, workspace);
        
        if ((snode->shaderfrom == SNODE_SHADER_OBJECT) ||
index c7f03d36efb9a88205193af02d850848d2d24366..643f187de9b205b43b88113ea04cc789bd7bea88 100644 (file)
@@ -63,7 +63,7 @@ static void texture_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tr
        SpaceNode *snode = CTX_wm_space_node(C);
        Scene *scene = CTX_data_scene(C);
        SceneLayer *scene_layer = CTX_data_scene_layer(C);
-       Object *ob = OBACT_NEW(scene_layer);
+       Object *ob = OBACT(scene_layer);
        Tex *tx = NULL;
 
        if (snode->texfrom == SNODE_TEX_OBJECT) {