[Bf-blender-cvs] [01fc7a6] master: 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.

Thomas Dinges noreply at git.blender.org
Sat Dec 14 10:48:34 CET 2013


Commit: 01fc7a687a19ef2dc8dac43ed9db69da35e3a55a
Author: Thomas Dinges
Date:   Sat Dec 14 10:48:12 2013 +0100
http://developer.blender.org/rB01fc7a687a19ef2dc8dac43ed9db69da35e3a55a

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.

===================================================================

M	release/scripts/startup/bl_ui/space_info.py
M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/intern/material.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/space_logic/logic_ops.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index d098a00..9da525d 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -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')
 
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 91c1715..e2d49aa 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -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
 }
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index f3dc64a..a38fce9 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -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 {
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 6e64dcc..e5304c7 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -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)");
 		}
 		
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index fac564f..dbbe87c 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -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);
 }




More information about the Bf-blender-cvs mailing list