Fixed Camera Ortho scale animation import
[blender-staging.git] / source / blender / collada / collada.cpp
index 0d822c63094be23ba7bb775648e6bc68efeb35ef..c15e608c3603deb2acdefc1d548b0af4e74f9442 100644 (file)
@@ -38,6 +38,11 @@ extern "C"
 #include "BKE_scene.h"
 #include "BKE_context.h"
 
+/* make dummy file */
+#include "BLI_storage.h"
+#include "BLI_path_util.h"
+#include "BLI_fileops.h"
+
        int collada_import(bContext *C, const char *filepath)
        {
                DocumentImporter imp (C, filepath);
@@ -46,11 +51,20 @@ extern "C"
                return 1;
        }
 
-       int collada_export(Scene *sce, const char *filepath)
+       int collada_export(Scene *sce, const char *filepath, int selected)
        {
-
                DocumentExporter exp;
-               exp.exportCurrentScene(sce, filepath);
+
+               /* annoying, collada crashes if file cant be created! [#27162] */
+               if(!BLI_exist(filepath)) {
+                       BLI_make_existing_file(filepath); /* makes the dir if its not there */
+                       if(BLI_touch(filepath) == 0) {
+                               return 0;
+                       }
+               }
+               /* end! */
+
+               exp.exportCurrentScene(sce, filepath, selected);
 
                return 1;
        }