add handling for special cases for the uv-calculation:
- When 3 vector have same UV, using default UV direction:
- When 2 vector have same UV, recalculate tangent/bitangent according to normal and bitangent/tangent.
Thanks to Ya ping Jin.
Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
Exiting function so early break the parsing procedure, misses node closing and causes improper initialization of element (cannot be referenced later on)
The 'mg' keyword is currently being interpreted as a material library keyword,
when it really refers to the merging group. Handle this case, in effect ignoring
the keyword as merging groups are currently unsupported.
For consistency, use a light gray default diffuse color for STL files.
This provides consistency with other geometric types, like PLY, that use a
light-gray default material.
There was a misleading TODO comment that encouraged to use fseek/ftell instead of fstat. However, fstat has been used intionally because fseek/ftell is potentially unsafe.
So I replaced the TODO and added some explanation why fstat is being used instead.
Which models crashed before the fix?:
The crash was observed for files with the following properties:
1. They contain >=1 meshes
2. They were loaded with SortByPType option
3. They only contained degenerated meshes, so that these were skipped SortByPType
What is improved by the fix?:
Obviously, the affected models were crappy anyway and will still produce empty output after the fix. However, the fix avoids the heap-corruption, which couldn't be solved by try/catch from outside and had the annoying effect that a whole scene with hundreds of individual models could crash due to a single crappy one.
Why did it crash before?
The SortByPType deleted some exluded meshes, but didn't reset the pointers in pScene. After throwing the DeadlyImportException (no remaining meshes), remaining meshes were deleted => Excluded meshes were deleted twice.
- Added BlenderBMesh.cpp/h which contains a class to convert a BMesh to an old style tri/quad mesh
- Added BlenderTessellator.cpp/h which contains a class to tessellate the poly loops contained within a BMesh
Previously assimp mapped all blender image textures as
aiTextureType_DIFFUSE. This change interprets the "mapto" property
which corresponds to the Blender "Influence" in the properties editor.
* Blender's Normal influence with "Normal Map" unchecked maps to
aiTextureType_HEIGHT.
* Blender's Normal influence with "Normal Map" checked maps to
aiTextureType_NORMAL.
* Influence scale is placed into AI_MATKEY_BUMPSCALING.