diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-07-04 12:59:28 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-07-04 12:59:28 +0400 |
commit | cf43e48fc781611c0850e09dae6f6fa1c95cc28b (patch) | |
tree | d6a786c92891eae9482da7b80724b15ca2fa831c /source/blender/windowmanager/intern/wm_operators.c | |
parent | aa1668c6f8a70e41b97b67f31647dbec382e19f7 (diff) |
Apply patch 4636051. COLLADA: Export selection.
Original patch by Jan Diederich, adapted by Pelle Johnsen. Review assistance by Daniel Tavares.
This patch adds an option to export only the selection.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index f65485b84dd..35afdf29b53 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2004,6 +2004,8 @@ static void WM_OT_save_mainfile(wmOperatorType *ot) static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { + int selected = 0; + if(!RNA_property_is_set(op->ptr, "filepath")) { char filepath[FILE_MAX]; BLI_strncpy(filepath, G.main->name, sizeof(filepath)); @@ -2020,6 +2022,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED static int wm_collada_export_exec(bContext *C, wmOperator *op) { char filename[FILE_MAX]; + int selected; if(!RNA_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filename given"); @@ -2027,7 +2030,8 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) } RNA_string_get(op->ptr, "filepath", filename); - if(collada_export(CTX_data_scene(C), filename)) { + selected = RNA_boolean_get(op->ptr, "selected"); + if(collada_export(CTX_data_scene(C), filename, selected)) { return OPERATOR_FINISHED; } else { @@ -2045,6 +2049,8 @@ static void WM_OT_collada_export(wmOperatorType *ot) ot->poll= WM_operator_winactive; WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH); + RNA_def_boolean(ot->srna, "selected", 0, "Export only selected", + "Export only selected elements"); } /* function used for WM_OT_save_mainfile too */ |