Code cleanup: Remove "TexFace to Material Convert", from the file menu. This was used for conversion from older 2.5x files. The do_version() code is still there and functioning though.

This commit is contained in:
Thomas Dinges 2013-12-14 10:48:12 +01:00
parent dda37dbc5c
commit 01fc7a687a
5 changed files with 8 additions and 39 deletions

@ -256,8 +256,6 @@ class INFO_MT_help(Menu):
layout.operator("wm.operator_cheat_sheet", icon='TEXT')
layout.operator("wm.sysinfo", icon='TEXT')
layout.separator()
layout.operator("logic.texface_convert", text="TexFace to Material Convert", icon='GAME')
layout.separator()
layout.operator("wm.splash", icon='BLENDER')

@ -111,8 +111,8 @@ void free_matcopybuf(void);
void copy_matcopybuf(struct Material *ma);
void paste_matcopybuf(struct Material *ma);
/* handle backward compatibility for tface/materials called from doversion (fileload=1) or Help Menu (fileload=0) */
int do_version_tface(struct Main *main, int fileload);
/* handle backward compatibility for tface/materials called from doversion */
int do_version_tface(struct Main *main);
#ifdef __cplusplus
}

@ -1919,7 +1919,7 @@ static void convert_tfacematerial(Main *main, Material *ma)
#define MAT_BGE_DISPUTED -99999
int do_version_tface(Main *main, int fileload)
int do_version_tface(Main *main)
{
Mesh *me;
Material *ma;
@ -1929,6 +1929,9 @@ int do_version_tface(Main *main, int fileload)
int a;
int flag;
int index;
/* Operator in help menu has been removed for 2.7x */
int fileload = 1;
/* sometimes mesh has no materials but will need a new one. In those
* cases we need to ignore the mf->mat_nr and only look at the face
@ -2072,7 +2075,7 @@ int do_version_tface(Main *main, int fileload)
if (ma->game.flag == MAT_BGE_DISPUTED) {
ma->game.flag = 0;
if (fileload) {
printf("Warning: material \"%s\" skipped - to convert old game texface to material go to the Help menu.\n", ma->id.name + 2);
printf("Warning: material \"%s\" skipped.\n", ma->id.name + 2);
nowarning = 0;
}
else {

@ -7349,7 +7349,7 @@ static void convert_tface_mt(FileData *fd, Main *main)
gmain = G.main;
G.main = main;
if (!(do_version_tface(main, 1))) {
if (!(do_version_tface(main))) {
BKE_report(fd->reports, RPT_WARNING, "Texface conversion problem (see error in console)");
}

@ -706,37 +706,6 @@ static void LOGIC_OT_actuator_move(wmOperatorType *ot)
RNA_def_enum(ot->srna, "direction", logicbricks_move_direction, 1, "Direction", "Move Up or Down");
}
/* ************* TexFace Converter Operator ************* */
static int texface_convert_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
do_version_tface(bmain, 0);
return OPERATOR_FINISHED;
}
static int texface_convert_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
return texface_convert_exec(C, op);
}
static void LOGIC_OT_texface_convert(wmOperatorType *ot)
{
/* identifiers */
ot->name = "TexFace to Material Converter";
ot->description = "Convert old texface settings into material. It may create new materials if needed";
ot->idname = "LOGIC_OT_texface_convert";
/* api callbacks */
ot->invoke = texface_convert_invoke;
ot->exec = texface_convert_exec;
// ot->poll = texface_convert_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ************************ view ********************* */
static int logic_view_all_exec(bContext *C, wmOperator *op)
@ -782,6 +751,5 @@ void ED_operatortypes_logic(void)
WM_operatortype_append(LOGIC_OT_actuator_remove);
WM_operatortype_append(LOGIC_OT_actuator_add);
WM_operatortype_append(LOGIC_OT_actuator_move);
WM_operatortype_append(LOGIC_OT_texface_convert);
WM_operatortype_append(LOGIC_OT_view_all);
}