Compare commits

..

30 Commits

Author SHA1 Message Date
Kim Kulling
eb8639d7c8 CHANGES: add documentation of featureset for 4.0.1 2017-07-28 22:33:41 +02:00
Kim Kulling
3fe8c72f5d new release: update to 4.0.1. 2017-07-28 22:27:36 +02:00
Kim Kulling
6c526d7c64 PPdPmdParser: fix compilation for clang. 2017-07-28 22:23:08 +02:00
Kim Kulling
d052b74b96 Merge branch 'master' of https://github.com/assimp/assimp 2017-07-27 20:49:54 +02:00
Kim Kulling
a2bbf76cf4 StreamReader: fix out-of-range exception 2017-07-27 20:49:49 +02:00
Kim Kulling
4b860dfc42 fix build second try 2017-07-27 13:31:22 +02:00
Kim Kulling
d74306ad67 fix build 2017-07-27 13:07:26 +02:00
Kim Kulling
cf0a83de17 unittests: fix build. 2017-07-25 09:46:54 +02:00
Kim Kulling
4013b319af unittests: add missing include to utProfiler. 2017-07-25 09:38:35 +02:00
Kim Kulling
256f28432a unittests: fix the build again. 2017-07-25 09:37:28 +02:00
Kim Kulling
4dc2cd8442 Profiler: fix invalid using statement. 2017-07-25 08:54:29 +02:00
Kim Kulling
2cb1a9efc6 Profiler: add a unittest. 2017-07-25 00:00:43 +02:00
Alexander Gessler
6bf68e063f Merge pull request #1355 from RodrigoFigueroaM/patch-1
Added support for python3
2017-07-23 01:57:57 +02:00
Alexander Gessler
96cb3f7140 Merge pull request #1359 from sacereda/profilerLogging
Elapsed seconds not shown correctly
2017-07-23 01:56:22 +02:00
Alexander Gessler
ae9755286a Merge pull request #1358 from sacereda/optimizeMeshes
Low performance in OptimizeMeshesProcess with huge number of meshes
2017-07-23 01:55:40 +02:00
Sergio Acereda
6429502fc5 Elapsed seconds not shown correctly 2017-07-22 23:31:10 +02:00
Sergio Acereda
8606ec6060 Low performance in OptimizeMeshesProcess::ProcessNode with huge number of aiMeshes 2017-07-22 23:28:55 +02:00
Kim Kulling
5ce614be3b Merge pull request #1356 from assimp/fix_osx_travis
travis: check if cmake is installed with brew.
2017-07-21 19:45:49 +02:00
Kim Kulling
d150874f06 travis: next try. 2017-07-21 19:10:32 +02:00
Kim Kulling
e94bbe7e0a travis: fix dev/null access. 2017-07-21 18:58:55 +02:00
Kim Kulling
501f09307c travis: fix brew ls command. 2017-07-21 18:55:25 +02:00
Kim Kulling
e7afc8baf3 travis: add next missing selicolon. 2017-07-21 14:37:42 +02:00
Kim Kulling
11e9173a09 travis: add missing semicolon in if-then statement. 2017-07-21 13:21:31 +02:00
Kim Kulling
91f888a254 travis: add missing semicolons. 2017-07-21 12:36:10 +02:00
Kim Kulling
f7a7e57807 travis: check if cmake is installed with brew. 2017-07-21 12:03:09 +02:00
rodrigo figueroa
01a288ff35 Added support for python3
When using python3 and running any of the provided scripts I get:
NameError: name 'unicode' is not defined.  Python3 does not have unicode. Using try-except method helps to support python3
2017-07-20 22:48:07 -07:00
Kim Kulling
0ef54bbbef Merge pull request #1352 from sacereda/master
not compiling when using ASSIMP_DOUBLE_PRECISION
2017-07-20 18:48:32 +02:00
Sergio Acereda
a965414ceb not compiling when using ASSIMP_DOUBLE_PRECISION 2017-07-19 14:05:54 +02:00
Kim Kulling
b394546e55 unittests: fix typo. 2017-07-18 20:53:47 +02:00
Kim Kulling
6f9dabe49c unittests: fix version test. 2017-07-18 20:42:55 +02:00
18 changed files with 263 additions and 40 deletions

