Merge pull request #2620 from RevoluPowered/feature/bug-fbx-application-scale-wrong
[WIP] Fix FBX units not being converted from CM to application scalepull/2621/head^2
commit
234b759cbc
|
@ -193,8 +193,8 @@ void FBXImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
|
||||||
// convert the FBX DOM to aiScene
|
// convert the FBX DOM to aiScene
|
||||||
ConvertToAssimpScene(pScene, doc, settings.removeEmptyBones, unit);
|
ConvertToAssimpScene(pScene, doc, settings.removeEmptyBones, unit);
|
||||||
|
|
||||||
// Set file scale relative to meters
|
// units is relative to CM :) we need it in meters for assimp
|
||||||
SetFileScale( doc.GlobalSettings().UnitScaleFactor() );
|
SetFileScale( doc.GlobalSettings().UnitScaleFactor() * 0.01f);
|
||||||
|
|
||||||
std::for_each(tokens.begin(),tokens.end(),Util::delete_fun<Token>());
|
std::for_each(tokens.begin(),tokens.end(),Util::delete_fun<Token>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -610,8 +610,12 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons
|
||||||
const std::string& ReferenceInformationType)
|
const std::string& ReferenceInformationType)
|
||||||
{
|
{
|
||||||
const size_t face_count = m_faces.size();
|
const size_t face_count = m_faces.size();
|
||||||
ai_assert(face_count);
|
|
||||||
|
|
||||||
|
if(face_count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// materials are handled separately. First of all, they are assigned per-face
|
// materials are handled separately. First of all, they are assigned per-face
|
||||||
// and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect
|
// and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect
|
||||||
// has a slightly different meaning for materials.
|
// has a slightly different meaning for materials.
|
||||||
|
|
Loading…
Reference in New Issue