From 5f735b4e5071878b5c840655ea2d20c6ec56c3cd Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Tue, 2 Jun 2015 19:34:19 -0700 Subject: [PATCH] Changes to makepanda to compile with Assimp This includes updating header files for Assimp 3. --- makepanda/makepanda.py | 14 +++++++++++++- pandatool/src/assimp/assimpLoader.cxx | 2 +- pandatool/src/assimp/assimpLoader.h | 3 ++- pandatool/src/assimp/config_assimp.h | 2 -- pandatool/src/assimp/p3assimp_composite1.cxx | 7 +++++++ pandatool/src/assimp/pandaIOStream.h | 2 +- pandatool/src/assimp/pandaIOSystem.h | 2 +- pandatool/src/assimp/pandaLogger.cxx | 2 +- pandatool/src/assimp/pandaLogger.h | 2 +- 9 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 pandatool/src/assimp/p3assimp_composite1.cxx diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 487d964d8f..6cec559b8a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -87,7 +87,7 @@ PkgListSet(["PYTHON", "DIRECT", # Python support "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics "SPEEDTREE", # SpeedTree "ZLIB", "PNG", "JPEG", "TIFF", "SQUISH", "FREETYPE", # 2D Formats support - ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", # 3D Formats support + ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", # 3D Formats support "VRPN", "OPENSSL", # Transport "FFTW", # Algorithm helpers "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality @@ -595,6 +595,7 @@ if (COMPILER == "MSVC"): if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib") if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib") if (PkgSkip("FCOLLADA")==0): LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib") + if (PkgSkip("ASSIMP")==0): PkgDisable("ASSIMP") # Not yet supported if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib") @@ -737,6 +738,7 @@ if (COMPILER=="GCC"): SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS') SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h") SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h")) + SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp") SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ffmpeg_libs) SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale", "libswscale/swscale.h"), target_pkg = "FFMPEG") SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample", "libswresample/swresample.h"), target_pkg = "FFMPEG") @@ -5207,6 +5209,16 @@ if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0): TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj') TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON']) +# +# DIRECTORY: pandatool/src/assimp +# +if (PkgSkip("PANDATOOL") == 0 and PkgSkip("ASSIMP")==0): + OPTS=['DIR:pandatool/src/assimp', 'ASSIMP', 'MODULE'] + TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx') + TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj') + TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS) + TargetAdd('libp3assimp.dll', opts=OPTS) + # # DIRECTORY: pandatool/src/daeprogs/ # diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 2dcd3f36e8..384462fc77 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -36,7 +36,7 @@ #include "pandaIOSystem.h" #include "pandaLogger.h" -#include "aiPostProcess.h" +#include "assimp/postprocess.h" //////////////////////////////////////////////////////////////////// // Function: AssimpLoader::Constructor diff --git a/pandatool/src/assimp/assimpLoader.h b/pandatool/src/assimp/assimpLoader.h index 54597f9228..3c8391b324 100644 --- a/pandatool/src/assimp/assimpLoader.h +++ b/pandatool/src/assimp/assimpLoader.h @@ -20,7 +20,8 @@ #include "modelRoot.h" #include "texture.h" -#include "aiScene.h" +#include "assimp/scene.h" +#include "assimp/Importer.hpp" //////////////////////////////////////////////////////////////////// // Class : AssimpLoader diff --git a/pandatool/src/assimp/config_assimp.h b/pandatool/src/assimp/config_assimp.h index 43cd1ef87e..4c2da9d449 100644 --- a/pandatool/src/assimp/config_assimp.h +++ b/pandatool/src/assimp/config_assimp.h @@ -17,8 +17,6 @@ #include "pandatoolbase.h" -#include "assimp.hpp" - #include "dconfig.h" ConfigureDecl(config_assimp, EXPCL_ASSIMP, EXPTP_ASSIMP); diff --git a/pandatool/src/assimp/p3assimp_composite1.cxx b/pandatool/src/assimp/p3assimp_composite1.cxx new file mode 100644 index 0000000000..bc813b11ec --- /dev/null +++ b/pandatool/src/assimp/p3assimp_composite1.cxx @@ -0,0 +1,7 @@ + +#include "config_assimp.cxx" +#include "assimpLoader.cxx" +#include "loaderFileTypeAssimp.cxx" +#include "pandaIOStream.cxx" +#include "pandaIOSystem.cxx" +#include "pandaLogger.cxx" diff --git a/pandatool/src/assimp/pandaIOStream.h b/pandatool/src/assimp/pandaIOStream.h index be9b2d0548..c89f4a15bf 100644 --- a/pandatool/src/assimp/pandaIOStream.h +++ b/pandatool/src/assimp/pandaIOStream.h @@ -17,7 +17,7 @@ #include "config_assimp.h" -#include "IOStream.h" +#include "assimp/IOStream.hpp" class PandaIOSystem; diff --git a/pandatool/src/assimp/pandaIOSystem.h b/pandatool/src/assimp/pandaIOSystem.h index 04b2c1edaa..b86c1695a1 100644 --- a/pandatool/src/assimp/pandaIOSystem.h +++ b/pandatool/src/assimp/pandaIOSystem.h @@ -18,7 +18,7 @@ #include "config_assimp.h" #include "virtualFileSystem.h" -#include "IOSystem.h" +#include "assimp/IOSystem.hpp" //////////////////////////////////////////////////////////////////// // Class : PandaIOSystem diff --git a/pandatool/src/assimp/pandaLogger.cxx b/pandatool/src/assimp/pandaLogger.cxx index 138dae43b5..20de4497b7 100644 --- a/pandatool/src/assimp/pandaLogger.cxx +++ b/pandatool/src/assimp/pandaLogger.cxx @@ -14,7 +14,7 @@ #include "pandaLogger.h" -#include "DefaultLogger.h" +#include "assimp/DefaultLogger.hpp" PandaLogger *PandaLogger::_ptr = NULL; diff --git a/pandatool/src/assimp/pandaLogger.h b/pandatool/src/assimp/pandaLogger.h index 5930ef1248..8d0f39fc2a 100644 --- a/pandatool/src/assimp/pandaLogger.h +++ b/pandatool/src/assimp/pandaLogger.h @@ -17,7 +17,7 @@ #include "config_assimp.h" -#include "Logger.h" +#include "assimp/Logger.hpp" //////////////////////////////////////////////////////////////////// // Class : PandaLogger