fix T58568 build errors when using collada 1.6.68 or newer
authorGaia Clary <gaia.clary@machinimatrix.org>
Tue, 4 Dec 2018 18:11:33 +0000 (19:11 +0100)
committerGaia Clary <gaia.clary@machinimatrix.org>
Tue, 4 Dec 2018 18:11:57 +0000 (19:11 +0100)
source/blender/collada/CMakeLists.txt
source/blender/collada/DocumentImporter.cpp
source/blender/collada/DocumentImporter.h

index 293049a1a0572a0b6912e19592405468481b3c6e..c250384b989fe2815c1f51dcffcd19cbf6225415 100644 (file)
 
 remove_strict_flags()
 
+FIND_FILE(_opencollada_with_animation_clip
+      NAMES
+        COLLADAFWAnimationClip.h
+      PATHS
+        ${OPENCOLLADA_INCLUDE_DIRS}
+      NO_DEFAULT_PATH
+    )
+
+IF(_opencollada_with_animation_clip)
+   add_compile_definitions(OPENCOLLADA_WITH_ANIMATION_CLIP)
+ENDIF()
+
 set(INC
        .
        ../blenkernel
index 67fd9d648c76197be99286568e557d230cd05967..24b7fc4317dad60bb27123ef079d9cecf494b152 100644 (file)
@@ -1349,6 +1349,19 @@ bool DocumentImporter::writeAnimationList(const COLLADAFW::AnimationList *animat
        return anim_importer.write_animation_list(animationList);
 }
 
+#if OPENCOLLADA_WITH_ANIMATION_CLIP
+// Since opencollada 1.6.68
+// called on post-process stage after writeVisualScenes
+bool DocumentImporter::writeAnimationClip(const COLLADAFW::AnimationClip *AnimationClip)
+{
+       if (mImportStage != General)
+               return true;
+
+       return true;
+       //return animation_clip_importer.write_animation_clip(animationClip); // TODO: implement import of AnimationClips
+}
+#endif
+
 /** When this method is called, the writer must write the skin controller data.
  * \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeSkinControllerData(const COLLADAFW::SkinControllerData *skin)
index 17e61326032a9f66a5eae79fb0f0742c86fc8545..5e9f899d42c1a1d121654c4ff950315f99767096 100644 (file)
@@ -49,8 +49,6 @@
 #include "MeshImporter.h"
 #include "ImportSettings.h"
 
-
-
 struct bContext;
 
 /** Importer class. */
@@ -108,6 +106,11 @@ public:
 
        bool writeAnimationList(const COLLADAFW::AnimationList*);
 
+#if OPENCOLLADA_WITH_ANIMATION_CLIP
+       // Please enable this when building with Collada 1.6.65 or newer (also in DocumentImporter.cpp)
+       bool DocumentImporter::writeAnimationClip(const COLLADAFW::AnimationClip *AnimationClip);
+#endif
+
        bool writeGeometry(const COLLADAFW::Geometry*);
 
        bool writeMaterial(const COLLADAFW::Material*);