Fix export API detection (for assimp < 2.0.885)
It looks like this API was added in Assimp 2.0.885:
ae23c03bd9
This commit is contained in:
parent
d0ecf85b53
commit
049aa4ef3e
|
@ -27,6 +27,9 @@ if( ASSIMP_FOUND )
|
||||||
if( NOT ${ASSIMP_VERSION} STRLESS "2.0.1150" )
|
if( NOT ${ASSIMP_VERSION} STRLESS "2.0.1150" )
|
||||||
add_definitions(-DASSIMP_UNIFIED_HEADER_NAMES)
|
add_definitions(-DASSIMP_UNIFIED_HEADER_NAMES)
|
||||||
endif()
|
endif()
|
||||||
|
if( NOT ${ASSIMP_VERSION} STRLESS "2.0.885" )
|
||||||
|
add_definitions(-DASSIMP_EXPORT_API)
|
||||||
|
endif()
|
||||||
include_directories(${ASSIMP_INCLUDE_DIRS})
|
include_directories(${ASSIMP_INCLUDE_DIRS})
|
||||||
link_directories(${ASSIMP_LIBRARY_DIRS})
|
link_directories(${ASSIMP_LIBRARY_DIRS})
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#else
|
#else
|
||||||
#include <assimp.hpp>
|
#include <assimp.hpp>
|
||||||
|
#if defined(ASSIMP_EXPORT_API)
|
||||||
#include <assimp/export.hpp>
|
#include <assimp/export.hpp>
|
||||||
|
#endif
|
||||||
#include <aiScene.h>
|
#include <aiScene.h>
|
||||||
#include <aiPostProcess.h>
|
#include <aiPostProcess.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -67,6 +69,7 @@ os << "xyz: " << origin.position.x << " " << origin.position.y << " " << origin.
|
||||||
|
|
||||||
void assimp_file_export(std::string fname, std::string ofname,
|
void assimp_file_export(std::string fname, std::string ofname,
|
||||||
std::string mesh_type = "collada") {
|
std::string mesh_type = "collada") {
|
||||||
|
#if defined(ASSIMP_EXPORT_API)
|
||||||
if (fname.find("file://") == 0) {
|
if (fname.find("file://") == 0) {
|
||||||
fname.erase(0, strlen("file://"));
|
fname.erase(0, strlen("file://"));
|
||||||
}
|
}
|
||||||
|
@ -100,6 +103,7 @@ void assimp_file_export(std::string fname, std::string ofname,
|
||||||
std::string str( "assimp error" );
|
std::string str( "assimp error" );
|
||||||
std::cerr << ";; " << str << std::endl;
|
std::cerr << ";; " << str << std::endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// assimp bounding box calculation
|
// assimp bounding box calculation
|
||||||
|
@ -593,7 +597,9 @@ int main(int argc, char** argv)
|
||||||
cerr << ";; Adding gazebo description" << endl;
|
cerr << ";; Adding gazebo description" << endl;
|
||||||
}
|
}
|
||||||
if (vm.count("use_assimp_export")) {
|
if (vm.count("use_assimp_export")) {
|
||||||
|
#if defined(ASSIMP_EXPORT_API)
|
||||||
use_assimp_export = true;
|
use_assimp_export = true;
|
||||||
|
#endif
|
||||||
cerr << ";; Use assimp export" << endl;
|
cerr << ";; Use assimp export" << endl;
|
||||||
}
|
}
|
||||||
if (vm.count("original_inertia_rotation")) {
|
if (vm.count("original_inertia_rotation")) {
|
||||||
|
|
Loading…
Reference in New Issue