Fix compiler bug for VS2019
- Check https://developercommunity.visualstudio.com/content/problem/1223143/visual-studio-2019-c-program-crash-with-stdstring.html for more details - closes https://github.com/assimp/assimp/issues/3572pull/3616/head
parent
83d4227e5c
commit
4471c36c08
|
@ -63,9 +63,8 @@ namespace FBX {
|
|||
using namespace Util;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Material::Material(uint64_t id, const Element& element, const Document& doc, const std::string& name)
|
||||
: Object(id,element,name)
|
||||
{
|
||||
Material::Material(uint64_t id, const Element& element, const Document& doc, const std::string& name) :
|
||||
Object(id,element,name) {
|
||||
const Scope& sc = GetRequiredScope(element);
|
||||
|
||||
const Element* const ShadingModel = sc["ShadingModel"];
|
||||
|
@ -77,8 +76,7 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con
|
|||
|
||||
if(ShadingModel) {
|
||||
shading = ParseTokenAsString(GetRequiredToken(*ShadingModel,0));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
DOMWarning("shading mode not specified, assuming phong",&element);
|
||||
shading = "phong";
|
||||
}
|
||||
|
@ -86,7 +84,9 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con
|
|||
std::string templateName;
|
||||
|
||||
// lower-case shading because Blender (for example) writes "Phong"
|
||||
std::transform(shading.data(), shading.data() + shading.size(), std::addressof(shading[0]), Assimp::ToLower<char>);
|
||||
for (size_t i = 0; i < shading.length(); ++i) {
|
||||
shading[i] = tolower(shading[i]);
|
||||
}
|
||||
if(shading == "phong") {
|
||||
templateName = "Material.FbxSurfacePhong";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue