Fixed Camera Ortho scale animation import
[blender-staging.git] / source / blender / collada / collada.cpp
index a519db3332c1d9ed83a123882e53a1f6ded51286..c15e608c3603deb2acdefc1d548b0af4e74f9442 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * ***** END GPL LICENSE BLOCK *****
  */
  *
  * ***** END GPL LICENSE BLOCK *****
  */
-#include "BKE_main.h"
-#include "BKE_scene.h"
-#include "BKE_context.h"
+
+/** \file blender/collada/collada.cpp
+ *  \ingroup collada
+ */
+
+
+/* COLLADABU_ASSERT, may be able to remove later */
+#include "COLLADABUPlatform.h"
 
 #include "DocumentExporter.h"
 #include "DocumentImporter.h"
 
 extern "C"
 {
 
 #include "DocumentExporter.h"
 #include "DocumentImporter.h"
 
 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)
        {
        int collada_import(bContext *C, const char *filepath)
        {
-               DocumentImporter imp;
-               imp.import(C, filepath);
+               DocumentImporter imp (C, filepath);
+               imp.import();
 
                return 1;
        }
 
 
                return 1;
        }
 
-       int collada_export(Scene *sce, const char *filepath)
+       int collada_export(Scene *sce, const char *filepath, int selected)
        {
        {
-
                DocumentExporter exp;
                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;
        }
 
                return 1;
        }