2008-06-15 10:27:08 +00:00
|
|
|
/*
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
Open Asset Import Library (ASSIMP)
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Copyright (c) 2006-2008, ASSIMP Development 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 Development 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.
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
/** @file ValidateDataStructure.cpp
|
|
|
|
* @brief Implementation of the post processing step to validate
|
|
|
|
* the data structure returned by Assimp.
|
2008-06-15 10:27:08 +00:00
|
|
|
*/
|
2008-07-18 20:29:46 +00:00
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
#include "AssimpPCH.h"
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-07-18 20:29:46 +00:00
|
|
|
// internal headers
|
2008-06-15 10:27:08 +00:00
|
|
|
#include "ValidateDataStructure.h"
|
|
|
|
#include "BaseImporter.h"
|
|
|
|
#include "fast_atof.h"
|
2009-03-11 22:56:16 +00:00
|
|
|
#include "ProcessHelper.h"
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-07-18 20:29:46 +00:00
|
|
|
// CRT headers
|
2008-06-15 10:27:08 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
using namespace Assimp;
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
// Constructor to be privately used by Importer
|
|
|
|
ValidateDSProcess::ValidateDSProcess()
|
2009-03-11 22:56:16 +00:00
|
|
|
{}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
// Destructor, private as well
|
|
|
|
ValidateDSProcess::~ValidateDSProcess()
|
2009-03-11 22:56:16 +00:00
|
|
|
{}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
// Returns whether the processing step is present in the given flag field.
|
|
|
|
bool ValidateDSProcess::IsActive( unsigned int pFlags) const
|
|
|
|
{
|
|
|
|
return (pFlags & aiProcess_ValidateDataStructure) != 0;
|
|
|
|
}
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::ReportError(const char* msg,...)
|
|
|
|
{
|
|
|
|
ai_assert(NULL != msg);
|
|
|
|
|
|
|
|
va_list args;
|
|
|
|
va_start(args,msg);
|
|
|
|
|
|
|
|
char szBuffer[3000];
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
const int iLen = vsprintf(szBuffer,msg,args);
|
|
|
|
ai_assert(iLen > 0);
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
va_end(args);
|
2008-10-13 16:45:48 +00:00
|
|
|
#ifdef _DEBUG
|
|
|
|
aiAssert( false,szBuffer,__LINE__,__FILE__ );
|
|
|
|
#endif
|
2008-06-15 10:27:08 +00:00
|
|
|
throw new ImportErrorException("Validation failed: " + std::string(szBuffer,iLen));
|
|
|
|
}
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::ReportWarning(const char* msg,...)
|
|
|
|
{
|
|
|
|
ai_assert(NULL != msg);
|
|
|
|
|
|
|
|
va_list args;
|
|
|
|
va_start(args,msg);
|
|
|
|
|
|
|
|
char szBuffer[3000];
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
const int iLen = vsprintf(szBuffer,msg,args);
|
|
|
|
ai_assert(iLen > 0);
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
va_end(args);
|
2008-07-18 20:29:46 +00:00
|
|
|
DefaultLogger::get()->warn("Validation warning: " + std::string(szBuffer,iLen));
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2008-10-19 11:32:33 +00:00
|
|
|
inline int HasNameMatch(const aiString& in, aiNode* node)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
int result = (node->mName == in ? 1 : 0 );
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
for (unsigned int i = 0; i < node->mNumChildren;++i) {
|
2008-10-19 11:32:33 +00:00
|
|
|
result += HasNameMatch(in,node->mChildren[i]);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
|
|
inline void ValidateDSProcess::DoValidation(T** parray, unsigned int size,
|
|
|
|
const char* firstName, const char* secondName)
|
|
|
|
{
|
|
|
|
// validate all entries
|
|
|
|
if (size)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
if (!parray)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::%s is NULL (aiScene::%s is %i)",
|
|
|
|
firstName, secondName, size);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
for (unsigned int i = 0; i < size;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
if (!parray[i])
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::%s[%i] is NULL (aiScene::%s is %i)",
|
|
|
|
firstName,i,secondName,size);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
Validate(parray[i]);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
|
|
inline void ValidateDSProcess::DoValidationEx(T** parray, unsigned int size,
|
|
|
|
const char* firstName, const char* secondName)
|
|
|
|
{
|
|
|
|
// validate all entries
|
|
|
|
if (size)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!parray) {
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::%s is NULL (aiScene::%s is %i)",
|
|
|
|
firstName, secondName, size);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
for (unsigned int i = 0; i < size;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
if (!parray[i])
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::%s[%i] is NULL (aiScene::%s is %i)",
|
|
|
|
firstName,i,secondName,size);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
Validate(parray[i]);
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// check whether there are duplicate names
|
|
|
|
for (unsigned int a = i+1; a < size;++a)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
if (parray[i]->mName == parray[a]->mName)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
this->ReportError("aiScene::%s[%i] has the same name as "
|
|
|
|
"aiScene::%s[%i]",firstName, i,secondName, a);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
|
|
inline void ValidateDSProcess::DoValidationWithNameCheck(T** array,
|
|
|
|
unsigned int size, const char* firstName,
|
|
|
|
const char* secondName)
|
|
|
|
{
|
|
|
|
// validate all entries
|
|
|
|
DoValidationEx(array,size,firstName,secondName);
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < size;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
int res = HasNameMatch(array[i]->mName,mScene->mRootNode);
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!res) {
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::%s[%i] has no corresponding node in the scene graph (%s)",
|
|
|
|
firstName,i,array[i]->mName.data);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (1 != res) {
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::%s[%i]: there are more than one nodes with %s as name",
|
|
|
|
firstName,i,array[i]->mName.data);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
// Executes the post processing step on the given imported data.
|
|
|
|
void ValidateDSProcess::Execute( aiScene* pScene)
|
|
|
|
{
|
|
|
|
this->mScene = pScene;
|
|
|
|
DefaultLogger::get()->debug("ValidateDataStructureProcess begin");
|
|
|
|
|
|
|
|
// validate the node graph of the scene
|
|
|
|
Validate(pScene->mRootNode);
|
|
|
|
|
|
|
|
// validate all meshes
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pScene->mNumMeshes) {
|
2008-10-19 11:32:33 +00:00
|
|
|
DoValidation(pScene->mMeshes,pScene->mNumMeshes,"mMeshes","mNumMeshes");
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (!(mScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE)) {
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::mNumMeshes is 0. At least one mesh must be there");
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (pScene->mMeshes) {
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiScene::mMeshes is non-null although there are no meshes");
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
// validate all animations
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pScene->mNumAnimations) {
|
2008-10-19 11:32:33 +00:00
|
|
|
DoValidation(pScene->mAnimations,pScene->mNumAnimations,
|
|
|
|
"mAnimations","mNumAnimations");
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (pScene->mAnimations) {
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiScene::mAnimations is non-null although there are no animations");
|
|
|
|
}
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// validate all cameras
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pScene->mNumCameras) {
|
2008-10-19 11:32:33 +00:00
|
|
|
DoValidationWithNameCheck(pScene->mCameras,pScene->mNumCameras,
|
|
|
|
"mCameras","mNumCameras");
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (pScene->mCameras) {
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiScene::mCameras is non-null although there are no cameras");
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// validate all lights
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pScene->mNumLights) {
|
2008-10-19 11:32:33 +00:00
|
|
|
DoValidationWithNameCheck(pScene->mLights,pScene->mNumLights,
|
|
|
|
"mLights","mNumLights");
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (pScene->mLights) {
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiScene::mLights is non-null although there are no lights");
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
// validate all materials
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pScene->mNumMaterials) {
|
2008-10-22 20:06:16 +00:00
|
|
|
DoValidation(pScene->mMaterials,pScene->mNumMaterials,"mMaterials","mNumMaterials");
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
#if 0
|
|
|
|
// NOTE: ScenePreprocessor generates a default material if none is there
|
|
|
|
else if (!(mScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE)) {
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiScene::mNumMaterials is 0. At least one material must be there");
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
#endif
|
|
|
|
else if (pScene->mMaterials) {
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiScene::mMaterials is non-null although there are no materials");
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// if (!has)ReportError("The aiScene data structure is empty");
|
2008-06-15 10:27:08 +00:00
|
|
|
DefaultLogger::get()->debug("ValidateDataStructureProcess end");
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiLight* pLight)
|
|
|
|
{
|
|
|
|
if (pLight->mType == aiLightSource_UNDEFINED)
|
2009-01-23 21:06:43 +00:00
|
|
|
ReportWarning("aiLight::mType is aiLightSource_UNDEFINED");
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
if (!pLight->mAttenuationConstant &&
|
|
|
|
!pLight->mAttenuationLinear &&
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
!pLight->mAttenuationQuadratic) {
|
2008-10-22 20:06:16 +00:00
|
|
|
ReportWarning("aiLight::mAttenuationXXX - all are zero");
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pLight->mAngleInnerCone > pLight->mAngleOuterCone)
|
|
|
|
ReportError("aiLight::mAngleInnerCone is larger than aiLight::mAngleOuterCone");
|
|
|
|
|
|
|
|
if (pLight->mColorDiffuse.IsBlack() && pLight->mColorAmbient.IsBlack()
|
|
|
|
&& pLight->mColorSpecular.IsBlack())
|
|
|
|
{
|
2008-10-22 20:06:16 +00:00
|
|
|
ReportWarning("aiLight::mColorXXX - all are black and won't have any influence");
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiCamera* pCamera)
|
|
|
|
{
|
|
|
|
if (pCamera->mClipPlaneFar <= pCamera->mClipPlaneNear)
|
|
|
|
ReportError("aiCamera::mClipPlaneFar must be >= aiCamera::mClipPlaneNear");
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// FIX: there are many 3ds files with invalid FOVs. No reason to
|
|
|
|
// reject them at all ... a warning is appropriate.
|
2008-10-19 11:32:33 +00:00
|
|
|
if (!pCamera->mHorizontalFOV || pCamera->mHorizontalFOV >= (float)AI_MATH_PI)
|
2009-01-23 21:06:43 +00:00
|
|
|
ReportWarning("%f is not a valid value for aiCamera::mHorizontalFOV",pCamera->mHorizontalFOV);
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiMesh* pMesh)
|
|
|
|
{
|
|
|
|
// validate the material index of the mesh
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (mScene->mNumMaterials && pMesh->mMaterialIndex >= mScene->mNumMaterials)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mMaterialIndex is invalid (value: %i maximum: %i)",
|
|
|
|
pMesh->mMaterialIndex,mScene->mNumMaterials-1);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
|
2008-09-30 20:20:56 +00:00
|
|
|
for (unsigned int i = 0; i < pMesh->mNumFaces; ++i)
|
|
|
|
{
|
|
|
|
aiFace& face = pMesh->mFaces[i];
|
|
|
|
|
|
|
|
if (pMesh->mPrimitiveTypes)
|
|
|
|
{
|
|
|
|
switch (face.mNumIndices)
|
|
|
|
{
|
|
|
|
case 0:
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mFaces[%i].mNumIndices is 0",i);
|
2008-09-30 20:20:56 +00:00
|
|
|
case 1:
|
|
|
|
if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_POINT))
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mFaces[%i] is a POINT but aiMesh::mPrimtiveTypes "
|
2008-09-30 20:20:56 +00:00
|
|
|
"does not report the POINT flag",i);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_LINE))
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mFaces[%i] is a LINE but aiMesh::mPrimtiveTypes "
|
2008-09-30 20:20:56 +00:00
|
|
|
"does not report the LINE flag",i);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE))
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mFaces[%i] is a TRIANGLE but aiMesh::mPrimtiveTypes "
|
2008-09-30 20:20:56 +00:00
|
|
|
"does not report the TRIANGLE flag",i);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_POLYGON))
|
|
|
|
{
|
|
|
|
this->ReportError("aiMesh::mFaces[%i] is a POLYGON but aiMesh::mPrimtiveTypes "
|
|
|
|
"does not report the POLYGON flag",i);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!face.mIndices)
|
|
|
|
ReportError("aiMesh::mFaces[%i].mIndices is NULL",i);
|
2008-09-30 20:20:56 +00:00
|
|
|
}
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// positions must always be there ...
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pMesh->mNumVertices || !pMesh->mVertices && !mScene->mFlags) {
|
|
|
|
ReportError("The mesh contains no vertices");
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
// if tangents are there there must also be bitangent vectors ...
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if ((pMesh->mTangents != NULL) != (pMesh->mBitangents != NULL)) {
|
|
|
|
ReportError("If there are tangents there must also be bitangent vectors");
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// faces, too
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pMesh->mNumFaces || !pMesh->mFaces && !mScene->mFlags) {
|
|
|
|
ReportError("The mesh contains no faces");
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// now check whether the face indexing layout is correct:
|
|
|
|
// unique vertices, pseudo-indexed.
|
|
|
|
std::vector<bool> abRefList;
|
|
|
|
abRefList.resize(pMesh->mNumVertices,false);
|
|
|
|
for (unsigned int i = 0; i < pMesh->mNumFaces;++i)
|
|
|
|
{
|
|
|
|
aiFace& face = pMesh->mFaces[i];
|
|
|
|
for (unsigned int a = 0; a < face.mNumIndices;++a)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (face.mIndices[a] >= pMesh->mNumVertices) {
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("aiMesh::mFaces[%i]::mIndices[%i] is out of range",i,a);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
// the MSB flag is temporarily used by the extra verbose
|
|
|
|
// mode to tell us that the JoinVerticesProcess might have
|
|
|
|
// been executed already.
|
|
|
|
if ( !(this->mScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT ) && abRefList[face.mIndices[a]])
|
|
|
|
{
|
|
|
|
ReportError("aiMesh::mVertices[%i] is referenced twice - second "
|
|
|
|
"time by aiMesh::mFaces[%i]::mIndices[%i]",face.mIndices[a],i,a);
|
|
|
|
}
|
|
|
|
abRefList[face.mIndices[a]] = true;
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
2008-10-22 20:06:16 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// check whether there are vertices that aren't referenced by a face
|
2008-10-22 20:06:16 +00:00
|
|
|
bool b = false;
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
for (unsigned int i = 0; i < pMesh->mNumVertices;++i) {
|
2008-10-22 20:06:16 +00:00
|
|
|
if (!abRefList[i])b = true;
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
|
|
|
abRefList.clear();
|
2008-10-22 20:06:16 +00:00
|
|
|
if (b)ReportWarning("There are unreferenced vertices");
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
// texture channel 2 may not be set if channel 1 is zero ...
|
|
|
|
{
|
|
|
|
unsigned int i = 0;
|
|
|
|
for (;i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
if (!pMesh->HasTextureCoords(i))break;
|
|
|
|
}
|
|
|
|
for (;i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
|
|
|
|
if (pMesh->HasTextureCoords(i))
|
2008-07-10 16:49:01 +00:00
|
|
|
{
|
2008-10-22 20:06:16 +00:00
|
|
|
ReportError("Texture coordinate channel %i exists "
|
2008-10-19 11:32:33 +00:00
|
|
|
"although the previous channel was NULL.",i);
|
2008-07-10 16:49:01 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
|
|
|
// the same for the vertex colors
|
|
|
|
{
|
|
|
|
unsigned int i = 0;
|
|
|
|
for (;i < AI_MAX_NUMBER_OF_COLOR_SETS;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
if (!pMesh->HasVertexColors(i))break;
|
|
|
|
}
|
|
|
|
for (;i < AI_MAX_NUMBER_OF_COLOR_SETS;++i)
|
|
|
|
if (pMesh->HasVertexColors(i))
|
2008-07-10 16:49:01 +00:00
|
|
|
{
|
2008-10-22 20:06:16 +00:00
|
|
|
ReportError("Vertex color channel %i is exists "
|
2008-10-19 11:32:33 +00:00
|
|
|
"although the previous channel was NULL.",i);
|
2008-07-10 16:49:01 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// now validate all bones
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
if (pMesh->mNumBones)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
|
|
|
if (!pMesh->mBones)
|
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportError("aiMesh::mBones is NULL (aiMesh::mNumBones is %i)",
|
2008-06-15 10:27:08 +00:00
|
|
|
pMesh->mNumBones);
|
|
|
|
}
|
2008-07-10 16:49:01 +00:00
|
|
|
float* afSum = NULL;
|
|
|
|
if (pMesh->mNumVertices)
|
|
|
|
{
|
|
|
|
afSum = new float[pMesh->mNumVertices];
|
|
|
|
for (unsigned int i = 0; i < pMesh->mNumVertices;++i)
|
|
|
|
afSum[i] = 0.0f;
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
// check whether there are duplicate bone names
|
|
|
|
for (unsigned int i = 0; i < pMesh->mNumBones;++i)
|
|
|
|
{
|
|
|
|
if (!pMesh->mBones[i])
|
|
|
|
{
|
2008-08-06 23:01:38 +00:00
|
|
|
delete[] afSum;
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mBones[%i] is NULL (aiMesh::mNumBones is %i)",
|
2008-06-15 10:27:08 +00:00
|
|
|
i,pMesh->mNumBones);
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
Validate(pMesh,pMesh->mBones[i],afSum);
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
for (unsigned int a = i+1; a < pMesh->mNumBones;++a)
|
|
|
|
{
|
|
|
|
if (pMesh->mBones[i]->mName == pMesh->mBones[a]->mName)
|
|
|
|
{
|
2008-08-06 23:01:38 +00:00
|
|
|
delete[] afSum;
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiMesh::mBones[%i] has the same name as "
|
2008-06-15 10:27:08 +00:00
|
|
|
"aiMesh::mBones[%i]",i,a);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-07-10 16:49:01 +00:00
|
|
|
// check whether all bone weights for a vertex sum to 1.0 ...
|
|
|
|
for (unsigned int i = 0; i < pMesh->mNumVertices;++i)
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (afSum[i] && (afSum[i] <= 0.94 || afSum[i] >= 1.05)) {
|
2008-10-19 11:32:33 +00:00
|
|
|
ReportWarning("aiMesh::mVertices[%i]: bone weight sum != 1.0 (sum is %f)",i,afSum[i]);
|
2008-07-10 16:49:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
delete[] afSum;
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
else if (pMesh->mBones)
|
|
|
|
{
|
|
|
|
ReportError("aiMesh::mBones is non-null although there are no bones");
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiMesh* pMesh,
|
2008-07-10 16:49:01 +00:00
|
|
|
const aiBone* pBone,float* afSum)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-06-22 10:09:26 +00:00
|
|
|
this->Validate(&pBone->mName);
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pBone->mNumWeights) {
|
|
|
|
ReportError("aiBone::mNumWeights is zero");
|
2008-08-07 20:55:59 +00:00
|
|
|
}
|
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// check whether all vertices affected by this bone are valid
|
|
|
|
for (unsigned int i = 0; i < pBone->mNumWeights;++i)
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pBone->mWeights[i].mVertexId >= pMesh->mNumVertices) {
|
|
|
|
ReportError("aiBone::mWeights[%i].mVertexId is out of range",i);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (!pBone->mWeights[i].mWeight || pBone->mWeights[i].mWeight > 1.0f) {
|
|
|
|
ReportWarning("aiBone::mWeights[%i].mWeight has an invalid value",i);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-07-10 16:49:01 +00:00
|
|
|
afSum[pBone->mWeights[i].mVertexId] += pBone->mWeights[i].mWeight;
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiAnimation* pAnimation)
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
Validate(&pAnimation->mName);
|
2008-06-22 10:09:26 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// validate all materials
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (pAnimation->mNumChannels)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pAnimation->mChannels) {
|
|
|
|
ReportError("aiAnimation::mChannels is NULL (aiAnimation::mNumChannels is %i)",
|
2008-09-30 13:05:48 +00:00
|
|
|
pAnimation->mNumChannels);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-09-30 13:05:48 +00:00
|
|
|
for (unsigned int i = 0; i < pAnimation->mNumChannels;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-09-30 13:05:48 +00:00
|
|
|
if (!pAnimation->mChannels[i])
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
ReportError("aiAnimation::mChannels[%i] is NULL (aiAnimation::mNumChannels is %i)",
|
2008-09-30 13:05:48 +00:00
|
|
|
i, pAnimation->mNumChannels);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
Validate(pAnimation, pAnimation->mChannels[i]);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there.");
|
2008-08-02 13:20:41 +00:00
|
|
|
|
|
|
|
// Animation duration is allowed to be zero in cases where the anim contains only a single key frame.
|
|
|
|
// if (!pAnimation->mDuration)this->ReportError("aiAnimation::mDuration is zero");
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureType type)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2009-03-11 22:56:16 +00:00
|
|
|
const char* szType = TextureTypeToString(type);
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
// ****************************************************************************
|
|
|
|
// Search all keys of the material ...
|
|
|
|
// textures must be specified with ascending indices
|
|
|
|
// (e.g. diffuse #2 may not be specified if diffuse #1 is not there ...)
|
|
|
|
// ****************************************************************************
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
int iNumIndices = 0;
|
|
|
|
int iIndex = -1;
|
|
|
|
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
|
|
|
|
{
|
|
|
|
aiMaterialProperty* prop = pMaterial->mProperties[i];
|
2009-02-15 20:29:07 +00:00
|
|
|
if (!::strcmp(prop->mKey.data,"$tex.file") && prop->mSemantic == type) {
|
2008-11-16 21:56:45 +00:00
|
|
|
iIndex = std::max(iIndex, (int) prop->mIndex);
|
|
|
|
++iNumIndices;
|
2008-06-15 10:27:08 +00:00
|
|
|
|
|
|
|
if (aiPTI_String != prop->mType)
|
2009-02-15 20:29:07 +00:00
|
|
|
ReportError("Material property %s is expected to be a string",prop->mKey.data);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-15 20:29:07 +00:00
|
|
|
if (iIndex +1 != iNumIndices) {
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("%s #%i is set, but there are only %i %s textures",
|
2008-06-15 10:27:08 +00:00
|
|
|
szType,iIndex,iNumIndices,szType);
|
|
|
|
}
|
2008-10-22 20:06:16 +00:00
|
|
|
if (!iNumIndices)return;
|
2008-11-16 21:56:45 +00:00
|
|
|
std::vector<aiTextureMapping> mappings(iNumIndices);
|
2008-10-22 20:06:16 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
// Now check whether all UV indices are valid ...
|
2008-10-22 20:06:16 +00:00
|
|
|
bool bNoSpecified = true;
|
2008-06-15 10:27:08 +00:00
|
|
|
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
|
|
|
|
{
|
|
|
|
aiMaterialProperty* prop = pMaterial->mProperties[i];
|
2008-11-16 21:56:45 +00:00
|
|
|
if (prop->mSemantic != type)continue;
|
|
|
|
|
|
|
|
if ((int)prop->mIndex >= iNumIndices)
|
|
|
|
{
|
|
|
|
ReportError("Found texture property with index %i, although there "
|
|
|
|
"are only %i textures of type %s",
|
|
|
|
prop->mIndex, iNumIndices, szType);
|
|
|
|
}
|
|
|
|
|
2009-02-15 20:29:07 +00:00
|
|
|
if (!::strcmp(prop->mKey.data,"$tex.mapping")) {
|
2008-11-16 21:56:45 +00:00
|
|
|
if (aiPTI_Integer != prop->mType || prop->mDataLength < sizeof(aiTextureMapping))
|
|
|
|
{
|
|
|
|
ReportError("Material property %s%i is expected to be an integer (size is %i)",
|
|
|
|
prop->mKey.data,prop->mIndex,prop->mDataLength);
|
|
|
|
}
|
|
|
|
mappings[prop->mIndex] = *((aiTextureMapping*)prop->mData);
|
|
|
|
}
|
2009-02-15 20:29:07 +00:00
|
|
|
else if (!::strcmp(prop->mKey.data,"$tex.uvtrafo")) {
|
2008-11-16 21:56:45 +00:00
|
|
|
if (aiPTI_Float != prop->mType || prop->mDataLength < sizeof(aiUVTransform))
|
|
|
|
{
|
|
|
|
ReportError("Material property %s%i is expected to be 5 floats large (size is %i)",
|
|
|
|
prop->mKey.data,prop->mIndex, prop->mDataLength);
|
|
|
|
}
|
|
|
|
mappings[prop->mIndex] = *((aiTextureMapping*)prop->mData);
|
|
|
|
}
|
2009-02-15 20:29:07 +00:00
|
|
|
else if (!::strcmp(prop->mKey.data,"$tex.uvwsrc")) {
|
2008-06-15 10:27:08 +00:00
|
|
|
if (aiPTI_Integer != prop->mType || sizeof(int) > prop->mDataLength)
|
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("Material property %s%i is expected to be an integer (size is %i)",
|
|
|
|
prop->mKey.data,prop->mIndex,prop->mDataLength);
|
|
|
|
}
|
|
|
|
bNoSpecified = false;
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
// Ignore UV indices for texture channels that are not there ...
|
|
|
|
|
|
|
|
// Get the value
|
|
|
|
iIndex = *((unsigned int*)prop->mData);
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
// Check whether there is a mesh using this material
|
|
|
|
// which has not enough UV channels ...
|
|
|
|
for (unsigned int a = 0; a < mScene->mNumMeshes;++a)
|
|
|
|
{
|
|
|
|
aiMesh* mesh = this->mScene->mMeshes[a];
|
|
|
|
if(mesh->mMaterialIndex == (unsigned int)i)
|
|
|
|
{
|
|
|
|
int iChannels = 0;
|
|
|
|
while (mesh->HasTextureCoords(iChannels))++iChannels;
|
|
|
|
if (iIndex >= iChannels)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2009-02-15 20:29:07 +00:00
|
|
|
ReportWarning("Invalid UV index: %i (key %s). Mesh %i has only %i UV channels",
|
2008-11-16 21:56:45 +00:00
|
|
|
iIndex,prop->mKey.data,a,iChannels);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-10-22 20:06:16 +00:00
|
|
|
if (bNoSpecified)
|
|
|
|
{
|
|
|
|
// Assume that all textures are using the first UV channel
|
|
|
|
for (unsigned int a = 0; a < mScene->mNumMeshes;++a)
|
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
aiMesh* mesh = mScene->mMeshes[a];
|
2008-11-26 13:17:39 +00:00
|
|
|
if(mesh->mMaterialIndex == (unsigned int)iIndex && mappings[0] == aiTextureMapping_UV)
|
2008-10-22 20:06:16 +00:00
|
|
|
{
|
|
|
|
if (!mesh->mTextureCoords[0])
|
|
|
|
{
|
|
|
|
// This is a special case ... it could be that the
|
|
|
|
// original mesh format intended the use of a special
|
|
|
|
// mapping here.
|
|
|
|
ReportWarning("UV-mapped texture, but there are no UV coords");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiMaterial* pMaterial)
|
|
|
|
{
|
|
|
|
// check whether there are material keys that are obviously not legal
|
|
|
|
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
|
|
|
|
{
|
2008-06-22 10:09:26 +00:00
|
|
|
const aiMaterialProperty* prop = pMaterial->mProperties[i];
|
2009-02-15 20:29:07 +00:00
|
|
|
if (!prop) {
|
|
|
|
ReportError("aiMaterial::mProperties[%i] is NULL (aiMaterial::mNumProperties is %i)",
|
2008-06-15 10:27:08 +00:00
|
|
|
i,pMaterial->mNumProperties);
|
|
|
|
}
|
2009-02-15 20:29:07 +00:00
|
|
|
if (!prop->mDataLength || !prop->mData) {
|
|
|
|
ReportError("aiMaterial::mProperties[%i].mDataLength or "
|
2008-06-15 10:27:08 +00:00
|
|
|
"aiMaterial::mProperties[%i].mData is 0",i,i);
|
|
|
|
}
|
2008-06-22 10:09:26 +00:00
|
|
|
// check all predefined types
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (aiPTI_String == prop->mType) {
|
2008-08-06 23:01:38 +00:00
|
|
|
// FIX: strings are now stored in a less expensive way ...
|
2009-02-15 20:29:07 +00:00
|
|
|
if (prop->mDataLength < sizeof(size_t) + ((const aiString*)prop->mData)->length + 1) {
|
|
|
|
ReportError("aiMaterial::mProperties[%i].mDataLength is "
|
2008-06-22 10:09:26 +00:00
|
|
|
"too small to contain a string (%i, needed: %i)",
|
|
|
|
i,prop->mDataLength,sizeof(aiString));
|
|
|
|
}
|
2009-02-15 20:29:07 +00:00
|
|
|
Validate((const aiString*)prop->mData);
|
2008-06-22 10:09:26 +00:00
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (aiPTI_Float == prop->mType) {
|
2009-02-15 20:29:07 +00:00
|
|
|
if (prop->mDataLength < sizeof(float)) {
|
|
|
|
ReportError("aiMaterial::mProperties[%i].mDataLength is "
|
2008-06-22 10:09:26 +00:00
|
|
|
"too small to contain a float (%i, needed: %i)",
|
|
|
|
i,prop->mDataLength,sizeof(float));
|
|
|
|
}
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
else if (aiPTI_Integer == prop->mType) {
|
2009-02-15 20:29:07 +00:00
|
|
|
if (prop->mDataLength < sizeof(int)) {
|
|
|
|
ReportError("aiMaterial::mProperties[%i].mDataLength is "
|
2008-06-22 10:09:26 +00:00
|
|
|
"too small to contain an integer (%i, needed: %i)",
|
|
|
|
i,prop->mDataLength,sizeof(int));
|
|
|
|
}
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
// TODO: check whether there is a key with an unknown name ...
|
|
|
|
}
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
// make some more specific tests
|
2008-06-15 10:27:08 +00:00
|
|
|
float fTemp;
|
|
|
|
int iShading;
|
2009-02-15 20:29:07 +00:00
|
|
|
if (AI_SUCCESS == aiGetMaterialInteger( pMaterial,AI_MATKEY_SHADING_MODEL,&iShading)) {
|
2008-06-15 10:27:08 +00:00
|
|
|
switch ((aiShadingMode)iShading)
|
|
|
|
{
|
|
|
|
case aiShadingMode_Blinn:
|
|
|
|
case aiShadingMode_CookTorrance:
|
|
|
|
case aiShadingMode_Phong:
|
|
|
|
|
2009-02-15 20:29:07 +00:00
|
|
|
if (AI_SUCCESS != aiGetMaterialFloat(pMaterial,AI_MATKEY_SHININESS,&fTemp)) {
|
|
|
|
ReportWarning("A specular shading model is specified but there is no "
|
2008-06-15 10:27:08 +00:00
|
|
|
"AI_MATKEY_SHININESS key");
|
|
|
|
}
|
2009-02-15 20:29:07 +00:00
|
|
|
if (AI_SUCCESS == aiGetMaterialFloat(pMaterial,AI_MATKEY_SHININESS_STRENGTH,&fTemp) && !fTemp) {
|
|
|
|
ReportWarning("A specular shading model is specified but the value of the "
|
2008-06-15 10:27:08 +00:00
|
|
|
"AI_MATKEY_SHININESS_STRENGTH key is 0.0");
|
|
|
|
}
|
|
|
|
break;
|
2008-09-12 20:25:11 +00:00
|
|
|
default: ;
|
2008-06-15 10:27:08 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2009-02-15 20:29:07 +00:00
|
|
|
if (AI_SUCCESS == aiGetMaterialFloat( pMaterial,AI_MATKEY_OPACITY,&fTemp) && (!fTemp || fTemp > 1.01f)) {
|
|
|
|
ReportWarning("Invalid opacity value (must be 0 < opacity < 1.0)");
|
2008-11-01 15:14:00 +00:00
|
|
|
}
|
|
|
|
|
2009-02-15 20:29:07 +00:00
|
|
|
// Check whether there are invalid texture keys
|
|
|
|
// TODO: that's a relict of the past, where texture type and index were baked
|
|
|
|
// into the material string ... we could do that in one single pass.
|
2008-11-16 21:56:45 +00:00
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_DIFFUSE);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_SPECULAR);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_AMBIENT);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_EMISSIVE);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_OPACITY);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_SHININESS);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_HEIGHT);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_NORMALS);
|
2009-02-15 20:29:07 +00:00
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_DISPLACEMENT);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_LIGHTMAP);
|
|
|
|
SearchForInvalidTextures(pMaterial,aiTextureType_REFLECTION);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiTexture* pTexture)
|
|
|
|
{
|
|
|
|
// the data section may NEVER be NULL
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pTexture->pcData) {
|
|
|
|
ReportError("aiTexture::pcData is NULL");
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
if (pTexture->mHeight)
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pTexture->mWidth)ReportError("aiTexture::mWidth is zero "
|
2008-06-15 10:27:08 +00:00
|
|
|
"(aiTexture::mHeight is %i, uncompressed texture)",pTexture->mHeight);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pTexture->mWidth) {
|
|
|
|
ReportError("aiTexture::mWidth is zero (compressed texture)");
|
|
|
|
}
|
|
|
|
if ('\0' != pTexture->achFormatHint[3]) {
|
|
|
|
ReportWarning("aiTexture::achFormatHint must be zero-terminated");
|
|
|
|
}
|
|
|
|
else if ('.' == pTexture->achFormatHint[0]) {
|
|
|
|
ReportWarning("aiTexture::achFormatHint should contain a file extension "
|
|
|
|
"without a leading dot (format hint: %s).",pTexture->achFormatHint);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-08-07 20:55:59 +00:00
|
|
|
|
|
|
|
const char* sz = pTexture->achFormatHint;
|
2008-11-16 21:56:45 +00:00
|
|
|
if (sz[0] >= 'A' && sz[0] <= 'Z' ||
|
2008-08-07 20:55:59 +00:00
|
|
|
sz[1] >= 'A' && sz[1] <= 'Z' ||
|
|
|
|
sz[2] >= 'A' && sz[2] <= 'Z' ||
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
sz[3] >= 'A' && sz[3] <= 'Z') {
|
|
|
|
ReportError("aiTexture::achFormatHint contains non-lowercase characters");
|
2008-08-07 20:55:59 +00:00
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiAnimation* pAnimation,
|
2008-09-30 13:05:48 +00:00
|
|
|
const aiNodeAnim* pNodeAnim)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
Validate(&pNodeAnim->mNodeName);
|
2008-06-22 10:09:26 +00:00
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pNodeAnim->mNumPositionKeys && !pNodeAnim->mScalingKeys && !pNodeAnim->mNumRotationKeys)
|
|
|
|
ReportError("Empty node animation channel");
|
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// otherwise check whether one of the keys exceeds the total duration of the animation
|
2008-09-30 13:05:48 +00:00
|
|
|
if (pNodeAnim->mNumPositionKeys)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-09-30 13:05:48 +00:00
|
|
|
if (!pNodeAnim->mPositionKeys)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-09-30 13:05:48 +00:00
|
|
|
this->ReportError("aiNodeAnim::mPositionKeys is NULL (aiNodeAnim::mNumPositionKeys is %i)",
|
|
|
|
pNodeAnim->mNumPositionKeys);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-26 22:03:14 +00:00
|
|
|
double dLast = -10e10;
|
2008-09-30 13:05:48 +00:00
|
|
|
for (unsigned int i = 0; i < pNodeAnim->mNumPositionKeys;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// ScenePreprocessor will compute the duration if still teh default value
|
2009-03-11 22:56:16 +00:00
|
|
|
if (pAnimation->mDuration > 0. && pNodeAnim->mPositionKeys[i].mTime > pAnimation->mDuration)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiNodeAnim::mPositionKeys[%i].mTime (%.5f) is larger "
|
2008-06-15 10:27:08 +00:00
|
|
|
"than aiAnimation::mDuration (which is %.5f)",i,
|
2008-09-30 13:05:48 +00:00
|
|
|
(float)pNodeAnim->mPositionKeys[i].mTime,
|
2008-06-15 10:27:08 +00:00
|
|
|
(float)pAnimation->mDuration);
|
|
|
|
}
|
2008-11-26 22:03:14 +00:00
|
|
|
if (i && pNodeAnim->mPositionKeys[i].mTime <= dLast)
|
2008-08-07 20:55:59 +00:00
|
|
|
{
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportWarning("aiNodeAnim::mPositionKeys[%i].mTime (%.5f) is smaller "
|
2008-08-07 20:55:59 +00:00
|
|
|
"than aiAnimation::mPositionKeys[%i] (which is %.5f)",i,
|
2008-09-30 13:05:48 +00:00
|
|
|
(float)pNodeAnim->mPositionKeys[i].mTime,
|
2008-08-09 22:39:57 +00:00
|
|
|
i-1, (float)dLast);
|
2008-08-07 20:55:59 +00:00
|
|
|
}
|
2008-09-30 13:05:48 +00:00
|
|
|
dLast = pNodeAnim->mPositionKeys[i].mTime;
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// rotation keys
|
2008-09-30 13:05:48 +00:00
|
|
|
if (pNodeAnim->mNumRotationKeys)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-09-30 13:05:48 +00:00
|
|
|
if (!pNodeAnim->mRotationKeys)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-09-30 13:05:48 +00:00
|
|
|
this->ReportError("aiNodeAnim::mRotationKeys is NULL (aiNodeAnim::mNumRotationKeys is %i)",
|
|
|
|
pNodeAnim->mNumRotationKeys);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-26 22:03:14 +00:00
|
|
|
double dLast = -10e10;
|
2008-09-30 13:05:48 +00:00
|
|
|
for (unsigned int i = 0; i < pNodeAnim->mNumRotationKeys;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2009-03-11 22:56:16 +00:00
|
|
|
if (pAnimation->mDuration > 0. && pNodeAnim->mRotationKeys[i].mTime > pAnimation->mDuration)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiNodeAnim::mRotationKeys[%i].mTime (%.5f) is larger "
|
2008-06-15 10:27:08 +00:00
|
|
|
"than aiAnimation::mDuration (which is %.5f)",i,
|
2008-09-30 13:05:48 +00:00
|
|
|
(float)pNodeAnim->mRotationKeys[i].mTime,
|
2008-06-15 10:27:08 +00:00
|
|
|
(float)pAnimation->mDuration);
|
|
|
|
}
|
2008-11-26 22:03:14 +00:00
|
|
|
if (i && pNodeAnim->mRotationKeys[i].mTime <= dLast)
|
2008-08-07 20:55:59 +00:00
|
|
|
{
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportWarning("aiNodeAnim::mRotationKeys[%i].mTime (%.5f) is smaller "
|
2008-08-07 20:55:59 +00:00
|
|
|
"than aiAnimation::mRotationKeys[%i] (which is %.5f)",i,
|
2008-09-30 13:05:48 +00:00
|
|
|
(float)pNodeAnim->mRotationKeys[i].mTime,
|
2008-08-09 22:39:57 +00:00
|
|
|
i-1, (float)dLast);
|
2008-08-07 20:55:59 +00:00
|
|
|
}
|
2008-09-30 13:05:48 +00:00
|
|
|
dLast = pNodeAnim->mRotationKeys[i].mTime;
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// scaling keys
|
2008-09-30 13:05:48 +00:00
|
|
|
if (pNodeAnim->mNumScalingKeys)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pNodeAnim->mScalingKeys) {
|
|
|
|
ReportError("aiNodeAnim::mScalingKeys is NULL (aiNodeAnim::mNumScalingKeys is %i)",
|
2008-09-30 13:05:48 +00:00
|
|
|
pNodeAnim->mNumScalingKeys);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-26 22:03:14 +00:00
|
|
|
double dLast = -10e10;
|
2008-09-30 13:05:48 +00:00
|
|
|
for (unsigned int i = 0; i < pNodeAnim->mNumScalingKeys;++i)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2009-03-11 22:56:16 +00:00
|
|
|
if (pAnimation->mDuration > 0. && pNodeAnim->mScalingKeys[i].mTime > pAnimation->mDuration)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportError("aiNodeAnim::mScalingKeys[%i].mTime (%.5f) is larger "
|
2008-06-15 10:27:08 +00:00
|
|
|
"than aiAnimation::mDuration (which is %.5f)",i,
|
2008-09-30 13:05:48 +00:00
|
|
|
(float)pNodeAnim->mScalingKeys[i].mTime,
|
2008-06-15 10:27:08 +00:00
|
|
|
(float)pAnimation->mDuration);
|
|
|
|
}
|
2008-11-26 22:03:14 +00:00
|
|
|
if (i && pNodeAnim->mScalingKeys[i].mTime <= dLast)
|
2008-08-07 20:55:59 +00:00
|
|
|
{
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
ReportWarning("aiNodeAnim::mScalingKeys[%i].mTime (%.5f) is smaller "
|
2008-08-07 20:55:59 +00:00
|
|
|
"than aiAnimation::mScalingKeys[%i] (which is %.5f)",i,
|
2008-09-30 13:05:48 +00:00
|
|
|
(float)pNodeAnim->mScalingKeys[i].mTime,
|
2008-08-09 22:39:57 +00:00
|
|
|
i-1, (float)dLast);
|
2008-08-07 20:55:59 +00:00
|
|
|
}
|
2008-09-30 13:05:48 +00:00
|
|
|
dLast = pNodeAnim->mScalingKeys[i].mTime;
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
|
|
|
|
if (!pNodeAnim->mNumScalingKeys && !pNodeAnim->mNumRotationKeys &&
|
|
|
|
!pNodeAnim->mNumPositionKeys)
|
|
|
|
{
|
|
|
|
ReportError("A node animation channel must have at least one subtrack");
|
|
|
|
}
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiNode* pNode)
|
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
if (!pNode)ReportError("A node of the scenegraph is NULL");
|
|
|
|
if (pNode != mScene->mRootNode && !pNode->mParent)
|
2008-06-15 10:27:08 +00:00
|
|
|
this->ReportError("A node has no valid parent (aiNode::mParent is NULL)");
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
this->Validate(&pNode->mName);
|
|
|
|
|
2008-06-15 10:27:08 +00:00
|
|
|
// validate all meshes
|
|
|
|
if (pNode->mNumMeshes)
|
|
|
|
{
|
|
|
|
if (!pNode->mMeshes)
|
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("aiNode::mMeshes is NULL (aiNode::mNumMeshes is %i)",
|
2008-06-15 10:27:08 +00:00
|
|
|
pNode->mNumMeshes);
|
|
|
|
}
|
|
|
|
std::vector<bool> abHadMesh;
|
2008-11-16 21:56:45 +00:00
|
|
|
abHadMesh.resize(mScene->mNumMeshes,false);
|
2008-06-15 10:27:08 +00:00
|
|
|
for (unsigned int i = 0; i < pNode->mNumMeshes;++i)
|
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
if (pNode->mMeshes[i] >= mScene->mNumMeshes)
|
2008-06-15 10:27:08 +00:00
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("aiNode::mMeshes[%i] is out of range (maximum is %i)",
|
|
|
|
pNode->mMeshes[i],mScene->mNumMeshes-1);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
if (abHadMesh[pNode->mMeshes[i]])
|
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("aiNode::mMeshes[%i] is already referenced by this node (value: %i)",
|
2008-06-15 10:27:08 +00:00
|
|
|
i,pNode->mMeshes[i]);
|
|
|
|
}
|
|
|
|
abHadMesh[pNode->mMeshes[i]] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pNode->mNumChildren)
|
|
|
|
{
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
if (!pNode->mChildren) {
|
|
|
|
ReportError("aiNode::mChildren is NULL (aiNode::mNumChildren is %i)",
|
2008-06-15 10:27:08 +00:00
|
|
|
pNode->mNumChildren);
|
|
|
|
}
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
for (unsigned int i = 0; i < pNode->mNumChildren;++i) {
|
2008-11-16 21:56:45 +00:00
|
|
|
Validate(pNode->mChildren[i]);
|
2008-06-15 10:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ValidateDSProcess::Validate( const aiString* pString)
|
|
|
|
{
|
|
|
|
if (pString->length > MAXLEN)
|
|
|
|
{
|
|
|
|
this->ReportError("aiString::length is too large (%i, maximum is %i)",
|
|
|
|
pString->length,MAXLEN);
|
|
|
|
}
|
|
|
|
const char* sz = pString->data;
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
if ('\0' == *sz)
|
|
|
|
{
|
|
|
|
if (pString->length != (unsigned int)(sz-pString->data))
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("aiString::data is invalid: the terminal zero is at a wrong offset");
|
2008-06-22 10:09:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (sz >= &pString->data[MAXLEN])
|
2008-11-16 21:56:45 +00:00
|
|
|
ReportError("aiString::data is invalid. There is no terminal character");
|
2008-06-22 10:09:26 +00:00
|
|
|
++sz;
|
|
|
|
}
|
|
|
|
}
|