pull/1293/head
Kim Kulling 2017-06-01 16:22:25 +02:00
commit 9d69a12532
536 changed files with 13992 additions and 6834 deletions

7
.gitattributes vendored
View File

@ -2,7 +2,14 @@
*.cpp text eol=lf *.cpp text eol=lf
*.h text eol=lf *.h text eol=lf
*.c text eol=lf *.c text eol=lf
*.cc text eol=lf
*.cpp text eol=lf
*.rc text eol=lf
*.hpp text eol=lf *.hpp text eol=lf
*.txt text eol=lf *.txt text eol=lf
*.cmake text eol=lf *.cmake text eol=lf
*.sh text eol=lf *.sh text eol=lf
CHANGES text eol=lf
CREDITS text eol=lf
LICENSE text eol=lf
Readme.md text eol=lf

378
CHANGES
View File

@ -1,173 +1,205 @@
---------------------------------------------------------------------- ----------------------------------------------------------------------
CHANGELOG CHANGELOG
---------------------------------------------------------------------- ----------------------------------------------------------------------
3.2.1 (2016-10-01) 3.3.1 (2016-07-08)
FEATURES: FIXES/HOUSEKEEPING:
- Updated glTF exporter to meet 1.0 specification. - Setup of default precision for 17 exporters
- Fix xcode project files
FIXES/HOUSEKEEPING: - Fix BlenderTesselator: offsetof operator
- Fixed glTF Validator errors for exported glTF format. - Invalid version in cmake file
- Update pstdint.h to latest greatest
ISSUES:
- Hard coded sampler setting for
- magFilter 3.3.0 (2016-07-05)
- minFilter
- void* in ExportData for accessor max and min. FEATURES:
- C++11 support enabled
- New regression-test-UI
- Experimental glTF-importer support
3.2.0 (2015-11-03) - OpenGEX: add support for cameras and lights
- C4D: update to latest Melange-SDK
FEATURES: - Add a gitter channel
- OpenDDL-Parser is part of contrib-source. - Coverity check enabled
- Experimental OpenGEX-support - Switch to <...> include brackets for public headers
- CI-check for linux and windows - Enable export by pyAssimp
- Coverity check added - CI: check windows build
- New regression testsuite. - Add functionality to perform a singlepost-processing step
- many more, just check the history
FIXES/HOUSEKEEPING:
- Hundreds of bugfixes in all parts of the library FIXES/HOUSEKEEPING:
- Unified line endings - Fix of many resource leaks in unittests and main lib
- Fix iOS-buildfor X64
- Choosing zlib manually for cmake
API COMPATIBILITY: - many more, just check the history
- Removed precompiled header to increase build speed for linux
3.2.1 (2016-010-10)
3.1.1 (2014-06-15)
FEATURES:
FEATURES: - Updated glTF exporter to meet 1.0 specification.
- Support for FBX 2013 and newer, binary and ASCII (this is partly
work from Google Summer of Code 2012) FIXES/HOUSEKEEPING:
- Support for OGRE binary mesh and skeleton format - Fixed glTF Validator errors for exported glTF format.
- Updated BLEND support for newer Blender versions
- Support for arbitrary meta data, used to hold FBX and DAE metadata ISSUES:
- OBJ Export now produces smaller files - Hard coded sampler setting for
- Meshes can now have names, this is supported by the major importers - magFilter
- Improved IFC geometry generation - minFilter
- M3 support has been removed - void* in ExportData for accessor max and min.
FIXES/HOUSEKEEPING:
- Hundreds of bugfixes in all parts of the library 3.2.0 (2015-11-03)
- CMake is now the primary build system
FEATURES:
API COMPATIBILITY: - OpenDDL-Parser is part of contrib-source.
- 3.1.1 is not binary compatible to 3.0 due to aiNode::mMetaData - Experimental OpenGEX-support
and aiMesh::mName - CI-check for linux and windows
- Export interface has been cleaned up and unified - Coverity check added
- Other than that no relevant changes - New regression testsuite.
FIXES/HOUSEKEEPING:
3.0 (2012-07-07) - Hundreds of bugfixes in all parts of the library
- Unified line endings
FEATURES:
- new export interface similar to the import API.
- Supported export formats: Collada, OBJ, PLY and STL API COMPATIBILITY:
- added new import formats: XGL/ZGL, M3 (experimental) - Removed precompiled header to increase build speed for linux
- new postprocessing steps: Debone
- vastly improved IFC (Industry Foundation Classes) support
- introduced API to query importer meta information (such as supported 3.1.1 (2014-06-15)
format versions, full name, maintainer info).
- reworked Ogre XML import FEATURES:
- C-API now supports per-import properties - Support for FBX 2013 and newer, binary and ASCII (this is partly
work from Google Summer of Code 2012)
FIXES/HOUSEKEEPING: - Support for OGRE binary mesh and skeleton format
- Updated BLEND support for newer Blender versions
- hundreds of bugfixes in all parts of the library - Support for arbitrary meta data, used to hold FBX and DAE metadata
- unified naming and cleanup of public headers - OBJ Export now produces smaller files
- improved CMake build system - Meshes can now have names, this is supported by the major importers
- templatized math library - Improved IFC geometry generation
- reduce dependency on boost.thread, only remaining spot - M3 support has been removed
is synchronization for the C logging API
FIXES/HOUSEKEEPING:
API COMPATIBILITY: - Hundreds of bugfixes in all parts of the library
- renamed headers, export interface, C API properties and meta data - CMake is now the primary build system
prevent compatibility with code written for 2.0, but in
most cases these can be easily resolved API COMPATIBILITY:
- Note: 3.0 is not binary compatible with 2.0 - 3.1.1 is not binary compatible to 3.0 due to aiNode::mMetaData
and aiMesh::mName
- Export interface has been cleaned up and unified
- Other than that no relevant changes
2.0 (2010-11-21)
3.0 (2012-07-07)
FEATURES:
- Add support for static Blender (*.blend) scenes FEATURES:
- Add support for Q3BSP scenes - new export interface similar to the import API.
- Add a windows-based OpenGL sample featuring texturing & basic materials - Supported export formats: Collada, OBJ, PLY and STL
- Add an experimental progress feedback interface. - added new import formats: XGL/ZGL, M3 (experimental)
- Vastly improved performance (up to 500%, depending on mesh size and - new postprocessing steps: Debone
spatial structure) in some expensive postprocessing steps - vastly improved IFC (Industry Foundation Classes) support
- AssimpView now uses a reworked layout which leaves more space - introduced API to query importer meta information (such as supported
to the scene hierarchy window format versions, full name, maintainer info).
- reworked Ogre XML import
- Add C# bindings ('Assimp.NET') - C-API now supports per-import properties
- Keep BSD-licensed and otherwise free test files in separate
folders (./test/models and ./test/models-nonbsd). FIXES/HOUSEKEEPING:
FIXES: - hundreds of bugfixes in all parts of the library
- Many Collada bugfixes, improve fault tolerance - unified naming and cleanup of public headers
- Fix possible crashes in the Obj loader - improved CMake build system
- Improve the Ogre XML loader - templatized math library
- OpenGL-sample now works with MinGW - reduce dependency on boost.thread, only remaining spot
- Fix Importer::FindLoader failing on uppercase file extensions is synchronization for the C logging API
- Fix flawed path handling when locating external files
- Limit the maximum number of vertices, faces, face indices and API COMPATIBILITY:
weights that Assimp is able to handle. This is to avoid - renamed headers, export interface, C API properties and meta data
crashes due to overflowing counters. prevent compatibility with code written for 2.0, but in
most cases these can be easily resolved
- Updated XCode project files - Note: 3.0 is not binary compatible with 2.0
- Further CMAKE build improvements
API CHANGES:
- Add data structures for vertex-based animations (These are not 2.0 (2010-11-21)
currently used, however ...)
- Some Assimp::Importer methods are const now. FEATURES:
- Add support for static Blender (*.blend) scenes
- Add support for Q3BSP scenes
- Add a windows-based OpenGL sample featuring texturing & basic materials
- Add an experimental progress feedback interface.
- Vastly improved performance (up to 500%, depending on mesh size and
1.1 (2010-04-17) spatial structure) in some expensive postprocessing steps
This is the list of relevant changes from the 1.0 (r412) release to 1.1 (r700). - AssimpView now uses a reworked layout which leaves more space
to the scene hierarchy window
FEATURES:
- Vastly improved Collada support - Add C# bindings ('Assimp.NET')
- Add MS3D (Milkshape 3D) support - Keep BSD-licensed and otherwise free test files in separate
- Add support for Ogre XML static meshes folders (./test/models and ./test/models-nonbsd).
- Add experimental COB (TrueSpace) support
- Automatic test suite to quickly locate regressions FIXES:
- D bindings (`dAssimp`) - Many Collada bugfixes, improve fault tolerance
- Python 2.n bindings (`PyAssimp`) - Fix possible crashes in the Obj loader
- Add basic support for Unicode input files (utf8, utf16 and utf32) - Improve the Ogre XML loader
- Add further utilities to the `assimp` tool (xml/binary dumps, quick file stats) - OpenGL-sample now works with MinGW
- Switch to a CMAKE-based build system including an install target for unix'es - Fix Importer::FindLoader failing on uppercase file extensions
- Automatic evaluation of subdivision surfaces for some formats. - Fix flawed path handling when locating external files
- Add `Importer::ReadFileFromMemory` and the corresponding C-API `aiReadFileFromMemory` - Limit the maximum number of vertices, faces, face indices and
- Expose further math utilities via the C-API (i.e. `aiMultiplyMatrix4`) weights that Assimp is able to handle. This is to avoid
crashes due to overflowing counters.
- Move noboost files away from the public include directory
- Many, many bugfixes and improvements in existing loaders and postprocessing steps - Updated XCode project files
- Documentation improved and clarified in many places. - Further CMAKE build improvements
- Add a sample on using Assimp in conjunction with OpenGL
- Distribution/packaging: comfortable SDK installer for Windows API CHANGES:
- Distribution/packaging: improved release packages for other architectures - Add data structures for vertex-based animations (These are not
currently used, however ...)
CRITICAL FIXES: - Some Assimp::Importer methods are const now.
- Resolve problems with clashing heap managers, STL ABIs and runtime libraries (win32)
- Fix automatic detection of file type if no file extension is given
- Improved exception safety and robustness, prevent leaking of exceptions through the C interface
- Fix possible heap corruption due to material properties pulled in incorrectly
- Avoid leaking in certain error scenarios
- Fix 64 bit compatibility problems in some loaders (i.e. MDL) 1.1 (2010-04-17)
This is the list of relevant changes from the 1.0 (r412) release to 1.1 (r700).
BREAKING API CHANGES:
- None - FEATURES:
- Vastly improved Collada support
MINOR API BEHAVIOUR CHANGES: - Add MS3D (Milkshape 3D) support
- Change quaternion orientation to suit to the more common convention (-w). - Add support for Ogre XML static meshes
- aiString is utf8 now. Not yet consistent, however. - Add experimental COB (TrueSpace) support
- Automatic test suite to quickly locate regressions
- D bindings (`dAssimp`)
- Python 2.n bindings (`PyAssimp`)
- Add basic support for Unicode input files (utf8, utf16 and utf32)
- Add further utilities to the `assimp` tool (xml/binary dumps, quick file stats)
- Switch to a CMAKE-based build system including an install target for unix'es
- Automatic evaluation of subdivision surfaces for some formats.
- Add `Importer::ReadFileFromMemory` and the corresponding C-API `aiReadFileFromMemory`
- Expose further math utilities via the C-API (i.e. `aiMultiplyMatrix4`)
- Move noboost files away from the public include directory
- Many, many bugfixes and improvements in existing loaders and postprocessing steps
- Documentation improved and clarified in many places.
- Add a sample on using Assimp in conjunction with OpenGL
- Distribution/packaging: comfortable SDK installer for Windows
- Distribution/packaging: improved release packages for other architectures
CRITICAL FIXES:
- Resolve problems with clashing heap managers, STL ABIs and runtime libraries (win32)
- Fix automatic detection of file type if no file extension is given
- Improved exception safety and robustness, prevent leaking of exceptions through the C interface
- Fix possible heap corruption due to material properties pulled in incorrectly
- Avoid leaking in certain error scenarios
- Fix 64 bit compatibility problems in some loaders (i.e. MDL)
BREAKING API CHANGES:
- None -
MINOR API BEHAVIOUR CHANGES:
- Change quaternion orientation to suit to the more common convention (-w).
- aiString is utf8 now. Not yet consistent, however.

View File

