Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_logic/logic_ops.c')
-rw-r--r--source/blender/editors/space_logic/logic_ops.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index 60e9595b77a..b7f9af09348 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -43,6 +43,7 @@
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_sca.h"
+#include "BKE_material.h" //for texface convert
#include "ED_logic.h"
#include "ED_object.h"
@@ -57,6 +58,11 @@
#include "logic_intern.h"
+// temporary new includes for texface functions
+#include "DNA_mesh_types.h"
+#include "DNA_material_types.h"
+#include "DNA_meshdata_types.h"
+
/* ************* Generic Operator Helpers ************* */
static int edit_sensor_poll(bContext *C)
{
@@ -687,6 +693,36 @@ 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, 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;
+}
+
void ED_operatortypes_logic(void)
{
@@ -699,4 +735,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);
}