View File

@@ -3,7 +3,15 @@ language: cpp
before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq && sudo apt-get install cmake && sudo apt-get install cmake python3 && sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install cmake python3 homebrew/x11/freeglut; fi
- 'if [ "$TRAVIS_OS_NAME" = "osx" ]; then
if brew ls --versions cmake > /dev/null; then
echo cmake already installed.;
else
brew install cmake;
fi;
brew install python3;
brew install homebrew/x11/freeglut;
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
# install latest LCOV (1.9 was failing)
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ${TRAVIS_BUILD_DIR} && wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz && tar xf lcov_1.11.orig.tar.gz && sudo make -C lcov-1.11/ install && gem install coveralls-lcov && lcov --version && g++ --version ; fi

12
CHANGES
View File

@@ -1,6 +1,18 @@
----------------------------------------------------------------------
CHANGELOG
----------------------------------------------------------------------
4.0.1 (2017-07-28)
- FIXES/HOUSEKEEPING:
- fix version test.
- Not compiling when using ASSIMP_DOUBLE_PRECISION
- Added support for python3
- Check if cmake is installed with brew
- Low performance in OptimizeMeshesProcess::ProcessNode with huge numbers of meshes
- Elapsed seconds not shown correctly
- StreamReader: fix out-of-range exception
- PPdPmdParser: fix compilation for clang
4.0.0 (2017-07-18)
FEATURES:

View File

