Base: update (unused) image_aspect function, copy_attr_menu and its sub-functions

Since this is unused, I didn't test the code. It should be fine though.
This commit is contained in:
Dalai Felinto
2017-03-29 21:19:07 +02:00
parent 63bbf753fc
commit 9571811b5d

View File

@@ -502,11 +502,11 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
} }
static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob) static void copymenu_properties(SceneLayer *sl, Object *ob)
{ {
//XXX no longer used - to be removed - replaced by game_properties_copy_exec //XXX no longer used - to be removed - replaced by game_properties_copy_exec
bProperty *prop; bProperty *prop;
BaseLegacy *base; Base *base;
int nr, tot = 0; int nr, tot = 0;
char *str; char *str;
@@ -535,8 +535,8 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
nr = pupmenu(str); nr = pupmenu(str);
if (nr == 1 || nr == 2) { if (nr == 1 || nr == 2) {
for (base = FIRSTBASE; base; base = base->next) { for (base = FIRSTBASE_NEW; base; base = base->next) {
if ((base != BASACT) && (TESTBASELIB(v3d, base))) { if ((base != BASACT_NEW) && (TESTBASELIB_NEW(base))) {
if (nr == 1) { /* replace */ if (nr == 1) { /* replace */
BKE_bproperty_copy_list(&base->object->prop, &ob->prop); BKE_bproperty_copy_list(&base->object->prop, &ob->prop);
} }
@@ -552,8 +552,8 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
prop = BLI_findlink(&ob->prop, nr - 4); /* account for first 3 menu items & menu index starting at 1*/ prop = BLI_findlink(&ob->prop, nr - 4); /* account for first 3 menu items & menu index starting at 1*/
if (prop) { if (prop) {
for (base = FIRSTBASE; base; base = base->next) { for (base = FIRSTBASE_NEW; base; base = base->next) {
if ((base != BASACT) && (TESTBASELIB(v3d, base))) { if ((base != BASACT_NEW) && (TESTBASELIB_NEW(base))) {
BKE_bproperty_object_set(base->object, prop); BKE_bproperty_object_set(base->object, prop);
} }
} }
@@ -563,14 +563,14 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
} }
static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob) static void copymenu_logicbricks(SceneLayer *sl, Object *ob)
{ {
//XXX no longer used - to be removed - replaced by logicbricks_copy_exec //XXX no longer used - to be removed - replaced by logicbricks_copy_exec
BaseLegacy *base; Base *base;
for (base = FIRSTBASE; base; base = base->next) { for (base = FIRSTBASE_NEW; base; base = base->next) {
if (base->object != ob) { if (base->object != ob) {
if (TESTBASELIB(v3d, base)) { if (TESTBASELIB_NEW(base)) {
/* first: free all logic */ /* first: free all logic */
free_sensors(&base->object->sensors); free_sensors(&base->object->sensors);
@@ -649,7 +649,7 @@ static void copy_texture_space(Object *to, Object *ob)
} }
/* UNUSED, keep in case we want to copy functionality for use elsewhere */ /* UNUSED, keep in case we want to copy functionality for use elsewhere */
static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, View3D *v3d, short event) static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event)
{ {
Object *ob; Object *ob;
Base *base; Base *base;
@@ -666,11 +666,11 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, View3D *v3d, sh
return; return;
} }
if (event == 9) { if (event == 9) {
copymenu_properties(scene, v3d, ob); copymenu_properties(sl, ob);
return; return;
} }
else if (event == 10) { else if (event == 10) {
copymenu_logicbricks(scene, v3d, ob); copymenu_logicbricks(sl, ob);
return; return;
} }
else if (event == 24) { else if (event == 24) {
@@ -900,7 +900,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, View3D *v3d, sh
DAG_relations_tag_update(bmain); DAG_relations_tag_update(bmain);
} }
static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLayer *sl, View3D *v3d) static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLayer *sl)
{ {
Object *ob; Object *ob;
short event; short event;
@@ -954,7 +954,7 @@ static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLay
event = pupmenu(str); event = pupmenu(str);
if (event <= 0) return; if (event <= 0) return;
copy_attr(bmain, scene, sl, v3d, event); copy_attr(bmain, scene, sl, event);
} }
/* ******************* force field toggle operator ***************** */ /* ******************* force field toggle operator ***************** */
@@ -1317,10 +1317,10 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot)
/* ********************** */ /* ********************** */
static void UNUSED_FUNCTION(image_aspect) (Scene *scene, View3D *v3d) static void UNUSED_FUNCTION(image_aspect) (Scene *scene, SceneLayer *sl)
{ {
/* all selected objects with an image map: scale in image aspect */ /* all selected objects with an image map: scale in image aspect */
BaseLegacy *base; Base *base;
Object *ob; Object *ob;
Material *ma; Material *ma;
Tex *tex; Tex *tex;
@@ -1330,8 +1330,8 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, View3D *v3d)
if (scene->obedit) return; // XXX get from context if (scene->obedit) return; // XXX get from context
if (ID_IS_LINKED_DATABLOCK(scene)) return; if (ID_IS_LINKED_DATABLOCK(scene)) return;
for (base = FIRSTBASE; base; base = base->next) { for (base = FIRSTBASE_NEW; base; base = base->next) {
if (TESTBASELIB(v3d, base)) { if (TESTBASELIB_NEW(base)) {
ob = base->object; ob = base->object;
done = false; done = false;