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:
@@ -256,8 +256,6 @@ class INFO_MT_help(Menu):
|
|||||||
layout.operator("wm.operator_cheat_sheet", icon='TEXT')
|
layout.operator("wm.operator_cheat_sheet", icon='TEXT')
|
||||||
layout.operator("wm.sysinfo", icon='TEXT')
|
layout.operator("wm.sysinfo", icon='TEXT')
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("logic.texface_convert", text="TexFace to Material Convert", icon='GAME')
|
|
||||||
layout.separator()
|
|
||||||
|
|
||||||
layout.operator("wm.splash", icon='BLENDER')
|
layout.operator("wm.splash", icon='BLENDER')
|
||||||
|
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ void free_matcopybuf(void);
|
|||||||
void copy_matcopybuf(struct Material *ma);
|
void copy_matcopybuf(struct Material *ma);
|
||||||
void paste_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) */
|
/* handle backward compatibility for tface/materials called from doversion */
|
||||||
int do_version_tface(struct Main *main, int fileload);
|
int do_version_tface(struct Main *main);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1919,7 +1919,7 @@ static void convert_tfacematerial(Main *main, Material *ma)
|
|||||||
|
|
||||||
#define MAT_BGE_DISPUTED -99999
|
#define MAT_BGE_DISPUTED -99999
|
||||||
|
|
||||||
int do_version_tface(Main *main, int fileload)
|
int do_version_tface(Main *main)
|
||||||
{
|
{
|
||||||
Mesh *me;
|
Mesh *me;
|
||||||
Material *ma;
|
Material *ma;
|
||||||
@@ -1929,6 +1929,9 @@ int do_version_tface(Main *main, int fileload)
|
|||||||
int a;
|
int a;
|
||||||
int flag;
|
int flag;
|
||||||
int index;
|
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
|
/* 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
|
* 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) {
|
if (ma->game.flag == MAT_BGE_DISPUTED) {
|
||||||
ma->game.flag = 0;
|
ma->game.flag = 0;
|
||||||
if (fileload) {
|
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;
|
nowarning = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -7349,7 +7349,7 @@ static void convert_tface_mt(FileData *fd, Main *main)
|
|||||||
gmain = G.main;
|
gmain = G.main;
|
||||||
G.main = 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)");
|
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");
|
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 ********************* */
|
/* ************************ view ********************* */
|
||||||
|
|
||||||
static int logic_view_all_exec(bContext *C, wmOperator *op)
|
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_remove);
|
||||||
WM_operatortype_append(LOGIC_OT_actuator_add);
|
WM_operatortype_append(LOGIC_OT_actuator_add);
|
||||||
WM_operatortype_append(LOGIC_OT_actuator_move);
|
WM_operatortype_append(LOGIC_OT_actuator_move);
|
||||||
WM_operatortype_append(LOGIC_OT_texface_convert);
|
|
||||||
WM_operatortype_append(LOGIC_OT_view_all);
|
WM_operatortype_append(LOGIC_OT_view_all);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user