- Merge in latest from assimp/assimp on GitHub (5c00aef7cd
)
- Added at least some of the new files to my Xcode 6 project, as well. - Built and tested with the DAE importer, seems to work fine.pull/615/head
commit
8b7fa48d27
|
@ -0,0 +1,22 @@
|
||||||
|
# See <http://EditorConfig.org> for details
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[CMakeLists.txt,*.cmake{,.in}]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
[*.h.in]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
[*.txt]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Declare files that will always have LF line endings on checkout.
|
||||||
|
*.cpp text eol=lf
|
||||||
|
*.h text eol=lf
|
||||||
|
*.c text eol=lf
|
||||||
|
*.hpp text eol=lf
|
||||||
|
*.txt text eol=lf
|
||||||
|
*.cmake text eol=lf
|
||||||
|
*.sh text eol=lf
|
|
@ -1,3 +1,4 @@
|
||||||
|
.idea
|
||||||
build
|
build
|
||||||
.project
|
.project
|
||||||
*.kdev4*
|
*.kdev4*
|
||||||
|
@ -10,7 +11,7 @@ build
|
||||||
# Output
|
# Output
|
||||||
bin/
|
bin/
|
||||||
lib/
|
lib/
|
||||||
contrib/
|
|
||||||
|
|
||||||
# Generated
|
# Generated
|
||||||
assimp.pc
|
assimp.pc
|
||||||
|
@ -54,3 +55,8 @@ tools/assimp_view/assimp_viewer.vcxproj.user
|
||||||
|
|
||||||
# Unix editor backups
|
# Unix editor backups
|
||||||
*~
|
*~
|
||||||
|
test/gtest/src/gtest-stamp/gtest-gitinfo.txt
|
||||||
|
test/gtest/src/gtest-stamp/gtest-gitclone-lastrun.txt
|
||||||
|
Assimp.opensdf
|
||||||
|
contrib/zlib/CTestTestfile.cmake
|
||||||
|
ipch/assimp_viewer-44bbbcd1/assimp_viewerd-ccc45335.ipch
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
function generate()
|
||||||
|
{
|
||||||
|
cmake -G "Unix Makefiles" -DASSIMP_ENABLE_BOOST_WORKAROUND=YES -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -DBUILD_SHARED_LIBS=$SHARED_BUILD
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $ANDROID ]; then
|
||||||
|
ant -v -Dmy.dir=${TRAVIS_BUILD_DIR} -f ${TRAVIS_BUILD_DIR}/port/jassimp/build.xml ndk-jni
|
||||||
|
else
|
||||||
|
generate \
|
||||||
|
&& make \
|
||||||
|
&& sudo make install \
|
||||||
|
&& sudo ldconfig \
|
||||||
|
&& (cd test/unit; ../../bin/unit) \
|
||||||
|
&& (cd test/regression; chmod 755 run.py; ./run.py; \
|
||||||
|
chmod 755 result_checker.py; ./result_checker.py)
|
||||||
|
fi
|
34
.travis.yml
34
.travis.yml
|
@ -1,16 +1,22 @@
|
||||||
before_install:
|
before_install:
|
||||||
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install cmake python3
|
- sudo apt-get install cmake python3
|
||||||
|
- if [ $LINUX ]; then sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; fi
|
||||||
|
- echo -e "#ifndef A_R_H_INC\n#define A_R_H_INC\n#define GitVersion ${TRAVIS_JOB_ID}\n#define GitBranch \"${TRAVIS_BRANCH}\"\n#endif // A_R_H_INC" > revision.h
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
global:
|
||||||
|
- PV=r8e PLATF=linux-x86_64 NDK_HOME=${TRAVIS_BUILD_DIR}/android-ndk-${PV} PATH=${PATH}:${NDK_HOME}
|
||||||
matrix:
|
matrix:
|
||||||
- LINUX=1 TRAVIS_NO_EXPORT=YES
|
- LINUX=1 TRAVIS_NO_EXPORT=YES
|
||||||
- LINUX=1 TRAVIS_NO_EXPORT=NO
|
- LINUX=1 TRAVIS_NO_EXPORT=NO
|
||||||
- LINUX=1 TRAVIS_STATIC_BUILD=ON
|
- LINUX=1 SHARED_BUILD=ON
|
||||||
- LINUX=1 TRAVIS_STATIC_BUILD=OFF
|
- LINUX=1 SHARED_BUILD=OFF
|
||||||
- WINDOWS=1 TRAVIS_NO_EXPORT=YES
|
- ANDROID=1
|
||||||
- WINDOWS=1 TRAVIS_NO_EXPORT=NO
|
|
||||||
- WINDOWS=1 TRAVIS_STATIC_BUILD=ON
|
|
||||||
- WINDOWS=1 TRAVIS_STATIC_BUILD=OFF
|
|
||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
|
@ -19,19 +25,7 @@ compiler:
|
||||||
- clang
|
- clang
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [ $WINDOWS ]; then travis_retry sudo apt-get install -q -y gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64; fi
|
- if [ $ANDROID ]; then wget -c http://dl.google.com/android/ndk/android-ndk-${PV}-${PLATF}.tar.bz2 && tar xf android-ndk-${PV}-${PLATF}.tar.bz2 ; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cmake -G "Unix Makefiles" -DASSIMP_ENABLE_BOOST_WORKAROUND=YES -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -STATIC_BUILD=$TRAVIS_STATIC_BUILD
|
- . ./.travis.sh
|
||||||
- make
|
|
||||||
- sudo make install
|
|
||||||
- sudo ldconfig
|
|
||||||
- cd test/unit
|
|
||||||
- ../../bin/unit
|
|
||||||
- cd ../regression
|
|
||||||
- chmod 755 run.py
|
|
||||||
- ./run.py
|
|
||||||
- echo "=========================================================="
|
|
||||||
- echo "REGRESSION TEST FAILS (results/run_regression_suite_failures.csv)"
|
|
||||||
- cat ../results/run_regression_suite_failures.csv
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
|
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 )
|
||||||
PROJECT( Assimp )
|
PROJECT( Assimp )
|
||||||
|
|
||||||
|
option(BUILD_SHARED_LIBS "Build package with shared libraries." ON)
|
||||||
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
#set(CMAKE_EXE_LINKER_FLAGS "-static")
|
||||||
|
set(LINK_SEARCH_START_STATIC TRUE)
|
||||||
|
endif(NOT BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
# Define here the needed parameters
|
# Define here the needed parameters
|
||||||
set (ASSIMP_VERSION_MAJOR 3)
|
set (ASSIMP_VERSION_MAJOR 3)
|
||||||
set (ASSIMP_VERSION_MINOR 1)
|
set (ASSIMP_VERSION_MINOR 1)
|
||||||
|
@ -11,10 +18,13 @@ set (PROJECT_VERSION "${ASSIMP_VERSION}")
|
||||||
|
|
||||||
set(ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources")
|
set(ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources")
|
||||||
|
|
||||||
|
# Needed for openddl_parser config, no use of c++11 at this moment
|
||||||
|
add_definitions( -DOPENDDL_NO_USE_CPP11 )
|
||||||
|
|
||||||
# Get the current working branch
|
# Get the current working branch
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git rev-parse --abbrev-ref HEAD
|
COMMAND git rev-parse --abbrev-ref HEAD
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE GIT_BRANCH
|
OUTPUT_VARIABLE GIT_BRANCH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
@ -22,7 +32,7 @@ execute_process(
|
||||||
# Get the latest abbreviated commit hash of the working branch
|
# Get the latest abbreviated commit hash of the working branch
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git log -1 --format=%h
|
COMMAND git log -1 --format=%h
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
@ -53,9 +63,9 @@ if( CMAKE_COMPILER_IS_MINGW )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW)
|
if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW)
|
||||||
add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it....
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # this is a very important switch and some libraries seem now to have it....
|
||||||
# hide all not-exported symbols
|
# hide all not-exported symbols
|
||||||
add_definitions( -fvisibility=hidden -Wall )
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall" )
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
# enable multi-core compilation with MSVC
|
# enable multi-core compilation with MSVC
|
||||||
add_definitions(/MP)
|
add_definitions(/MP)
|
||||||
|
@ -86,9 +96,6 @@ SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE PATH
|
||||||
|
|
||||||
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools")
|
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools")
|
||||||
|
|
||||||
# Allow the user to build a shared or static library
|
|
||||||
option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )
|
|
||||||
|
|
||||||
# Only generate this target if no higher-level project already has
|
# Only generate this target if no higher-level project already has
|
||||||
IF (NOT TARGET uninstall)
|
IF (NOT TARGET uninstall)
|
||||||
# add make uninstall capability
|
# add make uninstall capability
|
||||||
|
@ -126,6 +133,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${C
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
||||||
|
|
||||||
|
FIND_PACKAGE( DirectX )
|
||||||
|
|
||||||
option ( ASSIMP_NO_EXPORT
|
option ( ASSIMP_NO_EXPORT
|
||||||
"Disable Assimp's export functionality."
|
"Disable Assimp's export functionality."
|
||||||
OFF
|
OFF
|
||||||
|
@ -235,9 +244,9 @@ option ( ASSIMP_BUILD_ASSIMP_TOOLS
|
||||||
ON
|
ON
|
||||||
)
|
)
|
||||||
IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||||
IF ( WIN32 )
|
IF ( WIN32 AND DirectX_FOUND )
|
||||||
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
||||||
ENDIF ( WIN32 )
|
ENDIF ( WIN32 AND DirectX_FOUND )
|
||||||
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
||||||
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||||
|
|
||||||
|
|
7
CREDITS
7
CREDITS
|
@ -151,3 +151,10 @@ 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
|
||||||
|
Contributed ExportProperties interface
|
||||||
|
Contributed X File exporter
|
||||||
|
Contributed Step (stp) exporter
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
Open Asset Import Library Coding Conventions
|
||||||
|
==
|
||||||
|
|
||||||
|
If you want to participate as a developer in the **Open Asset Import Library** please read and respect the following coding conventions. This will ensure consistency throughout the codebase and help all the Open Asset Import Library users.
|
||||||
|
|
||||||
|
Spacing
|
||||||
|
==
|
||||||
|
|
||||||
|
* Use UNIX-style line endings (LF)
|
||||||
|
* Remove any trailing whitespace
|
||||||
|
* Expand tabs to 4 spaces
|
|
@ -1,14 +0,0 @@
|
||||||
===============================================
|
|
||||||
The Asset-Importer-Library Coding conventions
|
|
||||||
===============================================
|
|
||||||
|
|
||||||
If you want to participate to the Asset-Importer_Library please have a look
|
|
||||||
onto these coding conventions and try to follow them. They are more or less
|
|
||||||
some kind of guide line to help others coming into the code and help all
|
|
||||||
the Asset-Importer-Library users.
|
|
||||||
|
|
||||||
Tab width
|
|
||||||
===========
|
|
||||||
The tab width shall be 4 spaces.
|
|
||||||
|
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
56
Readme.md
56
Readme.md
|
@ -1,18 +1,31 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
========
|
========
|
||||||
|
|
||||||
Open Asset Import Library is a Open Source library designed to load various __3d file formats and convert them into a shared, in-memory format__. It supports more than __40 file formats__ for import and a growing selection of file formats for export. Additionally, assimp features various __post processing tools__ to refine the imported data: _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.
|
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.
|
||||||
|
|
||||||
This is the development trunk of assimp 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. According to [Travis-CI] (https://travis-ci.org/), the current build status of the trunk is [![Build Status](https://travis-ci.org/assimp/assimp.png)](https://travis-ci.org/assimp/assimp)
|
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.
|
||||||
|
|
||||||
[open3mod](https://github.com/acgessler/open3mod) is an Open Source 3D model viewer based off Assimp's import and export abilities.
|
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:
|
||||||
|
|
||||||
|
Linux [![Linux Build Status](https://travis-ci.org/assimp/assimp.png)](https://travis-ci.org/assimp/assimp)
|
||||||
|
Windows [![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp)
|
||||||
|
Coverity<a href="https://scan.coverity.com/projects/5607">
|
||||||
|
<img alt="Coverity Scan Build Status"
|
||||||
|
src="https://scan.coverity.com/projects/5607/badge.svg"/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__
|
||||||
|
|
||||||
#### Supported file formats ####
|
#### Supported file formats ####
|
||||||
|
|
||||||
The library provides importers for a lot of file formats, including:
|
A full list [is here](http://assimp.sourceforge.net/main_features_formats.html).
|
||||||
|
__Importers__:
|
||||||
|
|
||||||
- 3DS
|
- 3DS
|
||||||
- BLEND (Blender 3D)
|
- BLEND (Blender)
|
||||||
- DAE/Collada
|
- DAE/Collada
|
||||||
- FBX
|
- FBX
|
||||||
- IFC-STEP
|
- IFC-STEP
|
||||||
|
@ -29,6 +42,7 @@ The library provides importers for a lot of file formats, including:
|
||||||
- STL
|
- STL
|
||||||
- X
|
- X
|
||||||
- OBJ
|
- OBJ
|
||||||
|
- OpenGEX
|
||||||
- SMD
|
- SMD
|
||||||
- LWO
|
- LWO
|
||||||
- LXO
|
- LXO
|
||||||
|
@ -46,13 +60,13 @@ The library provides importers for a lot of file formats, including:
|
||||||
- Ogre Binary
|
- Ogre Binary
|
||||||
- Ogre XML
|
- Ogre XML
|
||||||
- Q3D
|
- Q3D
|
||||||
- ASSBIN (Assimp scene serialization)
|
- ASSBIN (Assimp custom format)
|
||||||
|
|
||||||
Additionally, the following formats are also supported, but not part of the core library as they depend on proprietary libraries.
|
Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default):
|
||||||
|
|
||||||
- C4D (https://github.com/acgessler/assimp-cinema4d)
|
- C4D (https://github.com/acgessler/assimp-cinema4d)
|
||||||
|
|
||||||
Exporters include:
|
__Exporters__:
|
||||||
|
|
||||||
- DAE (Collada)
|
- DAE (Collada)
|
||||||
- STL
|
- STL
|
||||||
|
@ -63,23 +77,21 @@ Exporters include:
|
||||||
- JSON (for WebGl, via https://github.com/acgessler/assimp2json)
|
- JSON (for WebGl, via https://github.com/acgessler/assimp2json)
|
||||||
- ASSBIN
|
- ASSBIN
|
||||||
|
|
||||||
See [the full list here](http://assimp.sourceforge.net/main_features_formats.html).
|
### Building ###
|
||||||
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
#### Repository structure ####
|
#### Repository structure ####
|
||||||
|
|
||||||
|
|
||||||
Open Asset Import Library is implemented in C++ (but provides both a C and a
|
Open Asset Import Library is implemented in C++. The directory structure is:
|
||||||
C++ish interface). The directory structure is:
|
|
||||||
|
|
||||||
/bin Folder for binaries, only used on Windows
|
|
||||||
/code Source code
|
/code Source code
|
||||||
/contrib Third-party libraries
|
/contrib Third-party libraries
|
||||||
/doc Documentation (doxysource and pre-compiled docs)
|
/doc Documentation (doxysource and pre-compiled docs)
|
||||||
/include Public header C and C++ header files
|
/include Public header C and C++ header files
|
||||||
/lib Static library location for Windows
|
|
||||||
/obj Object file location for Windows
|
|
||||||
/scripts Scripts used to generate the loading code for some formats
|
/scripts Scripts used to generate the loading code for some formats
|
||||||
/port Ports to other languages and scripts to maintain those.
|
/port Ports to other languages and scripts to maintain those.
|
||||||
/test Unit- and regression tests, test suite of models
|
/test Unit- and regression tests, test suite of models
|
||||||
|
@ -90,24 +102,15 @@ C++ish interface). The directory structure is:
|
||||||
CMake has superseeded all legacy build options!)
|
CMake has superseeded all legacy build options!)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Building ###
|
|
||||||
|
|
||||||
|
|
||||||
Take a look into the `INSTALL` file. Our build system is CMake, if you already used CMake before there is a good chance you know what to do.
|
|
||||||
|
|
||||||
|
|
||||||
### Where to get help ###
|
### Where to get help ###
|
||||||
|
|
||||||
|
|
||||||
For more information, visit [our website](http://assimp.sourceforge.net/). Or check out the `./doc`- folder, which contains the official documentation in HTML format.
|
For more information, visit [our website](http://assimp.sourceforge.net/). 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).
|
(CHMs for Windows are included in some release packages and should be located right here in the root folder).
|
||||||
|
|
||||||
If the documentation doesn't solve your problems,
|
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.
|
||||||
[try our forums at SF.net](http://sourceforge.net/p/assimp/discussion/817654) or ask on
|
|
||||||
[StackOverflow](http://stackoverflow.com/questions/tagged/assimp?sort=newest).
|
|
||||||
|
|
||||||
For development discussions, there is also a mailing list, _assimp-discussions_
|
For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_
|
||||||
[(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions)
|
[(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions)
|
||||||
|
|
||||||
### Contributing ###
|
### Contributing ###
|
||||||
|
@ -115,10 +118,9 @@ For development discussions, there is also a mailing list, _assimp-discussions_
|
||||||
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
|
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.
|
a pull request with your changes against the main repository's `master` branch.
|
||||||
|
|
||||||
|
|
||||||
### License ###
|
### License ###
|
||||||
|
|
||||||
Our license is based on the modified, __3-clause BSD__-License, which is very liberal.
|
Our license is based on the modified, __3-clause BSD__-License.
|
||||||
|
|
||||||
An _informal_ summary is: do whatever you want, but include Assimp's license text with your product -
|
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.
|
and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you may link statically to Assimp.
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# AppVeyor file
|
||||||
|
# http://www.appveyor.com/docs/appveyor-yml
|
||||||
|
|
||||||
|
# Operating system (build VM template)
|
||||||
|
os: Previous Windows Server 2012 R2 # using previous worker images since default worker has problem installing DART-Prerequisites.msi
|
||||||
|
|
||||||
|
# clone directory
|
||||||
|
clone_folder: c:\projects\assimp
|
||||||
|
|
||||||
|
# branches to build
|
||||||
|
branches:
|
||||||
|
# whitelist
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
platform: x64
|
||||||
|
configuration: Release
|
||||||
|
|
||||||
|
build:
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- cd c:\projects\assimp
|
||||||
|
- cmake CMakeLists.txt -G "Visual Studio 11"
|
||||||
|
- msbuild /m /p:Configuration=Release /p:Platform="Win32" Assimp.sln
|
|
@ -30,6 +30,13 @@ endif()
|
||||||
|
|
||||||
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest")
|
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest")
|
||||||
|
|
||||||
|
# try to find git - if found, setup gtest
|
||||||
|
find_package(Git)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(AddGTest_FOUND false CACHE BOOL "Was gtest setup correctly?")
|
||||||
|
else(NOT GIT_FOUND)
|
||||||
|
set(AddGTest_FOUND true CACHE BOOL "Was gtest setup correctly?")
|
||||||
|
|
||||||
ExternalProject_Add(gtest
|
ExternalProject_Add(gtest
|
||||||
GIT_REPOSITORY https://chromium.googlesource.com/external/googletest
|
GIT_REPOSITORY https://chromium.googlesource.com/external/googletest
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
|
@ -62,3 +69,4 @@ include_directories(${source_dir}/gtest/include)
|
||||||
|
|
||||||
ExternalProject_Get_Property(gtest binary_dir)
|
ExternalProject_Get_Property(gtest binary_dir)
|
||||||
link_directories(${binary_dir})
|
link_directories(${binary_dir})
|
||||||
|
endif(NOT GIT_FOUND)
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# this one sets internal to crosscompile (in theory)
|
||||||
|
SET(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
|
||||||
|
# the minimalistic settings
|
||||||
|
SET(CMAKE_C_COMPILER "/usr/bin/x86_64-w64-mingw32-gcc")
|
||||||
|
SET(CMAKE_CXX_COMPILER "/usr/bin/x86_64-w64-mingw32-g++")
|
||||||
|
SET(CMAKE_RC_COMPILER "/usr/bin/x86_64-w64-mingw32-windres")
|
||||||
|
|
||||||
|
# where is the target (so called staging) environment
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||||
|
|
||||||
|
# search for programs in the build host directories (default BOTH)
|
||||||
|
#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
# for libraries and headers in the target directories
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -0,0 +1,8 @@
|
||||||
|
# See <http://EditorConfig.org> for details
|
||||||
|
|
||||||
|
[*.{h,hpp,c,cpp}]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -41,12 +41,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/** @file Implementation of the 3ds importer class */
|
/** @file Implementation of the 3ds importer class */
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "3DSLoader.h"
|
#include "3DSLoader.h"
|
||||||
#include "TargetAnimation.h"
|
#include "TargetAnimation.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "StringComparison.h"
|
||||||
|
#include <boost/scoped_array.hpp>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -752,7 +757,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
|
||||||
pcNode->mNumMeshes = 1;
|
pcNode->mNumMeshes = 1;
|
||||||
|
|
||||||
// Build a name for the node
|
// Build a name for the node
|
||||||
pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%i",i);
|
pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%u",i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build dummy nodes for all cameras
|
// Build dummy nodes for all cameras
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,7 +38,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_EXPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_EXPORTER
|
||||||
|
@ -47,6 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "3DSLoader.h"
|
#include "3DSLoader.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "SplitLargeMeshes.h"
|
#include "SplitLargeMeshes.h"
|
||||||
|
#include "StringComparison.h"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/Exporter.hpp"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
@ -144,7 +148,7 @@ namespace {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Worker function for exporting a scene to 3DS. Prototyped and registered in Exporter.cpp
|
// Worker function for exporting a scene to 3DS. Prototyped and registered in Exporter.cpp
|
||||||
void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
|
void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<IOStream> outfile (pIOSystem->Open(pFile, "wb"));
|
boost::shared_ptr<IOStream> outfile (pIOSystem->Open(pFile, "wb"));
|
||||||
if(!outfile) {
|
if(!outfile) {
|
||||||
|
@ -188,8 +192,8 @@ Discreet3DSExporter:: Discreet3DSExporter(boost::shared_ptr<IOStream> outfile, c
|
||||||
|
|
||||||
{
|
{
|
||||||
ChunkWriter chunk(writer, Discreet3DS::CHUNK_OBJMESH);
|
ChunkWriter chunk(writer, Discreet3DS::CHUNK_OBJMESH);
|
||||||
WriteMeshes();
|
|
||||||
WriteMaterials();
|
WriteMaterials();
|
||||||
|
WriteMeshes();
|
||||||
|
|
||||||
{
|
{
|
||||||
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MASTER_SCALE);
|
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MASTER_SCALE);
|
||||||
|
@ -320,6 +324,7 @@ void Discreet3DSExporter::WriteMaterials()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
shading_mode_out = Discreet3DS::Flat;
|
||||||
ai_assert(false);
|
ai_assert(false);
|
||||||
};
|
};
|
||||||
writer.PutU2(static_cast<uint16_t>(shading_mode_out));
|
writer.PutU2(static_cast<uint16_t>(shading_mode_out));
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,11 +45,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_3DSEXPORTER_H_INC
|
#define AI_3DSEXPORTER_H_INC
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
#include "StreamWriter.h"
|
#include "StreamWriter.h"
|
||||||
|
#include "./../include/assimp/material.h"
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
|
struct aiMaterial;
|
||||||
|
struct aiMesh;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +46,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "SpatialSort.h"
|
#include "SpatialSort.h"
|
||||||
#include "SmoothingGroups.h"
|
#include "SmoothingGroups.h"
|
||||||
|
#include "qnan.h"
|
||||||
|
#include "./../include/assimp/material.h"
|
||||||
|
#include "./../include/assimp/camera.h"
|
||||||
|
#include "./../include/assimp/light.h"
|
||||||
|
#include "./../include/assimp/anim.h"
|
||||||
|
#include <stdio.h> //sprintf
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace D3DS {
|
namespace D3DS {
|
||||||
|
@ -326,6 +332,7 @@ struct Texture
|
||||||
, mScaleV (1.0f)
|
, mScaleV (1.0f)
|
||||||
, mRotation (0.0f)
|
, mRotation (0.0f)
|
||||||
, mMapMode (aiTextureMapMode_Wrap)
|
, mMapMode (aiTextureMapMode_Wrap)
|
||||||
|
, bPrivate()
|
||||||
, iUVSrc (0)
|
, iUVSrc (0)
|
||||||
{
|
{
|
||||||
mTextureBlend = get_qnan();
|
mTextureBlend = get_qnan();
|
||||||
|
@ -478,11 +485,11 @@ struct aiFloatKey
|
||||||
struct Node
|
struct Node
|
||||||
{
|
{
|
||||||
Node()
|
Node()
|
||||||
|
: mParent()
|
||||||
: mHierarchyPos (0)
|
, mInstanceNumber()
|
||||||
|
, mHierarchyPos (0)
|
||||||
, mHierarchyIndex (0)
|
, mHierarchyIndex (0)
|
||||||
, mInstanceCount (1)
|
, mInstanceCount (1)
|
||||||
|
|
||||||
{
|
{
|
||||||
static int iCnt = 0;
|
static int iCnt = 0;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -45,11 +45,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* http://www.the-labs.com/Blender/3DS-details.html
|
* http://www.the-labs.com/Blender/3DS-details.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "3DSLoader.h"
|
#include "3DSLoader.h"
|
||||||
|
#include "Macros.h"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "StringComparison.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -98,6 +103,14 @@ static const aiImporterDesc desc = {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
Discreet3DSImporter::Discreet3DSImporter()
|
Discreet3DSImporter::Discreet3DSImporter()
|
||||||
|
: stream(),
|
||||||
|
mLastNodeIndex(),
|
||||||
|
mCurrentNode(),
|
||||||
|
mRootNode(),
|
||||||
|
mScene(),
|
||||||
|
mMasterScale(),
|
||||||
|
bHasBG(),
|
||||||
|
bIsPrj()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -50,8 +50,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
struct aiNode;
|
|
||||||
#include "3DSHelper.h"
|
#include "3DSHelper.h"
|
||||||
|
#include "StreamReader.h"
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/** @file Implementation of the AC3D importer class */
|
/** @file Implementation of the AC3D importer class */
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_AC_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_AC_IMPORTER
|
||||||
|
|
||||||
|
@ -51,6 +51,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "Subdivision.h"
|
#include "Subdivision.h"
|
||||||
|
#include "Importer.h"
|
||||||
|
#include "BaseImporter.h"
|
||||||
|
#include "../include/assimp/Importer.hpp"
|
||||||
|
#include "../include/assimp/light.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/material.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "../include/assimp/config.h"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -119,6 +129,15 @@ static const aiImporterDesc desc = {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
AC3DImporter::AC3DImporter()
|
AC3DImporter::AC3DImporter()
|
||||||
|
: buffer(),
|
||||||
|
configSplitBFCull(),
|
||||||
|
configEvalSubdivision(),
|
||||||
|
mNumMeshes(),
|
||||||
|
mLights(),
|
||||||
|
lights(),
|
||||||
|
groups(),
|
||||||
|
polys(),
|
||||||
|
worlds()
|
||||||
{
|
{
|
||||||
// nothing to be done here
|
// nothing to be done here
|
||||||
}
|
}
|
||||||
|
@ -274,6 +293,9 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&buffer);
|
||||||
|
|
||||||
unsigned int t = strtoul10(buffer,&buffer);
|
unsigned int t = strtoul10(buffer,&buffer);
|
||||||
|
if (t >= std::numeric_limits<int32_t>::max() / sizeof(aiVector3D)) {
|
||||||
|
throw DeadlyImportError("AC3D: Too many vertices, would run out of memory");
|
||||||
|
}
|
||||||
obj.vertices.reserve(t);
|
obj.vertices.reserve(t);
|
||||||
for (unsigned int i = 0; i < t;++i)
|
for (unsigned int i = 0; i < t;++i)
|
||||||
{
|
{
|
||||||
|
@ -598,6 +620,9 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
|
||||||
face.mIndices[i] = cur++;
|
face.mIndices[i] = cur++;
|
||||||
|
|
||||||
// copy vertex positions
|
// copy vertex positions
|
||||||
|
if (static_cast<unsigned>(vertices - mesh->mVertices) >= mesh->mNumVertices) {
|
||||||
|
throw DeadlyImportError("AC3D: Invalid number of vertices");
|
||||||
|
}
|
||||||
*vertices = object.vertices[entry.first] + object.translation;
|
*vertices = object.vertices[entry.first] + object.translation;
|
||||||
|
|
||||||
|
|
||||||
|
@ -629,6 +654,10 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
|
||||||
face.mIndices[1] = cur++;
|
face.mIndices[1] = cur++;
|
||||||
|
|
||||||
// copy vertex positions
|
// copy vertex positions
|
||||||
|
if (it2 == (*it).entries.end() ) {
|
||||||
|
throw DeadlyImportError("AC3D: Bad line");
|
||||||
|
}
|
||||||
|
ai_assert((*it2).first < object.vertices.size());
|
||||||
*vertices++ = object.vertices[(*it2).first];
|
*vertices++ = object.vertices[(*it2).first];
|
||||||
|
|
||||||
// copy texture coordinates
|
// copy texture coordinates
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +49,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include "../include/assimp/types.h"
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
struct aiMesh;
|
||||||
|
struct aiMaterial;
|
||||||
|
struct aiLight;
|
||||||
|
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -124,6 +130,7 @@ public:
|
||||||
, surfaces()
|
, surfaces()
|
||||||
, numRefs (0)
|
, numRefs (0)
|
||||||
, subDiv (0)
|
, subDiv (0)
|
||||||
|
, crease()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Type description
|
// Type description
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the ASE importer class
|
* @brief Implementation of the ASE importer class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
|
@ -51,6 +50,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "TargetAnimation.h"
|
#include "TargetAnimation.h"
|
||||||
|
#include "../include/assimp/Importer.hpp"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
|
||||||
|
|
||||||
// utilities
|
// utilities
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
@ -74,7 +79,11 @@ static const aiImporterDesc desc = {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
ASEImporter::ASEImporter()
|
ASEImporter::ASEImporter()
|
||||||
: noSkeletonMesh()
|
: mParser(),
|
||||||
|
mBuffer(),
|
||||||
|
pcScene(),
|
||||||
|
configRecomputeNormals(),
|
||||||
|
noSkeletonMesh()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the ASE parser class
|
* @brief Implementation of the ASE parser class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
|
@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ASELoader.h"
|
#include "ASELoader.h"
|
||||||
#include "MaterialSystem.h"
|
#include "MaterialSystem.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::ASE;
|
using namespace Assimp::ASE;
|
||||||
|
@ -142,9 +143,9 @@ void Parser::LogWarning(const char* szWarn)
|
||||||
|
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
|
sprintf_s(szTemp,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#else
|
#else
|
||||||
snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
|
snprintf(szTemp,1024,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// output the warning to the logger ...
|
// output the warning to the logger ...
|
||||||
|
@ -158,9 +159,9 @@ void Parser::LogInfo(const char* szWarn)
|
||||||
|
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
|
sprintf_s(szTemp,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#else
|
#else
|
||||||
snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
|
snprintf(szTemp,1024,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// output the information to the logger ...
|
// output the information to the logger ...
|
||||||
|
@ -174,9 +175,9 @@ AI_WONT_RETURN void Parser::LogError(const char* szWarn)
|
||||||
|
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
|
sprintf_s(szTemp,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#else
|
#else
|
||||||
snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
|
snprintf(szTemp,1024,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// throw an exception
|
// throw an exception
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -40,10 +40,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file AssbinExporter.cpp
|
/** @file AssbinExporter.cpp
|
||||||
* ASSBIN exporter main code
|
* ASSBIN exporter main code
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#include "assbin_chunks.h"
|
#include "assbin_chunks.h"
|
||||||
#include "./../include/assimp/version.h"
|
#include "../include/assimp/version.h"
|
||||||
|
#include "../include/assimp/IOStream.hpp"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/Exporter.hpp"
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
|
#include "Exceptional.h"
|
||||||
|
#include <boost/static_assert.hpp>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
# include <zlib.h>
|
# include <zlib.h>
|
||||||
|
@ -754,7 +758,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
|
void ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
|
||||||
{
|
{
|
||||||
AssbinExport exporter;
|
AssbinExport exporter;
|
||||||
exporter.WriteBinaryDump( pFile, pIOSystem, pScene );
|
exporter.WriteBinaryDump( pFile, pIOSystem, pScene );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -45,13 +45,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* see assbin_chunks.h
|
* see assbin_chunks.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "AssbinLoader.h"
|
#include "AssbinLoader.h"
|
||||||
#include "assbin_chunks.h"
|
#include "assbin_chunks.h"
|
||||||
#include "MemoryIOWrapper.h"
|
#include "MemoryIOWrapper.h"
|
||||||
|
#include "../include/assimp/mesh.h"
|
||||||
|
#include "../include/assimp/anim.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include <boost/static_assert.hpp>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
# include <zlib.h>
|
# include <zlib.h>
|
||||||
#else
|
#else
|
||||||
|
@ -195,7 +199,8 @@ template <typename T> void ReadBounds( IOStream * stream, T* /*p*/, unsigned int
|
||||||
|
|
||||||
void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
|
void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AINODE);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
*node = new aiNode();
|
*node = new aiNode();
|
||||||
|
@ -226,7 +231,8 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
|
void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIBONE );
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AIBONE);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
b->mName = Read<aiString>(stream);
|
b->mName = Read<aiString>(stream);
|
||||||
|
@ -249,7 +255,8 @@ void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
|
||||||
|
|
||||||
void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
|
void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMESH);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AIMESH);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
mesh->mPrimitiveTypes = Read<unsigned int>(stream);
|
mesh->mPrimitiveTypes = Read<unsigned int>(stream);
|
||||||
|
@ -373,7 +380,8 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
|
||||||
|
|
||||||
void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialProperty* prop)
|
void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialProperty* prop)
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMATERIALPROPERTY);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AIMATERIALPROPERTY);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
prop->mKey = Read<aiString>(stream);
|
prop->mKey = Read<aiString>(stream);
|
||||||
|
@ -389,7 +397,8 @@ void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialPro
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
|
void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMATERIAL);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AIMATERIAL);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
mat->mNumAllocated = mat->mNumProperties = Read<unsigned int>(stream);
|
mat->mNumAllocated = mat->mNumProperties = Read<unsigned int>(stream);
|
||||||
|
@ -410,7 +419,8 @@ void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
|
void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AINODEANIM);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AINODEANIM);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
nd->mNodeName = Read<aiString>(stream);
|
nd->mNodeName = Read<aiString>(stream);
|
||||||
|
@ -458,7 +468,8 @@ void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim )
|
void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIANIMATION);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AIANIMATION);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
anim->mName = Read<aiString> (stream);
|
anim->mName = Read<aiString> (stream);
|
||||||
|
@ -478,7 +489,8 @@ void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim )
|
||||||
|
|
||||||
void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex)
|
void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex)
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AITEXTURE);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AITEXTURE);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
tex->mWidth = Read<unsigned int>(stream);
|
tex->mWidth = Read<unsigned int>(stream);
|
||||||
|
@ -501,7 +513,8 @@ void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex)
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
|
void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AILIGHT);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AILIGHT);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
l->mName = Read<aiString>(stream);
|
l->mName = Read<aiString>(stream);
|
||||||
|
@ -527,7 +540,8 @@ void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam )
|
void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AICAMERA);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AICAMERA);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
cam->mName = Read<aiString>(stream);
|
cam->mName = Read<aiString>(stream);
|
||||||
|
@ -542,7 +556,8 @@ void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam )
|
||||||
|
|
||||||
void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene )
|
void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene )
|
||||||
{
|
{
|
||||||
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AISCENE);
|
uint32_t chunkID = Read<uint32_t>(stream);
|
||||||
|
ai_assert(chunkID == ASSBIN_CHUNK_AISCENE);
|
||||||
/*uint32_t size =*/ Read<uint32_t>(stream);
|
/*uint32_t size =*/ Read<uint32_t>(stream);
|
||||||
|
|
||||||
scene->mFlags = Read<unsigned int>(stream);
|
scene->mFlags = Read<unsigned int>(stream);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +48,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include "../include/assimp/types.h"
|
||||||
|
|
||||||
|
struct aiMesh;
|
||||||
|
struct aiNode;
|
||||||
|
struct aiBone;
|
||||||
|
struct aiMaterial;
|
||||||
|
struct aiMaterialProperty;
|
||||||
|
struct aiNodeAnim;
|
||||||
|
struct aiAnimation;
|
||||||
|
struct aiTexture;
|
||||||
|
struct aiLight;
|
||||||
|
struct aiCamera;
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -42,13 +42,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the Plain-C API
|
* @brief Implementation of the Plain-C API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
#include <assimp/cimport.h>
|
||||||
#include "../include/assimp/cimport.h"
|
#include <assimp/LogStream.hpp>
|
||||||
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
#include <assimp/Importer.hpp>
|
||||||
|
#include <assimp/importerdesc.h>
|
||||||
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
#include "GenericProperty.h"
|
#include "GenericProperty.h"
|
||||||
#include "CInterfaceIOWrapper.h"
|
#include "CInterfaceIOWrapper.h"
|
||||||
#include "../include/assimp/importerdesc.h"
|
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
|
#include "Exceptional.h"
|
||||||
|
#include "ScenePrivate.h"
|
||||||
|
#include "BaseImporter.h"
|
||||||
|
#include <list>
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||||
|
@ -416,6 +423,21 @@ const char* aiGetErrorString()
|
||||||
return gLastErrorString.c_str();
|
return gLastErrorString.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------
|
||||||
|
// Return the description of a importer given its index
|
||||||
|
const aiImporterDesc* aiGetImportFormatDescription( size_t pIndex)
|
||||||
|
{
|
||||||
|
return Importer().GetImporterInfo(pIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------
|
||||||
|
// Return the number of importers
|
||||||
|
size_t aiGetImportFormatCount(void)
|
||||||
|
{
|
||||||
|
return Importer().GetImporterCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Returns the error text of the last failed import process.
|
// Returns the error text of the last failed import process.
|
||||||
aiBool aiIsExtensionSupported(const char* szExtension)
|
aiBool aiIsExtensionSupported(const char* szExtension)
|
||||||
|
@ -483,7 +505,7 @@ ASSIMP_API void aiSetImportPropertyInteger(aiPropertyStore* p, const char* szNam
|
||||||
{
|
{
|
||||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||||
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
||||||
SetGenericProperty<int>(pp->ints,szName,value,NULL);
|
SetGenericProperty<int>(pp->ints,szName,value);
|
||||||
ASSIMP_END_EXCEPTION_REGION(void);
|
ASSIMP_END_EXCEPTION_REGION(void);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +515,7 @@ ASSIMP_API void aiSetImportPropertyFloat(aiPropertyStore* p, const char* szName,
|
||||||
{
|
{
|
||||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||||
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
||||||
SetGenericProperty<float>(pp->floats,szName,value,NULL);
|
SetGenericProperty<float>(pp->floats,szName,value);
|
||||||
ASSIMP_END_EXCEPTION_REGION(void);
|
ASSIMP_END_EXCEPTION_REGION(void);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +529,7 @@ ASSIMP_API void aiSetImportPropertyString(aiPropertyStore* p, const char* szName
|
||||||
}
|
}
|
||||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||||
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
||||||
SetGenericProperty<std::string>(pp->strings,szName,std::string(st->C_Str()),NULL);
|
SetGenericProperty<std::string>(pp->strings,szName,std::string(st->C_Str()));
|
||||||
ASSIMP_END_EXCEPTION_REGION(void);
|
ASSIMP_END_EXCEPTION_REGION(void);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +543,7 @@ ASSIMP_API void aiSetImportPropertyMatrix(aiPropertyStore* p, const char* szName
|
||||||
}
|
}
|
||||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||||
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
|
||||||
SetGenericProperty<aiMatrix4x4>(pp->matrices,szName,*mat,NULL);
|
SetGenericProperty<aiMatrix4x4>(pp->matrices,szName,*mat);
|
||||||
ASSIMP_END_EXCEPTION_REGION(void);
|
ASSIMP_END_EXCEPTION_REGION(void);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
Assimp C export interface. See Exporter.cpp for some notes.
|
Assimp C export interface. See Exporter.cpp for some notes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
#include "CInterfaceIOWrapper.h"
|
#include "CInterfaceIOWrapper.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
|
#include "ScenePrivate.h"
|
||||||
|
#include "../include/assimp/Exporter.hpp"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -1,135 +0,0 @@
|
||||||
|
|
||||||
// Actually just a dummy, used by the compiler to build the precompiled header.
|
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#include "./../include/assimp/version.h"
|
|
||||||
|
|
||||||
static const unsigned int MajorVersion = 3;
|
|
||||||
static const unsigned int MinorVersion = 1;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
|
||||||
// Legal information string - dont't remove this.
|
|
||||||
static const char* LEGAL_INFORMATION =
|
|
||||||
|
|
||||||
"Open Asset Import Library (Assimp).\n"
|
|
||||||
"A free C/C++ library to import various 3D file formats into applications\n\n"
|
|
||||||
|
|
||||||
"(c) 2008-2010, assimp team\n"
|
|
||||||
"License under the terms and conditions of the 3-clause BSD license\n"
|
|
||||||
"http://assimp.sourceforge.net\n"
|
|
||||||
;
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Get legal string
|
|
||||||
ASSIMP_API const char* aiGetLegalString () {
|
|
||||||
return LEGAL_INFORMATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Get Assimp minor version
|
|
||||||
ASSIMP_API unsigned int aiGetVersionMinor () {
|
|
||||||
return MinorVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Get Assimp major version
|
|
||||||
ASSIMP_API unsigned int aiGetVersionMajor () {
|
|
||||||
return MajorVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Get flags used for compilation
|
|
||||||
ASSIMP_API unsigned int aiGetCompileFlags () {
|
|
||||||
|
|
||||||
unsigned int flags = 0;
|
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
|
|
||||||
flags |= ASSIMP_CFLAGS_NOBOOST;
|
|
||||||
#endif
|
|
||||||
#ifdef ASSIMP_BUILD_SINGLETHREADED
|
|
||||||
flags |= ASSIMP_CFLAGS_SINGLETHREADED;
|
|
||||||
#endif
|
|
||||||
#ifdef ASSIMP_BUILD_DEBUG
|
|
||||||
flags |= ASSIMP_CFLAGS_DEBUG;
|
|
||||||
#endif
|
|
||||||
#ifdef ASSIMP_BUILD_DLL_EXPORT
|
|
||||||
flags |= ASSIMP_CFLAGS_SHARED;
|
|
||||||
#endif
|
|
||||||
#ifdef _STLPORT_VERSION
|
|
||||||
flags |= ASSIMP_CFLAGS_STLPORT;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
// include current build revision, which is even updated from time to time -- :-)
|
|
||||||
#include "revision.h"
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
ASSIMP_API unsigned int aiGetVersionRevision ()
|
|
||||||
{
|
|
||||||
return GitVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
ASSIMP_API aiScene::aiScene()
|
|
||||||
: mFlags(0)
|
|
||||||
, mRootNode(NULL)
|
|
||||||
, mNumMeshes(0)
|
|
||||||
, mMeshes(NULL)
|
|
||||||
, mNumMaterials(0)
|
|
||||||
, mMaterials(NULL)
|
|
||||||
, mNumAnimations(0)
|
|
||||||
, mAnimations(NULL)
|
|
||||||
, mNumTextures(0)
|
|
||||||
, mTextures(NULL)
|
|
||||||
, mNumLights(0)
|
|
||||||
, mLights(NULL)
|
|
||||||
, mNumCameras(0)
|
|
||||||
, mCameras(NULL)
|
|
||||||
, mPrivate(new Assimp::ScenePrivateData())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
ASSIMP_API aiScene::~aiScene()
|
|
||||||
{
|
|
||||||
// delete all sub-objects recursively
|
|
||||||
delete mRootNode;
|
|
||||||
|
|
||||||
// To make sure we won't crash if the data is invalid it's
|
|
||||||
// much better to check whether both mNumXXX and mXXX are
|
|
||||||
// valid instead of relying on just one of them.
|
|
||||||
if (mNumMeshes && mMeshes)
|
|
||||||
for( unsigned int a = 0; a < mNumMeshes; a++)
|
|
||||||
delete mMeshes[a];
|
|
||||||
delete [] mMeshes;
|
|
||||||
|
|
||||||
if (mNumMaterials && mMaterials)
|
|
||||||
for( unsigned int a = 0; a < mNumMaterials; a++)
|
|
||||||
delete mMaterials[a];
|
|
||||||
delete [] mMaterials;
|
|
||||||
|
|
||||||
if (mNumAnimations && mAnimations)
|
|
||||||
for( unsigned int a = 0; a < mNumAnimations; a++)
|
|
||||||
delete mAnimations[a];
|
|
||||||
delete [] mAnimations;
|
|
||||||
|
|
||||||
if (mNumTextures && mTextures)
|
|
||||||
for( unsigned int a = 0; a < mNumTextures; a++)
|
|
||||||
delete mTextures[a];
|
|
||||||
delete [] mTextures;
|
|
||||||
|
|
||||||
if (mNumLights && mLights)
|
|
||||||
for( unsigned int a = 0; a < mNumLights; a++)
|
|
||||||
delete mLights[a];
|
|
||||||
delete [] mLights;
|
|
||||||
|
|
||||||
if (mNumCameras && mCameras)
|
|
||||||
for( unsigned int a = 0; a < mNumCameras; a++)
|
|
||||||
delete mCameras[a];
|
|
||||||
delete [] mCameras;
|
|
||||||
|
|
||||||
delete static_cast<Assimp::ScenePrivateData*>( mPrivate );
|
|
||||||
}
|
|
||||||
|
|
162
code/AssimpPCH.h
162
code/AssimpPCH.h
|
@ -1,162 +0,0 @@
|
||||||
/*
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
Open Asset Import Library (assimp)
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2006-2012, 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.
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @file AssimpPCH.h
|
|
||||||
* PCH master include. Every unit in Assimp has to include it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ASSIMP_PCH_INCLUDED
|
|
||||||
#define ASSIMP_PCH_INCLUDED
|
|
||||||
#define ASSIMP_INTERNAL_BUILD
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------------
|
|
||||||
/* General compile config taken from defs.h. It is important that the user compiles
|
|
||||||
* using exactly the same settings in defs.h. Settings in AssimpPCH.h may differ,
|
|
||||||
* they won't affect the public API.
|
|
||||||
*/
|
|
||||||
#include "../include/assimp/defs.h"
|
|
||||||
|
|
||||||
// Include our stdint.h replacement header for MSVC, take the global header for gcc/mingw
|
|
||||||
#if defined( _MSC_VER) && (_MSC_VER < 1600)
|
|
||||||
# include "../include/assimp/Compiler/pstdint.h"
|
|
||||||
#else
|
|
||||||
# include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Undefine the min/max macros defined by some platform headers (namely Windows.h) to
|
|
||||||
* avoid obvious conflicts with std::min() and std::max().
|
|
||||||
*/
|
|
||||||
#undef min
|
|
||||||
#undef max
|
|
||||||
|
|
||||||
/* Concatenate two tokens after evaluating them
|
|
||||||
*/
|
|
||||||
#define _AI_CONCAT(a,b) a ## b
|
|
||||||
#define AI_CONCAT(a,b) _AI_CONCAT(a,b)
|
|
||||||
|
|
||||||
/* Helper macro to set a pointer to NULL in debug builds
|
|
||||||
*/
|
|
||||||
#if (defined ASSIMP_BUILD_DEBUG)
|
|
||||||
# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
|
|
||||||
#else
|
|
||||||
# define AI_DEBUG_INVALIDATE_PTR(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Beginning with MSVC8 some C string manipulation functions are mapped to their _safe_
|
|
||||||
* counterparts (e.g. _itoa_s). This avoids a lot of trouble with deprecation warnings.
|
|
||||||
*/
|
|
||||||
#if _MSC_VER >= 1400 && !(defined _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
|
|
||||||
# define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* size_t to unsigned int, possible loss of data. The compiler is right with his warning
|
|
||||||
* but this loss of data won't be a problem for us. So shut up, little boy.
|
|
||||||
*/
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# pragma warning (disable : 4267)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------------
|
|
||||||
/* Actually that's not required for MSVC. It is included somewhere in the deeper parts of
|
|
||||||
* the MSVC STL but it's necessary for proper build with STLport.
|
|
||||||
*/
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
// Runtime/STL headers
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <map>
|
|
||||||
#include <set>
|
|
||||||
#include <string>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <cassert>
|
|
||||||
#include <stack>
|
|
||||||
#include <queue>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <numeric>
|
|
||||||
#include <new>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
// Boost headers
|
|
||||||
#include <boost/pointer_cast.hpp>
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
|
||||||
#include <boost/scoped_array.hpp>
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <boost/shared_array.hpp>
|
|
||||||
#include <boost/make_shared.hpp>
|
|
||||||
#include <boost/format.hpp>
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/static_assert.hpp>
|
|
||||||
#include <boost/lexical_cast.hpp>
|
|
||||||
|
|
||||||
// Public ASSIMP headers
|
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
|
||||||
#include "../include/assimp/IOStream.hpp"
|
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
|
||||||
#include "../include/assimp/scene.h"
|
|
||||||
#include "../include/assimp/importerdesc.h"
|
|
||||||
#include "../include/assimp/postprocess.h"
|
|
||||||
#include "../include/assimp/Importer.hpp"
|
|
||||||
#include "../include/assimp/Exporter.hpp"
|
|
||||||
|
|
||||||
// Internal utility headers
|
|
||||||
#include "BaseImporter.h"
|
|
||||||
#include "StringComparison.h"
|
|
||||||
#include "StreamReader.h"
|
|
||||||
#include "qnan.h"
|
|
||||||
#include "ScenePrivate.h"
|
|
||||||
|
|
||||||
|
|
||||||
// We need those constants, workaround for any platforms where nobody defined them yet
|
|
||||||
#if (!defined SIZE_MAX)
|
|
||||||
# define SIZE_MAX (~((size_t)0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (!defined UINT_MAX)
|
|
||||||
# define UINT_MAX (~((unsigned int)0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif // !! ASSIMP_PCH_INCLUDED
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +41,11 @@ 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 "AssimpPCH.h"
|
|
||||||
#include "./../include/assimp/version.h"
|
#include "./../include/assimp/version.h"
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
|
#include "../include/assimp/IOStream.hpp"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/Exporter.hpp"
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
# include <zlib.h>
|
# include <zlib.h>
|
||||||
|
@ -52,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
|
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
|
||||||
|
@ -621,7 +624,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened)
|
||||||
|
|
||||||
} // end of namespace AssxmlExport
|
} // end of namespace AssxmlExport
|
||||||
|
|
||||||
void ExportSceneAssxml(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
|
void ExportSceneAssxml(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
|
||||||
{
|
{
|
||||||
IOStream * out = pIOSystem->Open( pFile, "wt" );
|
IOStream * out = pIOSystem->Open( pFile, "wt" );
|
||||||
if (!out) return;
|
if (!out) return;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,13 +43,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the b3d importer class
|
* @brief Implementation of the b3d importer class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_B3D_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_B3D_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "B3DImporter.h"
|
#include "B3DImporter.h"
|
||||||
#include "TextureTransform.h"
|
#include "TextureTransform.h"
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/anim.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -233,7 +239,9 @@ unsigned B3DImporter::ChunkSize(){
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
T *B3DImporter::to_array( const vector<T> &v ){
|
T *B3DImporter::to_array( const vector<T> &v ){
|
||||||
if( !v.size() ) return 0;
|
if( v.empty() ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
T *p=new T[ v.size() ];
|
T *p=new T[ v.size() ];
|
||||||
for( size_t i=0;i<v.size();++i ){
|
for( size_t i=0;i<v.size();++i ){
|
||||||
p[i]=v[i];
|
p[i]=v[i];
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -47,10 +46,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "../include/assimp/types.h"
|
#include "../include/assimp/types.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include "../include/assimp/mesh.h"
|
||||||
#include "../include/assimp/material.h"
|
#include "../include/assimp/material.h"
|
||||||
|
#include "BaseImporter.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
struct aiNodeAnim;
|
||||||
|
struct aiNode;
|
||||||
|
struct aiAnimation;
|
||||||
|
|
||||||
namespace Assimp{
|
namespace Assimp{
|
||||||
|
|
||||||
class B3DImporter : public BaseImporter{
|
class B3DImporter : public BaseImporter{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -40,12 +40,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
|
||||||
|
|
||||||
#include "BVHLoader.h"
|
#include "BVHLoader.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
|
#include "../include/assimp/Importer.hpp"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <boost/format.hpp>
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -65,7 +70,10 @@ static const aiImporterDesc desc = {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
BVHLoader::BVHLoader()
|
BVHLoader::BVHLoader()
|
||||||
: noSkeletonMesh()
|
: mLine(),
|
||||||
|
mAnimTickDuration(),
|
||||||
|
mAnimNumFrames(),
|
||||||
|
noSkeletonMesh()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,11 +43,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of BaseImporter
|
* @brief Implementation of BaseImporter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "FileSystemFilter.h"
|
#include "FileSystemFilter.h"
|
||||||
|
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
|
#include "ByteSwapper.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "../include/assimp/Importer.hpp"
|
||||||
|
#include "../include/assimp/postprocess.h"
|
||||||
|
#include <ios>
|
||||||
|
#include <list>
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <boost/scoped_array.hpp>
|
||||||
|
#include <sstream>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -145,20 +154,26 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
|
||||||
// read 200 characters from the file
|
// read 200 characters from the file
|
||||||
boost::scoped_array<char> _buffer (new char[searchBytes+1 /* for the '\0' */]);
|
boost::scoped_array<char> _buffer (new char[searchBytes+1 /* for the '\0' */]);
|
||||||
char* buffer = _buffer.get();
|
char* buffer = _buffer.get();
|
||||||
|
if( NULL == buffer ) {
|
||||||
const unsigned int read = pStream->Read(buffer,1,searchBytes);
|
|
||||||
if (!read)
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < read;++i)
|
const size_t read = pStream->Read(buffer,1,searchBytes);
|
||||||
|
if( !read ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( size_t i = 0; i < read; ++i ) {
|
||||||
buffer[ i ] = ::tolower( buffer[ i ] );
|
buffer[ i ] = ::tolower( buffer[ i ] );
|
||||||
|
}
|
||||||
|
|
||||||
// It is not a proper handling of unicode files here ...
|
// It is not a proper handling of unicode files here ...
|
||||||
// ehm ... but it works in most cases.
|
// ehm ... but it works in most cases.
|
||||||
char* cur = buffer,*cur2 = buffer,*end = &buffer[read];
|
char* cur = buffer,*cur2 = buffer,*end = &buffer[read];
|
||||||
while (cur != end) {
|
while (cur != end) {
|
||||||
if (*cur)
|
if( *cur ) {
|
||||||
*cur2++ = *cur;
|
*cur2++ = *cur;
|
||||||
|
}
|
||||||
++cur;
|
++cur;
|
||||||
}
|
}
|
||||||
*cur2 = '\0';
|
*cur2 = '\0';
|
||||||
|
@ -168,8 +183,9 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
|
||||||
|
|
||||||
|
|
||||||
const char* r = strstr(buffer,tokens[i]);
|
const char* r = strstr(buffer,tokens[i]);
|
||||||
if (!r)
|
if( !r ) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
// We got a match, either we don't care where it is, or it happens to
|
// We got a match, either we don't care where it is, or it happens to
|
||||||
// be in the beginning of the file / line
|
// be in the beginning of the file / line
|
||||||
if (!tokensSol || r == buffer || r[-1] == '\r' || r[-1] == '\n') {
|
if (!tokensSol || r == buffer || r[-1] == '\r' || r[-1] == '\n') {
|
||||||
|
@ -178,6 +194,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,11 +400,11 @@ void BaseImporter::ConvertToUTF8(std::vector<char>& data)
|
||||||
// Convert to UTF8 data to ISO-8859-1
|
// Convert to UTF8 data to ISO-8859-1
|
||||||
void BaseImporter::ConvertUTF8toISO8859_1(std::string& data)
|
void BaseImporter::ConvertUTF8toISO8859_1(std::string& data)
|
||||||
{
|
{
|
||||||
unsigned int size = data.size();
|
size_t size = data.size();
|
||||||
unsigned int i = 0, j = 0;
|
size_t i = 0, j = 0;
|
||||||
|
|
||||||
while(i < size) {
|
while(i < size) {
|
||||||
if((unsigned char) data[i] < 0x80) {
|
if ((unsigned char) data[i] < (size_t) 0x80) {
|
||||||
data[j] = data[i];
|
data[j] = data[i];
|
||||||
} else if(i < size - 1) {
|
} else if(i < size - 1) {
|
||||||
if((unsigned char) data[i] == 0xC2) {
|
if((unsigned char) data[i] == 0xC2) {
|
||||||
|
@ -471,7 +488,9 @@ namespace Assimp
|
||||||
struct Assimp::BatchData
|
struct Assimp::BatchData
|
||||||
{
|
{
|
||||||
BatchData()
|
BatchData()
|
||||||
: next_id(0xffff)
|
: pIOSystem()
|
||||||
|
, pImporter()
|
||||||
|
, next_id(0xffff)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// IO system to be used for all imports
|
// IO system to be used for all imports
|
||||||
|
@ -592,7 +611,3 @@ void BatchLoader::LoadAll()
|
||||||
DefaultLogger::get()->info("%%% END EXTERNAL FILE %%%");
|
DefaultLogger::get()->info("%%% END EXTERNAL FILE %%%");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -47,19 +47,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "./../include/assimp/types.h"
|
#include <set>
|
||||||
|
#include "../include/assimp/types.h"
|
||||||
|
#include "../include/assimp/ProgressHandler.hpp"
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
class IOSystem;
|
|
||||||
class Importer;
|
class Importer;
|
||||||
class BaseImporter;
|
class IOSystem;
|
||||||
class BaseProcess;
|
class BaseProcess;
|
||||||
class SharedPostProcessInfo;
|
class SharedPostProcessInfo;
|
||||||
class IOStream;
|
class IOStream;
|
||||||
|
|
||||||
|
|
||||||
// utility to do char4 to uint32 in a portable manner
|
// utility to do char4 to uint32 in a portable manner
|
||||||
#define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
|
#define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
|
||||||
(string[1] << 16) + (string[2] << 8) + string[3]))
|
(string[1] << 16) + (string[2] << 8) + string[3]))
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/** @file Implementation of BaseProcess */
|
/** @file Implementation of BaseProcess */
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -45,9 +45,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* Used for file formats which embed their textures into the model file.
|
* Used for file formats which embed their textures into the model file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#include "Bitmap.h"
|
#include "Bitmap.h"
|
||||||
|
#include "../include/assimp/texture.h"
|
||||||
|
#include "../include/assimp/IOStream.hpp"
|
||||||
|
#include "ByteSwapper.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -48,8 +48,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_BITMAP_H_INC
|
#ifndef AI_BITMAP_H_INC
|
||||||
#define AI_BITMAP_H_INC
|
#define AI_BITMAP_H_INC
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <cstddef>
|
||||||
|
struct aiTexture;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
class IOStream;
|
||||||
class Bitmap {
|
class Bitmap {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -42,7 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Conversion of Blender's new BMesh stuff
|
* @brief Conversion of Blender's new BMesh stuff
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -42,12 +42,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the Blender `DNA`, that is its own
|
* @brief Implementation of the Blender `DNA`, that is its own
|
||||||
* serialized set of data structures.
|
* serialized set of data structures.
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
#include "BlenderDNA.h"
|
#include "BlenderDNA.h"
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::Blender;
|
using namespace Assimp::Blender;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -47,6 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
#include "StreamReader.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
|
|
||||||
// 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
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef INCLUDED_AI_BLEND_DNA_INL
|
#ifndef INCLUDED_AI_BLEND_DNA_INL
|
||||||
#define INCLUDED_AI_BLEND_DNA_INL
|
#define INCLUDED_AI_BLEND_DNA_INL
|
||||||
|
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace Blender {
|
namespace Blender {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +49,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BlenderDNA.h"
|
#include "BlenderDNA.h"
|
||||||
#include "BlenderScene.h"
|
#include "BlenderScene.h"
|
||||||
#include "BlenderSceneGen.h"
|
#include "BlenderSceneGen.h"
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include <deque>
|
||||||
|
#include "./../include/assimp/material.h"
|
||||||
|
|
||||||
|
struct aiTexture;
|
||||||
|
|
||||||
#define for_each(x,y) BOOST_FOREACH(x,y)
|
#define for_each(x,y) BOOST_FOREACH(x,y)
|
||||||
|
|
||||||
|
@ -118,6 +123,16 @@ namespace Blender {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# pragma warning(disable:4351)
|
# pragma warning(disable:4351)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct ObjectCompare {
|
||||||
|
bool operator() (const Object* left, const Object* right) const {
|
||||||
|
return strcmp(left->id.name, right->id.name) == -1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// When keeping objects in sets, sort them by their name.
|
||||||
|
typedef std::set<const Object*, ObjectCompare> ObjectSet;
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
/** ConversionData acts as intermediate storage location for
|
/** ConversionData acts as intermediate storage location for
|
||||||
* the various ConvertXXX routines in BlenderImporter.*/
|
* the various ConvertXXX routines in BlenderImporter.*/
|
||||||
|
@ -130,7 +145,13 @@ namespace Blender {
|
||||||
, db(db)
|
, db(db)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::set<const Object*> objects;
|
struct ObjectCompare {
|
||||||
|
bool operator() (const Object* left, const Object* right) const {
|
||||||
|
return strcmp(left->id.name, right->id.name) == -1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ObjectSet objects;
|
||||||
|
|
||||||
TempArray <std::vector, aiMesh> meshes;
|
TempArray <std::vector, aiMesh> meshes;
|
||||||
TempArray <std::vector, aiCamera> cameras;
|
TempArray <std::vector, aiCamera> cameras;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file BlenderLoader.cpp
|
/** @file BlenderLoader.cpp
|
||||||
* @brief Implementation of the Blender3D importer class.
|
* @brief Implementation of the Blender3D importer class.
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
//#define ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
//#define ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
||||||
// Uncomment this to disable support for (gzip)compressed .BLEND files
|
// Uncomment this to disable support for (gzip)compressed .BLEND files
|
||||||
|
@ -52,9 +52,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BlenderIntermediate.h"
|
#include "BlenderIntermediate.h"
|
||||||
#include "BlenderModifier.h"
|
#include "BlenderModifier.h"
|
||||||
#include "BlenderBMesh.h"
|
#include "BlenderBMesh.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "StringComparison.h"
|
||||||
|
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "MemoryIOWrapper.h"
|
#include "MemoryIOWrapper.h"
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
|
||||||
// zlib is needed for compressed blend files
|
// zlib is needed for compressed blend files
|
||||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
||||||
|
@ -559,24 +563,26 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
||||||
if (mesh->mMaterialIndex == static_cast<unsigned int>( -1 )) {
|
if (mesh->mMaterialIndex == static_cast<unsigned int>( -1 )) {
|
||||||
|
|
||||||
if (index == static_cast<unsigned int>( -1 )) {
|
if (index == static_cast<unsigned int>( -1 )) {
|
||||||
|
// Setup a default material.
|
||||||
// ok, we need to add a dedicated default material for some poor material-less meshes
|
|
||||||
boost::shared_ptr<Material> p(new Material());
|
boost::shared_ptr<Material> p(new Material());
|
||||||
|
ai_assert(::strlen(AI_DEFAULT_MATERIAL_NAME) < sizeof(p->id.name)-2);
|
||||||
strcpy( p->id.name+2, AI_DEFAULT_MATERIAL_NAME );
|
strcpy( p->id.name+2, AI_DEFAULT_MATERIAL_NAME );
|
||||||
|
|
||||||
|
// Note: MSVC11 does not zero-initialize Material here, although it should.
|
||||||
|
// Thus all relevant fields should be explicitly initialized. We cannot add
|
||||||
|
// a default constructor to Material since the DNA codegen does not support
|
||||||
|
// parsing it.
|
||||||
p->r = p->g = p->b = 0.6f;
|
p->r = p->g = p->b = 0.6f;
|
||||||
p->specr = p->specg = p->specb = 0.6f;
|
p->specr = p->specg = p->specb = 0.6f;
|
||||||
p->ambr = p->ambg = p->ambb = 0.0f;
|
p->ambr = p->ambg = p->ambb = 0.0f;
|
||||||
p->mirr = p->mirg = p->mirb = 0.0f;
|
p->mirr = p->mirg = p->mirb = 0.0f;
|
||||||
p->emit = 0.f;
|
p->emit = 0.f;
|
||||||
p->alpha = 0.f;
|
p->alpha = 0.f;
|
||||||
|
p->har = 0;
|
||||||
// XXX add more / or add default c'tor to Material
|
|
||||||
|
|
||||||
index = static_cast<unsigned int>( conv_data.materials_raw.size() );
|
index = static_cast<unsigned int>( conv_data.materials_raw.size() );
|
||||||
conv_data.materials_raw.push_back(p);
|
conv_data.materials_raw.push_back(p);
|
||||||
|
LogInfo("Adding default material");
|
||||||
LogInfo("Adding default material ...");
|
|
||||||
}
|
}
|
||||||
mesh->mMaterialIndex = index;
|
mesh->mMaterialIndex = index;
|
||||||
}
|
}
|
||||||
|
@ -591,6 +597,7 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
||||||
|
|
||||||
aiMaterial* mout = new aiMaterial();
|
aiMaterial* mout = new aiMaterial();
|
||||||
conv_data.materials->push_back(mout);
|
conv_data.materials->push_back(mout);
|
||||||
|
// For any new material field handled here, the default material above must be updated with an appropriate default value.
|
||||||
|
|
||||||
// set material name
|
// set material name
|
||||||
aiString name = aiString(mat->id.name+2); // skip over the name prefix 'MA'
|
aiString name = aiString(mat->id.name+2); // skip over the name prefix 'MA'
|
||||||
|
@ -1044,7 +1051,7 @@ aiLight* BlenderImporter::ConvertLight(const Scene& /*in*/, const Object* obj, c
|
||||||
aiNode* BlenderImporter::ConvertNode(const Scene& in, const Object* obj, ConversionData& conv_data, const aiMatrix4x4& parentTransform)
|
aiNode* BlenderImporter::ConvertNode(const Scene& in, const Object* obj, ConversionData& conv_data, const aiMatrix4x4& parentTransform)
|
||||||
{
|
{
|
||||||
std::deque<const Object*> children;
|
std::deque<const Object*> children;
|
||||||
for(std::set<const Object*>::iterator it = conv_data.objects.begin(); it != conv_data.objects.end() ;) {
|
for(ObjectSet::iterator it = conv_data.objects.begin(); it != conv_data.objects.end() ;) {
|
||||||
const Object* object = *it;
|
const Object* object = *it;
|
||||||
if (object->parent == obj) {
|
if (object->parent == obj) {
|
||||||
children.push_back(object);
|
children.push_back(object);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +46,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "LogAux.h"
|
#include "LogAux.h"
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
struct aiMesh;
|
||||||
|
struct aiLight;
|
||||||
|
struct aiCamera;
|
||||||
|
struct aiMaterial;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,12 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file BlenderModifier.cpp
|
/** @file BlenderModifier.cpp
|
||||||
* @brief Implementation of some blender modifiers (i.e subdivision, mirror).
|
* @brief Implementation of some blender modifiers (i.e subdivision, mirror).
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
#include "BlenderModifier.h"
|
#include "BlenderModifier.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "Subdivision.h"
|
#include "Subdivision.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <boost/scoped_array.hpp>
|
||||||
|
#include <boost/pointer_cast.hpp>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file BlenderScene.cpp
|
/** @file BlenderScene.cpp
|
||||||
* @brief MACHINE GENERATED BY ./scripts/BlenderImporter/genblenddna.py
|
* @brief MACHINE GENERATED BY ./scripts/BlenderImporter/genblenddna.py
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
|
|
||||||
#include "BlenderDNA.h"
|
#include "BlenderDNA.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef INCLUDED_AI_BLEND_SCENE_H
|
#ifndef INCLUDED_AI_BLEND_SCENE_H
|
||||||
#define INCLUDED_AI_BLEND_SCENE_H
|
#define INCLUDED_AI_BLEND_SCENE_H
|
||||||
|
|
||||||
|
#include "BlenderDNA.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace Blender {
|
namespace Blender {
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef INCLUDED_AI_BLEND_SCENEGEN_H
|
#ifndef INCLUDED_AI_BLEND_SCENEGEN_H
|
||||||
#define INCLUDED_AI_BLEND_SCENEGEN_H
|
#define INCLUDED_AI_BLEND_SCENEGEN_H
|
||||||
|
|
||||||
|
#include "BlenderDNA.h"
|
||||||
|
#include "BlenderScene.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace Blender {
|
namespace Blender {
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief A simple tessellation wrapper
|
* @brief A simple tessellation wrapper
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -45,6 +45,15 @@ 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 "./../include/assimp/cexport.h"
|
||||||
|
#include "./../include/assimp/IOSystem.hpp"
|
||||||
|
#include "./../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <set>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
class BlobIOSystem;
|
class BlobIOSystem;
|
||||||
|
|
||||||
|
@ -120,9 +129,11 @@ public:
|
||||||
{
|
{
|
||||||
case aiOrigin_CUR:
|
case aiOrigin_CUR:
|
||||||
cursor += pOffset;
|
cursor += pOffset;
|
||||||
|
break;
|
||||||
|
|
||||||
case aiOrigin_END:
|
case aiOrigin_END:
|
||||||
cursor = file_size - pOffset;
|
cursor = file_size - pOffset;
|
||||||
|
break;
|
||||||
|
|
||||||
case aiOrigin_SET:
|
case aiOrigin_SET:
|
||||||
cursor = pOffset;
|
cursor = pOffset;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
// Internal stub
|
// Internal stub
|
||||||
|
|
||||||
|
#include <stddef.h> //NULL
|
||||||
|
#include <algorithm> //std::swap
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
class controller {
|
class controller {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
//#include <boost/config.hpp>
|
//#include <boost/config.hpp>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
#include <limits>
|
||||||
//#include <boost/limits.hpp>
|
//#include <boost/limits.hpp>
|
||||||
|
|
||||||
# ifdef BOOST_NO_STDC_NAMESPACE
|
# ifdef BOOST_NO_STDC_NAMESPACE
|
||||||
|
|
285
code/ByteSwap.h
285
code/ByteSwap.h
|
@ -1,285 +0,0 @@
|
||||||
/*
|
|
||||||
Open Asset Import Library (assimp)
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2006-2012, 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.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @file Helper class tp perform various byte oder swappings
|
|
||||||
(e.g. little to big endian) */
|
|
||||||
#ifndef AI_BYTESWAP_H_INC
|
|
||||||
#define AI_BYTESWAP_H_INC
|
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
|
||||||
#include "../include/assimp/types.h"
|
|
||||||
|
|
||||||
#if _MSC_VER >= 1400
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Assimp {
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
/** Defines some useful byte order swap routines.
|
|
||||||
*
|
|
||||||
* This is required to read big-endian model formats on little-endian machines,
|
|
||||||
* and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
class ByteSwap
|
|
||||||
{
|
|
||||||
ByteSwap() {}
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** Swap two bytes of data
|
|
||||||
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
|
||||||
static inline void Swap2(void* _szOut)
|
|
||||||
{
|
|
||||||
ai_assert(_szOut);
|
|
||||||
|
|
||||||
#if _MSC_VER >= 1400
|
|
||||||
uint16_t* const szOut = reinterpret_cast<uint16_t*>(_szOut);
|
|
||||||
*szOut = _byteswap_ushort(*szOut);
|
|
||||||
#else
|
|
||||||
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
|
||||||
std::swap(szOut[0],szOut[1]);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** Swap four bytes of data
|
|
||||||
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
|
||||||
static inline void Swap4(void* _szOut)
|
|
||||||
{
|
|
||||||
ai_assert(_szOut);
|
|
||||||
|
|
||||||
#if _MSC_VER >= 1400
|
|
||||||
uint32_t* const szOut = reinterpret_cast<uint32_t*>(_szOut);
|
|
||||||
*szOut = _byteswap_ulong(*szOut);
|
|
||||||
#else
|
|
||||||
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
|
||||||
std::swap(szOut[0],szOut[3]);
|
|
||||||
std::swap(szOut[1],szOut[2]);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** Swap eight bytes of data
|
|
||||||
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
|
||||||
static inline void Swap8(void* _szOut)
|
|
||||||
{
|
|
||||||
ai_assert(_szOut);
|
|
||||||
|
|
||||||
#if _MSC_VER >= 1400
|
|
||||||
uint64_t* const szOut = reinterpret_cast<uint64_t*>(_szOut);
|
|
||||||
*szOut = _byteswap_uint64(*szOut);
|
|
||||||
#else
|
|
||||||
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
|
||||||
std::swap(szOut[0],szOut[7]);
|
|
||||||
std::swap(szOut[1],szOut[6]);
|
|
||||||
std::swap(szOut[2],szOut[5]);
|
|
||||||
std::swap(szOut[3],szOut[4]);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** ByteSwap a float. Not a joke.
|
|
||||||
* @param[inout] fOut ehm. .. */
|
|
||||||
static inline void Swap(float* fOut) {
|
|
||||||
Swap4(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** ByteSwap a double. Not a joke.
|
|
||||||
* @param[inout] fOut ehm. .. */
|
|
||||||
static inline void Swap(double* fOut) {
|
|
||||||
Swap8(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** ByteSwap an int16t. Not a joke.
|
|
||||||
* @param[inout] fOut ehm. .. */
|
|
||||||
static inline void Swap(int16_t* fOut) {
|
|
||||||
Swap2(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void Swap(uint16_t* fOut) {
|
|
||||||
Swap2(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** ByteSwap an int32t. Not a joke.
|
|
||||||
* @param[inout] fOut ehm. .. */
|
|
||||||
static inline void Swap(int32_t* fOut){
|
|
||||||
Swap4(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void Swap(uint32_t* fOut){
|
|
||||||
Swap4(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/** ByteSwap an int64t. Not a joke.
|
|
||||||
* @param[inout] fOut ehm. .. */
|
|
||||||
static inline void Swap(int64_t* fOut) {
|
|
||||||
Swap8(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void Swap(uint64_t* fOut) {
|
|
||||||
Swap8(fOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
//! Templatized ByteSwap
|
|
||||||
//! \returns param tOut as swapped
|
|
||||||
template<typename Type>
|
|
||||||
static inline Type Swapped(Type tOut)
|
|
||||||
{
|
|
||||||
return _swapper<Type,sizeof(Type)>()(tOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
template <typename T, size_t size> struct _swapper;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T> struct ByteSwap::_swapper<T,2> {
|
|
||||||
T operator() (T tOut) {
|
|
||||||
Swap2(&tOut);
|
|
||||||
return tOut;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T> struct ByteSwap::_swapper<T,4> {
|
|
||||||
T operator() (T tOut) {
|
|
||||||
Swap4(&tOut);
|
|
||||||
return tOut;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T> struct ByteSwap::_swapper<T,8> {
|
|
||||||
T operator() (T tOut) {
|
|
||||||
Swap8(&tOut);
|
|
||||||
return tOut;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
// ByteSwap macros for BigEndian/LittleEndian support
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
#if (defined AI_BUILD_BIG_ENDIAN)
|
|
||||||
# define AI_LE(t) (t)
|
|
||||||
# define AI_BE(t) ByteSwap::Swapped(t)
|
|
||||||
# define AI_LSWAP2(p)
|
|
||||||
# define AI_LSWAP4(p)
|
|
||||||
# define AI_LSWAP8(p)
|
|
||||||
# define AI_LSWAP2P(p)
|
|
||||||
# define AI_LSWAP4P(p)
|
|
||||||
# define AI_LSWAP8P(p)
|
|
||||||
# define LE_NCONST const
|
|
||||||
# define AI_SWAP2(p) ByteSwap::Swap2(&(p))
|
|
||||||
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
|
|
||||||
# define AI_SWAP8(p) ByteSwap::Swap8(&(p))
|
|
||||||
# define AI_SWAP2P(p) ByteSwap::Swap2((p))
|
|
||||||
# define AI_SWAP4P(p) ByteSwap::Swap4((p))
|
|
||||||
# define AI_SWAP8P(p) ByteSwap::Swap8((p))
|
|
||||||
# define BE_NCONST
|
|
||||||
#else
|
|
||||||
# define AI_BE(t) (t)
|
|
||||||
# define AI_LE(t) ByteSwap::Swapped(t)
|
|
||||||
# define AI_SWAP2(p)
|
|
||||||
# define AI_SWAP4(p)
|
|
||||||
# define AI_SWAP8(p)
|
|
||||||
# define AI_SWAP2P(p)
|
|
||||||
# define AI_SWAP4P(p)
|
|
||||||
# define AI_SWAP8P(p)
|
|
||||||
# define BE_NCONST const
|
|
||||||
# define AI_LSWAP2(p) ByteSwap::Swap2(&(p))
|
|
||||||
# define AI_LSWAP4(p) ByteSwap::Swap4(&(p))
|
|
||||||
# define AI_LSWAP8(p) ByteSwap::Swap8(&(p))
|
|
||||||
# define AI_LSWAP2P(p) ByteSwap::Swap2((p))
|
|
||||||
# define AI_LSWAP4P(p) ByteSwap::Swap4((p))
|
|
||||||
# define AI_LSWAP8P(p) ByteSwap::Swap8((p))
|
|
||||||
# define LE_NCONST
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace Intern {
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------
|
|
||||||
template <typename T, bool doit>
|
|
||||||
struct ByteSwapper {
|
|
||||||
void operator() (T* inout) {
|
|
||||||
ByteSwap::Swap(inout);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
struct ByteSwapper<T,false> {
|
|
||||||
void operator() (T*) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------
|
|
||||||
template <bool SwapEndianess, typename T, bool RuntimeSwitch>
|
|
||||||
struct Getter {
|
|
||||||
void operator() (T* inout, bool le) {
|
|
||||||
#ifdef AI_BUILD_BIG_ENDIAN
|
|
||||||
le = le;
|
|
||||||
#else
|
|
||||||
le = !le;
|
|
||||||
#endif
|
|
||||||
if (le) {
|
|
||||||
ByteSwapper<T,(sizeof(T)>1?true:false)> () (inout);
|
|
||||||
}
|
|
||||||
else ByteSwapper<T,false> () (inout);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <bool SwapEndianess, typename T>
|
|
||||||
struct Getter<SwapEndianess,T,false> {
|
|
||||||
|
|
||||||
void operator() (T* inout, bool /*le*/) {
|
|
||||||
// static branch
|
|
||||||
ByteSwapper<T,(SwapEndianess && sizeof(T)>1)> () (inout);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // end Intern
|
|
||||||
} // end Assimp
|
|
||||||
|
|
||||||
#endif //!! AI_BYTESWAP_H_INC
|
|
|
@ -0,0 +1,286 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (assimp)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2015, 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.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file Helper class tp perform various byte oder swappings
|
||||||
|
(e.g. little to big endian) */
|
||||||
|
#ifndef AI_BYTESWAPPER_H_INC
|
||||||
|
#define AI_BYTESWAPPER_H_INC
|
||||||
|
|
||||||
|
#include "../include/assimp/ai_assert.h"
|
||||||
|
#include "../include/assimp/types.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1400
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
/** Defines some useful byte order swap routines.
|
||||||
|
*
|
||||||
|
* This is required to read big-endian model formats on little-endian machines,
|
||||||
|
* and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
class ByteSwap
|
||||||
|
{
|
||||||
|
ByteSwap() {}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** Swap two bytes of data
|
||||||
|
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
||||||
|
static inline void Swap2(void* _szOut)
|
||||||
|
{
|
||||||
|
ai_assert(_szOut);
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1400
|
||||||
|
uint16_t* const szOut = reinterpret_cast<uint16_t*>(_szOut);
|
||||||
|
*szOut = _byteswap_ushort(*szOut);
|
||||||
|
#else
|
||||||
|
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
||||||
|
std::swap(szOut[0],szOut[1]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** Swap four bytes of data
|
||||||
|
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
||||||
|
static inline void Swap4(void* _szOut)
|
||||||
|
{
|
||||||
|
ai_assert(_szOut);
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1400
|
||||||
|
uint32_t* const szOut = reinterpret_cast<uint32_t*>(_szOut);
|
||||||
|
*szOut = _byteswap_ulong(*szOut);
|
||||||
|
#else
|
||||||
|
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
||||||
|
std::swap(szOut[0],szOut[3]);
|
||||||
|
std::swap(szOut[1],szOut[2]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** Swap eight bytes of data
|
||||||
|
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
||||||
|
static inline void Swap8(void* _szOut)
|
||||||
|
{
|
||||||
|
ai_assert(_szOut);
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1400
|
||||||
|
uint64_t* const szOut = reinterpret_cast<uint64_t*>(_szOut);
|
||||||
|
*szOut = _byteswap_uint64(*szOut);
|
||||||
|
#else
|
||||||
|
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
||||||
|
std::swap(szOut[0],szOut[7]);
|
||||||
|
std::swap(szOut[1],szOut[6]);
|
||||||
|
std::swap(szOut[2],szOut[5]);
|
||||||
|
std::swap(szOut[3],szOut[4]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** ByteSwap a float. Not a joke.
|
||||||
|
* @param[inout] fOut ehm. .. */
|
||||||
|
static inline void Swap(float* fOut) {
|
||||||
|
Swap4(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** ByteSwap a double. Not a joke.
|
||||||
|
* @param[inout] fOut ehm. .. */
|
||||||
|
static inline void Swap(double* fOut) {
|
||||||
|
Swap8(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** ByteSwap an int16t. Not a joke.
|
||||||
|
* @param[inout] fOut ehm. .. */
|
||||||
|
static inline void Swap(int16_t* fOut) {
|
||||||
|
Swap2(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void Swap(uint16_t* fOut) {
|
||||||
|
Swap2(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** ByteSwap an int32t. Not a joke.
|
||||||
|
* @param[inout] fOut ehm. .. */
|
||||||
|
static inline void Swap(int32_t* fOut){
|
||||||
|
Swap4(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void Swap(uint32_t* fOut){
|
||||||
|
Swap4(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
/** ByteSwap an int64t. Not a joke.
|
||||||
|
* @param[inout] fOut ehm. .. */
|
||||||
|
static inline void Swap(int64_t* fOut) {
|
||||||
|
Swap8(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void Swap(uint64_t* fOut) {
|
||||||
|
Swap8(fOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
//! Templatized ByteSwap
|
||||||
|
//! \returns param tOut as swapped
|
||||||
|
template<typename Type>
|
||||||
|
static inline Type Swapped(Type tOut)
|
||||||
|
{
|
||||||
|
return _swapper<Type,sizeof(Type)>()(tOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
template <typename T, size_t size> struct _swapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T> struct ByteSwap::_swapper<T,2> {
|
||||||
|
T operator() (T tOut) {
|
||||||
|
Swap2(&tOut);
|
||||||
|
return tOut;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T> struct ByteSwap::_swapper<T,4> {
|
||||||
|
T operator() (T tOut) {
|
||||||
|
Swap4(&tOut);
|
||||||
|
return tOut;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T> struct ByteSwap::_swapper<T,8> {
|
||||||
|
T operator() (T tOut) {
|
||||||
|
Swap8(&tOut);
|
||||||
|
return tOut;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// ByteSwap macros for BigEndian/LittleEndian support
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
#if (defined AI_BUILD_BIG_ENDIAN)
|
||||||
|
# define AI_LE(t) (t)
|
||||||
|
# define AI_BE(t) ByteSwap::Swapped(t)
|
||||||
|
# define AI_LSWAP2(p)
|
||||||
|
# define AI_LSWAP4(p)
|
||||||
|
# define AI_LSWAP8(p)
|
||||||
|
# define AI_LSWAP2P(p)
|
||||||
|
# define AI_LSWAP4P(p)
|
||||||
|
# define AI_LSWAP8P(p)
|
||||||
|
# define LE_NCONST const
|
||||||
|
# define AI_SWAP2(p) ByteSwap::Swap2(&(p))
|
||||||
|
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
|
||||||
|
# define AI_SWAP8(p) ByteSwap::Swap8(&(p))
|
||||||
|
# define AI_SWAP2P(p) ByteSwap::Swap2((p))
|
||||||
|
# define AI_SWAP4P(p) ByteSwap::Swap4((p))
|
||||||
|
# define AI_SWAP8P(p) ByteSwap::Swap8((p))
|
||||||
|
# define BE_NCONST
|
||||||
|
#else
|
||||||
|
# define AI_BE(t) (t)
|
||||||
|
# define AI_LE(t) ByteSwap::Swapped(t)
|
||||||
|
# define AI_SWAP2(p)
|
||||||
|
# define AI_SWAP4(p)
|
||||||
|
# define AI_SWAP8(p)
|
||||||
|
# define AI_SWAP2P(p)
|
||||||
|
# define AI_SWAP4P(p)
|
||||||
|
# define AI_SWAP8P(p)
|
||||||
|
# define BE_NCONST const
|
||||||
|
# define AI_LSWAP2(p) ByteSwap::Swap2(&(p))
|
||||||
|
# define AI_LSWAP4(p) ByteSwap::Swap4(&(p))
|
||||||
|
# define AI_LSWAP8(p) ByteSwap::Swap8(&(p))
|
||||||
|
# define AI_LSWAP2P(p) ByteSwap::Swap2((p))
|
||||||
|
# define AI_LSWAP4P(p) ByteSwap::Swap4((p))
|
||||||
|
# define AI_LSWAP8P(p) ByteSwap::Swap8((p))
|
||||||
|
# define LE_NCONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
namespace Intern {
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
template <typename T, bool doit>
|
||||||
|
struct ByteSwapper {
|
||||||
|
void operator() (T* inout) {
|
||||||
|
ByteSwap::Swap(inout);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct ByteSwapper<T,false> {
|
||||||
|
void operator() (T*) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
template <bool SwapEndianess, typename T, bool RuntimeSwitch>
|
||||||
|
struct Getter {
|
||||||
|
void operator() (T* inout, bool le) {
|
||||||
|
#ifdef AI_BUILD_BIG_ENDIAN
|
||||||
|
le = le;
|
||||||
|
#else
|
||||||
|
le = !le;
|
||||||
|
#endif
|
||||||
|
if (le) {
|
||||||
|
ByteSwapper<T,(sizeof(T)>1?true:false)> () (inout);
|
||||||
|
}
|
||||||
|
else ByteSwapper<T,false> () (inout);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <bool SwapEndianess, typename T>
|
||||||
|
struct Getter<SwapEndianess,T,false> {
|
||||||
|
|
||||||
|
void operator() (T* inout, bool /*le*/) {
|
||||||
|
// static branch
|
||||||
|
ByteSwapper<T,(SwapEndianess && sizeof(T)>1)> () (inout);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // end Intern
|
||||||
|
} // end Assimp
|
||||||
|
|
||||||
|
#endif //!! AI_BYTESWAPPER_H_INC
|
|
@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file C4DImporter.cpp
|
/** @file C4DImporter.cpp
|
||||||
* @brief Implementation of the Cinema4D importer class.
|
* @brief Implementation of the Cinema4D importer class.
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
#ifndef ASSIMP_BUILD_NO_C4D_IMPORTER
|
||||||
|
|
||||||
// no #ifdefing here, Cinema4D support is carried out in a branch of assimp
|
// no #ifdefing here, Cinema4D support is carried out in a branch of assimp
|
||||||
// where it is turned on in the CMake settings.
|
// where it is turned on in the CMake settings.
|
||||||
|
@ -639,3 +639,6 @@ unsigned int C4DImporter::ResolveMaterial(PolygonObject* obj)
|
||||||
ai_assert((*it).second < mat_count);
|
ai_assert((*it).second < mat_count);
|
||||||
return (*it).second;
|
return (*it).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // ASSIMP_BUILD_NO_C4D_IMPORTER
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "LogAux.h"
|
#include "LogAux.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
struct aiNode;
|
||||||
|
struct aiMesh;
|
||||||
|
struct aiMaterial;
|
||||||
|
|
||||||
struct aiImporterDesc;
|
struct aiImporterDesc;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_CIOSYSTEM_H_INCLUDED
|
#define AI_CIOSYSTEM_H_INCLUDED
|
||||||
|
|
||||||
#include "../include/assimp/cfileio.h"
|
#include "../include/assimp/cfileio.h"
|
||||||
|
#include "../include/assimp/IOStream.hpp"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ SET( Common_SRCS
|
||||||
ScenePrivate.h
|
ScenePrivate.h
|
||||||
PostStepRegistry.cpp
|
PostStepRegistry.cpp
|
||||||
ImporterRegistry.cpp
|
ImporterRegistry.cpp
|
||||||
ByteSwap.h
|
ByteSwapper.h
|
||||||
DefaultProgressHandler.h
|
DefaultProgressHandler.h
|
||||||
DefaultIOStream.cpp
|
DefaultIOStream.cpp
|
||||||
DefaultIOStream.h
|
DefaultIOStream.h
|
||||||
|
@ -145,6 +145,7 @@ SET( Common_SRCS
|
||||||
Bitmap.cpp
|
Bitmap.cpp
|
||||||
Bitmap.h
|
Bitmap.h
|
||||||
XMLTools.h
|
XMLTools.h
|
||||||
|
Version.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP(Common FILES ${Common_SRCS})
|
SOURCE_GROUP(Common FILES ${Common_SRCS})
|
||||||
|
|
||||||
|
@ -156,7 +157,27 @@ 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 )
|
||||||
|
|
||||||
SET( 3DS_SRCS
|
# 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)
|
||||||
|
MACRO(ADD_ASSIMP_IMPORTER name)
|
||||||
|
OPTION(ASSIMP_BUILD_${name}_IMPORTER "build the ${name} importer" TRUE)
|
||||||
|
IF(ASSIMP_BUILD_${name}_IMPORTER)
|
||||||
|
LIST(APPEND ASSIMP_LOADER_SRCS ${ARGN})
|
||||||
|
SET(ASSIMP_IMPORTERS_ENABLED "${ASSIMP_IMPORTERS_ENABLED} ${name}")
|
||||||
|
SET(${name}_SRCS ${ARGN})
|
||||||
|
SOURCE_GROUP(${name} FILES ${ARGN})
|
||||||
|
ELSE()
|
||||||
|
SET(${name}_SRC "")
|
||||||
|
SET(ASSIMP_IMPORTERS_DISABLED "${ASSIMP_IMPORTERS_DISABLED} ${name}")
|
||||||
|
add_definitions(-DASSIMP_BUILD_NO_${name}_IMPORTER)
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
SET(ASSIMP_LOADER_SRCS "")
|
||||||
|
SET(ASSIMP_IMPORTERS_ENABLED "") # list of enabled importers
|
||||||
|
SET(ASSIMP_IMPORTERS_DISABLED "") # disabled list (used to print)
|
||||||
|
|
||||||
|
ADD_ASSIMP_IMPORTER(3DS
|
||||||
3DSConverter.cpp
|
3DSConverter.cpp
|
||||||
3DSHelper.h
|
3DSHelper.h
|
||||||
3DSLoader.cpp
|
3DSLoader.cpp
|
||||||
|
@ -164,49 +185,42 @@ SET( 3DS_SRCS
|
||||||
3DSExporter.h
|
3DSExporter.h
|
||||||
3DSExporter.cpp
|
3DSExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP(3DS FILES ${3DS_SRCS})
|
|
||||||
|
|
||||||
SET( AC_SRCS
|
ADD_ASSIMP_IMPORTER(AC
|
||||||
ACLoader.cpp
|
ACLoader.cpp
|
||||||
ACLoader.h
|
ACLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( AC FILES ${AC_SRCS})
|
|
||||||
|
|
||||||
SET( ASE_SRCS
|
ADD_ASSIMP_IMPORTER(ASE
|
||||||
ASELoader.cpp
|
ASELoader.cpp
|
||||||
ASELoader.h
|
ASELoader.h
|
||||||
ASEParser.cpp
|
ASEParser.cpp
|
||||||
ASEParser.h
|
ASEParser.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( ASE FILES ${ASE_SRCS})
|
|
||||||
|
|
||||||
SET( ASSBIN_SRCS
|
ADD_ASSIMP_IMPORTER(ASSBIN
|
||||||
AssbinExporter.h
|
AssbinExporter.h
|
||||||
AssbinExporter.cpp
|
AssbinExporter.cpp
|
||||||
AssbinLoader.h
|
AssbinLoader.h
|
||||||
AssbinLoader.cpp
|
AssbinLoader.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Assbin FILES ${ASSBIN_SRCS})
|
|
||||||
|
|
||||||
SET( ASSXML_SRCS
|
ADD_ASSIMP_IMPORTER(ASSXML
|
||||||
AssxmlExporter.h
|
AssxmlExporter.h
|
||||||
AssxmlExporter.cpp
|
AssxmlExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Assxml FILES ${ASSXML_SRCS})
|
|
||||||
|
|
||||||
SET( B3D_SRCS
|
ADD_ASSIMP_IMPORTER(B3D
|
||||||
B3DImporter.cpp
|
B3DImporter.cpp
|
||||||
B3DImporter.h
|
B3DImporter.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( B3D FILES ${B3D_SRCS})
|
|
||||||
|
|
||||||
SET( BVH_SRCS
|
ADD_ASSIMP_IMPORTER(BVH
|
||||||
BVHLoader.cpp
|
BVHLoader.cpp
|
||||||
BVHLoader.h
|
BVHLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( BVH FILES ${BVH_SRCS})
|
|
||||||
|
|
||||||
SET( Collada_SRCS
|
ADD_ASSIMP_IMPORTER(COLLADA
|
||||||
ColladaHelper.h
|
ColladaHelper.h
|
||||||
ColladaLoader.cpp
|
ColladaLoader.cpp
|
||||||
ColladaLoader.h
|
ColladaLoader.h
|
||||||
|
@ -215,30 +229,27 @@ SET( Collada_SRCS
|
||||||
ColladaExporter.h
|
ColladaExporter.h
|
||||||
ColladaExporter.cpp
|
ColladaExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Collada FILES ${Collada_SRCS})
|
|
||||||
|
|
||||||
SET( DXF_SRCS
|
ADD_ASSIMP_IMPORTER(DXF
|
||||||
DXFLoader.cpp
|
DXFLoader.cpp
|
||||||
DXFLoader.h
|
DXFLoader.h
|
||||||
DXFHelper.h
|
DXFHelper.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( DXF FILES ${DXF_SRCS})
|
|
||||||
|
|
||||||
SET( CSM_SRCS
|
ADD_ASSIMP_IMPORTER(CSM
|
||||||
CSMLoader.cpp
|
CSMLoader.cpp
|
||||||
CSMLoader.h
|
CSMLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( CSM FILES ${CSM_SRCS})
|
|
||||||
|
|
||||||
SET( HMP_SRCS
|
ADD_ASSIMP_IMPORTER(HMP
|
||||||
HMPFileData.h
|
HMPFileData.h
|
||||||
HMPLoader.cpp
|
HMPLoader.cpp
|
||||||
HMPLoader.h
|
HMPLoader.h
|
||||||
HalfLifeFileData.h
|
HalfLifeFileData.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( HMP FILES ${HMP_SRCS})
|
|
||||||
|
|
||||||
SET( Irr_SRCS
|
#FIXME: allow to set IRRMESH by option
|
||||||
|
ADD_ASSIMP_IMPORTER(IRR
|
||||||
IRRLoader.cpp
|
IRRLoader.cpp
|
||||||
IRRLoader.h
|
IRRLoader.h
|
||||||
IRRMeshLoader.cpp
|
IRRMeshLoader.cpp
|
||||||
|
@ -246,9 +257,8 @@ SET( Irr_SRCS
|
||||||
IRRShared.cpp
|
IRRShared.cpp
|
||||||
IRRShared.h
|
IRRShared.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Irr FILES ${Irr_SRCS})
|
|
||||||
|
|
||||||
SET( LWO_SRCS
|
ADD_ASSIMP_IMPORTER(LWO
|
||||||
LWOAnimation.cpp
|
LWOAnimation.cpp
|
||||||
LWOAnimation.h
|
LWOAnimation.h
|
||||||
LWOBLoader.cpp
|
LWOBLoader.cpp
|
||||||
|
@ -257,55 +267,46 @@ SET( LWO_SRCS
|
||||||
LWOLoader.h
|
LWOLoader.h
|
||||||
LWOMaterial.cpp
|
LWOMaterial.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( LWO FILES ${LWO_SRCS})
|
|
||||||
|
|
||||||
SET( LWS_SRCS
|
ADD_ASSIMP_IMPORTER(LWS
|
||||||
LWSLoader.cpp
|
LWSLoader.cpp
|
||||||
LWSLoader.h
|
LWSLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( LWS FILES ${LWS_SRCS})
|
|
||||||
|
|
||||||
|
ADD_ASSIMP_IMPORTER(MD2
|
||||||
|
|
||||||
SET( MD2_SRCS
|
|
||||||
MD2FileData.h
|
MD2FileData.h
|
||||||
MD2Loader.cpp
|
MD2Loader.cpp
|
||||||
MD2Loader.h
|
MD2Loader.h
|
||||||
MD2NormalTable.h
|
MD2NormalTable.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MD2 FILES ${MD2_SRCS})
|
|
||||||
|
|
||||||
SET( MD3_SRCS
|
ADD_ASSIMP_IMPORTER(MD3
|
||||||
MD3FileData.h
|
MD3FileData.h
|
||||||
MD3Loader.cpp
|
MD3Loader.cpp
|
||||||
MD3Loader.h
|
MD3Loader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MD3 FILES ${MD3_SRCS})
|
|
||||||
|
|
||||||
SET( MD5_SRCS
|
ADD_ASSIMP_IMPORTER(MD5
|
||||||
MD5Loader.cpp
|
MD5Loader.cpp
|
||||||
MD5Loader.h
|
MD5Loader.h
|
||||||
MD5Parser.cpp
|
MD5Parser.cpp
|
||||||
MD5Parser.h
|
MD5Parser.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MD5 FILES ${MD5_SRCS})
|
|
||||||
|
|
||||||
SET( MDC_SRCS
|
ADD_ASSIMP_IMPORTER(MDC
|
||||||
MDCFileData.h
|
MDCFileData.h
|
||||||
MDCLoader.cpp
|
MDCLoader.cpp
|
||||||
MDCLoader.h
|
MDCLoader.h
|
||||||
MDCNormalTable.h
|
MDCNormalTable.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MDC FILES ${MDC_SRCS})
|
|
||||||
|
|
||||||
SET( MDL_SRCS
|
ADD_ASSIMP_IMPORTER(MDL
|
||||||
MDLDefaultColorMap.h
|
MDLDefaultColorMap.h
|
||||||
MDLFileData.h
|
MDLFileData.h
|
||||||
MDLLoader.cpp
|
MDLLoader.cpp
|
||||||
MDLLoader.h
|
MDLLoader.h
|
||||||
MDLMaterialLoader.cpp
|
MDLMaterialLoader.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MDL FILES ${MDL_SRCS})
|
|
||||||
|
|
||||||
SET( MaterialSystem_SRCS
|
SET( MaterialSystem_SRCS
|
||||||
MaterialSystem.cpp
|
MaterialSystem.cpp
|
||||||
|
@ -313,25 +314,22 @@ SET( MaterialSystem_SRCS
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MaterialSystem FILES ${MaterialSystem_SRCS})
|
SOURCE_GROUP( MaterialSystem FILES ${MaterialSystem_SRCS})
|
||||||
|
|
||||||
SET( NFF_SRCS
|
ADD_ASSIMP_IMPORTER(NFF
|
||||||
NFFLoader.cpp
|
NFFLoader.cpp
|
||||||
NFFLoader.h
|
NFFLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( NFF FILES ${NFF_SRCS})
|
|
||||||
|
|
||||||
SET( NDO_SRCS
|
ADD_ASSIMP_IMPORTER(NDO
|
||||||
NDOLoader.cpp
|
NDOLoader.cpp
|
||||||
NDOLoader.h
|
NDOLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( NDO FILES ${NDO_SRCS})
|
|
||||||
|
|
||||||
SET( OFFFormat_SRCS
|
ADD_ASSIMP_IMPORTER(OFF
|
||||||
OFFLoader.cpp
|
OFFLoader.cpp
|
||||||
OFFLoader.h
|
OFFLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( OFFFormat FILES ${OFFFormat_SRCS})
|
|
||||||
|
|
||||||
SET( Obj_SRCS
|
ADD_ASSIMP_IMPORTER(OBJ
|
||||||
ObjFileData.h
|
ObjFileData.h
|
||||||
ObjFileImporter.cpp
|
ObjFileImporter.cpp
|
||||||
ObjFileImporter.h
|
ObjFileImporter.h
|
||||||
|
@ -344,9 +342,8 @@ SET( Obj_SRCS
|
||||||
ObjExporter.h
|
ObjExporter.h
|
||||||
ObjExporter.cpp
|
ObjExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Obj FILES ${Obj_SRCS})
|
|
||||||
|
|
||||||
SET( Ogre_SRCS
|
ADD_ASSIMP_IMPORTER(OGRE
|
||||||
OgreImporter.h
|
OgreImporter.h
|
||||||
OgreStructs.h
|
OgreStructs.h
|
||||||
OgreParsingUtils.h
|
OgreParsingUtils.h
|
||||||
|
@ -358,9 +355,16 @@ SET( Ogre_SRCS
|
||||||
OgreXmlSerializer.cpp
|
OgreXmlSerializer.cpp
|
||||||
OgreMaterial.cpp
|
OgreMaterial.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Ogre FILES ${Ogre_SRCS})
|
|
||||||
|
|
||||||
SET( Ply_SRCS
|
ADD_ASSIMP_IMPORTER(OPENGEX
|
||||||
|
OpenGEXExporter.cpp
|
||||||
|
OpenGEXExporter.h
|
||||||
|
OpenGEXImporter.cpp
|
||||||
|
OpenGEXImporter.h
|
||||||
|
OpenGEXStructs.h
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_ASSIMP_IMPORTER(PLY
|
||||||
PlyLoader.cpp
|
PlyLoader.cpp
|
||||||
PlyLoader.h
|
PlyLoader.h
|
||||||
PlyParser.cpp
|
PlyParser.cpp
|
||||||
|
@ -368,22 +372,19 @@ SET( Ply_SRCS
|
||||||
PlyExporter.cpp
|
PlyExporter.cpp
|
||||||
PlyExporter.h
|
PlyExporter.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Ply FILES ${Ply_SRCS})
|
|
||||||
|
|
||||||
SET(MS3D_SRCS
|
ADD_ASSIMP_IMPORTER(MS3D
|
||||||
MS3DLoader.cpp
|
MS3DLoader.cpp
|
||||||
MS3DLoader.h
|
MS3DLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MS3D FILES ${MS3D_SRCS})
|
|
||||||
|
|
||||||
SET(COB_SRCS
|
ADD_ASSIMP_IMPORTER(COB
|
||||||
COBLoader.cpp
|
COBLoader.cpp
|
||||||
COBLoader.h
|
COBLoader.h
|
||||||
COBScene.h
|
COBScene.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( COB FILES ${COB_SRCS})
|
|
||||||
|
|
||||||
SET(BLENDER_SRCS
|
ADD_ASSIMP_IMPORTER(BLEND
|
||||||
BlenderLoader.cpp
|
BlenderLoader.cpp
|
||||||
BlenderLoader.h
|
BlenderLoader.h
|
||||||
BlenderDNA.cpp
|
BlenderDNA.cpp
|
||||||
|
@ -400,9 +401,8 @@ SET(BLENDER_SRCS
|
||||||
BlenderTessellator.h
|
BlenderTessellator.h
|
||||||
BlenderTessellator.cpp
|
BlenderTessellator.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( BLENDER FILES ${BLENDER_SRCS})
|
|
||||||
|
|
||||||
SET(IFC_SRCS
|
ADD_ASSIMP_IMPORTER(IFC
|
||||||
IFCLoader.cpp
|
IFCLoader.cpp
|
||||||
IFCLoader.h
|
IFCLoader.h
|
||||||
IFCReaderGen.cpp
|
IFCReaderGen.cpp
|
||||||
|
@ -421,16 +421,14 @@ SET(IFC_SRCS
|
||||||
STEPFileEncoding.cpp
|
STEPFileEncoding.cpp
|
||||||
STEPFileEncoding.h
|
STEPFileEncoding.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( IFC FILES ${IFC_SRCS})
|
|
||||||
|
|
||||||
SET( XGL_SRCS
|
ADD_ASSIMP_IMPORTER(XGL
|
||||||
XGLLoader.cpp
|
XGLLoader.cpp
|
||||||
XGLLoader.h
|
XGLLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( XGL FILES ${XGL_SRCS})
|
|
||||||
|
|
||||||
|
|
||||||
SET(FBX_SRCS
|
ADD_ASSIMP_IMPORTER(FBX
|
||||||
FBXImporter.cpp
|
FBXImporter.cpp
|
||||||
FBXCompileConfig.h
|
FBXCompileConfig.h
|
||||||
FBXImporter.h
|
FBXImporter.h
|
||||||
|
@ -456,8 +454,6 @@ SET(FBX_SRCS
|
||||||
FBXBinaryTokenizer.cpp
|
FBXBinaryTokenizer.cpp
|
||||||
FBXDocumentUtil.cpp
|
FBXDocumentUtil.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( FBX FILES ${FBX_SRCS})
|
|
||||||
|
|
||||||
|
|
||||||
SET( PostProcessing_SRCS
|
SET( PostProcessing_SRCS
|
||||||
CalcTangentsProcess.cpp
|
CalcTangentsProcess.cpp
|
||||||
|
@ -514,13 +510,12 @@ SET( PostProcessing_SRCS
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
|
SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
|
||||||
|
|
||||||
SET( Q3D_SRCS
|
ADD_ASSIMP_IMPORTER(Q3D
|
||||||
Q3DLoader.cpp
|
Q3DLoader.cpp
|
||||||
Q3DLoader.h
|
Q3DLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Q3D FILES ${Q3D_SRCS})
|
|
||||||
|
|
||||||
SET( Q3BSP_SRCS
|
ADD_ASSIMP_IMPORTER(Q3BSP
|
||||||
Q3BSPFileData.h
|
Q3BSPFileData.h
|
||||||
Q3BSPFileParser.h
|
Q3BSPFileParser.h
|
||||||
Q3BSPFileParser.cpp
|
Q3BSPFileParser.cpp
|
||||||
|
@ -529,41 +524,35 @@ SET( Q3BSP_SRCS
|
||||||
Q3BSPZipArchive.h
|
Q3BSPZipArchive.h
|
||||||
Q3BSPZipArchive.cpp
|
Q3BSPZipArchive.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Q3BSP FILES ${Q3BSP_SRCS})
|
|
||||||
|
|
||||||
SET( Raw_SRCS
|
ADD_ASSIMP_IMPORTER(RAW
|
||||||
RawLoader.cpp
|
RawLoader.cpp
|
||||||
RawLoader.h
|
RawLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Raw FILES ${Raw_SRCS})
|
|
||||||
|
|
||||||
SET( SMD_SRCS
|
ADD_ASSIMP_IMPORTER(SMD
|
||||||
SMDLoader.cpp
|
SMDLoader.cpp
|
||||||
SMDLoader.h
|
SMDLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( SMD FILES ${SMD_SRCS})
|
|
||||||
|
|
||||||
SET( STL_SRCS
|
ADD_ASSIMP_IMPORTER(STL
|
||||||
STLLoader.cpp
|
STLLoader.cpp
|
||||||
STLLoader.h
|
STLLoader.h
|
||||||
STLExporter.h
|
STLExporter.h
|
||||||
STLExporter.cpp
|
STLExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( STL FILES ${STL_SRCS})
|
|
||||||
|
|
||||||
SET( Terragen_SRCS
|
ADD_ASSIMP_IMPORTER(TERRAGEN
|
||||||
TerragenLoader.cpp
|
TerragenLoader.cpp
|
||||||
TerragenLoader.h
|
TerragenLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Terragen FILES ${Terragen_SRCS})
|
|
||||||
|
|
||||||
SET( Unreal_SRCS
|
ADD_ASSIMP_IMPORTER(3D
|
||||||
UnrealLoader.cpp
|
UnrealLoader.cpp
|
||||||
UnrealLoader.h
|
UnrealLoader.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Unreal FILES ${Unreal_SRCS})
|
|
||||||
|
|
||||||
SET( XFile_SRCS
|
ADD_ASSIMP_IMPORTER(X
|
||||||
XFileHelper.h
|
XFileHelper.h
|
||||||
XFileImporter.cpp
|
XFileImporter.cpp
|
||||||
XFileImporter.h
|
XFileImporter.h
|
||||||
|
@ -572,7 +561,12 @@ SET( XFile_SRCS
|
||||||
XFileExporter.h
|
XFileExporter.h
|
||||||
XFileExporter.cpp
|
XFileExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( XFile FILES ${XFile_SRCS})
|
|
||||||
|
SET( Step_SRCS
|
||||||
|
StepExporter.h
|
||||||
|
StepExporter.cpp
|
||||||
|
)
|
||||||
|
SOURCE_GROUP( Step FILES ${Step_SRCS})
|
||||||
|
|
||||||
SET( Exporter_SRCS
|
SET( Exporter_SRCS
|
||||||
Exporter.cpp
|
Exporter.cpp
|
||||||
|
@ -635,6 +629,17 @@ SET( unzip_SRCS
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( unzip FILES ${unzip_SRCS})
|
SOURCE_GROUP( unzip FILES ${unzip_SRCS})
|
||||||
|
|
||||||
|
SET ( openddl_parser_SRCS
|
||||||
|
../contrib/openddlparser/code/OpenDDLParser.cpp
|
||||||
|
../contrib/openddlparser/code/DDLNode.cpp
|
||||||
|
../contrib/openddlparser/code/Value.cpp
|
||||||
|
../contrib/openddlparser/include/openddlparser/OpenDDLParser.h
|
||||||
|
../contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h
|
||||||
|
../contrib/openddlparser/include/openddlparser/OpenDDLCommon.h
|
||||||
|
../contrib/openddlparser/include/openddlparser/DDLNode.h
|
||||||
|
../contrib/openddlparser/include/openddlparser/Value.h
|
||||||
|
)
|
||||||
|
SOURCE_GROUP( openddl_parser FILES ${openddl_parser_SRCS})
|
||||||
|
|
||||||
# VC2010 fixes
|
# VC2010 fixes
|
||||||
if(MSVC10)
|
if(MSVC10)
|
||||||
|
@ -657,6 +662,9 @@ else (UNZIP_FOUND)
|
||||||
SET (unzip_compile_SRCS ${unzip_SRCS})
|
SET (unzip_compile_SRCS ${unzip_SRCS})
|
||||||
endif (UNZIP_FOUND)
|
endif (UNZIP_FOUND)
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Enabled formats:${ASSIMP_IMPORTERS_ENABLED}")
|
||||||
|
MESSAGE(STATUS "Disabled formats:${ASSIMP_IMPORTERS_DISABLED}")
|
||||||
|
|
||||||
SET( assimp_src
|
SET( assimp_src
|
||||||
# Assimp Files
|
# Assimp Files
|
||||||
${Core_SRCS}
|
${Core_SRCS}
|
||||||
|
@ -664,49 +672,11 @@ SET( assimp_src
|
||||||
${Logging_SRCS}
|
${Logging_SRCS}
|
||||||
${Exporter_SRCS}
|
${Exporter_SRCS}
|
||||||
${PostProcessing_SRCS}
|
${PostProcessing_SRCS}
|
||||||
|
${MaterialSystem_SRCS}
|
||||||
|
${Step_SRCS}
|
||||||
|
|
||||||
# Model Support
|
# Model Support
|
||||||
${3DS_SRCS}
|
${ASSIMP_LOADER_SRCS}
|
||||||
${AC_SRCS}
|
|
||||||
${ASE_SRCS}
|
|
||||||
${ASSBIN_SRCS}
|
|
||||||
${ASSXML_SRCS}
|
|
||||||
${B3D_SRCS}
|
|
||||||
${BVH_SRCS}
|
|
||||||
${Collada_SRCS}
|
|
||||||
${DXF_SRCS}
|
|
||||||
${CSM_SRCS}
|
|
||||||
${HMP_SRCS}
|
|
||||||
${Irr_SRCS}
|
|
||||||
${LWO_SRCS}
|
|
||||||
${LWS_SRCS}
|
|
||||||
${MD2_SRCS}
|
|
||||||
${MD3_SRCS}
|
|
||||||
${MD5_SRCS}
|
|
||||||
${MDC_SRCS}
|
|
||||||
${MDL_SRCS}
|
|
||||||
${MaterialSystem_SRCS}
|
|
||||||
${NFF_SRCS}
|
|
||||||
${OFFFormat_SRCS}
|
|
||||||
${Obj_SRCS}
|
|
||||||
${Ogre_SRCS}
|
|
||||||
${Ply_SRCS}
|
|
||||||
${Q3D_SRCS}
|
|
||||||
${Q3BSP_SRCS}
|
|
||||||
${Raw_SRCS}
|
|
||||||
${SMD_SRCS}
|
|
||||||
${STL_SRCS}
|
|
||||||
${Terragen_SRCS}
|
|
||||||
${Unreal_SRCS}
|
|
||||||
${XFile_SRCS}
|
|
||||||
${Extra_SRCS}
|
|
||||||
${MS3D_SRCS}
|
|
||||||
${COB_SRCS}
|
|
||||||
${BLENDER_SRCS}
|
|
||||||
${NDO_SRCS}
|
|
||||||
${IFC_SRCS}
|
|
||||||
${XGL_SRCS}
|
|
||||||
${FBX_SRCS}
|
|
||||||
|
|
||||||
# Third-party libraries
|
# Third-party libraries
|
||||||
${IrrXML_SRCS}
|
${IrrXML_SRCS}
|
||||||
|
@ -714,16 +684,18 @@ SET( assimp_src
|
||||||
${unzip_compile_SRCS}
|
${unzip_compile_SRCS}
|
||||||
${Poly2Tri_SRCS}
|
${Poly2Tri_SRCS}
|
||||||
${Clipper_SRCS}
|
${Clipper_SRCS}
|
||||||
|
${openddl_parser_SRCS}
|
||||||
# Necessary to show the headers in the project when using the VC++ generator:
|
# Necessary to show the headers in the project when using the VC++ generator:
|
||||||
${Boost_SRCS}
|
${Boost_SRCS}
|
||||||
|
|
||||||
${PUBLIC_HEADERS}
|
${PUBLIC_HEADERS}
|
||||||
${COMPILER_HEADERS}
|
${COMPILER_HEADERS}
|
||||||
|
|
||||||
# Old precompiled header
|
)
|
||||||
# (removed because the precompiled header is not updated when visual studio switch configuration which leads to failed compilation.
|
add_definitions( -DOPENDDLPARSER_BUILD )
|
||||||
# Moreover it's a drag to recompile assimp entirely each time a modification is made to one of the included header, which is definitely counter-productive.)
|
|
||||||
AssimpPCH.cpp
|
INCLUDE_DIRECTORIES(
|
||||||
|
../contrib/openddlparser/include
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
|
@ -731,11 +703,9 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
INCLUDE_DIRECTORIES(${C4D_INCLUDES})
|
INCLUDE_DIRECTORIES(${C4D_INCLUDES})
|
||||||
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
|
|
||||||
#ADD_MSVC_PRECOMPILED_HEADER("AssimpPCH.h" "AssimpPCH.cpp" assimp_src)
|
|
||||||
|
|
||||||
ADD_LIBRARY( assimp ${assimp_src} )
|
ADD_LIBRARY( assimp ${assimp_src} )
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES})
|
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} )
|
||||||
|
|
||||||
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)
|
||||||
|
@ -766,7 +736,7 @@ if( MSVC )
|
||||||
else()
|
else()
|
||||||
set(MSVC_PREFIX "vc130")
|
set(MSVC_PREFIX "vc130")
|
||||||
endif()
|
endif()
|
||||||
set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" FORCE)
|
set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES( assimp PROPERTIES
|
SET_TARGET_PROPERTIES( assimp PROPERTIES
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file COBLoader.cpp
|
/** @file COBLoader.cpp
|
||||||
* @brief Implementation of the TrueSpace COB/SCN importer class.
|
* @brief Implementation of the TrueSpace COB/SCN importer class.
|
||||||
*/
|
*/
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COB_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_COB_IMPORTER
|
||||||
#include "COBLoader.h"
|
#include "COBLoader.h"
|
||||||
|
@ -53,6 +53,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "LineSplitter.h"
|
#include "LineSplitter.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::COB;
|
using namespace Assimp::COB;
|
||||||
|
@ -148,13 +154,17 @@ void COBImporter::InternReadFile( const std::string& pFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultLogger::get()->info("File format tag: "+std::string(head+9,6));
|
DefaultLogger::get()->info("File format tag: "+std::string(head+9,6));
|
||||||
void (COBImporter::* load)(Scene&,StreamReaderLE*)= head[15]=='A'?&COBImporter::ReadAsciiFile:&COBImporter::ReadBinaryFile;
|
|
||||||
if (head[16]!='L') {
|
if (head[16]!='L') {
|
||||||
ThrowException("File is big-endian, which is not supported");
|
ThrowException("File is big-endian, which is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
// load data into intermediate structures
|
// load data into intermediate structures
|
||||||
(this->*load)(scene,stream.get());
|
if (head[15]=='A') {
|
||||||
|
ReadAsciiFile(scene, stream.get());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ReadBinaryFile(scene, stream.get());
|
||||||
|
}
|
||||||
if(scene.nodes.empty()) {
|
if(scene.nodes.empty()) {
|
||||||
ThrowException("No nodes loaded");
|
ThrowException("No nodes loaded");
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +45,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define INCLUDED_AI_COB_LOADER_H
|
#define INCLUDED_AI_COB_LOADER_H
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
#include "StreamReader.h"
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
class LineSplitter;
|
class LineSplitter;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,7 +45,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define INCLUDED_AI_COB_SCENE_H
|
#define INCLUDED_AI_COB_SCENE_H
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <deque>
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
#include "./../include/assimp/material.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace COB {
|
namespace COB {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* Implementation of the CSM importer class.
|
* Implementation of the CSM importer class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
|
||||||
|
|
||||||
|
@ -51,6 +51,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
#include "../include/assimp/Importer.hpp"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/anim.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +43,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef INCLUDED_AI_CSM_LOADER_H
|
#ifndef INCLUDED_AI_CSM_LOADER_H
|
||||||
#define INCLUDED_AI_CSM_LOADER_H
|
#define INCLUDED_AI_CSM_LOADER_H
|
||||||
|
|
||||||
|
#include "BaseImporter.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,12 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* tangents and bitangents for all imported meshes
|
* tangents and bitangents for all imported meshes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "CalcTangentsProcess.h"
|
#include "CalcTangentsProcess.h"
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
#include "qnan.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,7 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
|
#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
|
||||||
|
@ -47,8 +47,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "Bitmap.h"
|
#include "Bitmap.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
|
#include "DefaultIOSystem.h"
|
||||||
#include "XMLTools.h"
|
#include "XMLTools.h"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/Exporter.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
|
||||||
|
#include "Exceptional.h"
|
||||||
|
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
@ -59,24 +66,10 @@ namespace Assimp
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Worker function for exporting a scene to Collada. Prototyped and registered in Exporter.cpp
|
// Worker function for exporting a scene to Collada. Prototyped and registered in Exporter.cpp
|
||||||
void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
|
void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
|
||||||
{
|
{
|
||||||
std::string path = "";
|
std::string path = DefaultIOSystem::absolutePath(std::string(pFile));
|
||||||
std::string file = pFile;
|
std::string file = DefaultIOSystem::completeBaseName(std::string(pFile));
|
||||||
|
|
||||||
// We need to test both types of folder separators because pIOSystem->getOsSeparator() is not reliable.
|
|
||||||
// Moreover, the path given by some applications is not even consistent with the OS specific type of separator.
|
|
||||||
const char* end_path = std::max(strrchr(pFile, '\\'), strrchr(pFile, '/'));
|
|
||||||
|
|
||||||
if(end_path != NULL) {
|
|
||||||
path = std::string(pFile, end_path + 1 - pFile);
|
|
||||||
file = file.substr(end_path + 1 - pFile, file.npos);
|
|
||||||
|
|
||||||
std::size_t pos = file.find_last_of('.');
|
|
||||||
if(pos != file.npos) {
|
|
||||||
file = file.substr(0, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file);
|
ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file);
|
||||||
|
@ -134,6 +127,8 @@ void ColladaExporter::WriteFile()
|
||||||
WriteTextures();
|
WriteTextures();
|
||||||
WriteHeader();
|
WriteHeader();
|
||||||
|
|
||||||
|
WriteCamerasLibrary();
|
||||||
|
WriteLightsLibrary();
|
||||||
WriteMaterials();
|
WriteMaterials();
|
||||||
WriteGeometryLibrary();
|
WriteGeometryLibrary();
|
||||||
|
|
||||||
|
@ -172,8 +167,6 @@ void ColladaExporter::WriteHeader()
|
||||||
std::time_t date = std::time(NULL);
|
std::time_t date = std::time(NULL);
|
||||||
std::strftime(date_str, date_nb_chars, "%Y-%m-%dT%H:%M:%S", std::localtime(&date));
|
std::strftime(date_str, date_nb_chars, "%Y-%m-%dT%H:%M:%S", std::localtime(&date));
|
||||||
|
|
||||||
std::string scene_name = mScene->mRootNode->mName.C_Str();
|
|
||||||
|
|
||||||
aiVector3D scaling;
|
aiVector3D scaling;
|
||||||
aiQuaternion rotation;
|
aiQuaternion rotation;
|
||||||
aiVector3D position;
|
aiVector3D position;
|
||||||
|
@ -293,6 +286,201 @@ void ColladaExporter::WriteTextures() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Write the embedded textures
|
||||||
|
void ColladaExporter::WriteCamerasLibrary() {
|
||||||
|
if(mScene->HasCameras()) {
|
||||||
|
|
||||||
|
mOutput << startstr << "<library_cameras>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
|
||||||
|
for( size_t a = 0; a < mScene->mNumCameras; ++a)
|
||||||
|
WriteCamera( a);
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</library_cameras>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ColladaExporter::WriteCamera(size_t pIndex){
|
||||||
|
|
||||||
|
const aiCamera *cam = mScene->mCameras[pIndex];
|
||||||
|
const std::string idstrEscaped = XMLEscape(cam->mName.C_Str());
|
||||||
|
|
||||||
|
mOutput << startstr << "<camera id=\"" << idstrEscaped << "-camera\" name=\"" << idstrEscaped << "_name\" >" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<optics>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<technique_common>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
//assimp doesn't support the import of orthographic cameras! se we write
|
||||||
|
//always perspective
|
||||||
|
mOutput << startstr << "<perspective>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<xfov sid=\"xfov\">"<<
|
||||||
|
AI_RAD_TO_DEG(cam->mHorizontalFOV)
|
||||||
|
<<"</xfov>" << endstr;
|
||||||
|
mOutput << startstr << "<aspect_ratio>"
|
||||||
|
<< cam->mAspect
|
||||||
|
<< "</aspect_ratio>" << endstr;
|
||||||
|
mOutput << startstr << "<znear sid=\"znear\">"
|
||||||
|
<< cam->mClipPlaneNear
|
||||||
|
<< "</znear>" << endstr;
|
||||||
|
mOutput << startstr << "<zfar sid=\"zfar\">"
|
||||||
|
<< cam->mClipPlaneFar
|
||||||
|
<< "</zfar>" << endstr;
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</perspective>" << endstr;
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</technique_common>" << endstr;
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</optics>" << endstr;
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</camera>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Write the embedded textures
|
||||||
|
void ColladaExporter::WriteLightsLibrary() {
|
||||||
|
if(mScene->HasLights()) {
|
||||||
|
|
||||||
|
mOutput << startstr << "<library_lights>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
|
||||||
|
for( size_t a = 0; a < mScene->mNumLights; ++a)
|
||||||
|
WriteLight( a);
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</library_lights>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ColladaExporter::WriteLight(size_t pIndex){
|
||||||
|
|
||||||
|
const aiLight *light = mScene->mLights[pIndex];
|
||||||
|
const std::string idstrEscaped = XMLEscape(light->mName.C_Str());
|
||||||
|
|
||||||
|
mOutput << startstr << "<light id=\"" << idstrEscaped << "-light\" name=\""
|
||||||
|
<< idstrEscaped << "_name\" >" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<technique_common>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
switch(light->mType){
|
||||||
|
case aiLightSource_AMBIENT:
|
||||||
|
WriteAmbienttLight(light);
|
||||||
|
break;
|
||||||
|
case aiLightSource_DIRECTIONAL:
|
||||||
|
WriteDirectionalLight(light);
|
||||||
|
break;
|
||||||
|
case aiLightSource_POINT:
|
||||||
|
WritePointLight(light);
|
||||||
|
break;
|
||||||
|
case aiLightSource_SPOT:
|
||||||
|
WriteSpotLight(light);
|
||||||
|
break;
|
||||||
|
case aiLightSource_UNDEFINED:
|
||||||
|
case _aiLightSource_Force32Bit:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</technique_common>" << endstr;
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</light>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ColladaExporter::WritePointLight(const aiLight *const light){
|
||||||
|
const aiColor3D &color= light->mColorDiffuse;
|
||||||
|
mOutput << startstr << "<point>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<color sid=\"color\">"
|
||||||
|
<< color.r<<" "<<color.g<<" "<<color.b
|
||||||
|
<<"</color>" << endstr;
|
||||||
|
mOutput << startstr << "<constant_attenuation>"
|
||||||
|
<< light->mAttenuationConstant
|
||||||
|
<<"</constant_attenuation>" << endstr;
|
||||||
|
mOutput << startstr << "<linear_attenuation>"
|
||||||
|
<< light->mAttenuationLinear
|
||||||
|
<<"</linear_attenuation>" << endstr;
|
||||||
|
mOutput << startstr << "<quadratic_attenuation>"
|
||||||
|
<< light->mAttenuationQuadratic
|
||||||
|
<<"</quadratic_attenuation>" << endstr;
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</point>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
void ColladaExporter::WriteDirectionalLight(const aiLight *const light){
|
||||||
|
const aiColor3D &color= light->mColorDiffuse;
|
||||||
|
mOutput << startstr << "<directional>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<color sid=\"color\">"
|
||||||
|
<< color.r<<" "<<color.g<<" "<<color.b
|
||||||
|
<<"</color>" << endstr;
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</directional>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
void ColladaExporter::WriteSpotLight(const aiLight *const light){
|
||||||
|
|
||||||
|
const aiColor3D &color= light->mColorDiffuse;
|
||||||
|
mOutput << startstr << "<spot>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<color sid=\"color\">"
|
||||||
|
<< color.r<<" "<<color.g<<" "<<color.b
|
||||||
|
<<"</color>" << endstr;
|
||||||
|
mOutput << startstr << "<constant_attenuation>"
|
||||||
|
<< light->mAttenuationConstant
|
||||||
|
<<"</constant_attenuation>" << endstr;
|
||||||
|
mOutput << startstr << "<linear_attenuation>"
|
||||||
|
<< light->mAttenuationLinear
|
||||||
|
<<"</linear_attenuation>" << endstr;
|
||||||
|
mOutput << startstr << "<quadratic_attenuation>"
|
||||||
|
<< light->mAttenuationQuadratic
|
||||||
|
<<"</quadratic_attenuation>" << endstr;
|
||||||
|
/*
|
||||||
|
out->mAngleOuterCone = AI_DEG_TO_RAD (std::acos(std::pow(0.1f,1.f/srcLight->mFalloffExponent))+
|
||||||
|
srcLight->mFalloffAngle);
|
||||||
|
*/
|
||||||
|
|
||||||
|
const float fallOffAngle = AI_RAD_TO_DEG(light->mAngleInnerCone);
|
||||||
|
mOutput << startstr <<"<falloff_angle sid=\"fall_off_angle\">"
|
||||||
|
<< fallOffAngle
|
||||||
|
<<"</falloff_angle>" << endstr;
|
||||||
|
double temp = light->mAngleOuterCone-light->mAngleInnerCone;
|
||||||
|
|
||||||
|
temp = std::cos(temp);
|
||||||
|
temp = std::log(temp)/std::log(0.1);
|
||||||
|
temp = 1/temp;
|
||||||
|
mOutput << startstr << "<falloff_exponent sid=\"fall_off_exponent\">"
|
||||||
|
<< temp
|
||||||
|
<<"</falloff_exponent>" << endstr;
|
||||||
|
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</spot>" << endstr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ColladaExporter::WriteAmbienttLight(const aiLight *const light){
|
||||||
|
|
||||||
|
const aiColor3D &color= light->mColorAmbient;
|
||||||
|
mOutput << startstr << "<ambient>" << endstr;
|
||||||
|
PushTag();
|
||||||
|
mOutput << startstr << "<color sid=\"color\">"
|
||||||
|
<< color.r<<" "<<color.g<<" "<<color.b
|
||||||
|
<<"</color>" << endstr;
|
||||||
|
|
||||||
|
PopTag();
|
||||||
|
mOutput << startstr << "</ambient>" << endstr;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Reads a single surface entry from the given material keys
|
// Reads a single surface entry from the given material keys
|
||||||
void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex)
|
void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex)
|
||||||
|
@ -432,8 +620,6 @@ void ColladaExporter::WriteMaterials()
|
||||||
{
|
{
|
||||||
materials.resize( mScene->mNumMaterials);
|
materials.resize( mScene->mNumMaterials);
|
||||||
|
|
||||||
std::set<std::string> material_names;
|
|
||||||
|
|
||||||
/// collect all materials from the scene
|
/// collect all materials from the scene
|
||||||
size_t numTextures = 0;
|
size_t numTextures = 0;
|
||||||
for( size_t a = 0; a < mScene->mNumMaterials; ++a )
|
for( size_t a = 0; a < mScene->mNumMaterials; ++a )
|
||||||
|
@ -854,6 +1040,23 @@ void ColladaExporter::WriteNode(aiNode* pNode)
|
||||||
mOutput << mat.d1 << " " << mat.d2 << " " << mat.d3 << " " << mat.d4;
|
mOutput << mat.d1 << " " << mat.d2 << " " << mat.d3 << " " << mat.d4;
|
||||||
mOutput << "</matrix>" << endstr;
|
mOutput << "</matrix>" << endstr;
|
||||||
|
|
||||||
|
if(pNode->mNumMeshes==0){
|
||||||
|
//check if it is a camera node
|
||||||
|
for(size_t i=0; i<mScene->mNumCameras; i++){
|
||||||
|
if(mScene->mCameras[i]->mName == pNode->mName){
|
||||||
|
mOutput << startstr <<"<instance_camera url=\"#" << node_name_escaped << "-camera\"/>" << endstr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//check if it is a light node
|
||||||
|
for(size_t i=0; i<mScene->mNumLights; i++){
|
||||||
|
if(mScene->mLights[i]->mName == pNode->mName){
|
||||||
|
mOutput << startstr <<"<instance_light url=\"#" << node_name_escaped << "-light\"/>" << endstr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else
|
||||||
// instance every geometry
|
// instance every geometry
|
||||||
for( size_t a = 0; a < pNode->mNumMeshes; ++a )
|
for( size_t a = 0; a < pNode->mNumMeshes; ++a )
|
||||||
{
|
{
|
||||||
|
@ -861,7 +1064,6 @@ void ColladaExporter::WriteNode(aiNode* pNode)
|
||||||
// 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;
|
mOutput << startstr << "<instance_geometry url=\"#" << XMLEscape(GetMeshId( pNode->mMeshes[a])) << "\">" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
mOutput << startstr << "<bind_material>" << endstr;
|
mOutput << startstr << "<bind_material>" << endstr;
|
||||||
|
@ -887,4 +1089,3 @@ void ColladaExporter::WriteNode(aiNode* pNode)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,7 +45,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_COLLADAEXPORTER_H_INC
|
#define AI_COLLADAEXPORTER_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include "../include/assimp/ai_assert.h"
|
||||||
|
#include "../include/assimp/material.h"
|
||||||
|
#include "../include/assimp/mesh.h"
|
||||||
|
#include "../include/assimp/light.h"
|
||||||
|
#include "../include/assimp/Exporter.hpp"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
|
@ -77,6 +84,22 @@ protected:
|
||||||
/// Writes the material setup
|
/// Writes the material setup
|
||||||
void WriteMaterials();
|
void WriteMaterials();
|
||||||
|
|
||||||
|
/// Writes the cameras library
|
||||||
|
void WriteCamerasLibrary();
|
||||||
|
|
||||||
|
// Write a camera entry
|
||||||
|
void WriteCamera(size_t pIndex);
|
||||||
|
|
||||||
|
/// Writes the cameras library
|
||||||
|
void WriteLightsLibrary();
|
||||||
|
|
||||||
|
// Write a camera entry
|
||||||
|
void WriteLight(size_t pIndex);
|
||||||
|
void WritePointLight(const aiLight *const light);
|
||||||
|
void WriteDirectionalLight(const aiLight *const light);
|
||||||
|
void WriteSpotLight(const aiLight *const light);
|
||||||
|
void WriteAmbienttLight(const aiLight *const light);
|
||||||
|
|
||||||
/// Writes the geometry library
|
/// Writes the geometry library
|
||||||
void WriteGeometryLibrary();
|
void WriteGeometryLibrary();
|
||||||
|
|
||||||
|
@ -139,7 +162,10 @@ protected:
|
||||||
{
|
{
|
||||||
bool exist;
|
bool exist;
|
||||||
float value;
|
float value;
|
||||||
Property() { exist = false; }
|
Property()
|
||||||
|
: exist(false)
|
||||||
|
, value(0.0f)
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
// summarize a material in an convinient way.
|
// summarize a material in an convinient way.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +43,16 @@ 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 <vector>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "../include/assimp/light.h"
|
||||||
|
#include "../include/assimp/mesh.h"
|
||||||
|
#include "../include/assimp/material.h"
|
||||||
|
|
||||||
|
struct aiMaterial;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace Collada {
|
namespace Collada {
|
||||||
|
|
||||||
|
@ -124,7 +134,8 @@ struct Camera
|
||||||
struct Light
|
struct Light
|
||||||
{
|
{
|
||||||
Light()
|
Light()
|
||||||
: mAttConstant (1.f)
|
: mType (aiLightSource_UNDEFINED)
|
||||||
|
, mAttConstant (1.f)
|
||||||
, mAttLinear (0.f)
|
, mAttLinear (0.f)
|
||||||
, mAttQuadratic (0.f)
|
, mAttQuadratic (0.f)
|
||||||
, mFalloffAngle (180.f)
|
, mFalloffAngle (180.f)
|
||||||
|
@ -163,12 +174,13 @@ struct InputSemanticMapEntry
|
||||||
{
|
{
|
||||||
InputSemanticMapEntry()
|
InputSemanticMapEntry()
|
||||||
: mSet(0)
|
: mSet(0)
|
||||||
|
, mType(IT_Invalid)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//! Index of set, optional
|
//! Index of set, optional
|
||||||
unsigned int mSet;
|
unsigned int mSet;
|
||||||
|
|
||||||
//! Name of referenced vertex input
|
//! Type of referenced vertex input
|
||||||
InputType mType;
|
InputType mType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -503,6 +515,8 @@ struct Effect
|
||||||
// Scalar factory
|
// Scalar factory
|
||||||
float mShininess, mRefractIndex, mReflectivity;
|
float mShininess, mRefractIndex, mReflectivity;
|
||||||
float mTransparency;
|
float mTransparency;
|
||||||
|
bool mHasTransparency;
|
||||||
|
bool mRGBTransparency;
|
||||||
|
|
||||||
// local params referring to each other by their SID
|
// local params referring to each other by their SID
|
||||||
typedef std::map<std::string, Collada::EffectParam> ParamLibrary;
|
typedef std::map<std::string, Collada::EffectParam> ParamLibrary;
|
||||||
|
@ -523,7 +537,9 @@ struct Effect
|
||||||
, mShininess (10.0f)
|
, mShininess (10.0f)
|
||||||
, mRefractIndex (1.f)
|
, mRefractIndex (1.f)
|
||||||
, mReflectivity (1.f)
|
, mReflectivity (1.f)
|
||||||
, mTransparency (0.f)
|
, mTransparency (1.f)
|
||||||
|
, mHasTransparency (false)
|
||||||
|
, mRGBTransparency(false)
|
||||||
, mDoubleSided (false)
|
, mDoubleSided (false)
|
||||||
, mWireframe (false)
|
, mWireframe (false)
|
||||||
, mFaceted (false)
|
, mFaceted (false)
|
||||||
|
@ -595,7 +611,15 @@ struct ChannelEntry
|
||||||
const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values
|
const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values
|
||||||
const Collada::Data* mValueData; ///> Source datat array for the key value values
|
const Collada::Data* mValueData; ///> Source datat array for the key value values
|
||||||
|
|
||||||
ChannelEntry() { mChannel = NULL; mSubElement = 0; }
|
ChannelEntry()
|
||||||
|
: mChannel()
|
||||||
|
, mTransformIndex()
|
||||||
|
, mSubElement()
|
||||||
|
, mTimeAccessor()
|
||||||
|
, mTimeData()
|
||||||
|
, mValueAccessor()
|
||||||
|
, mValueData()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace Collada
|
} // end of namespace Collada
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -41,18 +41,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/** @file Implementation of the Collada loader */
|
/** @file Implementation of the Collada loader */
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
||||||
|
|
||||||
#include "../include/assimp/anim.h"
|
#include "../include/assimp/anim.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
#include "ColladaLoader.h"
|
#include "ColladaLoader.h"
|
||||||
#include "ColladaParser.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 "time.h"
|
#include "time.h"
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/Importer.hpp"
|
||||||
|
#include <numeric>
|
||||||
|
#include "Defines.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -73,7 +81,10 @@ static const aiImporterDesc desc = {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
ColladaLoader::ColladaLoader()
|
ColladaLoader::ColladaLoader()
|
||||||
: noSkeletonMesh(), ignoreUpDirection(false), mNodeNameCounter()
|
: noSkeletonMesh()
|
||||||
|
, ignoreUpDirection(false)
|
||||||
|
, invertTransparency(false)
|
||||||
|
, mNodeNameCounter()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -109,6 +120,7 @@ void ColladaLoader::SetupProperties(const Importer* pImp)
|
||||||
{
|
{
|
||||||
noSkeletonMesh = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_NO_SKELETON_MESHES,0) != 0;
|
noSkeletonMesh = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_NO_SKELETON_MESHES,0) != 0;
|
||||||
ignoreUpDirection = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION,0) != 0;
|
ignoreUpDirection = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION,0) != 0;
|
||||||
|
invertTransparency = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_COLLADA_INVERT_TRANSPARENCY,0) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -321,8 +333,16 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
|
||||||
out->mAttenuationLinear = srcLight->mAttLinear;
|
out->mAttenuationLinear = srcLight->mAttLinear;
|
||||||
out->mAttenuationQuadratic = srcLight->mAttQuadratic;
|
out->mAttenuationQuadratic = srcLight->mAttQuadratic;
|
||||||
|
|
||||||
// collada doesn't differenciate between these color types
|
|
||||||
out->mColorDiffuse = out->mColorSpecular = out->mColorAmbient = srcLight->mColor*srcLight->mIntensity;
|
out->mColorDiffuse = out->mColorSpecular = out->mColorAmbient = srcLight->mColor*srcLight->mIntensity;
|
||||||
|
if (out->mType == aiLightSource_AMBIENT) {
|
||||||
|
out->mColorDiffuse = out->mColorSpecular = aiColor3D(0, 0, 0);
|
||||||
|
out->mColorAmbient = srcLight->mColor*srcLight->mIntensity;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// collada doesn't differentiate between these color types
|
||||||
|
out->mColorDiffuse = out->mColorSpecular = srcLight->mColor*srcLight->mIntensity;
|
||||||
|
out->mColorAmbient = aiColor3D(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// convert falloff angle and falloff exponent in our representation, if given
|
// convert falloff angle and falloff exponent in our representation, if given
|
||||||
if (out->mType == aiLightSource_SPOT) {
|
if (out->mType == aiLightSource_SPOT) {
|
||||||
|
@ -337,8 +357,8 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
|
||||||
{
|
{
|
||||||
// Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
|
// Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
|
||||||
// epsilon chosen to be 0.1
|
// epsilon chosen to be 0.1
|
||||||
out->mAngleOuterCone = AI_DEG_TO_RAD (std::acos(std::pow(0.1f,1.f/srcLight->mFalloffExponent))+
|
out->mAngleOuterCone = std::acos(std::pow(0.1f,1.f/srcLight->mFalloffExponent))+
|
||||||
srcLight->mFalloffAngle);
|
out->mAngleInnerCone;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD( srcLight->mPenumbraAngle );
|
out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD( srcLight->mPenumbraAngle );
|
||||||
|
@ -907,7 +927,7 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructs the animations for the given source anim
|
// Constructs the animations for the given source anim
|
||||||
void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string pPrefix)
|
void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string &pPrefix)
|
||||||
{
|
{
|
||||||
std::string animName = pPrefix.empty() ? pSrcAnim->mName : pPrefix + "_" + pSrcAnim->mName;
|
std::string animName = pPrefix.empty() ? pSrcAnim->mName : pPrefix + "_" + pSrcAnim->mName;
|
||||||
|
|
||||||
|
@ -1330,12 +1350,26 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
|
||||||
mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI);
|
mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI);
|
||||||
|
|
||||||
// transparency, a very hard one. seemingly not all files are following the
|
// transparency, a very hard one. seemingly not all files are following the
|
||||||
// specification here .. but we can trick.
|
// specification here (1.0 transparency => completly opaque)...
|
||||||
if (effect.mTransparency >= 0.f && effect.mTransparency < 1.f) {
|
// therefore, we let the opportunity for the user to manually invert
|
||||||
|
// the transparency if necessary and we add preliminary support for RGB_ZERO mode
|
||||||
|
if(effect.mTransparency >= 0.f && effect.mTransparency <= 1.f) {
|
||||||
|
// Trying some support for RGB_ZERO mode
|
||||||
|
if(effect.mRGBTransparency) {
|
||||||
|
effect.mTransparency = 1.f - effect.mTransparent.a;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Global option
|
||||||
|
if(invertTransparency) {
|
||||||
effect.mTransparency = 1.f - effect.mTransparency;
|
effect.mTransparency = 1.f - effect.mTransparency;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the material finally transparent ?
|
||||||
|
if (effect.mHasTransparency || effect.mTransparency < 1.f) {
|
||||||
mat.AddProperty( &effect.mTransparency, 1, AI_MATKEY_OPACITY );
|
mat.AddProperty( &effect.mTransparency, 1, AI_MATKEY_OPACITY );
|
||||||
mat.AddProperty( &effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT );
|
mat.AddProperty( &effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// add textures, if given
|
// add textures, if given
|
||||||
if( !effect.mTexAmbient.mName.empty())
|
if( !effect.mTexAmbient.mName.empty())
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +46,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "ColladaParser.h"
|
#include "ColladaParser.h"
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
struct aiCamera;
|
||||||
|
struct aiLight;
|
||||||
|
struct aiTexture;
|
||||||
|
struct aiAnimation;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -149,7 +155,7 @@ protected:
|
||||||
* @param pSrcAnim the source animation to process
|
* @param pSrcAnim the source animation to process
|
||||||
* @param pPrefix Prefix to the name in case of nested animations
|
* @param pPrefix Prefix to the name in case of nested animations
|
||||||
*/
|
*/
|
||||||
void StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string pPrefix);
|
void StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pPrefix);
|
||||||
|
|
||||||
/** Constructs the animation for the given source anim */
|
/** Constructs the animation for the given source anim */
|
||||||
void CreateAnimation( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName);
|
void CreateAnimation( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName);
|
||||||
|
@ -235,6 +241,7 @@ protected:
|
||||||
|
|
||||||
bool noSkeletonMesh;
|
bool noSkeletonMesh;
|
||||||
bool ignoreUpDirection;
|
bool ignoreUpDirection;
|
||||||
|
bool invertTransparency;
|
||||||
|
|
||||||
/** Used by FindNameForNode() to generate unique node names */
|
/** Used by FindNameForNode() to generate unique node names */
|
||||||
unsigned int mNodeNameCounter;
|
unsigned int mNodeNameCounter;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,352 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (assimp)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2015, 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.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file ColladaParser.h
|
||||||
|
* @brief Defines the parser helper class for the collada loader
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AI_COLLADAPARSER_H_INC
|
||||||
|
#define AI_COLLADAPARSER_H_INC
|
||||||
|
|
||||||
|
#include "irrXMLWrapper.h"
|
||||||
|
#include "ColladaHelper.h"
|
||||||
|
#include "../include/assimp/ai_assert.h"
|
||||||
|
#include <boost/format.hpp>
|
||||||
|
|
||||||
|
namespace Assimp
|
||||||
|
{
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------
|
||||||
|
/** Parser helper class for the Collada loader.
|
||||||
|
*
|
||||||
|
* Does all the XML reading and builds internal data structures from it,
|
||||||
|
* but leaves the resolving of all the references to the loader.
|
||||||
|
*/
|
||||||
|
class ColladaParser
|
||||||
|
{
|
||||||
|
friend class ColladaLoader;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** Constructor from XML file */
|
||||||
|
ColladaParser( IOSystem* pIOHandler, const std::string& pFile);
|
||||||
|
|
||||||
|
/** Destructor */
|
||||||
|
~ColladaParser();
|
||||||
|
|
||||||
|
/** Reads the contents of the file */
|
||||||
|
void ReadContents();
|
||||||
|
|
||||||
|
/** Reads the structure of the file */
|
||||||
|
void ReadStructure();
|
||||||
|
|
||||||
|
/** Reads asset informations such as coordinate system informations and legal blah */
|
||||||
|
void ReadAssetInfo();
|
||||||
|
|
||||||
|
/** Reads the animation library */
|
||||||
|
void ReadAnimationLibrary();
|
||||||
|
|
||||||
|
/** Reads an animation into the given parent structure */
|
||||||
|
void ReadAnimation( Collada::Animation* pParent);
|
||||||
|
|
||||||
|
/** Reads an animation sampler into the given anim channel */
|
||||||
|
void ReadAnimationSampler( Collada::AnimationChannel& pChannel);
|
||||||
|
|
||||||
|
/** Reads the skeleton controller library */
|
||||||
|
void ReadControllerLibrary();
|
||||||
|
|
||||||
|
/** Reads a controller into the given mesh structure */
|
||||||
|
void ReadController( Collada::Controller& pController);
|
||||||
|
|
||||||
|
/** Reads the joint definitions for the given controller */
|
||||||
|
void ReadControllerJoints( Collada::Controller& pController);
|
||||||
|
|
||||||
|
/** Reads the joint weights for the given controller */
|
||||||
|
void ReadControllerWeights( Collada::Controller& pController);
|
||||||
|
|
||||||
|
/** Reads the image library contents */
|
||||||
|
void ReadImageLibrary();
|
||||||
|
|
||||||
|
/** Reads an image entry into the given image */
|
||||||
|
void ReadImage( Collada::Image& pImage);
|
||||||
|
|
||||||
|
/** Reads the material library */
|
||||||
|
void ReadMaterialLibrary();
|
||||||
|
|
||||||
|
/** Reads a material entry into the given material */
|
||||||
|
void ReadMaterial( Collada::Material& pMaterial);
|
||||||
|
|
||||||
|
/** Reads the camera library */
|
||||||
|
void ReadCameraLibrary();
|
||||||
|
|
||||||
|
/** Reads a camera entry into the given camera */
|
||||||
|
void ReadCamera( Collada::Camera& pCamera);
|
||||||
|
|
||||||
|
/** Reads the light library */
|
||||||
|
void ReadLightLibrary();
|
||||||
|
|
||||||
|
/** Reads a light entry into the given light */
|
||||||
|
void ReadLight( Collada::Light& pLight);
|
||||||
|
|
||||||
|
/** Reads the effect library */
|
||||||
|
void ReadEffectLibrary();
|
||||||
|
|
||||||
|
/** Reads an effect entry into the given effect*/
|
||||||
|
void ReadEffect( Collada::Effect& pEffect);
|
||||||
|
|
||||||
|
/** Reads an COMMON effect profile */
|
||||||
|
void ReadEffectProfileCommon( Collada::Effect& pEffect);
|
||||||
|
|
||||||
|
/** Read sampler properties */
|
||||||
|
void ReadSamplerProperties( Collada::Sampler& pSampler);
|
||||||
|
|
||||||
|
/** Reads an effect entry containing a color or a texture defining that color */
|
||||||
|
void ReadEffectColor( aiColor4D& pColor, Collada::Sampler& pSampler);
|
||||||
|
|
||||||
|
/** Reads an effect entry containing a float */
|
||||||
|
void ReadEffectFloat( float& pFloat);
|
||||||
|
|
||||||
|
/** Reads an effect parameter specification of any kind */
|
||||||
|
void ReadEffectParam( Collada::EffectParam& pParam);
|
||||||
|
|
||||||
|
/** Reads the geometry library contents */
|
||||||
|
void ReadGeometryLibrary();
|
||||||
|
|
||||||
|
/** Reads a geometry from the geometry library. */
|
||||||
|
void ReadGeometry( Collada::Mesh* pMesh);
|
||||||
|
|
||||||
|
/** Reads a mesh from the geometry library */
|
||||||
|
void ReadMesh( Collada::Mesh* pMesh);
|
||||||
|
|
||||||
|
/** Reads a source element - a combination of raw data and an accessor defining
|
||||||
|
* things that should not be redefinable. Yes, that's another rant.
|
||||||
|
*/
|
||||||
|
void ReadSource();
|
||||||
|
|
||||||
|
/** Reads a data array holding a number of elements, and stores it in the global library.
|
||||||
|
* Currently supported are array of floats and arrays of strings.
|
||||||
|
*/
|
||||||
|
void ReadDataArray();
|
||||||
|
|
||||||
|
/** Reads an accessor and stores it in the global library under the given ID -
|
||||||
|
* accessors use the ID of the parent <source> element
|
||||||
|
*/
|
||||||
|
void ReadAccessor( const std::string& pID);
|
||||||
|
|
||||||
|
/** Reads input declarations of per-vertex mesh data into the given mesh */
|
||||||
|
void ReadVertexData( Collada::Mesh* pMesh);
|
||||||
|
|
||||||
|
/** Reads input declarations of per-index mesh data into the given mesh */
|
||||||
|
void ReadIndexData( Collada::Mesh* pMesh);
|
||||||
|
|
||||||
|
/** Reads a single input channel element and stores it in the given array, if valid */
|
||||||
|
void ReadInputChannel( std::vector<Collada::InputChannel>& poChannels);
|
||||||
|
|
||||||
|
/** Reads a <p> primitive index list and assembles the mesh data into the given mesh */
|
||||||
|
size_t ReadPrimitives( Collada::Mesh* pMesh, std::vector<Collada::InputChannel>& pPerIndexChannels,
|
||||||
|
size_t pNumPrimitives, const std::vector<size_t>& pVCount, Collada::PrimitiveType pPrimType);
|
||||||
|
|
||||||
|
/** Copies the data for a single primitive into the mesh, based on the InputChannels */
|
||||||
|
void CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset,
|
||||||
|
Collada::Mesh* pMesh, std::vector<Collada::InputChannel>& pPerIndexChannels,
|
||||||
|
size_t currentPrimitive, const std::vector<size_t>& indices);
|
||||||
|
|
||||||
|
/** Reads one triangle of a tristrip into the mesh */
|
||||||
|
void ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Collada::Mesh* pMesh,
|
||||||
|
std::vector<Collada::InputChannel>& pPerIndexChannels, size_t currentPrimitive, const std::vector<size_t>& indices);
|
||||||
|
|
||||||
|
/** Extracts a single object from an input channel and stores it in the appropriate mesh data array */
|
||||||
|
void ExtractDataObjectFromChannel( const Collada::InputChannel& pInput, size_t pLocalIndex, Collada::Mesh* pMesh);
|
||||||
|
|
||||||
|
/** Reads the library of node hierarchies and scene parts */
|
||||||
|
void ReadSceneLibrary();
|
||||||
|
|
||||||
|
/** Reads a scene node's contents including children and stores it in the given node */
|
||||||
|
void ReadSceneNode( Collada::Node* pNode);
|
||||||
|
|
||||||
|
/** Reads a node transformation entry of the given type and adds it to the given node's transformation list. */
|
||||||
|
void ReadNodeTransformation( Collada::Node* pNode, Collada::TransformType pType);
|
||||||
|
|
||||||
|
/** Reads a mesh reference in a node and adds it to the node's mesh list */
|
||||||
|
void ReadNodeGeometry( Collada::Node* pNode);
|
||||||
|
|
||||||
|
/** Reads the collada scene */
|
||||||
|
void ReadScene();
|
||||||
|
|
||||||
|
// Processes bind_vertex_input and bind elements
|
||||||
|
void ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** Aborts the file reading with an exception */
|
||||||
|
AI_WONT_RETURN void ThrowException( const std::string& pError) const AI_WONT_RETURN_SUFFIX;
|
||||||
|
|
||||||
|
/** Skips all data until the end node of the current element */
|
||||||
|
void SkipElement();
|
||||||
|
|
||||||
|
/** Skips all data until the end node of the given element */
|
||||||
|
void SkipElement( const char* pElement);
|
||||||
|
|
||||||
|
/** Compares the current xml element name to the given string and returns true if equal */
|
||||||
|
bool IsElement( const char* pName) const;
|
||||||
|
|
||||||
|
/** Tests for the opening tag of the given element, throws an exception if not found */
|
||||||
|
void TestOpening( const char* pName);
|
||||||
|
|
||||||
|
/** Tests for the closing tag of the given element, throws an exception if not found */
|
||||||
|
void TestClosing( const char* pName);
|
||||||
|
|
||||||
|
/** Checks the present element for the presence of the attribute, returns its index
|
||||||
|
or throws an exception if not found */
|
||||||
|
int GetAttribute( const char* pAttr) const;
|
||||||
|
|
||||||
|
/** Returns the index of the named attribute or -1 if not found. Does not throw,
|
||||||
|
therefore useful for optional attributes */
|
||||||
|
int TestAttribute( const char* pAttr) const;
|
||||||
|
|
||||||
|
/** Reads the text contents of an element, throws an exception if not given.
|
||||||
|
Skips leading whitespace. */
|
||||||
|
const char* GetTextContent();
|
||||||
|
|
||||||
|
/** Reads the text contents of an element, returns NULL if not given.
|
||||||
|
Skips leading whitespace. */
|
||||||
|
const char* TestTextContent();
|
||||||
|
|
||||||
|
/** Reads a single bool from current text content */
|
||||||
|
bool ReadBoolFromTextContent();
|
||||||
|
|
||||||
|
/** Reads a single float from current text content */
|
||||||
|
float ReadFloatFromTextContent();
|
||||||
|
|
||||||
|
/** Calculates the resulting transformation from all the given transform steps */
|
||||||
|
aiMatrix4x4 CalculateResultTransform( const std::vector<Collada::Transform>& pTransforms) const;
|
||||||
|
|
||||||
|
/** Determines the input data type for the given semantic string */
|
||||||
|
Collada::InputType GetTypeForSemantic( const std::string& pSemantic);
|
||||||
|
|
||||||
|
/** Finds the item in the given library by its reference, throws if not found */
|
||||||
|
template <typename Type> const Type& ResolveLibraryReference(
|
||||||
|
const std::map<std::string, Type>& pLibrary, const std::string& pURL) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** Filename, for a verbose error message */
|
||||||
|
std::string mFileName;
|
||||||
|
|
||||||
|
/** XML reader, member for everyday use */
|
||||||
|
irr::io::IrrXMLReader* mReader;
|
||||||
|
|
||||||
|
/** All data arrays found in the file by ID. Might be referred to by actually
|
||||||
|
everyone. Collada, you are a steaming pile of indirection. */
|
||||||
|
typedef std::map<std::string, Collada::Data> DataLibrary;
|
||||||
|
DataLibrary mDataLibrary;
|
||||||
|
|
||||||
|
/** Same for accessors which define how the data in a data array is accessed. */
|
||||||
|
typedef std::map<std::string, Collada::Accessor> AccessorLibrary;
|
||||||
|
AccessorLibrary mAccessorLibrary;
|
||||||
|
|
||||||
|
/** Mesh library: mesh by ID */
|
||||||
|
typedef std::map<std::string, Collada::Mesh*> MeshLibrary;
|
||||||
|
MeshLibrary mMeshLibrary;
|
||||||
|
|
||||||
|
/** node library: root node of the hierarchy part by ID */
|
||||||
|
typedef std::map<std::string, Collada::Node*> NodeLibrary;
|
||||||
|
NodeLibrary mNodeLibrary;
|
||||||
|
|
||||||
|
/** Image library: stores texture properties by ID */
|
||||||
|
typedef std::map<std::string, Collada::Image> ImageLibrary;
|
||||||
|
ImageLibrary mImageLibrary;
|
||||||
|
|
||||||
|
/** Effect library: surface attributes by ID */
|
||||||
|
typedef std::map<std::string, Collada::Effect> EffectLibrary;
|
||||||
|
EffectLibrary mEffectLibrary;
|
||||||
|
|
||||||
|
/** Material library: surface material by ID */
|
||||||
|
typedef std::map<std::string, Collada::Material> MaterialLibrary;
|
||||||
|
MaterialLibrary mMaterialLibrary;
|
||||||
|
|
||||||
|
/** Light library: surface light by ID */
|
||||||
|
typedef std::map<std::string, Collada::Light> LightLibrary;
|
||||||
|
LightLibrary mLightLibrary;
|
||||||
|
|
||||||
|
/** Camera library: surface material by ID */
|
||||||
|
typedef std::map<std::string, Collada::Camera> CameraLibrary;
|
||||||
|
CameraLibrary mCameraLibrary;
|
||||||
|
|
||||||
|
/** Controller library: joint controllers by ID */
|
||||||
|
typedef std::map<std::string, Collada::Controller> ControllerLibrary;
|
||||||
|
ControllerLibrary mControllerLibrary;
|
||||||
|
|
||||||
|
/** Pointer to the root node. Don't delete, it just points to one of
|
||||||
|
the nodes in the node library. */
|
||||||
|
Collada::Node* mRootNode;
|
||||||
|
|
||||||
|
/** Root animation container */
|
||||||
|
Collada::Animation mAnims;
|
||||||
|
|
||||||
|
/** Size unit: how large compared to a meter */
|
||||||
|
float mUnitSize;
|
||||||
|
|
||||||
|
/** Which is the up vector */
|
||||||
|
enum { UP_X, UP_Y, UP_Z } mUpDirection;
|
||||||
|
|
||||||
|
/** Collada file format version */
|
||||||
|
Collada::FormatVersion mFormat;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Check for element match
|
||||||
|
inline bool ColladaParser::IsElement( const char* pName) const
|
||||||
|
{
|
||||||
|
ai_assert( mReader->getNodeType() == irr::io::EXN_ELEMENT);
|
||||||
|
return ::strcmp( mReader->getNodeName(), pName) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Finds the item in the given library by its reference, throws if not found
|
||||||
|
template <typename Type>
|
||||||
|
const Type& ColladaParser::ResolveLibraryReference( const std::map<std::string, Type>& pLibrary, const std::string& pURL) const
|
||||||
|
{
|
||||||
|
typename std::map<std::string, Type>::const_iterator it = pLibrary.find( pURL);
|
||||||
|
if( it == pLibrary.end())
|
||||||
|
ThrowException( boost::str( boost::format( "Unable to resolve library reference \"%s\".") % pURL));
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end of namespace Assimp
|
||||||
|
|
||||||
|
#endif // AI_COLLADAPARSER_H_INC
|
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,12 +43,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the Collada parser helper
|
* @brief Implementation of the Collada parser helper
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
#include "ColladaParser.h"
|
#include "ColladaParser.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/light.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::Collada;
|
using namespace Assimp::Collada;
|
||||||
|
@ -1224,6 +1231,14 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
|
||||||
ReadEffectColor( pEffect.mReflective, pEffect.mTexReflective);
|
ReadEffectColor( pEffect.mReflective, pEffect.mTexReflective);
|
||||||
}
|
}
|
||||||
else if( IsElement( "transparent")) {
|
else if( IsElement( "transparent")) {
|
||||||
|
pEffect.mHasTransparency = true;
|
||||||
|
|
||||||
|
// In RGB_ZERO mode, the transparency is interpreted in reverse, go figure...
|
||||||
|
if(::strcmp(mReader->getAttributeValueSafe("opaque"), "RGB_ZERO") == 0) {
|
||||||
|
// TODO: handle RGB_ZERO mode completely
|
||||||
|
pEffect.mRGBTransparency = true;
|
||||||
|
}
|
||||||
|
|
||||||
ReadEffectColor( pEffect.mTransparent,pEffect.mTexTransparent);
|
ReadEffectColor( pEffect.mTransparent,pEffect.mTexTransparent);
|
||||||
}
|
}
|
||||||
else if( IsElement( "shininess"))
|
else if( IsElement( "shininess"))
|
||||||
|
@ -1982,10 +1997,12 @@ void ColladaParser::ReadIndexData( Mesh* pMesh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// small sanity check
|
#ifdef ASSIMP_BUILD_DEBUG
|
||||||
if (primType != Prim_TriFans && primType != Prim_TriStrips &&
|
if (primType != Prim_TriFans && primType != Prim_TriStrips &&
|
||||||
primType != Prim_Lines) // this is ONLY to workaround a bug in SketchUp 15.3.331 where it writes the wrong 'count' when it writes out the 'lines'.
|
primType != Prim_Lines) { // this is ONLY to workaround a bug in SketchUp 15.3.331 where it writes the wrong 'count' when it writes out the 'lines'.
|
||||||
ai_assert(actualPrimitives == numPrimitives);
|
ai_assert(actualPrimitives == numPrimitives);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// only when we're done reading all <p> tags (and thus know the final vertex count) can we commit the submesh
|
// only when we're done reading all <p> tags (and thus know the final vertex count) can we commit the submesh
|
||||||
subgroup.mNumFaces = actualPrimitives;
|
subgroup.mNumFaces = actualPrimitives;
|
||||||
|
@ -2702,7 +2719,6 @@ AI_WONT_RETURN void ColladaParser::ThrowException( const std::string& pError) co
|
||||||
{
|
{
|
||||||
throw DeadlyImportError( boost::str( boost::format( "Collada: %s - %s") % mFileName % pError));
|
throw DeadlyImportError( boost::str( boost::format( "Collada: %s - %s") % mFileName % pError));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColladaParser::ReportWarning(const char* msg,...)
|
void ColladaParser::ReportWarning(const char* msg,...)
|
||||||
{
|
{
|
||||||
ai_assert(NULL != msg);
|
ai_assert(NULL != msg);
|
||||||
|
@ -2718,6 +2734,7 @@ void ColladaParser::ReportWarning(const char* msg,...)
|
||||||
DefaultLogger::get()->warn("Validation warning: " + std::string(szBuffer,iLen));
|
DefaultLogger::get()->warn("Validation warning: " + std::string(szBuffer,iLen));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Skips all data until the end node of the current element
|
// Skips all data until the end node of the current element
|
||||||
void ColladaParser::SkipElement()
|
void ColladaParser::SkipElement()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -47,6 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
#include "ColladaHelper.h"
|
#include "ColladaHelper.h"
|
||||||
|
#include "../include/assimp/ai_assert.h"
|
||||||
|
#include <boost/format.hpp>
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file GenUVCoords step */
|
/** @file GenUVCoords step */
|
||||||
|
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#include "ComputeUVMappingProcess.h"
|
#include "ComputeUVMappingProcess.h"
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
|
#include "Exceptional.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ void ComputeUVMappingProcess::Execute( aiScene* pScene)
|
||||||
{
|
{
|
||||||
if (!DefaultLogger::isNullLogger())
|
if (!DefaultLogger::isNullLogger())
|
||||||
{
|
{
|
||||||
sprintf(buffer, "Found non-UV mapped texture (%s,%i). Mapping type: %s",
|
sprintf(buffer, "Found non-UV mapped texture (%s,%u). Mapping type: %s",
|
||||||
TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex,
|
TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex,
|
||||||
MappingTypeToString(mapping));
|
MappingTypeToString(mapping));
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,8 +45,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include "../include/assimp/mesh.h"
|
||||||
|
#include "../include/assimp/material.h"
|
||||||
|
#include "../include/assimp/types.h"
|
||||||
|
|
||||||
class ComputeUVMappingTest;
|
class ComputeUVMappingTest;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -47,8 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* better location.
|
* better location.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include "../include/assimp/postprocess.h"
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +54,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
struct aiNodeAnim;
|
struct aiNodeAnim;
|
||||||
|
struct aiNode;
|
||||||
|
struct aiMaterial;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "LineSplitter.h"
|
#include "LineSplitter.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
|
#include "fast_atof.h"
|
||||||
|
#include <vector>
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace DXF {
|
namespace DXF {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the DXF importer class
|
* @brief Implementation of the DXF importer class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
|
||||||
|
|
||||||
#include "DXFLoader.h"
|
#include "DXFLoader.h"
|
||||||
|
@ -52,6 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
|
||||||
#include "DXFHelper.h"
|
#include "DXFHelper.h"
|
||||||
|
#include "../include/assimp/IOSystem.hpp"
|
||||||
|
#include "../include/assimp/scene.h"
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,11 +41,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/// @file DeboneProcess.cpp
|
/// @file DeboneProcess.cpp
|
||||||
/** Implementation of the DeboneProcess post processing step */
|
/** Implementation of the DeboneProcess post processing step */
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
// internal headers of the post-processing framework
|
// internal headers of the post-processing framework
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
#include "DeboneProcess.h"
|
#include "DeboneProcess.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
@ -146,7 +147,7 @@ void DeboneProcess::Execute( aiScene* pScene)
|
||||||
|
|
||||||
if(!DefaultLogger::isNullLogger()) {
|
if(!DefaultLogger::isNullLogger()) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
::sprintf(buffer,"Removed %i bones. Input bones: %i. Output bones: %i",in-out,in,out);
|
::sprintf(buffer,"Removed %u bones. Input bones: %u. Output bones: %u",in-out,in,out);
|
||||||
DefaultLogger::get()->info(buffer);
|
DefaultLogger::get()->info(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -42,9 +42,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Default File I/O implementation for #Importer
|
* @brief Default File I/O implementation for #Importer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
|
||||||
|
|
||||||
|
#include "../include/assimp/ai_assert.h"
|
||||||
#include "DefaultIOStream.h"
|
#include "DefaultIOStream.h"
|
||||||
|
#include <boost/static_assert.hpp>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,6 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include "../include/assimp/IOStream.hpp"
|
||||||
|
#include "../include/assimp/importerdesc.h"
|
||||||
|
#include "Defines.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -40,11 +40,14 @@ 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 "AssimpPCH.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "DefaultIOSystem.h"
|
#include "DefaultIOSystem.h"
|
||||||
#include "DefaultIOStream.h"
|
#include "DefaultIOStream.h"
|
||||||
|
#include "StringComparison.h"
|
||||||
|
|
||||||
|
#include "../include/assimp/DefaultLogger.hpp"
|
||||||
|
#include "../include/assimp/ai_assert.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -164,4 +167,31 @@ bool DefaultIOSystem::ComparePaths (const char* one, const char* second) const
|
||||||
return !ASSIMP_stricmp(temp1,temp2);
|
return !ASSIMP_stricmp(temp1,temp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string DefaultIOSystem::fileName(std::string path)
|
||||||
|
{
|
||||||
|
std::string ret = path;
|
||||||
|
std::size_t last = ret.find_last_of("\\/");
|
||||||
|
if (last != std::string::npos) ret = ret.substr(last + 1);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string DefaultIOSystem::completeBaseName(std::string path)
|
||||||
|
{
|
||||||
|
std::string ret = fileName(path);
|
||||||
|
std::size_t pos = ret.find_last_of('.');
|
||||||
|
if(pos != ret.npos) ret = ret.substr(0, pos);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string DefaultIOSystem::absolutePath(std::string path)
|
||||||
|
{
|
||||||
|
std::string ret = path;
|
||||||
|
std::size_t last = ret.find_last_of("\\/");
|
||||||
|
if (last != std::string::npos) ret = ret.substr(0, last);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#undef PATHLIMIT
|
#undef PATHLIMIT
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2015, 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,
|
||||||
|
@ -76,6 +76,21 @@ public:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Compare two paths */
|
/** Compare two paths */
|
||||||
bool ComparePaths (const char* one, const char* second) const;
|
bool ComparePaths (const char* one, const char* second) const;
|
||||||
|
|
||||||
|
/** @brief get the file name of a full filepath
|
||||||
|
* example: /tmp/archive.tar.gz -> archive.tar.gz
|
||||||
|
*/
|
||||||
|
static std::string fileName(std::string path);
|
||||||
|
|
||||||
|
/** @brief get the complete base name of a full filepath
|
||||||
|
* example: /tmp/archive.tar.gz -> archive.tar
|
||||||
|
*/
|
||||||
|
static std::string completeBaseName(std::string path);
|
||||||
|
|
||||||
|
/** @brief get the path of a full filepath
|
||||||
|
* example: /tmp/archive.tar.gz -> /tmp/
|
||||||
|
*/
|
||||||
|
static std::string absolutePath(std::string path);
|
||||||
};
|
};
|
||||||
|
|
||||||
} //!ns Assimp
|
} //!ns Assimp
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue