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:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-03-07 03:21:52 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-03-07 03:21:52 +0400
commit8664d4b98ba6cdcde44a6878dbdf4d8327a1f96e (patch)
tree6f9ba6771a106311dc0326606f42f7b1644bdd17 /source/blender/editors/io
parent65869589b6bc0caf9a08a10415a18dc563a447cf (diff)
Collada: Added option for how rot,loc,trans data is exported (improves flexibility for support of other 3D tools)
Diffstat (limited to 'source/blender/editors/io')
-rw-r--r--source/blender/editors/io/io_collada.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index 4908c101a7c..7c47bc62aaa 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -95,6 +95,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
int triangulate;
int use_object_instantiation;
int sort_by_name;
+ int export_transformation_type;
int second_life;
if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
@@ -119,10 +120,11 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
use_texture_copies = RNA_boolean_get(op->ptr, "use_texture_copies");
active_uv_only = RNA_boolean_get(op->ptr, "active_uv_only");
- triangulate = RNA_boolean_get(op->ptr, "triangulate");
- use_object_instantiation = RNA_boolean_get(op->ptr, "use_object_instantiation");
- sort_by_name = RNA_boolean_get(op->ptr, "sort_by_name");
- second_life = RNA_boolean_get(op->ptr, "second_life");
+ triangulate = RNA_boolean_get(op->ptr, "triangulate");
+ use_object_instantiation = RNA_boolean_get(op->ptr, "use_object_instantiation");
+ sort_by_name = RNA_boolean_get(op->ptr, "sort_by_name");
+ export_transformation_type = RNA_enum_get(op->ptr, "export_transformation_type_selection");
+ second_life = RNA_boolean_get(op->ptr, "second_life");
/* get editmode results */
ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */
@@ -145,6 +147,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
triangulate,
use_object_instantiation,
sort_by_name,
+ export_transformation_type,
second_life))
{
return OPERATOR_FINISHED;
@@ -224,6 +227,12 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr)
uiItemR(row, imfptr, "triangulate", 0, NULL, ICON_NONE);
row = uiLayoutRow(box, FALSE);
uiItemR(row, imfptr, "use_object_instantiation", 0, NULL, ICON_NONE);
+
+ row = uiLayoutRow(box, FALSE);
+ split = uiLayoutSplit(row, 0.6f, UI_LAYOUT_ALIGN_RIGHT);
+ uiItemL(split, IFACE_("Transformation Type"), ICON_NONE);
+ uiItemR(split, imfptr, "export_transformation_type_selection", 0, "", ICON_NONE);
+
row = uiLayoutRow(box, FALSE);
uiItemR(row, imfptr, "sort_by_name", 0, NULL, ICON_NONE);
@@ -245,6 +254,13 @@ void WM_OT_collada_export(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem prop_bc_export_transformation_type[] = {
+ {BC_TRANSFORMATION_TYPE_MATRIX, "matrix", 0, "Matrix", "Use <matrix> to specify transformations"},
+ {BC_TRANSFORMATION_TYPE_TRANSROTLOC, "transrotloc", 0, "TransRotLoc", "Use <translate>, <rotate>, <scale> to specify transformations"},
+ {BC_TRANSFORMATION_TYPE_BOTH, "both", 0, "Both", "Use <matrix> AND <translate>, <rotate>, <scale> to specify transformations"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
ot->name = "Export COLLADA";
ot->description = "Save a Collada file";
ot->idname = "WM_OT_collada_export";
@@ -308,6 +324,12 @@ void WM_OT_collada_export(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "sort_by_name", 0, "Sort by Object name",
"Sort exported data by Object name");
+ RNA_def_int(ot->srna, "export_transformation_type", 0, INT_MIN, INT_MAX,
+ "Transform", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX);
+
+ RNA_def_enum(ot->srna, "export_transformation_type_selection", prop_bc_export_transformation_type, 0,
+ "Transform", "Transformation type for translation, scale and rotation");
+
RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life",
"Compatibility mode for Second Life");
}