PLY loader now works with files which use "st" instead of "uv" for texture coordinates. Thanks @JLouisB for patch.

This fixes loading from files generated by Blender or Assimp. 
Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5609 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2018-05-12 15:31:01 +00:00
parent fb39389bb8
commit 1d99bd8ff2
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
--------------------------
Changes in 1.9 (not yet released)
- PLY loader now works with files which use "st" instead of "uv" for texture coordinates (like generated from Blender or Assimp). Thanks @JLouisB for patch (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261)
- STL writer does now also write binary files when EMWF_WRITE_BINARY flag is used. Based on patch from JLouisB. (Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261)
(EMWF_WRITE_COMPRESSED also still works for downward compatibility)
- Improved PLY exporter. Thanks for Patch from JLouisB. (Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261):

View File

@ -324,9 +324,10 @@ bool CPLYMeshFileLoader::readVertex(const SPLYElement &Element, scene::CDynamicM
vert.Normal.Y = getFloat(t);
result=true;
}
else if (Element.Properties[i].Name == "u")
// there isn't a single convention for the UV, some software like Blender or Assimp uses "st" instead of "uv"
else if (Element.Properties[i].Name == "u" || Element.Properties[i].Name == "s")
vert.TCoords.X = getFloat(t);
else if (Element.Properties[i].Name == "v")
else if (Element.Properties[i].Name == "v" || Element.Properties[i].Name == "t")
vert.TCoords.Y = getFloat(t);
else if (Element.Properties[i].Name == "red")
{