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
|
||||
ConvertToAssimpScene(pScene, doc, settings.removeEmptyBones, unit);
|
||||
|
||||
// Set file scale relative to meters
|
||||
SetFileScale( doc.GlobalSettings().UnitScaleFactor() );
|
||||
// units is relative to CM :) we need it in meters for assimp
|
||||
SetFileScale( doc.GlobalSettings().UnitScaleFactor() * 0.01f);
|
||||
|
||||
std::for_each(tokens.begin(),tokens.end(),Util::delete_fun<Token>());
|
||||
}
|
||||
|
|
|
@ -610,7 +610,11 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons
|
|||
const std::string& ReferenceInformationType)
|
||||
{
|
||||
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
|
||||
// and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect
|
||||
|
|
Loading…
Reference in New Issue