diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-20 16:01:16 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-20 16:01:16 +0400 |
commit | 7172316b945c62797e6beba953ff203766614531 (patch) | |
tree | 640ac56fadded9c7686399b5a1f1c64f1a135700 /source/blender/editors/space_logic | |
parent | 2015eefef70350382931881dd65ed2da09f8f2cd (diff) | |
parent | 78d4260144dbf01166fac8bc9303e6d5aa022f71 (diff) |
Merging r40366 through r40392 from trunk into soc-2011-garlicsoc-2011-garlic
Diffstat (limited to 'source/blender/editors/space_logic')
-rw-r--r-- | source/blender/editors/space_logic/logic_ops.c | 37 |
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); } |