@@ -106,7 +106,7 @@ ENDIF(NOT BUILD_SHARED_LIBS)
# Define here the needed parameters
SET (ASSIMP_VERSION_MAJOR 4)
SET (ASSIMP_VERSION_MINOR 0)
SET (ASSIMP_VERSION_PATCH 0) # subversion revision?
SET (ASSIMP_VERSION_PATCH 1) # subversion revision?
SET (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
SET (ASSIMP_SOVERSION 4)
SET (PROJECT_VERSION "${ASSIMP_VERSION}")

View File

@@ -50,12 +50,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FBXDocument.h"
#include "FBXImporter.h"
#include "FBXDocumentUtil.h"
#include "FBXProperties.h"
namespace Assimp {
namespace FBX {
using namespace Util;
using namespace Util;
// ------------------------------------------------------------------------------------------------
AnimationCurve::AnimationCurve(uint64_t id, const Element& element, const std::string& name, const Document& /*doc*/)

View File

@@ -284,11 +284,17 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
return true;
}
static
inline
bool isEndOfCache( size_t pos, size_t cacheSize ) {
return ( pos == cacheSize );
}
template<class T>
inline
bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
buffer.resize(m_cacheSize);
if (m_cachePos == m_cacheSize || 0 == m_filePos) {
if ( isEndOfCache( m_cachePos, m_cacheSize ) || 0 == m_filePos) {
if (!readNextBlock()) {
return false;
}
@@ -300,11 +306,16 @@ bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
++m_cachePos;
}
++m_cachePos;
if ( isEndOfCache( m_cachePos, m_cacheSize ) ) {
if ( !readNextBlock() ) {
return false;
}
}
}
size_t i = 0;
while (!IsLineEnd(m_cache[m_cachePos])) {
buffer[i] = m_cache[m_cachePos];
while (!IsLineEnd(m_cache[ m_cachePos ])) {
buffer[i] = m_cache[ m_cachePos ];
m_cachePos++;
i++;
if (m_cachePos >= m_cacheSize) {

View File

@@ -158,7 +158,7 @@ namespace pmd
sphere_filename.clear();
}
else {
*pstar = (char)NULL;
*pstar = 0;
texture_filename = std::string(buffer);
sphere_filename = std::string(pstar+1);
}

View File

@@ -181,11 +181,8 @@ void OptimizeMeshesProcess::ProcessNode( aiNode* pNode)
verts += mScene->mMeshes[am]->mNumVertices;
faces += mScene->mMeshes[am]->mNumFaces;
pNode->mMeshes[a] = pNode->mMeshes[pNode->mNumMeshes - 1];
--pNode->mNumMeshes;
for( unsigned int n = a; n < pNode->mNumMeshes; ++n ) {
pNode->mMeshes[ n ] = pNode->mMeshes[ n + 1 ];
}
--a;
}
}

View File

@@ -52,21 +52,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <map>
namespace Assimp {
namespace Profiling {
using namespace Formatter;
namespace Profiling {
using namespace Formatter;
// ------------------------------------------------------------------------------------------------
/** Simple wrapper around boost::timer to simplify reporting. Timings are automatically
* dumped to the log file.
*/
class Profiler
{
class Profiler {
public:
Profiler() {}
Profiler() {
// empty
}
public:
@@ -84,17 +82,17 @@ public:
return;
}
auto elapsedSeconds = std::chrono::system_clock::now() - regions[region];
std::chrono::duration<double> elapsedSeconds = std::chrono::system_clock::now() - regions[region];
DefaultLogger::get()->debug((format("END `"),region,"`, dt= ", elapsedSeconds.count()," s"));
}
private:
typedef std::map<std::string,std::chrono::time_point<std::chrono::system_clock>> RegionMap;
RegionMap regions;
};
}
}
}
#endif

View File

@@ -107,8 +107,7 @@ ASSIMP_API unsigned int aiGetCompileFlags () {
#include "revision.h"
// ------------------------------------------------------------------------------------------------
ASSIMP_API unsigned int aiGetVersionRevision ()
{
ASSIMP_API unsigned int aiGetVersionRevision() {
return GitVersion;
}
@@ -133,8 +132,7 @@ ASSIMP_API aiScene::aiScene()
}
// ------------------------------------------------------------------------------------------------
ASSIMP_API aiScene::~aiScene()
{
ASSIMP_API aiScene::~aiScene() {
// delete all sub-objects recursively
delete mRootNode;
@@ -173,3 +171,4 @@ ASSIMP_API aiScene::~aiScene()
delete static_cast<Assimp::ScenePrivateData*>( mPrivate );
}

View File

@@ -64,12 +64,11 @@ class ASSIMP_API LogStream
{
protected:
/** @brief Default constructor */
LogStream() {
}
LogStream();
public:
/** @brief Virtual destructor */
virtual ~LogStream() {
}
virtual ~LogStream();
// -------------------------------------------------------------------
/** @brief Overwrite this for your own output methods
@@ -94,6 +93,17 @@ public:
IOSystem* io = NULL);
}; // !class LogStream
inline
LogStream::LogStream() {
// empty
}
inline
LogStream::~LogStream() {
// empty
}
// ------------------------------------------------------------------------------------
} // Namespace Assimp

View File

@@ -417,7 +417,7 @@ ASSIMP_API void aiSetImportPropertyInteger(
ASSIMP_API void aiSetImportPropertyFloat(
C_STRUCT aiPropertyStore* store,
const char* szName,
float value);
ai_real value);
// --------------------------------------------------------------------------------
/** Set a string property.

View File

@@ -105,3 +105,4 @@ ASSIMP_API unsigned int aiGetCompileFlags (void);
#endif
#endif // !! #ifndef AI_VERSION_H_INC

View File

@@ -119,7 +119,10 @@ def _init(self, target = None, parent = None):
if m == 'mName':
obj = self.mName
uni = unicode(obj.data, errors='ignore')
try:
uni = unicode(obj.data, errors='ignore')
except:
uni = str(obj.data, errors='ignore')
target.name = str( uni )
target.__class__.__repr__ = lambda x: str(x.__class__) + "(" + x.name + ")"
target.__class__.__str__ = lambda x: x.name
@@ -440,7 +443,10 @@ def _get_properties(properties, length):
for p in [properties[i] for i in range(length)]:
#the name
p = p.contents
uni = unicode(p.mKey.data, errors='ignore')
try:
uni = unicode(p.mKey.data, errors='ignore')
except:
uni = str(p.mKey.data, errors='ignore')
key = (str(uni).split('.')[1], p.mSemantic)
#the data
@@ -449,7 +455,10 @@ def _get_properties(properties, length):
arr = cast(p.mData, POINTER(c_float * int(p.mDataLength/sizeof(c_float)) )).contents
value = [x for x in arr]
elif p.mType == 3: #string can't be an array
uni = unicode(cast(p.mData, POINTER(structs.MaterialPropertyString)).contents.data, errors='ignore')
try:
uni = unicode(cast(p.mData, POINTER(structs.MaterialPropertyString)).contents.data, errors='ignore')
except:
uni = str(cast(p.mData, POINTER(structs.MaterialPropertyString)).contents.data, errors='ignore')
value = uni
elif p.mType == 4:
@@ -476,3 +485,4 @@ def decompose_matrix(matrix):
from ctypes import byref, pointer
_assimp_lib.dll.aiDecomposeMatrix(pointer(matrix), byref(scaling), byref(rotation), byref(position))
return scaling._init(), rotation._init(), position._init()

View File

@@ -57,6 +57,7 @@ SOURCE_GROUP( unit FILES
)
SET( TEST_SRCS
unit/UTLogStream.h
unit/AbstractImportExportBase.cpp
unit/TestIOSystem.h
unit/TestModelFactory.h
@@ -129,6 +130,7 @@ SET( TEST_SRCS
unit/utVector3.cpp
unit/utXImporterExporter.cpp
unit/utD3MFImportExport.cpp
unit/utProfiler.cpp
)
SOURCE_GROUP( tests FILES ${TEST_SRCS} )

63
test/unit/UTLogStream.h Normal file
View File

@@ -0,0 +1,63 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#pragma once
#include <assimp/LogStream.hpp>
class UTLogStream : public Assimp::LogStream {
public:
UTLogStream()
: LogStream() {
// empty
}
virtual ~UTLogStream() {
// empty
}
virtual void write(const char* message) {
if ( nullptr != message ) {
m_messages.push_back( std::string( message ) );
}
}
std::vector<std::string> m_messages;
};

View File

@@ -1,8 +1,44 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team
// #ifndef ASSIMP_BUILD_SINGLETHREADED
// # include <boost/thread.hpp>
// #endif
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.
---------------------------------------------------------------------------
*/
#pragma once
// We need to be sure to have the same STL settings as Assimp
@@ -10,6 +46,7 @@
#include <gtest/gtest.h>
#include <memory>
#include <math.h>
#include "UTLogStream.h"
#undef min
#undef max

76
test/unit/utProfiler.cpp Normal file
View File

@@ -0,0 +1,76 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#include "UnitTestPCH.h"
#include "UTLogStream.h"
#include "code/Profiler.h"
#include <assimp/DefaultLogger.hpp>
using namespace ::Assimp;
using namespace ::Assimp::Profiling;
class utProfiler : public ::testing::Test {
public:
LogStream *m_stream;
/*virtual void SetUp() {
m_stream = new UTLogStream;
DefaultLogger::create();
DefaultLogger::get()->attachStream( m_stream );
}
virtual void TearDown() {
DefaultLogger::get()->detatchStream( m_stream );
m_stream = nullptr;
}*/
};
TEST_F( utProfiler, addRegion_success ) {
Profiler myProfiler;
myProfiler.BeginRegion( "t1" );
for ( int i=0; i<10; i++ ) {
volatile int j=0;
j++;
}
myProfiler.EndRegion( "t1" );
//UTLogStream *stream( (UTLogStream*) m_stream );
//EXPECT_FALSE( stream->m_messages.empty() );
}

View File

@@ -54,11 +54,11 @@ TEST_F( utVersion, aiGetLegalStringTest ) {
}
TEST_F( utVersion, aiGetVersionMinorTest ) {
EXPECT_EQ( aiGetVersionMinor(), 3U );
EXPECT_EQ( aiGetVersionMinor(), 0U );
}
TEST_F( utVersion, aiGetVersionMajorTest ) {
EXPECT_EQ( aiGetVersionMajor(), 3U );
EXPECT_EQ( aiGetVersionMajor(), 4U );
}
TEST_F( utVersion, aiGetCompileFlagsTest ) {