diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-15 16:59:38 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-15 16:59:38 +0300 |
commit | 77497175fa1f2f3aacf4ab966df9d7223d4034cc (patch) | |
tree | 34e143b88d2f9857e6926a1d156b8d8c3243d7b2 /source/blender/editors/object | |
parent | 90d80ddaa28908048e428fd08c4c771c015a0d66 (diff) |
Cleanup/refactor: no new general arg-less macros enforcing var names please!
We do have an history of those pieces of evil in our code, would be nice
to get fully rid of it, but at the very least let's not add more of them
in new code. :)
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 20 | ||||
-rw-r--r-- | source/blender/editors/object/object_group.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_select.c | 4 |
7 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 839e5f415e2..7df436efdd5 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2029,11 +2029,11 @@ static int convert_exec(bContext *C, wmOperator *op) if (basact) { /* active base was changed */ ED_object_base_activate(C, basact); - BASACT_NEW = basact; + BASACT_NEW(sl) = basact; } - else if (BASACT_NEW->object->flag & OB_DONE) { - WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, BASACT_NEW->object); - WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT_NEW->object); + 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); } DEG_relations_tag_update(bmain); @@ -2366,7 +2366,7 @@ static int duplicate_exec(bContext *C, wmOperator *op) } /* new object becomes active */ - if (BASACT_NEW == base) + if (BASACT_NEW(sl) == base) ED_object_base_activate(C, basen); if (basen->object->data) { diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index e3dd47295fe..b02cb3e02a8 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -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 : NULL; + bkr->actob = (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT_NEW(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 : NULL); + 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); /* baking itself is threaded, cannot use test_break in threads */ BLI_init_threads(&threads, do_bake_render, 1); diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 0605be5c773..4e578906e07 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -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, *newbase = NULL; + Base *base = BASACT_NEW(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; + newbase = BASACT_NEW(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 = base; + BASACT_NEW(sl) = base; base->flag |= BASE_SELECTED; /* make our new target the new object */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 13f9f950236..953dedab02d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -545,8 +545,8 @@ static void copymenu_properties(SceneLayer *sl, Object *ob) nr = pupmenu(str); if (nr == 1 || nr == 2) { - for (base = FIRSTBASE_NEW; base; base = base->next) { - if ((base != BASACT_NEW) && (TESTBASELIB_NEW(base))) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { + if ((base != BASACT_NEW(sl)) && (TESTBASELIB_NEW(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; base; base = base->next) { - if ((base != BASACT_NEW) && (TESTBASELIB_NEW(base))) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { + if ((base != BASACT_NEW(sl)) && (TESTBASELIB_NEW(base))) { BKE_bproperty_object_set(base->object, prop); } } @@ -578,7 +578,7 @@ 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; base; base = base->next) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { if (base->object != ob) { if (TESTBASELIB_NEW(base)) { @@ -669,7 +669,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) if (ID_IS_LINKED_DATABLOCK(scene)) return; - if (!(ob = OBACT_NEW)) return; + if (!(ob = OBACT_NEW(sl))) return; if (scene->obedit) { // XXX get from context /* obedit_copymenu(); */ @@ -689,8 +689,8 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) return; } - for (base = FIRSTBASE_NEW; base; base = base->next) { - if (base != BASACT_NEW) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { + if (base != BASACT_NEW(sl)) { if (TESTBASELIB_NEW(base)) { DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); @@ -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)) return; + if (!(ob = OBACT_NEW(sl))) return; if (scene->obedit) { /* XXX get from context */ /* if (ob->type == OB_MESH) */ @@ -1341,7 +1341,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, SceneLayer *sl) if (scene->obedit) return; // XXX get from context if (ID_IS_LINKED_DATABLOCK(scene)) return; - for (base = FIRSTBASE_NEW; base; base = base->next) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { if (TESTBASELIB_NEW(base)) { ob = base->object; done = false; diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index 3064bf8af1a..b32fb975ea8 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -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; + Object *ob = OBACT_NEW(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; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 7e10cbeeb82..04ac42a5471 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -247,7 +247,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) else { Object workob; - ob->parent = BASACT_NEW->object; + ob->parent = BASACT_NEW(sl)->object; if (v3) { ob->partype = PARVERT3; ob->par1 = v1 - 1; @@ -354,7 +354,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op) if (ob) { Object *newob; - BaseLegacy *newbase, *oldbase = BASACT_NEW; + BaseLegacy *newbase, *oldbase = BASACT_NEW(sl); char name[MAX_ID_NAME + 4]; BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name + 2); @@ -363,7 +363,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op) newob = BKE_object_add(bmain, scene, sl, OB_EMPTY, name); /* set layers OK */ - newbase = BASACT_NEW; /* BKE_object_add sets active... */ + newbase = BASACT_NEW(sl); /* BKE_object_add sets active... */ newbase->lay = oldbase->lay; newob->lay = newbase->lay; diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 0a9b8b749f1..628c5b846a3 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -425,7 +425,7 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) CTX_DATA_END; } - ob = OBACT_NEW; + ob = OBACT_NEW(sl); if (ob == NULL) { BKE_report(op->reports, RPT_ERROR, "No active object"); return OPERATOR_CANCELLED; @@ -836,7 +836,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) CTX_DATA_END; } - ob = OBACT_NEW; + ob = OBACT_NEW(sl); if (ob == NULL) { BKE_report(op->reports, RPT_ERROR, "No active object"); return OPERATOR_CANCELLED; |