Kim Kulling 2021-01-26 20:59:21 +01:00 committed by GitHub
parent 83d4227e5c
commit 4471c36c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -60,12 +60,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp { namespace Assimp {
namespace FBX { namespace FBX {
using namespace Util; using namespace Util;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
Material::Material(uint64_t id, const Element& element, const Document& doc, const std::string& name) Material::Material(uint64_t id, const Element& element, const Document& doc, const std::string& name) :
: Object(id,element,name) Object(id,element,name) {
{
const Scope& sc = GetRequiredScope(element); const Scope& sc = GetRequiredScope(element);
const Element* const ShadingModel = sc["ShadingModel"]; const Element* const ShadingModel = sc["ShadingModel"];
@ -77,8 +76,7 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con
if(ShadingModel) { if(ShadingModel) {
shading = ParseTokenAsString(GetRequiredToken(*ShadingModel,0)); shading = ParseTokenAsString(GetRequiredToken(*ShadingModel,0));
} } else {
else {
DOMWarning("shading mode not specified, assuming phong",&element); DOMWarning("shading mode not specified, assuming phong",&element);
shading = "phong"; shading = "phong";
} }
@ -86,7 +84,9 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con
std::string templateName; std::string templateName;
// lower-case shading because Blender (for example) writes "Phong" // 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") { if(shading == "phong") {
templateName = "Material.FbxSurfacePhong"; templateName = "Material.FbxSurfacePhong";
} }