diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/collada/collada.cpp | 20 | ||||
-rw-r--r-- | source/blender/editors/io/io_collada.c | 55 |
2 files changed, 45 insertions, 30 deletions
diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp index 223ab3eca2a..ffbbb8623ac 100644 --- a/source/blender/collada/collada.cpp +++ b/source/blender/collada/collada.cpp @@ -111,16 +111,28 @@ int collada_export(Scene *sce, eObjectSet objectSet = (export_settings.selected) ? OB_SET_SELECTED : OB_SET_ALL; export_settings.export_set = BKE_object_relational_superset(sce, objectSet, (eObRelationTypes)includeFilter); - - if (export_settings.sort_by_name) - bc_bubble_sort_by_Object_name(export_settings.export_set); + int export_count = BLI_linklist_length(export_settings.export_set); + + if (export_count==0) + { + if (export_settings.selected) { + fprintf(stderr, "Collada: Found no objects to export.\nPlease ensure that all objects which shall be exported are also visible in the 3D Viewport.\n"); + } + else{ + fprintf(stderr, "Collada: Your scene seems to be empty. No Objects will be exported.\n"); + } + } + else { + if (export_settings.sort_by_name) + bc_bubble_sort_by_Object_name(export_settings.export_set); + } DocumentExporter exporter(&export_settings); exporter.exportCurrentScene(sce); BLI_linklist_free(export_settings.export_set, NULL); - return 1; + return export_count; } /* end extern C */ diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index a4130540b1b..bc23c2db433 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -148,33 +148,36 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) ED_object_editmode_load(CTX_data_edit_object(C)); - - if (collada_export(CTX_data_scene(C), - filepath, - apply_modifiers, - export_mesh_type, - selected, - include_children, - include_armatures, - include_shapekeys, - deform_bones_only, - - active_uv_only, - include_uv_textures, - include_material_textures, - use_texture_copies, - - triangulate, - use_object_instantiation, - sort_by_name, - export_transformation_type, - open_sim)) - { - return OPERATOR_FINISHED; - } - else { - BKE_report(op->reports, RPT_WARNING, "Export file not created"); + int export_count = collada_export(CTX_data_scene(C), + filepath, + apply_modifiers, + export_mesh_type, + selected, + include_children, + include_armatures, + include_shapekeys, + deform_bones_only, + + active_uv_only, + include_uv_textures, + include_material_textures, + use_texture_copies, + + triangulate, + use_object_instantiation, + sort_by_name, + export_transformation_type, + open_sim); + + if(export_count == 0) { + BKE_report(op->reports, RPT_WARNING, "Export file is empty"); return OPERATOR_CANCELLED; + } + else { + char buff[100]; + sprintf(buff, "Exported %d Objects", export_count); + BKE_report(op->reports, RPT_INFO, buff); + return OPERATOR_FINISHED; } } |