mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
* Adjustment: Update Assimp version to 5.0.1.
This commit is contained in:
parent
14ebeaf3eb
commit
4758f7bdaf
679 changed files with 50502 additions and 19698 deletions
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2020, assimp team
|
||||
Copyright (c) 2006-2019, assimp team
|
||||
|
||||
|
||||
|
||||
|
|
@ -538,17 +538,13 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation)
|
|||
{
|
||||
Validate(&pAnimation->mName);
|
||||
|
||||
// validate all animations
|
||||
if (pAnimation->mNumChannels || pAnimation->mNumMorphMeshChannels)
|
||||
// validate all materials
|
||||
if (pAnimation->mNumChannels)
|
||||
{
|
||||
if (!pAnimation->mChannels && pAnimation->mNumChannels) {
|
||||
if (!pAnimation->mChannels) {
|
||||
ReportError("aiAnimation::mChannels is NULL (aiAnimation::mNumChannels is %i)",
|
||||
pAnimation->mNumChannels);
|
||||
}
|
||||
if (!pAnimation->mMorphMeshChannels && pAnimation->mNumMorphMeshChannels) {
|
||||
ReportError("aiAnimation::mMorphMeshChannels is NULL (aiAnimation::mNumMorphMeshChannels is %i)",
|
||||
pAnimation->mNumMorphMeshChannels);
|
||||
}
|
||||
for (unsigned int i = 0; i < pAnimation->mNumChannels;++i)
|
||||
{
|
||||
if (!pAnimation->mChannels[i])
|
||||
|
|
@ -558,15 +554,6 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation)
|
|||
}
|
||||
Validate(pAnimation, pAnimation->mChannels[i]);
|
||||
}
|
||||
for (unsigned int i = 0; i < pAnimation->mNumMorphMeshChannels;++i)
|
||||
{
|
||||
if (!pAnimation->mMorphMeshChannels[i])
|
||||
{
|
||||
ReportError("aiAnimation::mMorphMeshChannels[%i] is NULL (aiAnimation::mNumMorphMeshChannels is %i)",
|
||||
i, pAnimation->mNumMorphMeshChannels);
|
||||
}
|
||||
Validate(pAnimation, pAnimation->mMorphMeshChannels[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there.");
|
||||
|
|
@ -603,18 +590,15 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
|
|||
ReportError("%s #%i is set, but there are only %i %s textures",
|
||||
szType,iIndex,iNumIndices,szType);
|
||||
}
|
||||
if (!iNumIndices) {
|
||||
return;
|
||||
}
|
||||
if (!iNumIndices)return;
|
||||
std::vector<aiTextureMapping> mappings(iNumIndices);
|
||||
|
||||
// Now check whether all UV indices are valid ...
|
||||
bool bNoSpecified = true;
|
||||
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i) {
|
||||
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
|
||||
{
|
||||
aiMaterialProperty* prop = pMaterial->mProperties[i];
|
||||
if (prop->mSemantic != type) {
|
||||
continue;
|
||||
}
|
||||
if (prop->mSemantic != type)continue;
|
||||
|
||||
if ((int)prop->mIndex >= iNumIndices)
|
||||
{
|
||||
|
|
@ -637,7 +621,7 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
|
|||
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] = ((aiUVTransform*)prop->mData);
|
||||
mappings[prop->mIndex] = *((aiTextureMapping*)prop->mData);
|
||||
}
|
||||
else if (!::strcmp(prop->mKey.data,"$tex.uvwsrc")) {
|
||||
if (aiPTI_Integer != prop->mType || sizeof(int) > prop->mDataLength)
|
||||
|
|
@ -777,12 +761,6 @@ void ValidateDSProcess::Validate( const aiMaterial* pMaterial)
|
|||
SearchForInvalidTextures(pMaterial,aiTextureType_DISPLACEMENT);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_LIGHTMAP);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_REFLECTION);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_BASE_COLOR);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_NORMAL_CAMERA);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_EMISSION_COLOR);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_METALNESS);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_DIFFUSE_ROUGHNESS);
|
||||
SearchForInvalidTextures(pMaterial,aiTextureType_AMBIENT_OCCLUSION);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
@ -804,7 +782,7 @@ void ValidateDSProcess::Validate( const aiTexture* pTexture)
|
|||
if (!pTexture->mWidth) {
|
||||
ReportError("aiTexture::mWidth is zero (compressed texture)");
|
||||
}
|
||||
if ('\0' != pTexture->achFormatHint[HINTMAXTEXTURELEN - 1]) {
|
||||
if ('\0' != pTexture->achFormatHint[3]) {
|
||||
ReportWarning("aiTexture::achFormatHint must be zero-terminated");
|
||||
}
|
||||
else if ('.' == pTexture->achFormatHint[0]) {
|
||||
|
|
@ -925,48 +903,6 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation,
|
|||
}
|
||||
}
|
||||
|
||||
void ValidateDSProcess::Validate( const aiAnimation* pAnimation,
|
||||
const aiMeshMorphAnim* pMeshMorphAnim)
|
||||
{
|
||||
Validate(&pMeshMorphAnim->mName);
|
||||
|
||||
if (!pMeshMorphAnim->mNumKeys) {
|
||||
ReportError("Empty mesh morph animation channel");
|
||||
}
|
||||
|
||||
// otherwise check whether one of the keys exceeds the total duration of the animation
|
||||
if (pMeshMorphAnim->mNumKeys)
|
||||
{
|
||||
if (!pMeshMorphAnim->mKeys)
|
||||
{
|
||||
ReportError("aiMeshMorphAnim::mKeys is NULL (aiMeshMorphAnim::mNumKeys is %i)",
|
||||
pMeshMorphAnim->mNumKeys);
|
||||
}
|
||||
double dLast = -10e10;
|
||||
for (unsigned int i = 0; i < pMeshMorphAnim->mNumKeys;++i)
|
||||
{
|
||||
// ScenePreprocessor will compute the duration if still the default value
|
||||
// (Aramis) Add small epsilon, comparison tended to fail if max_time == duration,
|
||||
// seems to be due the compilers register usage/width.
|
||||
if (pAnimation->mDuration > 0. && pMeshMorphAnim->mKeys[i].mTime > pAnimation->mDuration+0.001)
|
||||
{
|
||||
ReportError("aiMeshMorphAnim::mKeys[%i].mTime (%.5f) is larger "
|
||||
"than aiAnimation::mDuration (which is %.5f)",i,
|
||||
(float)pMeshMorphAnim->mKeys[i].mTime,
|
||||
(float)pAnimation->mDuration);
|
||||
}
|
||||
if (i && pMeshMorphAnim->mKeys[i].mTime <= dLast)
|
||||
{
|
||||
ReportWarning("aiMeshMorphAnim::mKeys[%i].mTime (%.5f) is smaller "
|
||||
"than aiMeshMorphAnim::mKeys[%i] (which is %.5f)",i,
|
||||
(float)pMeshMorphAnim->mKeys[i].mTime,
|
||||
i-1, (float)dLast);
|
||||
}
|
||||
dLast = pMeshMorphAnim->mKeys[i].mTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ValidateDSProcess::Validate( const aiNode* pNode)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue