diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-06-15 13:51:27 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-06-15 13:51:27 +0400 |
commit | e95e2419f848116c0b74dc9cb30b410bbd682551 (patch) | |
tree | 7256c6edd44ac14fe6c85bb23ebf99143a61e4e9 | |
parent | 35d1a1cbd81c6ed152ff517344364370746d65f5 (diff) |
Collada (Exporter) improved export panel layout
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 66 |
1 files changed, 61 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b4bec014b9c..458ed43d489 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2206,6 +2206,58 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) } } + +void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) +{ + ID *id = imfptr->id.data; + + uiLayout *box, *row; + + // Export Options: + box = uiLayoutBox(layout); + row = uiLayoutRow(box, 0); + uiItemL(row, IFACE_("Export Data Options:"), ICON_MESH_DATA); + + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "apply_modifiers", 0, NULL, ICON_NONE); + + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "selected", 0, NULL, ICON_NONE); + + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "include_armatures", 0, NULL, ICON_NONE); + uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected")); + + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "include_children", 0, NULL, ICON_NONE); + uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected")); + + + // Collada options: + box = uiLayoutBox(layout); + row = uiLayoutRow(box, 0); + uiItemL(row, IFACE_("Collada Options:"), ICON_MODIFIER); + + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "use_object_instantiation", 0, NULL, ICON_NONE); + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "sort_by_name", 0, IFACE_("Sort by Object name"), ICON_NONE); + row = uiLayoutRow(box, 0); + uiItemR(row, imfptr, "second_life", 0, IFACE_("Export for Second Life"), ICON_NONE); + +} + +static void wm_collada_export_draw(bContext *C, wmOperator *op) +{ + uiLayout *layout = op->layout; + PointerRNA ptr; + + /* image template */ + RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); + uiCollada_exportSettings(layout, &ptr); + +} + static void WM_OT_collada_export(wmOperatorType *ot) { ot->name = "Export COLLADA"; @@ -2217,22 +2269,25 @@ static void WM_OT_collada_export(wmOperatorType *ot) ot->poll = WM_operator_winactive; ot->flag |= OPTYPE_PRESET; + + ot->ui = wm_collada_export_draw; WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); + RNA_def_boolean(ot->srna, "selected", 0, "Selection Only", "Export only selected elements"); - RNA_def_boolean(ot->srna, "apply_modifiers", 0, "Apply Modifiers", - "Apply modifiers (Preview Resolution)"); - RNA_def_boolean(ot->srna, "include_armatures", 0, "Include Armatures", - "Include armature(s) used by the exported objects"); + "Include armature(s) even if not selected"); RNA_def_boolean(ot->srna, "include_children", 0, "Include Children", "Include all children even if not selected"); - RNA_def_boolean(ot->srna, "use_object_instantiation", 1, "Use Object Instantiation", + RNA_def_boolean(ot->srna, "apply_modifiers", 0, "Apply Modifiers", + "Apply modifiers (Preview Resolution)"); + + RNA_def_boolean(ot->srna, "use_object_instantiation", 1, "Use Object Instances", "Instantiate multiple Objects from same Data"); RNA_def_boolean(ot->srna, "sort_by_name", 0, "Sort by Object name", @@ -2242,6 +2297,7 @@ static void WM_OT_collada_export(wmOperatorType *ot) "Compatibility mode for Second Life"); } + /* function used for WM_OT_save_mainfile too */ static int wm_collada_import_exec(bContext *C, wmOperator *op) { |