@ -1,7 +1,6 @@
# Open Asset Import Library (assimp) # Open Asset Import Library (assimp)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# # Copyright (c) 2006-2017, assimp team
# Copyright (c) 2006-2016, assimp team
# All rights reserved. # All rights reserved.
# #
# Redistribution and use of this software in source and binary forms, # Redistribution and use of this software in source and binary forms,
@ -33,7 +32,6 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#---------------------------------------------------------------------- #----------------------------------------------------------------------
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
cmake_minimum_required( VERSION 2.8 ) cmake_minimum_required( VERSION 2.8 )
@ -81,6 +79,20 @@ OPTION ( ASSIMP_COVERALLS
OFF OFF
) )
option ( SYSTEM_IRRXML
"Use system installed Irrlicht/IrrXML library."
OFF
)
OPTION ( BUILD_DOCS
"Build documentation using Doxygen."
OFF
)
if (WIN32)
add_definitions( -DWIN32_LEAN_AND_MEAN )
endif()
IF(MSVC) IF(MSVC)
set (CMAKE_PREFIX_PATH "D:\\libs\\devil") set (CMAKE_PREFIX_PATH "D:\\libs\\devil")
OPTION( ASSIMP_INSTALL_PDB OPTION( ASSIMP_INSTALL_PDB
@ -140,7 +152,7 @@ configure_file(
configure_file( configure_file(
${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h.in ${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h.in
${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h ${CMAKE_CURRENT_BINARY_DIR}/include/assimp/config.h
) )
include_directories( include_directories(
@ -155,25 +167,28 @@ SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M
SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev)
SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
# Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux
IF( UNIX ) IF( UNIX )
# Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux
IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 )
ENDIF() ENDIF()
ENDIF()
IF((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW) # Use GNUInstallDirs for Unix predefined directories
IF (BUILD_SHARED_LIBS AND CMAKE_SIZEOF_VOID_P EQUAL 8) # -fPIC is only required for shared libs on 64 bit include(GNUInstallDirs)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") ENDIF( UNIX )
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
ENDIF()
# Grouped compiler settings
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
# hide all not-exported symbols # hide all not-exported symbols
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -Wall -std=c++0x" ) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -fPIC -Wall -std=c++0x")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET(LIBSTDC++_LIBRARIES -lstdc++)
ELSEIF(MSVC) ELSEIF(MSVC)
# enable multi-core compilation with MSVC # enable multi-core compilation with MSVC
add_compile_options(/MP) add_compile_options(/MP)
ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -Wall -Wno-long-long -pedantic -std=c++11" ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -fPIC -Wall -Wno-long-long -pedantic -std=c++11" )
ELSEIF( CMAKE_COMPILER_IS_MINGW ) ELSEIF( CMAKE_COMPILER_IS_MINGW )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wno-long-long -pedantic -std=c++11" ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wno-long-long -pedantic -std=c++11" )
add_definitions( -U__STRICT_ANSI__ ) add_definitions( -U__STRICT_ANSI__ )
@ -185,9 +200,9 @@ if (ASSIMP_COVERALLS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
endif() endif()
INCLUDE (FindPkgConfig)
INCLUDE_DIRECTORIES( include ) INCLUDE_DIRECTORIES( include )
INCLUDE (FindPkgMacros)
INCLUDE (PrecompiledHeader) INCLUDE (PrecompiledHeader)
# If this is an in-source build (CMAKE_SOURCE_DIR == CMAKE_BINARY_DIR), # If this is an in-source build (CMAKE_SOURCE_DIR == CMAKE_BINARY_DIR),
@ -228,9 +243,14 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${C
FIND_PACKAGE( DirectX ) FIND_PACKAGE( DirectX )
IF( CMAKE_COMPILER_IS_GNUCXX ) IF( BUILD_DOCS )
SET(LIBSTDC++_LIBRARIES -lstdc++) add_subdirectory(doc)
ENDIF( CMAKE_COMPILER_IS_GNUCXX ) ENDIF( BUILD_DOCS )
# Look for system installed irrXML
IF ( SYSTEM_IRRXML )
find_package( IrrXML REQUIRED )
ENDIF( SYSTEM_IRRXML )
# Search for external dependencies, and build them from source if not found # Search for external dependencies, and build them from source if not found
# Search for zlib # Search for zlib
@ -255,9 +275,7 @@ ENDIF(NOT ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
# Search for unzip # Search for unzip
IF (PKG_CONFIG_FOUND) use_pkgconfig(UNZIP minizip)
PKG_CHECK_MODULES(UNZIP minizip)
ENDIF (PKG_CONFIG_FOUND)
IF ( ASSIMP_NO_EXPORT ) IF ( ASSIMP_NO_EXPORT )
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)
@ -328,6 +346,8 @@ ELSE (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER ) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER )
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
ADD_SUBDIRECTORY(contrib)
ADD_SUBDIRECTORY( code/ ) ADD_SUBDIRECTORY( code/ )
IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
IF ( WIN32 AND DirectX_D3DX9_LIBRARY ) IF ( WIN32 AND DirectX_D3DX9_LIBRARY )
@ -431,29 +451,29 @@ IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
ENDIF() ENDIF()
if(WIN32) if(WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/") SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/")
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/") SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/")
elseif() elseif()
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/") SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/")
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/") SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/")
ENDIF() ENDIF()
if(MSVC12) if(MSVC12)
SET(ASSIMP_MSVC_VERSION "vc120") SET(ASSIMP_MSVC_VERSION "vc120")
elseif(MSVC14) elseif(MSVC14)
SET(ASSIMP_MSVC_VERSION "vc140") SET(ASSIMP_MSVC_VERSION "vc140")
ENDIF(MSVC12) ENDIF(MSVC12)
if(MSVC12 OR MSVC14) if(MSVC12 OR MSVC14)
add_custom_target(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM) add_custom_target(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.exp VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.exp VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.lib VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.lib VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.dll VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.dll VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.exp VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.exp VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.lib VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.lib VERBATIM)
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM) add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
ENDIF(MSVC12 OR MSVC14) ENDIF(MSVC12 OR MSVC14)
ENDIF (WIN32) ENDIF (WIN32)

320
CREDITS
View File

@ -1,160 +1,160 @@
=============================================================== ===============================================================
Open Asset Import Library (Assimp) Open Asset Import Library (Assimp)
Developers and Contributors Developers and Contributors
=============================================================== ===============================================================
The following is a non-exhaustive list of all constributors over the years. The following is a non-exhaustive list of all constributors over the years.
If you think your name should be listed here, drop us a line and we'll add you. If you think your name should be listed here, drop us a line and we'll add you.
- Alexander Gessler, - Alexander Gessler,
3DS-, BLEND-, ASE-, DXF-, HMP-, MDL-, MD2-, MD3-, MD5-, MDC-, NFF-, PLY-, STL-, RAW-, OFF-, MS3D-, Q3D- and LWO-Loader, Assimp-Viewer, assimp-cmd, -noboost, Website (Design). 3DS-, BLEND-, ASE-, DXF-, HMP-, MDL-, MD2-, MD3-, MD5-, MDC-, NFF-, PLY-, STL-, RAW-, OFF-, MS3D-, Q3D- and LWO-Loader, Assimp-Viewer, assimp-cmd, -noboost, Website (Design).
- Thomas Schulze, - Thomas Schulze,
X-, Collada-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation. X-, Collada-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation.
- Kim Kulling, - Kim Kulling,
Obj-, Q3BSD-, OpenGEX-Loader, Logging system, CMake-build-environment, Linux-build, Website ( Admin ), Coverity ( Admin ), Glitter ( Admin ). Obj-, Q3BSD-, OpenGEX-Loader, Logging system, CMake-build-environment, Linux-build, Website ( Admin ), Coverity ( Admin ), Glitter ( Admin ).
- R.Schmidt, - R.Schmidt,
Linux build, eclipse support. Linux build, eclipse support.
- Matthias Gubisch, - Matthias Gubisch,
Assimp.net Assimp.net
Visual Studio 9 support, bugfixes. Visual Studio 9 support, bugfixes.
- Mark Sibly - Mark Sibly
B3D-Loader, Assimp testing B3D-Loader, Assimp testing
- Jonathan Klein - Jonathan Klein
Ogre Loader, VC2010 fixes and CMake fixes. Ogre Loader, VC2010 fixes and CMake fixes.
- Sebastian Hempel, - Sebastian Hempel,
PyAssimp (first version) PyAssimp (first version)
Compile-Bugfixes for mingw, add environment for static library support in make. Compile-Bugfixes for mingw, add environment for static library support in make.
- Jonathan Pokrass - Jonathan Pokrass
Supplied a bugfix concerning the scaling in the md3 loader. Supplied a bugfix concerning the scaling in the md3 loader.
- Andrew Galante, - Andrew Galante,
Submitted patches to make Assimp compile with GCC-4, a makefile and the xcode3 workspace. Submitted patches to make Assimp compile with GCC-4, a makefile and the xcode3 workspace.
- Andreas Nagel - Andreas Nagel
First Assimp testing & verification under Windows Vista 64 Bit. First Assimp testing & verification under Windows Vista 64 Bit.
- Marius Schr<68>der - Marius Schr<68>der
Allowed us to use many of his models for screenshots and testing. Allowed us to use many of his models for screenshots and testing.
- Christian Schubert - Christian Schubert
Supplied various XFiles for testing purposes. Supplied various XFiles for testing purposes.
- Tizian Wieland - Tizian Wieland
Searched the web for hundreds of test models for internal use Searched the web for hundreds of test models for internal use
- John Connors - John Connors
Supplied patches for linux and SCons. Supplied patches for linux and SCons.
- T. R. - T. R.
The GUY who performed some of the CSM mocaps. The GUY who performed some of the CSM mocaps.
- Andy Maloney - Andy Maloney
Contributed fixes for the documentation and the doxygen markup Contributed fixes for the documentation and the doxygen markup
- Zhao Lei - Zhao Lei
Contributed several bugfixes fixing memory leaks and improving float parsing Contributed several bugfixes fixing memory leaks and improving float parsing
- sueastside - sueastside
Updated PyAssimp to the latest Assimp data structures and provided a script to keep the Python binding up-to-date. Updated PyAssimp to the latest Assimp data structures and provided a script to keep the Python binding up-to-date.
- Tobias Rittig - Tobias Rittig
Collada testing with Cinema 4D Collada testing with Cinema 4D
- Brad Grantham - Brad Grantham
Improvements in OpenGL-Sample. Improvements in OpenGL-Sample.
- Robert Ramirez - Robert Ramirez
Add group loading feature to Obj-Loader. Add group loading feature to Obj-Loader.
- Chris Maiwald - Chris Maiwald
Many bugreports, improving Assimp's portability, regular testing & feedback. Many bugreports, improving Assimp's portability, regular testing & feedback.
- Stepan Hrbek - Stepan Hrbek
Bugreport and fix for a obj-materialloader crash. Bugreport and fix for a obj-materialloader crash.
- David Nadlinger - David Nadlinger
D bindings, CMake install support. D bindings, CMake install support.
- Dario Accornero - Dario Accornero
Contributed several patches regarding Mac OS/XCode targets, bug reports. Contributed several patches regarding Mac OS/XCode targets, bug reports.
- Martin Walser (Samhayne) - Martin Walser (Samhayne)
Contributed the 'SimpleTexturedOpenGl' sample. Contributed the 'SimpleTexturedOpenGl' sample.
- Matthias Fauconneau - Matthias Fauconneau
Contributed a fix for the Q3-BSP loader. Contributed a fix for the Q3-BSP loader.
- J<EFBFBD>rgen P. Tjern<72> - Jørgen P. Tjernø
Contributed updated and improved xcode workspaces Contributed updated and improved xcode workspaces
- drparallax - drparallax
Contributed the /samples/SimpleAssimpViewX sample Contributed the /samples/SimpleAssimpViewX sample
- Carsten Fuchs - Carsten Fuchs
Contributed a fix for the Normalize method in aiQuaternion. Contributed a fix for the Normalize method in aiQuaternion.
- dbburgess - dbburgess
Contributes a Android-specific build issue: log the hardware architecture for ARM. Contributes a Android-specific build issue: log the hardware architecture for ARM.
- alfiereinre7 - alfiereinre7
Contributes a obj-fileparser fix: missing tokens in the obj-token list. Contributes a obj-fileparser fix: missing tokens in the obj-token list.
- Roman Kharitonov - Roman Kharitonov
Contributes a fix for the configure script environment. Contributes a fix for the configure script environment.
- Ed Diana - Ed Diana
Contributed AssimpDelphi (/port/AssimpDelphi). Contributed AssimpDelphi (/port/AssimpDelphi).
- rdb - rdb
Contributes a bundle of fixes and improvements for the bsp-importer. Contributes a bundle of fixes and improvements for the bsp-importer.
- Mick P - Mick P
For contributing the De-bone postprocessing step and filing various bug reports. For contributing the De-bone postprocessing step and filing various bug reports.
- Rosen Diankov - Rosen Diankov
Contributed patches to build assimp debian packages using cmake. Contributed patches to build assimp debian packages using cmake.
- Mark Page - Mark Page
Contributed a patch to fix the VertexTriangleAdjacency postprocessing step. Contributed a patch to fix the VertexTriangleAdjacency postprocessing step.
- IOhannes - IOhannes
Contributed the Debian build fixes ( architecture macro ). Contributed the Debian build fixes ( architecture macro ).
- gellule - gellule
Several LWO and LWS fixes (pivoting). Several LWO and LWS fixes (pivoting).
- Marcel Metz - Marcel Metz
GCC/Linux fixes for the SimpleOpenGL sample. GCC/Linux fixes for the SimpleOpenGL sample.
- Brian Miller - Brian Miller
Bugfix for a compiler fix for iOS on arm. Bugfix for a compiler fix for iOS on arm.
- S<EFBFBD>verin Lemaignan - SĂ©verin Lemaignan
Rewrite of PyAssimp, distutils and Python3 support Rewrite of PyAssimp, distutils and Python3 support
- albert-wang - albert-wang
Bugfixes for the collada parser Bugfixes for the collada parser
- Ya ping Jin - Ya ping Jin
Bugfixes for uv-tanget calculation. Bugfixes for uv-tanget calculation.
- Jonne Nauha - Jonne Nauha
Ogre Binary format support Ogre Binary format support
- Filip Wasil, Tieto Poland Sp. z o.o. - Filip Wasil, Tieto Poland Sp. z o.o.
Android JNI asset extraction support Android JNI asset extraction support
- Richard Steffen - Richard Steffen
Contributed ExportProperties interface Contributed ExportProperties interface
Contributed X File exporter Contributed X File exporter
Contributed Step (stp) exporter Contributed Step (stp) exporter

156
LICENSE
View File

@ -1,78 +1,78 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2016, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the with or without modification, are permitted provided that the
following conditions are met: following conditions are met:
* Redistributions of source code must retain the above * Redistributions of source code must retain the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer. following disclaimer.
* Redistributions in binary form must reproduce the above * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other following disclaimer in the documentation and/or other
materials provided with the distribution. materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its * Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products contributors may be used to endorse or promote products
derived from this software without specific prior derived from this software without specific prior
written permission of the assimp team. written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************** ******************************************************************************
AN EXCEPTION applies to all files in the ./test/models-nonbsd folder. AN EXCEPTION applies to all files in the ./test/models-nonbsd folder.
These are 3d models for testing purposes, from various free sources These are 3d models for testing purposes, from various free sources
on the internet. They are - unless otherwise stated - copyright of on the internet. They are - unless otherwise stated - copyright of
their respective creators, which may impose additional requirements their respective creators, which may impose additional requirements
on the use of their work. For any of these models, see on the use of their work. For any of these models, see
<model-name>.source.txt for more legal information. Contact us if you <model-name>.source.txt for more legal information. Contact us if you
are a copyright holder and believe that we credited you inproperly or are a copyright holder and believe that we credited you inproperly or
if you don't want your files to appear in the repository. if you don't want your files to appear in the repository.
****************************************************************************** ******************************************************************************
Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
http://code.google.com/p/poly2tri/ http://code.google.com/p/poly2tri/
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, * Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution. and/or other materials provided with the distribution.
* Neither the name of Poly2Tri nor the names of its contributors may be * Neither the name of Poly2Tri nor the names of its contributors may be
used to endorse or promote products derived from this software without specific used to endorse or promote products derived from this software without specific
prior written permission. prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

288
Readme.md
View File

@ -1,143 +1,145 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
================================== ==================================
[![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp) [![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp)
<a href="https://scan.coverity.com/projects/5607"> <a href="https://scan.coverity.com/projects/5607">
<img alt="Coverity Scan Build Status" <img alt="Coverity Scan Build Status"
src="https://scan.coverity.com/projects/5607/badge.svg"/> src="https://scan.coverity.com/projects/5607/badge.svg"/>
</a> </a>
[![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master) <span class="badge-patreon"><a href="https://www.patreon.com/assimp" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<br> [![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master)
<br>
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS.
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS.
Additionally, assimp features various __mesh post processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more.
Additionally, assimp features various __mesh post processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more.
This is the development trunk containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [assimp.sf.net](http://assimp.sf.net) or from *nix package repositories.
The current build status is: This is the development trunk containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [assimp.sf.net](http://assimp.sf.net) or from *nix package repositories.
The current build status is:
Gitter chat: [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br>
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__ Gitter chat: [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br>
Please check our Wiki as well: https://github.com/assimp/assimp/wiki And we also have an IRC-channel at freenode: #assetimporterlib . You can easily join us via: [KiwiIRC/freenote](https://kiwiirc.com/client/irc.freenode.net), choose your nickname and type
> /join #assetimporterlib
#### Supported file formats ####
<br>
A full list [is here](http://assimp.org/main_features_formats.html). __[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__
__Importers__:
Please check our Wiki as well: https://github.com/assimp/assimp/wiki
- 3DS
- BLEND (Blender) #### Supported file formats ####
- DAE/Collada
- FBX A full list [is here](http://assimp.org/main_features_formats.html).
- IFC-STEP __Importers__:
- ASE
- DXF - 3DS
- HMP - BLEND (Blender)
- MD2 - DAE/Collada
- MD3 - FBX
- MD5 - IFC-STEP
- MDC - ASE
- MDL - DXF
- NFF - HMP
- PLY - MD2
- STL - MD3
- X - MD5
- OBJ - MDC
- OpenGEX - MDL
- SMD - NFF
- LWO - PLY
- LXO - STL
- LWS - X
- TER - OBJ
- AC3D - OpenGEX
- MS3D - SMD
- COB - LWO
- Q3BSP - LXO
- XGL - LWS
- CSM - TER
- BVH - AC3D
- B3D - MS3D
- NDO - COB
- Ogre Binary - Q3BSP
- Ogre XML - XGL
- Q3D - CSM
- ASSBIN (Assimp custom format) - BVH
- glTF (partial) - B3D
- 3MF - NDO
- Ogre Binary
Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default): - Ogre XML
- Q3D
- C4D (https://github.com/acgessler/assimp-cinema4d) - ASSBIN (Assimp custom format)
- glTF (partial)
__Exporters__: - 3MF
- DAE (Collada) Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default):
- STL
- OBJ - C4D (https://github.com/acgessler/assimp-cinema4d)
- PLY
- X __Exporters__:
- 3DS
- JSON (for WebGl, via https://github.com/acgessler/assimp2json) - DAE (Collada)
- ASSBIN - STL
- STEP - OBJ
- glTF (partial) - PLY
- X
### Building ### - 3DS
Take a look into the `INSTALL` file. Our build system is CMake, if you used CMake before there is a good chance you know what to do. - JSON (for WebGl, via https://github.com/acgessler/assimp2json)
- ASSBIN
### Ports ### - STEP
* [Android](port/AndroidJNI/README.md) - glTF (partial)
* [Python](port/PyAssimp/README.md)
* [.NET](port/AssimpNET/Readme.md) ### Building ###
* [Pascal](port/AssimpPascal/Readme.md) Take a look into the `INSTALL` file. Our build system is CMake, if you used CMake before there is a good chance you know what to do.
* [Javascript (Alpha)](https://github.com/makc/assimp2json)
### Ports ###
#### Repository structure #### * [Android](port/AndroidJNI/README.md)
Open Asset Import Library is implemented in C++. The directory structure is: * [Python](port/PyAssimp/README.md)
* [.NET](port/AssimpNET/Readme.md)
/code Source code * [Pascal](port/AssimpPascal/Readme.md)
/contrib Third-party libraries * [Javascript (Alpha)](https://github.com/makc/assimp2json)
/doc Documentation (doxysource and pre-compiled docs)
/include Public header C and C++ header files #### Repository structure ####
/scripts Scripts used to generate the loading code for some formats Open Asset Import Library is implemented in C++. The directory structure is:
/port Ports to other languages and scripts to maintain those.
/test Unit- and regression tests, test suite of models /code Source code
/tools Tools (old assimp viewer, command line `assimp`) /contrib Third-party libraries
/samples A small number of samples to illustrate possible /doc Documentation (doxysource and pre-compiled docs)
use cases for Assimp /include Public header C and C++ header files
/workspaces Build environments for vc,xcode,... (deprecated, /scripts Scripts used to generate the loading code for some formats
CMake has superseeded all legacy build options!) /port Ports to other languages and scripts to maintain those.
/test Unit- and regression tests, test suite of models
/tools Tools (old assimp viewer, command line `assimp`)
### Where to get help ### /samples A small number of samples to illustrate possible
For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format. use cases for Assimp
(CHMs for Windows are included in some release packages and should be located right here in the root folder). /workspaces Build environments for vc,xcode,... (deprecated,
CMake has superseeded all legacy build options!)
If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflow.com/questions/tagged/assimp?sort=newest). If you think you found a bug, please open an issue on Github.
For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_ ### Where to get help ###
[(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions) For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format.
(CHMs for Windows are included in some release packages and should be located right here in the root folder).
Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.
If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflow.com/questions/tagged/assimp?sort=newest). If you think you found a bug, please open an issue on Github.
And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br>
For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_
### Contributing ### [(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions)
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
a pull request with your changes against the main repository's `master` branch. Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.
### Donate ### And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br>
If you like assimp, consider buying us a beer (or two):
[Donate](http://sourceforge.net/donate/index.php?group_id=226462) ### Contributing ###
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
### License ### a pull request with your changes against the main repository's `master` branch.
Our license is based on the modified, __3-clause BSD__-License.
### License ###
An _informal_ summary is: do whatever you want, but include Assimp's license text with your product - Our license is based on the modified, __3-clause BSD__-License.
and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you may link statically to Assimp.
For the legal details, see the `LICENSE` file. An _informal_ summary is: do whatever you want, but include Assimp's license text with your product -
and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you may link statically to Assimp.
### Why this name ### For the legal details, see the `LICENSE` file.
Sorry, we're germans :-), no english native speakers ...
### Why this name ###
Sorry, we're germans :-), no english native speakers ...

View File

@ -1,8 +1,43 @@
# Open Asset Import Library (assimp)
# ----------------------------------------------------------------------
# Copyright (c) 2006-2017, assimp team
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the
# following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions and the
# following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the
# following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# * Neither the name of the assimp team, nor the names of its
# contributors may be used to endorse or promote products
# derived from this software without specific prior
# written permission of the assimp team.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#----------------------------------------------------------------------
set( PACKAGE_VERSION "@ASSIMP_VERSION@" ) set( PACKAGE_VERSION "@ASSIMP_VERSION@" )
if( "${PACKAGE_FIND_VERSION}" VERSION_EQUAL "@ASSIMP_VERSION@") if( "${PACKAGE_FIND_VERSION}" VERSION_EQUAL "@ASSIMP_VERSION@")
set(PACKAGE_VERSION_EXACT 1) set(PACKAGE_VERSION_EXACT 1)
endif() endif()
if( "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@ASSIMP_SOVERSION@" ) if( "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@ASSIMP_VERSION@" )
set(PACKAGE_VERSION_COMPATIBLE 1) set(PACKAGE_VERSION_COMPATIBLE 1)
elseif( "${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@ASSIMP_VERSION_MAJOR@" ) elseif( "${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@ASSIMP_VERSION_MAJOR@" )
# for now backward compatible if minor version is less # for now backward compatible if minor version is less

View File

@ -0,0 +1,72 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindDevIL
# ---------
#
#
#
# This module locates the developer's image library.
# http://openil.sourceforge.net/
#
# This module sets:
#
# ::
#
# IL_LIBRARIES - the name of the IL library. These include the full path to
# the core DevIL library. This one has to be linked into the
# application.
# ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
# library is for filters and effects, not actual loading. It
# doesn't have to be linked if the functionality it provides
# is not used.
# ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
# library interfaces with OpenGL. It is not strictly needed
# in applications.
# IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
# IL_FOUND - this is set to TRUE if all the above variables were set.
# This will be set to false if ILU or ILUT are not found,
# even if they are not needed. In most systems, if one
# library is found all the others are as well. That's the
# way the DevIL developers release it.
# TODO: Add version support.
# Tested under Linux and Windows (MSVC)
#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
include(FindPackageHandleStandardArgs)
find_path(IL_INCLUDE_DIR il.h
PATH_SUFFIXES include IL
DOC "The path to the directory that contains il.h"
)
#message("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
find_library(IL_LIBRARIES
NAMES IL DEVIL
PATH_SUFFIXES lib64 lib lib32
DOC "The file that corresponds to the base il library."
)
#message("IL_LIBRARIES is ${IL_LIBRARIES}")
find_library(ILUT_LIBRARIES
NAMES ILUT
PATH_SUFFIXES lib64 lib lib32
DOC "The file that corresponds to the il (system?) utility library."
)
#message("ILUT_LIBRARIES is ${ILUT_LIBRARIES}")
find_library(ILU_LIBRARIES
NAMES ILU
PATH_SUFFIXES lib64 lib lib32
DOC "The file that corresponds to the il utility library."
)
#message("ILU_LIBRARIES is ${ILU_LIBRARIES}")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG
IL_LIBRARIES IL_INCLUDE_DIR)

View File

@ -0,0 +1,17 @@
# Find IrrXMl from irrlicht project
#
# Find LibIrrXML headers and library
#
# IRRXML_FOUND - IrrXML found
# IRRXML_INCLUDE_DIR - Headers location
# IRRXML_LIBRARY - IrrXML main library
find_path(IRRXML_INCLUDE_DIR irrXML.h
PATH_SUFFIXES include/irrlicht include/irrxml)
find_library(IRRXML_LIBRARY IrrXML)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IrrXML REQUIRED_VARS IRRXML_INCLUDE_DIR IRRXML_LIBRARY)
mark_as_advanced(IRRXML_INCLUDE_DIR IRRXML_LIBRARY)

View File

@ -59,10 +59,13 @@ endmacro(clear_if_changed)
# Try to get some hints from pkg-config, if available # Try to get some hints from pkg-config, if available
macro(use_pkgconfig PREFIX PKGNAME) macro(use_pkgconfig PREFIX PKGNAME)
find_package(PkgConfig) # Android does not support PKG_CONFIG so we disable it
if (PKG_CONFIG_FOUND) IF ( NOT ANDROID )
pkg_check_modules(${PREFIX} ${PKGNAME}) find_package(PkgConfig)
endif () if (PKG_CONFIG_FOUND)
pkg_check_modules(${PREFIX} ${PKGNAME})
endif ()
ENDIF ( NOT ANDROID )
endmacro (use_pkgconfig) endmacro (use_pkgconfig)
# Couple a set of release AND debug libraries (or frameworks) # Couple a set of release AND debug libraries (or frameworks)

View File

@ -11,7 +11,7 @@
# Once done, this will define # Once done, this will define
# #
# ZLIB_FOUND - system has ZLIB # ZLIB_FOUND - system has ZLIB
# ZLIB_INCLUDE_DIRS - the ZLIB include directories # ZLIB_INCLUDE_DIRS - the ZLIB include directories
# ZLIB_LIBRARIES - link these to use ZLIB # ZLIB_LIBRARIES - link these to use ZLIB
include(FindPkgMacros) include(FindPkgMacros)

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -48,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <memory> #include <memory>
#include "StreamWriter.h" #include "StreamWriter.h"
#include "./../include/assimp/material.h" #include <assimp/material.h>
struct aiScene; struct aiScene;
struct aiNode; struct aiNode;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -48,10 +49,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SmoothingGroups.h" #include "SmoothingGroups.h"
#include "StringUtils.h" #include "StringUtils.h"
#include "qnan.h" #include "qnan.h"
#include "./../include/assimp/material.h" #include <assimp/material.h>
#include "./../include/assimp/camera.h" #include <assimp/camera.h>
#include "./../include/assimp/light.h" #include <assimp/light.h>
#include "./../include/assimp/anim.h" #include <assimp/anim.h>
#include <stdio.h> //sprintf #include <stdio.h> //sprintf
namespace Assimp { namespace Assimp {

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -54,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/importerdesc.h>
#include "StringComparison.h" #include "StringComparison.h"
using namespace Assimp; using namespace Assimp;

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -60,6 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/config.h> #include <assimp/config.h>
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/importerdesc.h>
#include <memory> #include <memory>
using namespace Assimp; using namespace Assimp;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -51,11 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "AMFImporter_Macro.hpp" #include "AMFImporter_Macro.hpp"
#include "fast_atof.h" #include "fast_atof.h"
#include "DefaultIOSystem.h" #include <assimp/DefaultIOSystem.h>
// Header files, stdlib. // Header files, stdlib.
#include <memory> #include <memory>
#include <string>
namespace Assimp namespace Assimp
{ {

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -52,9 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "AMFImporter_Node.hpp" #include "AMFImporter_Node.hpp"
// Header files, Assimp. // Header files, Assimp.
#include "assimp/DefaultLogger.hpp" #include <assimp/DefaultLogger.hpp>
#include "assimp/importerdesc.h" #include <assimp/importerdesc.h>
#include "assimp/ProgressHandler.hpp"
#include "assimp/types.h" #include "assimp/types.h"
#include "BaseImporter.h" #include "BaseImporter.h"
#include "irrXMLWrapper.h" #include "irrXMLWrapper.h"

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -59,18 +60,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/// \class CAMFImporter_NodeElement /// \class CAMFImporter_NodeElement
/// Base class for elements of nodes. /// Base class for elements of nodes.
class CAMFImporter_NodeElement class CAMFImporter_NodeElement {
{
/***********************************************/
/******************** Types ********************/
/***********************************************/
public: public:
/// \enum EType
/// Define what data type contain node element. /// Define what data type contain node element.
enum EType enum EType {
{
ENET_Color, ///< Color element: <color>. ENET_Color, ///< Color element: <color>.
ENET_Constellation,///< Grouping element: <constellation>. ENET_Constellation,///< Grouping element: <constellation>.
ENET_Coordinates, ///< Coordinates element: <coordinates>. ENET_Coordinates, ///< Coordinates element: <coordinates>.
@ -91,52 +85,37 @@ public:
ENET_Invalid ///< Element has invalid type and possible contain invalid data. ENET_Invalid ///< Element has invalid type and possible contain invalid data.
}; };
/***********************************************/
/****************** Constants ******************/
/***********************************************/
public:
const EType Type;///< Type of element. const EType Type;///< Type of element.
/***********************************************/
/****************** Variables ******************/
/***********************************************/
public:
std::string ID;///< ID of element. std::string ID;///< ID of element.
CAMFImporter_NodeElement* Parent;///< Parrent element. If nullptr then this node is root. CAMFImporter_NodeElement* Parent;///< Parent element. If nullptr then this node is root.
std::list<CAMFImporter_NodeElement*> Child;///< Child elements. std::list<CAMFImporter_NodeElement*> Child;///< Child elements.
/***********************************************/ public: /// Destructor, virtual..
/****************** Functions ******************/ virtual ~CAMFImporter_NodeElement() {
/***********************************************/ // empty
}
private: private:
/// \fn CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement)
/// Disabled copy constructor. /// Disabled copy constructor.
CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement); CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement);
/// \fn CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement)
/// Disabled assign operator. /// Disabled assign operator.
CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement); CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement);
/// \fn CAMFImporter_NodeElement()
/// Disabled default constructor. /// Disabled default constructor.
CAMFImporter_NodeElement(); CAMFImporter_NodeElement();
protected: protected:
/// \fn CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
/// In constructor inheritor must set element type. /// In constructor inheritor must set element type.
/// \param [in] pType - element type. /// \param [in] pType - element type.
/// \param [in] pParent - parent element. /// \param [in] pParent - parent element.
CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent) CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
: Type(pType), Parent(pParent) : Type(pType)
{} , ID()
, Parent(pParent)
, Child() {
// empty
}
};// class IAMFImporter_NodeElement };// class IAMFImporter_NodeElement
/// \struct CAMFImporter_NodeElement_Constellation /// \struct CAMFImporter_NodeElement_Constellation
@ -399,25 +378,23 @@ struct CAMFImporter_NodeElement_Triangle : public CAMFImporter_NodeElement
};// struct CAMFImporter_NodeElement_Triangle };// struct CAMFImporter_NodeElement_Triangle
/// \struct CAMFImporter_NodeElement_Texture
/// Structure that define texture node. /// Structure that define texture node.
struct CAMFImporter_NodeElement_Texture : public CAMFImporter_NodeElement struct CAMFImporter_NodeElement_Texture : public CAMFImporter_NodeElement {
{
/****************** Variables ******************/
size_t Width, Height, Depth;///< Size of the texture. size_t Width, Height, Depth;///< Size of the texture.
std::vector<uint8_t> Data;///< Data of the texture. std::vector<uint8_t> Data;///< Data of the texture.
bool Tiled; bool Tiled;
/****************** Functions ******************/
/// \fn CAMFImporter_NodeElement_Texture(CAMFImporter_NodeElement* pParent)
/// Constructor. /// Constructor.
/// \param [in] pParent - pointer to parent node. /// \param [in] pParent - pointer to parent node.
CAMFImporter_NodeElement_Texture(CAMFImporter_NodeElement* pParent) CAMFImporter_NodeElement_Texture(CAMFImporter_NodeElement* pParent)
: CAMFImporter_NodeElement(ENET_Texture, pParent) : CAMFImporter_NodeElement(ENET_Texture, pParent)
{} , Width( 0 )
, Height( 0 )
, Depth( 0 )
, Data()
, Tiled( false ){
// empty
}
};// struct CAMFImporter_NodeElement_Texture };// struct CAMFImporter_NodeElement_Texture
#endif // INCLUDED_AI_AMF_IMPORTER_NODE_H #endif // INCLUDED_AI_AMF_IMPORTER_NODE_H

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -54,7 +55,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "StringUtils.h" #include "StringUtils.h"
// Header files, stdlib. // Header files, stdlib.
#include <algorithm>
#include <iterator> #include <iterator>
namespace Assimp namespace Assimp
@ -62,7 +62,7 @@ namespace Assimp
aiColor4D AMFImporter::SPP_Material::GetColor(const float pX, const float pY, const float pZ) const aiColor4D AMFImporter::SPP_Material::GetColor(const float pX, const float pY, const float pZ) const
{ {
aiColor4D tcol; aiColor4D tcol;
// Check if stored data are supported. // Check if stored data are supported.
if(Composition.size() != 0) if(Composition.size() != 0)
@ -93,8 +93,8 @@ aiColor4D tcol;
void AMFImporter::PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector<aiVector3D>& pVertexCoordinateArray, void AMFImporter::PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector<aiVector3D>& pVertexCoordinateArray,
std::vector<CAMFImporter_NodeElement_Color*>& pVertexColorArray) const std::vector<CAMFImporter_NodeElement_Color*>& pVertexColorArray) const
{ {
CAMFImporter_NodeElement_Vertices* vn = nullptr; CAMFImporter_NodeElement_Vertices* vn = nullptr;
size_t col_idx; size_t col_idx;
// All data stored in "vertices", search for it. // All data stored in "vertices", search for it.
for(CAMFImporter_NodeElement* ne_child: pNodeElement.Child) for(CAMFImporter_NodeElement* ne_child: pNodeElement.Child)
@ -142,8 +142,8 @@ size_t col_idx;
size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B,
const std::string& pID_A) const std::string& pID_A)
{ {
size_t TextureConverted_Index; size_t TextureConverted_Index;
std::string TextureConverted_ID; std::string TextureConverted_ID;
// check input data // check input data
if(pID_R.empty() && pID_G.empty() && pID_B.empty() && pID_A.empty()) if(pID_R.empty() && pID_G.empty() && pID_B.empty() && pID_A.empty())
@ -261,21 +261,20 @@ std::string TextureConverted_ID;
size_t off_b = 0; size_t off_b = 0;
// Calculate size of the target array and rule how data will be copied. // Calculate size of the target array and rule how data will be copied.
if ( nullptr != src_texture ) { if(!pID_R.empty() && nullptr != src_texture[ 0 ] ) {
if(!pID_R.empty()) { tex_size += src_texture[0]->Data.size(); step++, off_g++, off_b++;
tex_size += src_texture[0]->Data.size(); step++, off_g++, off_b++;
}
if(!pID_G.empty()) {
tex_size += src_texture[1]->Data.size(); step++, off_b++;
}
if(!pID_B.empty()) {
tex_size += src_texture[2]->Data.size(); step++;
}
if(!pID_A.empty()) {
tex_size += src_texture[3]->Data.size(); step++;
}
} }
// Create target array. if(!pID_G.empty() && nullptr != src_texture[ 1 ] ) {
tex_size += src_texture[1]->Data.size(); step++, off_b++;
}
if(!pID_B.empty() && nullptr != src_texture[ 2 ] ) {
tex_size += src_texture[2]->Data.size(); step++;
}
if(!pID_A.empty() && nullptr != src_texture[ 3 ] ) {
tex_size += src_texture[3]->Data.size(); step++;
}
// Create target array.
converted_texture.Data = new uint8_t[tex_size]; converted_texture.Data = new uint8_t[tex_size];
// And copy data // And copy data
auto CopyTextureData = [&](const std::string& pID, const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void auto CopyTextureData = [&](const std::string& pID, const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void
@ -302,19 +301,19 @@ std::string TextureConverted_ID;
void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace>& pInputList, std::list<std::list<SComplexFace> >& pOutputList_Separated) void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace>& pInputList, std::list<std::list<SComplexFace> >& pOutputList_Separated)
{ {
auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap* pTexMap1, const CAMFImporter_NodeElement_TexMap* pTexMap2) -> bool auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap* pTexMap1, const CAMFImporter_NodeElement_TexMap* pTexMap2) -> bool
{ {
if((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true; if((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true;
if(pTexMap1 == nullptr) return false; if(pTexMap1 == nullptr) return false;
if(pTexMap2 == nullptr) return false; if(pTexMap2 == nullptr) return false;
if(pTexMap1->TextureID_R != pTexMap2->TextureID_R) return false; if(pTexMap1->TextureID_R != pTexMap2->TextureID_R) return false;
if(pTexMap1->TextureID_G != pTexMap2->TextureID_G) return false; if(pTexMap1->TextureID_G != pTexMap2->TextureID_G) return false;
if(pTexMap1->TextureID_B != pTexMap2->TextureID_B) return false; if(pTexMap1->TextureID_B != pTexMap2->TextureID_B) return false;
if(pTexMap1->TextureID_A != pTexMap2->TextureID_A) return false; if(pTexMap1->TextureID_A != pTexMap2->TextureID_A) return false;
return true; return true;
}; };
pOutputList_Separated.clear(); pOutputList_Separated.clear();
if(pInputList.size() == 0) return; if(pInputList.size() == 0) return;

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -54,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/importerdesc.h>
#include <memory> #include <memory>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -46,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BaseImporter.h" #include "BaseImporter.h"
#include <assimp/types.h> #include <assimp/types.h>
#include "ASEParser.h"
struct aiNode; struct aiNode;
#include "ASEParser.h"
namespace Assimp { namespace Assimp {

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -49,7 +50,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// internal headers // internal headers
#include "TextureTransform.h" #include "TextureTransform.h"
#include "ASELoader.h" #include "ASELoader.h"
#include "MaterialSystem.h"
#include "fast_atof.h" #include "fast_atof.h"
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
@ -1858,7 +1858,7 @@ void Parser::ParseLV3MeshCFaceListBlock(unsigned int iNumFaces, ASE::Mesh& mesh)
++filePtr; ++filePtr;
// Face entry // Face entry
if (TokenMatch(filePtr,"MESH_CFACE" ,11)) if (TokenMatch(filePtr,"MESH_CFACE" ,10))
{ {
unsigned int aiValues[3]; unsigned int aiValues[3];
unsigned int iIndex = 0; unsigned int iIndex = 0;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -54,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/mesh.h> #include <assimp/mesh.h>
#include <assimp/anim.h> #include <assimp/anim.h>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/importerdesc.h>
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB #ifdef ASSIMP_BUILD_NO_OWN_ZLIB
# include <zlib.h> # include <zlib.h>
@ -196,7 +198,7 @@ template <typename T> void ReadBounds( IOStream * stream, T* /*p*/, unsigned int
stream->Seek( sizeof(T) * n, aiOrigin_CUR ); stream->Seek( sizeof(T) * n, aiOrigin_CUR );
} }
void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node ) void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node, aiNode* parent )
{ {
uint32_t chunkID = Read<uint32_t>(stream); uint32_t chunkID = Read<uint32_t>(stream);
ai_assert(chunkID == ASSBIN_CHUNK_AINODE); ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
@ -208,6 +210,10 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
(*node)->mTransformation = Read<aiMatrix4x4>(stream); (*node)->mTransformation = Read<aiMatrix4x4>(stream);
(*node)->mNumChildren = Read<unsigned int>(stream); (*node)->mNumChildren = Read<unsigned int>(stream);
(*node)->mNumMeshes = Read<unsigned int>(stream); (*node)->mNumMeshes = Read<unsigned int>(stream);
if(parent)
{
(*node)->mParent = parent;
}
if ((*node)->mNumMeshes) if ((*node)->mNumMeshes)
{ {
@ -221,7 +227,7 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
{ {
(*node)->mChildren = new aiNode*[(*node)->mNumChildren]; (*node)->mChildren = new aiNode*[(*node)->mNumChildren];
for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) { for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) {
ReadBinaryNode( stream, &(*node)->mChildren[i] ); ReadBinaryNode( stream, &(*node)->mChildren[i], *node );
} }
} }
@ -569,7 +575,7 @@ void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene )
// Read node graph // Read node graph
scene->mRootNode = new aiNode[1]; scene->mRootNode = new aiNode[1];
ReadBinaryNode( stream, &scene->mRootNode ); ReadBinaryNode( stream, &scene->mRootNode, (aiNode*)NULL );
// Read all meshes // Read all meshes
if (scene->mNumMeshes) if (scene->mNumMeshes)

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -46,7 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_ASSBINIMPORTER_H_INC #define AI_ASSBINIMPORTER_H_INC
#include "BaseImporter.h" #include "BaseImporter.h"
#include <assimp/types.h>
struct aiMesh; struct aiMesh;
struct aiNode; struct aiNode;
@ -86,7 +86,7 @@ public:
IOSystem* pIOHandler IOSystem* pIOHandler
); );
void ReadBinaryScene( IOStream * stream, aiScene* pScene ); void ReadBinaryScene( IOStream * stream, aiScene* pScene );
void ReadBinaryNode( IOStream * stream, aiNode** mRootNode ); void ReadBinaryNode( IOStream * stream, aiNode** mRootNode, aiNode* parent );
void ReadBinaryMesh( IOStream * stream, aiMesh* mesh ); void ReadBinaryMesh( IOStream * stream, aiMesh* mesh );
void ReadBinaryBone( IOStream * stream, aiBone* bone ); void ReadBinaryBone( IOStream * stream, aiBone* bone );
void ReadBinaryMaterial(IOStream * stream, aiMaterial* mat); void ReadBinaryMaterial(IOStream * stream, aiMaterial* mat);

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -65,8 +66,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
using namespace Assimp; using namespace Assimp;
namespace Assimp namespace Assimp {
{
// underlying structure for aiPropertyStore // underlying structure for aiPropertyStore
typedef BatchLoader::PropertyMap PropertyMap; typedef BatchLoader::PropertyMap PropertyMap;
@ -109,12 +109,11 @@ static std::mutex gLogStreamMutex;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Custom LogStream implementation for the C-API // Custom LogStream implementation for the C-API
class LogToCallbackRedirector : public LogStream class LogToCallbackRedirector : public LogStream {
{
public: public:
explicit LogToCallbackRedirector(const aiLogStream& s) explicit LogToCallbackRedirector(const aiLogStream& s)
: stream (s) { : stream (s) {
ai_assert(NULL != s.callback); ai_assert(NULL != s.callback);
} }
~LogToCallbackRedirector() { ~LogToCallbackRedirector() {
@ -145,8 +144,7 @@ private:
}; };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void ReportSceneNotFoundError() void ReportSceneNotFoundError() {
{
DefaultLogger::get()->error("Unable to find the Assimp::Importer for this aiScene. " DefaultLogger::get()->error("Unable to find the Assimp::Importer for this aiScene. "
"The C-API does not accept scenes produced by the C++ API and vice versa"); "The C-API does not accept scenes produced by the C++ API and vice versa");
@ -155,22 +153,18 @@ void ReportSceneNotFoundError()
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Reads the given file and returns its content. // Reads the given file and returns its content.
const aiScene* aiImportFile( const char* pFile, unsigned int pFlags) const aiScene* aiImportFile( const char* pFile, unsigned int pFlags) {
{
return aiImportFileEx(pFile,pFlags,NULL); return aiImportFileEx(pFile,pFlags,NULL);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags, aiFileIO* pFS) const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags, aiFileIO* pFS) {
{
return aiImportFileExWithProperties(pFile, pFlags, pFS, NULL); return aiImportFileExWithProperties(pFile, pFlags, pFS, NULL);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFlags, const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFlags,
aiFileIO* pFS, aiFileIO* pFS, const aiPropertyStore* props) {
const aiPropertyStore* props)
{
ai_assert(NULL != pFile); ai_assert(NULL != pFile);
const aiScene* scene = NULL; const aiScene* scene = NULL;
@ -189,7 +183,7 @@ const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFl
pimpl->mMatrixProperties = pp->matrices; pimpl->mMatrixProperties = pp->matrices;
} }
// setup a custom IO system if necessary // setup a custom IO system if necessary
if (pFS) { if (pFS) {
imp->SetIOHandler( new CIOSystemWrapper (pFS) ); imp->SetIOHandler( new CIOSystemWrapper (pFS) );
} }
@ -200,8 +194,7 @@ const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFl
if( scene) { if( scene) {
ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) ); ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) );
priv->mOrigImporter = imp; priv->mOrigImporter = imp;
} } else {
else {
// if failed, extract error code and destroy the import // if failed, extract error code and destroy the import
gLastErrorString = imp->GetErrorString(); gLastErrorString = imp->GetErrorString();
delete imp; delete imp;
@ -209,6 +202,7 @@ const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFl
// return imported data. If the import failed the pointer is NULL anyways // return imported data. If the import failed the pointer is NULL anyways
ASSIMP_END_EXCEPTION_REGION(const aiScene*); ASSIMP_END_EXCEPTION_REGION(const aiScene*);
return scene; return scene;
} }

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -41,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ASSXML exporter main code * ASSXML exporter main code
*/ */
#include <stdarg.h> #include <stdarg.h>
#include "./../include/assimp/version.h" #include <assimp/version.h>
#include "ProcessHelper.h" #include "ProcessHelper.h"
#include <assimp/IOStream.hpp> #include <assimp/IOStream.hpp>
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -56,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/anim.h> #include <assimp/anim.h>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/importerdesc.h>
using namespace Assimp; using namespace Assimp;
using namespace std; using namespace std;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -48,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/material.h> #include <assimp/material.h>
#include "BaseImporter.h" #include "BaseImporter.h"
#include <string>
#include <vector> #include <vector>
struct aiNodeAnim; struct aiNodeAnim;

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -51,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "TinyFormatter.h" #include "TinyFormatter.h"
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/importerdesc.h>
using namespace Assimp; using namespace Assimp;
using namespace Assimp::Formatter; using namespace Assimp::Formatter;

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -50,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/Importer.hpp> #include <assimp/Importer.hpp>
#include <assimp/postprocess.h> #include <assimp/postprocess.h>
#include <assimp/importerdesc.h>
#include <ios> #include <ios>
#include <list> #include <list>
#include <memory> #include <memory>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -44,14 +45,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Exceptional.h" #include "Exceptional.h"
#include <string>
#include <map>
#include <vector> #include <vector>
#include <set> #include <set>
#include <assimp/types.h> #include <assimp/types.h>
#include <assimp/ProgressHandler.hpp> #include <assimp/ProgressHandler.hpp>
struct aiScene; struct aiScene;
struct aiImporterDesc;
namespace Assimp { namespace Assimp {

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -43,8 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define INCLUDED_AI_BASEPROCESS_H #define INCLUDED_AI_BASEPROCESS_H
#include <map> #include <map>
#include <assimp/types.h>
#include "GenericProperty.h" #include "GenericProperty.h"
struct aiScene; struct aiScene;

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -50,93 +51,71 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h> #include <stdint.h>
#include <cstddef> #include <cstddef>
struct aiTexture; struct aiTexture;
namespace Assimp { namespace Assimp {
class IOStream; class IOStream;
class Bitmap { class Bitmap {
protected:
protected: struct Header {
uint16_t type;
uint32_t size;
uint16_t reserved1;
uint16_t reserved2;
uint32_t offset;
struct Header { // We define the struct size because sizeof(Header) might return a wrong result because of structure padding.
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field).
static const std::size_t header_size =
sizeof(uint16_t) + // type
sizeof(uint32_t) + // size
sizeof(uint16_t) + // reserved1
sizeof(uint16_t) + // reserved2
sizeof(uint32_t); // offset
};
uint16_t type; struct DIB {
uint32_t size;
int32_t width;
int32_t height;
uint16_t planes;
uint16_t bits_per_pixel;
uint32_t compression;
uint32_t image_size;
int32_t x_resolution;
int32_t y_resolution;
uint32_t nb_colors;
uint32_t nb_important_colors;
uint32_t size; // We define the struct size because sizeof(DIB) might return a wrong result because of structure padding.
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field).
static const std::size_t dib_size =
sizeof(uint32_t) + // size
sizeof(int32_t) + // width
sizeof(int32_t) + // height
sizeof(uint16_t) + // planes
sizeof(uint16_t) + // bits_per_pixel
sizeof(uint32_t) + // compression
sizeof(uint32_t) + // image_size
sizeof(int32_t) + // x_resolution
sizeof(int32_t) + // y_resolution
sizeof(uint32_t) + // nb_colors
sizeof(uint32_t); // nb_important_colors
};
uint16_t reserved1; static const std::size_t mBytesPerPixel = 4;
uint16_t reserved2; public:
static void Save(aiTexture* texture, IOStream* file);
uint32_t offset;
// We define the struct size because sizeof(Header) might return a wrong result because of structure padding.
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field).
static const std::size_t header_size =
sizeof(uint16_t) + // type
sizeof(uint32_t) + // size
sizeof(uint16_t) + // reserved1
sizeof(uint16_t) + // reserved2
sizeof(uint32_t); // offset
};
struct DIB {
uint32_t size;
int32_t width;
int32_t height;
uint16_t planes;
uint16_t bits_per_pixel;
uint32_t compression;
uint32_t image_size;
int32_t x_resolution;
int32_t y_resolution;
uint32_t nb_colors;
uint32_t nb_important_colors;
// We define the struct size because sizeof(DIB) might return a wrong result because of structure padding.
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field).
static const std::size_t dib_size =
sizeof(uint32_t) + // size
sizeof(int32_t) + // width
sizeof(int32_t) + // height
sizeof(uint16_t) + // planes
sizeof(uint16_t) + // bits_per_pixel
sizeof(uint32_t) + // compression
sizeof(uint32_t) + // image_size
sizeof(int32_t) + // x_resolution
sizeof(int32_t) + // y_resolution
sizeof(uint32_t) + // nb_colors
sizeof(uint32_t); // nb_important_colors
};
static const std::size_t mBytesPerPixel = 4;
public:
static void Save(aiTexture* texture, IOStream* file);
protected:
static void WriteHeader(Header& header, IOStream* file);
static void WriteDIB(DIB& dib, IOStream* file);
static void WriteData(aiTexture* texture, IOStream* file);
protected:
static void WriteHeader(Header& header, IOStream* file);
static void WriteDIB(DIB& dib, IOStream* file);
static void WriteData(aiTexture* texture, IOStream* file);
}; };
} }

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -48,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BlenderDNA.h" #include "BlenderDNA.h"
#include "StreamReader.h" #include "StreamReader.h"
#include "fast_atof.h" #include "fast_atof.h"
#include "TinyFormatter.h"
using namespace Assimp; using namespace Assimp;
using namespace Assimp::Blender; using namespace Assimp::Blender;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -46,12 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define INCLUDED_AI_BLEND_DNA_H #define INCLUDED_AI_BLEND_DNA_H
#include "BaseImporter.h" #include "BaseImporter.h"
#include "TinyFormatter.h"
#include "StreamReader.h" #include "StreamReader.h"
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <stdint.h> #include <stdint.h>
#include <memory> #include <memory>
#include <map>
// enable verbose log output. really verbose, so be careful. // enable verbose log output. really verbose, so be careful.
#ifdef ASSIMP_BUILD_DEBUG #ifdef ASSIMP_BUILD_DEBUG

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -46,9 +47,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define INCLUDED_AI_BLEND_DNA_INL #define INCLUDED_AI_BLEND_DNA_INL
#include <memory> #include <memory>
#include "TinyFormatter.h"
namespace Assimp { namespace Assimp {
namespace Blender { namespace Blender {
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
const Field& Structure :: operator [] (const std::string& ss) const const Field& Structure :: operator [] (const std::string& ss) const

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -48,9 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BlenderLoader.h" #include "BlenderLoader.h"
#include "BlenderDNA.h" #include "BlenderDNA.h"
#include "BlenderScene.h" #include "BlenderScene.h"
#include "BlenderSceneGen.h"
#include <deque> #include <deque>
#include "./../include/assimp/material.h" #include <assimp/material.h>
struct aiTexture; struct aiTexture;

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -54,12 +55,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BlenderBMesh.h" #include "BlenderBMesh.h"
#include "StringUtils.h" #include "StringUtils.h"
#include <assimp/scene.h> #include <assimp/scene.h>
#include "StringComparison.h" #include <assimp/importerdesc.h>
#include "StringComparison.h"
#include "StreamReader.h" #include "StreamReader.h"
#include "MemoryIOWrapper.h" #include "MemoryIOWrapper.h"
#include <cctype> #include <cctype>
#include <cstdint>
// zlib is needed for compressed blend files // zlib is needed for compressed blend files
@ -108,6 +110,7 @@ BlenderImporter::~BlenderImporter()
} }
static const char* Tokens[] = { "BLENDER" }; static const char* Tokens[] = { "BLENDER" };
static const char* TokensForSearch[] = { "blender" };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file. // Returns whether the class can handle the format of the given file.
@ -120,7 +123,7 @@ bool BlenderImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, b
else if ((!extension.length() || checkSig) && pIOHandler) { else if ((!extension.length() || checkSig) && pIOHandler) {
// note: this won't catch compressed files // note: this won't catch compressed files
return SearchFileHeaderForToken(pIOHandler,pFile, Tokens,1); return SearchFileHeaderForToken(pIOHandler,pFile, TokensForSearch,1);
} }
return false; return false;
} }
@ -165,6 +168,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
free_it free_it_really(dest); free_it free_it_really(dest);
#endif #endif
FileDatabase file; FileDatabase file;
std::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb")); std::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
if (!stream) { if (!stream) {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -44,9 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER #ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
#include "BlenderDNA.h"
#include "BlenderScene.h" #include "BlenderScene.h"
#include "BlenderSceneGen.h" #include "BlenderSceneGen.h"
#include "BlenderDNA.h"
using namespace Assimp; using namespace Assimp;
using namespace Assimp::Blender; using namespace Assimp::Blender;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -638,6 +639,7 @@ struct Base : ElemBase {
Base() Base()
: ElemBase() : ElemBase()
, prev( nullptr )
, next() , next()
, object() { , object() {
// empty // empty
@ -784,10 +786,12 @@ struct Tex : ElemBase {
//char use_nodes; //char use_nodes;
Tex() Tex()
: ElemBase() { : ElemBase()
, imaflag( ImageFlags_INTERPOL )
, type( Type_CLOUDS )
, ima() {
// empty // empty
} }
}; };
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -45,10 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_BLOBIOSYSTEM_H_INCLUDED #ifndef AI_BLOBIOSYSTEM_H_INCLUDED
#define AI_BLOBIOSYSTEM_H_INCLUDED #define AI_BLOBIOSYSTEM_H_INCLUDED
#include "./../include/assimp/IOStream.hpp" #include <assimp/IOStream.hpp>
#include "./../include/assimp/cexport.h" #include <assimp/cexport.h>
#include "./../include/assimp/IOSystem.hpp" #include <assimp/IOSystem.hpp>
#include "./../include/assimp/DefaultLogger.hpp" #include <assimp/DefaultLogger.hpp>
#include <stdint.h> #include <stdint.h>
#include <set> #include <set>
#include <vector> #include <vector>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -1,7 +1,8 @@
# Open Asset Import Library (assimp) # Open Asset Import Library (assimp)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# #
# Copyright (c) 2006-2016, assimp team # Copyright (c) 2006-2017, assimp team
# All rights reserved. # All rights reserved.
# #
# Redistribution and use of this software in source and binary forms, # Redistribution and use of this software in source and binary forms,
@ -58,7 +59,7 @@ SET( PUBLIC_HEADERS
${HEADER_PATH}/camera.h ${HEADER_PATH}/camera.h
${HEADER_PATH}/color4.h ${HEADER_PATH}/color4.h
${HEADER_PATH}/color4.inl ${HEADER_PATH}/color4.inl
${HEADER_PATH}/config.h ${CMAKE_CURRENT_BINARY_DIR}/../include/assimp/config.h
${HEADER_PATH}/defs.h ${HEADER_PATH}/defs.h
${HEADER_PATH}/cfileio.h ${HEADER_PATH}/cfileio.h
${HEADER_PATH}/light.h ${HEADER_PATH}/light.h
@ -93,6 +94,8 @@ SET( PUBLIC_HEADERS
${HEADER_PATH}/NullLogger.hpp ${HEADER_PATH}/NullLogger.hpp
${HEADER_PATH}/cexport.h ${HEADER_PATH}/cexport.h
${HEADER_PATH}/Exporter.hpp ${HEADER_PATH}/Exporter.hpp
${HEADER_PATH}/DefaultIOStream.h
${HEADER_PATH}/DefaultIOSystem.h
) )
SET( Core_SRCS SET( Core_SRCS
@ -125,9 +128,7 @@ SET( Common_SRCS
ByteSwapper.h ByteSwapper.h
DefaultProgressHandler.h DefaultProgressHandler.h
DefaultIOStream.cpp DefaultIOStream.cpp
DefaultIOStream.h
DefaultIOSystem.cpp DefaultIOSystem.cpp
DefaultIOSystem.h
CInterfaceIOWrapper.cpp CInterfaceIOWrapper.cpp
CInterfaceIOWrapper.h CInterfaceIOWrapper.h
Hash.h Hash.h
@ -187,10 +188,16 @@ IF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER )
SOURCE_GROUP( C4D FILES ${C4D_SRCS}) SOURCE_GROUP( C4D FILES ${C4D_SRCS})
ENDIF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER ) ENDIF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER )
# if this variable is set to TRUE, the user can manually disable importers by setting
# ASSIMP_BUILD_XXX_IMPORTER to FALSE for each importer
# if this variable is set to FALSE, the user can manually enable importers by setting
# ASSIMP_BUILD_XXX_IMPORTER to TRUE for each importer
OPTION(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT "default value of all ASSIMP_BUILD_XXX_IMPORTER value" TRUE)
# macro to add the CMake Option ADD_ASSIMP_IMPORTER_<name> which enables compile of loader # macro to add the CMake Option ADD_ASSIMP_IMPORTER_<name> which enables compile of loader
# this way selective loaders can be compiled (reduces filesize + compile time) # this way selective loaders can be compiled (reduces filesize + compile time)
MACRO(ADD_ASSIMP_IMPORTER name) MACRO(ADD_ASSIMP_IMPORTER name)
OPTION(ASSIMP_BUILD_${name}_IMPORTER "build the ${name} importer" TRUE) OPTION(ASSIMP_BUILD_${name}_IMPORTER "build the ${name} importer" ${ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT})
IF(ASSIMP_BUILD_${name}_IMPORTER) IF(ASSIMP_BUILD_${name}_IMPORTER)
LIST(APPEND ASSIMP_LOADER_SRCS ${ARGN}) LIST(APPEND ASSIMP_LOADER_SRCS ${ARGN})
SET(ASSIMP_IMPORTERS_ENABLED "${ASSIMP_IMPORTERS_ENABLED} ${name}") SET(ASSIMP_IMPORTERS_ENABLED "${ASSIMP_IMPORTERS_ENABLED} ${name}")
@ -563,6 +570,9 @@ SET( PostProcessing_SRCS
) )
SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS}) SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
SET( IrrXML_SRCS irrXMLWrapper.h )
SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS})
ADD_ASSIMP_IMPORTER( Q3D ADD_ASSIMP_IMPORTER( Q3D
Q3DLoader.cpp Q3DLoader.cpp
Q3DLoader.h Q3DLoader.h
@ -657,6 +667,16 @@ ADD_ASSIMP_IMPORTER( 3MF
D3MFOpcPackage.cpp D3MFOpcPackage.cpp
) )
ADD_ASSIMP_IMPORTER( MMD
MMDCpp14.h
MMDImporter.cpp
MMDImporter.h
MMDPmdParser.h
MMDPmxParser.h
MMDPmxParser.cpp
MMDVmdParser.h
)
SET( Step_SRCS SET( Step_SRCS
StepExporter.h StepExporter.h
StepExporter.cpp StepExporter.cpp
@ -675,18 +695,6 @@ SET( Extra_SRCS
) )
SOURCE_GROUP( Extra FILES ${Extra_SRCS}) SOURCE_GROUP( Extra FILES ${Extra_SRCS})
SET( IrrXML_SRCS
irrXMLWrapper.h
../contrib/irrXML/CXMLReaderImpl.h
../contrib/irrXML/heapsort.h
../contrib/irrXML/irrArray.h
../contrib/irrXML/irrString.h
../contrib/irrXML/irrTypes.h
../contrib/irrXML/irrXML.cpp
../contrib/irrXML/irrXML.h
)
SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS})
SET( ConvertUTF_SRCS SET( ConvertUTF_SRCS
../contrib/ConvertUTF/ConvertUTF.h ../contrib/ConvertUTF/ConvertUTF.h
../contrib/ConvertUTF/ConvertUTF.c ../contrib/ConvertUTF/ConvertUTF.c
@ -842,7 +850,8 @@ SET( assimp_src
ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
../contrib/openddlparser/include ${IRRXML_INCLUDE_DIR}
../contrib/openddlparser/include
) )
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
@ -852,7 +861,7 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
ADD_LIBRARY( assimp ${assimp_src} ) ADD_LIBRARY( assimp ${assimp_src} )
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ) TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} )
if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI) set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI)
@ -930,7 +939,7 @@ if(MSVC AND ASSIMP_INSTALL_PDB)
DESTINATION ${ASSIMP_LIB_INSTALL_DIR} DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
CONFIGURATIONS Debug CONFIGURATIONS Debug
) )
install(FILES ${Assimp_BINARY_DIR}/code/RelWithDebInfo/assimp.pdb install(FILES ${Assimp_BINARY_DIR}/code/RelWithDebInfo/assimp${LIBRARY_SUFFIX}.pdb
DESTINATION ${ASSIMP_LIB_INSTALL_DIR} DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
CONFIGURATIONS RelWithDebInfo CONFIGURATIONS RelWithDebInfo
) )

View File

@ -2,7 +2,7 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/importerdesc.h>
using namespace Assimp; using namespace Assimp;
using namespace Assimp::COB; using namespace Assimp::COB;
@ -941,20 +941,22 @@ void COBImporter::UnsupportedChunk_Binary( StreamReaderLE& reader, const ChunkIn
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// tiny utility guard to aid me at staying within chunk boundaries. // tiny utility guard to aid me at staying within chunk boundaries.
class chunk_guard { class chunk_guard {
public: public:
chunk_guard(const COB::ChunkInfo& nfo, StreamReaderLE& reader) chunk_guard(const COB::ChunkInfo& nfo, StreamReaderLE& reader)
: nfo(nfo) : nfo(nfo)
, reader(reader) , reader(reader)
, cur(reader.GetCurrentPos()) , cur(reader.GetCurrentPos()) {
{
} }
~chunk_guard() { ~chunk_guard() {
// don't do anything if the size is not given // don't do anything if the size is not given
if(nfo.size != static_cast<unsigned int>(-1)) { if(nfo.size != static_cast<unsigned int>(-1)) {
reader.IncPtr(static_cast<int>(nfo.size)-reader.GetCurrentPos()+cur); try {
reader.IncPtr( static_cast< int >( nfo.size ) - reader.GetCurrentPos() + cur );
} catch ( DeadlyImportError e ) {
// out of limit so correct the value
reader.IncPtr( reader.GetReadLimit() );
}
} }
} }

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -46,12 +47,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <memory> #include <memory>
#include <deque> #include <deque>
#include <map>
#include "BaseImporter.h" #include "BaseImporter.h"
#include "./../include/assimp/material.h" #include <assimp/material.h>
namespace Assimp { namespace Assimp {
namespace COB { namespace COB {
// ------------------ // ------------------
/** Represents a single vertex index in a face */ /** Represents a single vertex index in a face */

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -57,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/anim.h> #include <assimp/anim.h>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/importerdesc.h>
using namespace Assimp; using namespace Assimp;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -38,18 +39,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------- ----------------------------------------------------------------------
*/ */
#ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
#include "ColladaExporter.h"
#include "ColladaExporter.h"
#include "Bitmap.h" #include "Bitmap.h"
#include "fast_atof.h" #include "fast_atof.h"
#include "SceneCombiner.h" #include "SceneCombiner.h"
#include "DefaultIOSystem.h"
#include "StringUtils.h" #include "StringUtils.h"
#include "XMLTools.h" #include "XMLTools.h"
#include <assimp/DefaultIOSystem.h>
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/Exporter.hpp> #include <assimp/Exporter.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
@ -59,6 +58,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <memory> #include <memory>
#include <ctime> #include <ctime>
#include <set> #include <set>
#include <vector>
#include <iostream>
using namespace Assimp; using namespace Assimp;
@ -133,6 +134,7 @@ void ColladaExporter::WriteFile()
WriteLightsLibrary(); WriteLightsLibrary();
WriteMaterials(); WriteMaterials();
WriteGeometryLibrary(); WriteGeometryLibrary();
WriteControllerLibrary();
WriteSceneLibrary(); WriteSceneLibrary();
@ -692,7 +694,6 @@ void ColladaExporter::WriteMaterials()
materials[a].shininess.exist = mat->Get( AI_MATKEY_SHININESS, materials[a].shininess.value) == aiReturn_SUCCESS; materials[a].shininess.exist = mat->Get( AI_MATKEY_SHININESS, materials[a].shininess.value) == aiReturn_SUCCESS;
materials[a].transparency.exist = mat->Get( AI_MATKEY_OPACITY, materials[a].transparency.value) == aiReturn_SUCCESS; materials[a].transparency.exist = mat->Get( AI_MATKEY_OPACITY, materials[a].transparency.value) == aiReturn_SUCCESS;
materials[a].transparency.value = materials[a].transparency.value;
materials[a].index_refraction.exist = mat->Get( AI_MATKEY_REFRACTI, materials[a].index_refraction.value) == aiReturn_SUCCESS; materials[a].index_refraction.exist = mat->Get( AI_MATKEY_REFRACTI, materials[a].index_refraction.value) == aiReturn_SUCCESS;
} }
@ -787,6 +788,177 @@ void ColladaExporter::WriteMaterials()
} }
} }
// ------------------------------------------------------------------------------------------------
// Writes the controller library
void ColladaExporter::WriteControllerLibrary()
{
mOutput << startstr << "<library_controllers>" << endstr;
PushTag();
for( size_t a = 0; a < mScene->mNumMeshes; ++a)
WriteController( a);
PopTag();
mOutput << startstr << "</library_controllers>" << endstr;
}
// ------------------------------------------------------------------------------------------------
// Writes a skin controller of the given mesh
void ColladaExporter::WriteController( size_t pIndex)
{
const aiMesh* mesh = mScene->mMeshes[pIndex];
const std::string idstr = GetMeshId( pIndex);
const std::string idstrEscaped = XMLEscape(idstr);
if ( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 )
return;
if ( mesh->mNumBones == 0 )
return;
mOutput << startstr << "<controller id=\"" << idstrEscaped << "-skin\" ";
mOutput << "name=\"skinCluster" << pIndex << "\">"<< endstr;
PushTag();
mOutput << startstr << "<skin source=\"#" << idstrEscaped << "\">" << endstr;
PushTag();
// bind pose matrix
mOutput << startstr << "<bind_shape_matrix>" << endstr;
PushTag();
// I think it is identity in general cases.
aiMatrix4x4 mat;
mOutput << startstr << mat.a1 << " " << mat.a2 << " " << mat.a3 << " " << mat.a4 << endstr;
mOutput << startstr << mat.b1 << " " << mat.b2 << " " << mat.b3 << " " << mat.b4 << endstr;
mOutput << startstr << mat.c1 << " " << mat.c2 << " " << mat.c3 << " " << mat.c4 << endstr;
mOutput << startstr << mat.d1 << " " << mat.d2 << " " << mat.d3 << " " << mat.d4 << endstr;
PopTag();
mOutput << startstr << "</bind_shape_matrix>" << endstr;
mOutput << startstr << "<source id=\"" << idstrEscaped << "-skin-joints\" name=\"" << idstrEscaped << "-skin-joints\">" << endstr;
PushTag();
mOutput << startstr << "<Name_array id=\"" << idstrEscaped << "-skin-joints-array\" count=\"" << mesh->mNumBones << "\">";
for( size_t i = 0; i < mesh->mNumBones; ++i )
mOutput << XMLEscape(mesh->mBones[i]->mName.C_Str()) << " ";
mOutput << "</Name_array>" << endstr;
mOutput << startstr << "<technique_common>" << endstr;
PushTag();
mOutput << startstr << "<accessor source=\"#" << idstrEscaped << "-skin-joints-array\" count=\"" << mesh->mNumBones << "\" stride=\"" << 1 << "\">" << endstr;
PushTag();
mOutput << startstr << "<param name=\"JOINT\" type=\"Name\"></param>" << endstr;
PopTag();
mOutput << startstr << "</accessor>" << endstr;
PopTag();
mOutput << startstr << "</technique_common>" << endstr;
PopTag();
mOutput << startstr << "</source>" << endstr;
std::vector<ai_real> bind_poses;
bind_poses.reserve(mesh->mNumBones * 16);
for( size_t i = 0; i < mesh->mNumBones; ++i)
for( size_t j = 0; j < 4; ++j)
bind_poses.insert(bind_poses.end(), mesh->mBones[i]->mOffsetMatrix[j], mesh->mBones[i]->mOffsetMatrix[j] + 4);
WriteFloatArray( idstr + "-skin-bind_poses", FloatType_Mat4x4, (const ai_real*) bind_poses.data(), bind_poses.size() / 16);
bind_poses.clear();
std::vector<ai_real> skin_weights;
skin_weights.reserve(mesh->mNumVertices * mesh->mNumBones);
for( size_t i = 0; i < mesh->mNumBones; ++i)
for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j)
skin_weights.push_back(mesh->mBones[i]->mWeights[j].mWeight);
WriteFloatArray( idstr + "-skin-weights", FloatType_Weight, (const ai_real*) skin_weights.data(), skin_weights.size());
skin_weights.clear();
mOutput << startstr << "<joints>" << endstr;
PushTag();
mOutput << startstr << "<input semantic=\"JOINT\" source=\"#" << idstrEscaped << "-skin-joints\"></input>" << endstr;
mOutput << startstr << "<input semantic=\"INV_BIND_MATRIX\" source=\"#" << idstrEscaped << "-skin-bind_poses\"></input>" << endstr;
PopTag();
mOutput << startstr << "</joints>" << endstr;
mOutput << startstr << "<vertex_weights count=\"" << mesh->mNumVertices << "\">" << endstr;
PushTag();
mOutput << startstr << "<input semantic=\"JOINT\" source=\"#" << idstrEscaped << "-skin-joints\" offset=\"0\"></input>" << endstr;
mOutput << startstr << "<input semantic=\"WEIGHT\" source=\"#" << idstrEscaped << "-skin-weights\" offset=\"1\"></input>" << endstr;
mOutput << startstr << "<vcount>";
std::vector<ai_uint> num_influences(mesh->mNumVertices, (ai_uint)0);
for( size_t i = 0; i < mesh->mNumBones; ++i)
for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j)
++num_influences[mesh->mBones[i]->mWeights[j].mVertexId];
for( size_t i = 0; i < mesh->mNumVertices; ++i)
mOutput << num_influences[i] << " ";
mOutput << "</vcount>" << endstr;
mOutput << startstr << "<v>";
ai_uint joint_weight_indices_length = 0;
std::vector<ai_uint> accum_influences;
accum_influences.reserve(num_influences.size());
for( size_t i = 0; i < num_influences.size(); ++i)
{
accum_influences.push_back(joint_weight_indices_length);
joint_weight_indices_length += num_influences[i];
}
ai_uint weight_index = 0;
std::vector<ai_int> joint_weight_indices(2 * joint_weight_indices_length, (ai_int)-1);
for( size_t i = 0; i < mesh->mNumBones; ++i)
for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j)
{
unsigned int vId = mesh->mBones[i]->mWeights[j].mVertexId;
for( size_t k = 0; k < num_influences[vId]; ++k)
{
if (joint_weight_indices[2 * (accum_influences[vId] + k)] == -1)
{
joint_weight_indices[2 * (accum_influences[vId] + k)] = i;
joint_weight_indices[2 * (accum_influences[vId] + k) + 1] = weight_index;
break;
}
}
++weight_index;
}
for( size_t i = 0; i < joint_weight_indices.size(); ++i)
mOutput << joint_weight_indices[i] << " ";
num_influences.clear();
accum_influences.clear();
joint_weight_indices.clear();
mOutput << "</v>" << endstr;
PopTag();
mOutput << startstr << "</vertex_weights>" << endstr;
PopTag();
mOutput << startstr << "</skin>" << endstr;
PopTag();
mOutput << startstr << "</controller>" << endstr;
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Writes the geometry library // Writes the geometry library
void ColladaExporter::WriteGeometryLibrary() void ColladaExporter::WriteGeometryLibrary()
@ -951,6 +1123,8 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy
case FloatType_TexCoord2: floatsPerElement = 2; break; case FloatType_TexCoord2: floatsPerElement = 2; break;
case FloatType_TexCoord3: floatsPerElement = 3; break; case FloatType_TexCoord3: floatsPerElement = 3; break;
case FloatType_Color: floatsPerElement = 3; break; case FloatType_Color: floatsPerElement = 3; break;
case FloatType_Mat4x4: floatsPerElement = 16; break;
case FloatType_Weight: floatsPerElement = 1; break;
default: default:
return; return;
} }
@ -1019,6 +1193,14 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy
mOutput << startstr << "<param name=\"G\" type=\"float\" />" << endstr; mOutput << startstr << "<param name=\"G\" type=\"float\" />" << endstr;
mOutput << startstr << "<param name=\"B\" type=\"float\" />" << endstr; mOutput << startstr << "<param name=\"B\" type=\"float\" />" << endstr;
break; break;
case FloatType_Mat4x4:
mOutput << startstr << "<param name=\"TRANSFORM\" type=\"float4x4\" />" << endstr;
break;
case FloatType_Weight:
mOutput << startstr << "<param name=\"WEIGHT\" type=\"float\" />" << endstr;
break;
} }
PopTag(); PopTag();
@ -1080,16 +1262,24 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode)
// If the node is associated with a bone, it is a joint node (JOINT) // If the node is associated with a bone, it is a joint node (JOINT)
// otherwise it is a normal node (NODE) // otherwise it is a normal node (NODE)
const char * node_type; const char * node_type;
bool is_joint, is_skeleton_root = false;
if (NULL == findBone(pScene, pNode->mName.C_Str())) { if (NULL == findBone(pScene, pNode->mName.C_Str())) {
node_type = "NODE"; node_type = "NODE";
is_joint = false;
} else { } else {
node_type = "JOINT"; node_type = "JOINT";
is_joint = true;
if(!pNode->mParent || NULL == findBone(pScene, pNode->mParent->mName.C_Str()))
is_skeleton_root = true;
} }
const std::string node_name_escaped = XMLEscape(pNode->mName.data); const std::string node_name_escaped = XMLEscape(pNode->mName.data);
mOutput << startstr mOutput << startstr
<< "<node id=\"" << node_name_escaped << "<node ";
<< "\" name=\"" << node_name_escaped if(is_skeleton_root)
mOutput << "id=\"" << "skeleton_root" << "\" "; // For now, only support one skeleton in a scene.
mOutput << (is_joint ? "s" : "") << "id=\"" << node_name_escaped;
mOutput << "\" name=\"" << node_name_escaped
<< "\" type=\"" << node_type << "\" type=\"" << node_type
<< "\">" << endstr; << "\">" << endstr;
PushTag(); PushTag();
@ -1097,7 +1287,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode)
// write transformation - we can directly put the matrix there // write transformation - we can directly put the matrix there
// TODO: (thom) decompose into scale - rot - quad to allow addressing it by animations afterwards // TODO: (thom) decompose into scale - rot - quad to allow addressing it by animations afterwards
const aiMatrix4x4& mat = pNode->mTransformation; const aiMatrix4x4& mat = pNode->mTransformation;
mOutput << startstr << "<matrix>"; mOutput << startstr << "<matrix sid=\"transform\">";
mOutput << mat.a1 << " " << mat.a2 << " " << mat.a3 << " " << mat.a4 << " "; mOutput << mat.a1 << " " << mat.a2 << " " << mat.a3 << " " << mat.a4 << " ";
mOutput << mat.b1 << " " << mat.b2 << " " << mat.b3 << " " << mat.b4 << " "; mOutput << mat.b1 << " " << mat.b2 << " " << mat.b3 << " " << mat.b4 << " ";
mOutput << mat.c1 << " " << mat.c2 << " " << mat.c3 << " " << mat.c4 << " "; mOutput << mat.c1 << " " << mat.c2 << " " << mat.c3 << " " << mat.c4 << " ";
@ -1125,33 +1315,50 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode)
for( size_t a = 0; a < pNode->mNumMeshes; ++a ) for( size_t a = 0; a < pNode->mNumMeshes; ++a )
{ {
const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]]; const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]];
// do not instanciate mesh if empty. I wonder how this could happen // do not instanciate mesh if empty. I wonder how this could happen
if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 )
continue; continue;
mOutput << startstr << "<instance_geometry url=\"#" << XMLEscape(GetMeshId( pNode->mMeshes[a])) << "\">" << endstr;
PushTag(); if( mesh->mNumBones == 0 )
mOutput << startstr << "<bind_material>" << endstr; {
PushTag(); mOutput << startstr << "<instance_geometry url=\"#" << XMLEscape(GetMeshId( pNode->mMeshes[a])) << "\">" << endstr;
mOutput << startstr << "<technique_common>" << endstr; PushTag();
PushTag(); }
mOutput << startstr << "<instance_material symbol=\"defaultMaterial\" target=\"#" << XMLEscape(materials[mesh->mMaterialIndex].name) << "\">" << endstr; else
PushTag(); {
for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) mOutput << startstr
{ << "<instance_controller url=\"#" << XMLEscape(GetMeshId( pNode->mMeshes[a])) << "-skin\">"
if( mesh->HasTextureCoords( static_cast<unsigned int>(a) ) ) << endstr;
// semantic as in <texture texcoord=...> PushTag();
// input_semantic as in <input semantic=...>
// input_set as in <input set=...> mOutput << startstr << "<skeleton>#skeleton_root</skeleton>" << endstr;
mOutput << startstr << "<bind_vertex_input semantic=\"CHANNEL" << a << "\" input_semantic=\"TEXCOORD\" input_set=\"" << a << "\"/>" << endstr; }
} mOutput << startstr << "<bind_material>" << endstr;
PopTag(); PushTag();
mOutput << startstr << "</instance_material>" << endstr; mOutput << startstr << "<technique_common>" << endstr;
PopTag(); PushTag();
mOutput << startstr << "</technique_common>" << endstr; mOutput << startstr << "<instance_material symbol=\"defaultMaterial\" target=\"#" << XMLEscape(materials[mesh->mMaterialIndex].name) << "\">" << endstr;
PopTag(); PushTag();
mOutput << startstr << "</bind_material>" << endstr; for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a )
PopTag(); {
mOutput << startstr << "</instance_geometry>" << endstr; if( mesh->HasTextureCoords( static_cast<unsigned int>(a) ) )
// semantic as in <texture texcoord=...>
// input_semantic as in <input semantic=...>
// input_set as in <input set=...>
mOutput << startstr << "<bind_vertex_input semantic=\"CHANNEL" << a << "\" input_semantic=\"TEXCOORD\" input_set=\"" << a << "\"/>" << endstr;
}
PopTag();
mOutput << startstr << "</instance_material>" << endstr;
PopTag();
mOutput << startstr << "</technique_common>" << endstr;
PopTag();
mOutput << startstr << "</bind_material>" << endstr;
PopTag();
if( mesh->mNumBones == 0)
mOutput << startstr << "</instance_geometry>" << endstr;
else
mOutput << startstr << "</instance_controller>" << endstr;
} }
// recurse into subnodes // recurse into subnodes

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -101,13 +102,19 @@ protected:
void WriteSpotLight(const aiLight *const light); void WriteSpotLight(const aiLight *const light);
void WriteAmbienttLight(const aiLight *const light); void WriteAmbienttLight(const aiLight *const light);
/// Writes the controller library
void WriteControllerLibrary();
/// Writes a skin controller of the given mesh
void WriteController( size_t pIndex);
/// Writes the geometry library /// Writes the geometry library
void WriteGeometryLibrary(); void WriteGeometryLibrary();
/// Writes the given mesh /// Writes the given mesh
void WriteGeometry( size_t pIndex); void WriteGeometry( size_t pIndex);
enum FloatDataType { FloatType_Vector, FloatType_TexCoord2, FloatType_TexCoord3, FloatType_Color }; enum FloatDataType { FloatType_Vector, FloatType_TexCoord2, FloatType_TexCoord3, FloatType_Color, FloatType_Mat4x4, FloatType_Weight };
/// Writes a float array of the given type /// Writes a float array of the given type
void WriteFloatArray( const std::string& pIdString, FloatDataType pType, const ai_real* pData, size_t pElementCount); void WriteFloatArray( const std::string& pIdString, FloatDataType pType, const ai_real* pData, size_t pElementCount);

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -43,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_COLLADAHELPER_H_INC #ifndef AI_COLLADAHELPER_H_INC
#define AI_COLLADAHELPER_H_INC #define AI_COLLADAHELPER_H_INC
#include <string>
#include <map> #include <map>
#include <vector> #include <vector>
#include <stdint.h> #include <stdint.h>

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -49,21 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/Importer.hpp> #include <assimp/Importer.hpp>
#include "ColladaParser.h" #include <assimp/importerdesc.h>
#include "ColladaParser.h"
#include "fast_atof.h" #include "fast_atof.h"
#include "ParsingUtils.h" #include "ParsingUtils.h"
#include "SkeletonMeshBuilder.h" #include "SkeletonMeshBuilder.h"
#include "Defines.h"
#include "CreateAnimMesh.h" #include "CreateAnimMesh.h"
#include "time.h" #include "time.h"
#include "math.h" #include "math.h"
#include <algorithm> #include <algorithm>
#include <cstdint>
#include <numeric> #include <numeric>
#include "Defines.h" #include <assimp/Defines.h>
using namespace Assimp; using namespace Assimp;
using namespace Assimp::Formatter; using namespace Assimp::Formatter;

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -49,7 +50,6 @@
#include "ColladaHelper.h" #include "ColladaHelper.h"
#include <assimp/ai_assert.h> #include <assimp/ai_assert.h>
#include "TinyFormatter.h" #include "TinyFormatter.h"
#include <memory>
namespace Assimp namespace Assimp
{ {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -43,24 +44,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "D3MFImporter.h" #include "D3MFImporter.h"
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/IOStream.hpp>
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/importerdesc.h>
#include "StringComparison.h" #include "StringComparison.h"
#include "StringUtils.h" #include "StringUtils.h"
#include <string> #include <string>
#include <sstream>
#include <vector> #include <vector>
#include <map> #include <map>
#include <algorithm>
#include <cassert> #include <cassert>
#include <cstdlib>
#include <memory> #include <memory>
#include <assimp/ai_assert.h>
#include "D3MFOpcPackage.h" #include "D3MFOpcPackage.h"
#include <contrib/unzip/unzip.h> #include <contrib/unzip/unzip.h>
#include "irrXMLWrapper.h" #include "irrXMLWrapper.h"
@ -68,7 +63,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp { namespace Assimp {
namespace D3MF { namespace D3MF {
namespace XmlTag { namespace XmlTag {
static const std::string model = "model"; static const std::string model = "model";
static const std::string metadata = "metadata"; static const std::string metadata = "metadata";
@ -254,9 +248,7 @@ private:
mesh->mFaces = new aiFace[mesh->mNumFaces]; mesh->mFaces = new aiFace[mesh->mNumFaces];
mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
std::copy(faces.begin(), faces.end(), mesh->mFaces); std::copy(faces.begin(), faces.end(), mesh->mFaces);
} }
aiFace ReadTriangle() aiFace ReadTriangle()
@ -313,8 +305,6 @@ private:
private: private:
std::vector<aiMesh*> meshes; std::vector<aiMesh*> meshes;
XmlReader* xmlReader; XmlReader* xmlReader;
}; };
} //namespace D3MF } //namespace D3MF

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -41,9 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_D3MFLOADER_H_INCLUDED #ifndef AI_D3MFLOADER_H_INCLUDED
#define AI_D3MFLOADER_H_INCLUDED #define AI_D3MFLOADER_H_INCLUDED
#include <vector>
#include <cstdint>
#include "BaseImporter.h" #include "BaseImporter.h"
namespace Assimp { namespace Assimp {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -53,7 +54,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <cstdlib>
#include <contrib/unzip/unzip.h> #include <contrib/unzip/unzip.h>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -41,7 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef D3MFOPCPACKAGE_H #ifndef D3MFOPCPACKAGE_H
#define D3MFOPCPACKAGE_H #define D3MFOPCPACKAGE_H
#include <string>
#include <memory> #include <memory>
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -54,6 +55,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "DXFHelper.h" #include "DXFHelper.h"
#include <assimp/IOSystem.hpp> #include <assimp/IOSystem.hpp>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <assimp/importerdesc.h>
#include <numeric> #include <numeric>
using namespace Assimp; using namespace Assimp;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -45,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_DXFLOADER_H_INCLUDED #define AI_DXFLOADER_H_INCLUDED
#include "BaseImporter.h" #include "BaseImporter.h"
#include <map>
namespace Assimp { namespace Assimp {
namespace DXF { namespace DXF {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -44,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/ai_assert.h> #include <assimp/ai_assert.h>
#include "DefaultIOStream.h" #include <assimp/DefaultIOStream.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -126,7 +127,7 @@ size_t DefaultIOStream::FileSize() const
if (0 != err) if (0 != err)
return 0; return 0;
mCachedSize = (size_t) (fileStat.st_size); mCachedSize = (size_t) (fileStat.st_size);
#elif defined __GNUC__ || defined __APPLE__ || defined __MACH__ #elif defined __GNUC__ || defined __APPLE__ || defined __MACH__ || defined __FreeBSD__
struct stat fileStat; struct stat fileStat;
int err = stat(mFilename.c_str(), &fileStat ); int err = stat(mFilename.c_str(), &fileStat );
if (0 != err) if (0 != err)

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -40,10 +41,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/** @file Default implementation of IOSystem using the standard C file functions */ /** @file Default implementation of IOSystem using the standard C file functions */
#include "DefaultIOSystem.h"
#include "DefaultIOStream.h"
#include "StringComparison.h" #include "StringComparison.h"
#include <assimp/DefaultIOSystem.h>
#include <assimp/DefaultIOStream.h>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/ai_assert.h> #include <assimp/ai_assert.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -43,13 +44,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @brief Implementation of DefaultLogger (and Logger) * @brief Implementation of DefaultLogger (and Logger)
*/ */
#include "DefaultIOSystem.h"
// Default log streams // Default log streams
#include "Win32DebugLogStream.h" #include "Win32DebugLogStream.h"
#include "StdOStreamLogStream.h" #include "StdOStreamLogStream.h"
#include "FileLogStream.h" #include "FileLogStream.h"
#include "StringUtils.h" #include "StringUtils.h"
#include <assimp/DefaultIOSystem.h>
#include <assimp/NullLogger.hpp> #include <assimp/NullLogger.hpp>
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#include <assimp/ai_assert.h> #include <assimp/ai_assert.h>

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define INCLUDED_EXCEPTIONAL_H #define INCLUDED_EXCEPTIONAL_H
#include <stdexcept> #include <stdexcept>
#include "DefaultIOStream.h" #include <assimp/DefaultIOStream.h>
using std::runtime_error; using std::runtime_error;
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
@ -52,7 +53,6 @@ Here we implement only the C++ interface (Assimp::Exporter).
#ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_EXPORT
#include "DefaultIOSystem.h"
#include "BlobIOSystem.h" #include "BlobIOSystem.h"
#include "SceneCombiner.h" #include "SceneCombiner.h"
#include "BaseProcess.h" #include "BaseProcess.h"
@ -64,11 +64,12 @@ Here we implement only the C++ interface (Assimp::Exporter).
#include "Exceptional.h" #include "Exceptional.h"
#include "ScenePrivate.h" #include "ScenePrivate.h"
#include <memory> #include <memory>
#include <assimp/DefaultIOSystem.h>
#include <assimp/Exporter.hpp> #include <assimp/Exporter.hpp>
#include <assimp/mesh.h> #include <assimp/mesh.h>
#include <assimp/postprocess.h> #include <assimp/postprocess.h>
#include <assimp/scene.h> #include <assimp/scene.h>
#include <memory>
namespace Assimp { namespace Assimp {
@ -235,7 +236,7 @@ bool Exporter::IsDefaultIOHandler() const {
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId,
unsigned int, const ExportProperties* pProperties ) { unsigned int, const ExportProperties* pProperties ) {
if (pimpl->blob) { if (pimpl->blob) {
delete pimpl->blob; delete pimpl->blob;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team Copyright (c) 2006-2017, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -48,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FBXParser.h" #include "FBXParser.h"
#include "FBXDocument.h" #include "FBXDocument.h"
#include "FBXImporter.h" #include "FBXImporter.h"
#include "FBXImportSettings.h"
#include "FBXDocumentUtil.h" #include "FBXDocumentUtil.h"
#include "FBXProperties.h" #include "FBXProperties.h"

Some files were not shown because too many files have changed in this diff Show More