Export material names properly
parent
a9c4fa84b5
commit
37527849b7
|
@ -284,10 +284,6 @@ namespace glTF2 {
|
||||||
|
|
||||||
inline void Write(Value& obj, Material& m, AssetWriter& w)
|
inline void Write(Value& obj, Material& m, AssetWriter& w)
|
||||||
{
|
{
|
||||||
if (!m.name.empty()) {
|
|
||||||
obj.AddMember("name", m.name, w.mAl);
|
|
||||||
}
|
|
||||||
|
|
||||||
Value pbrMetallicRoughness;
|
Value pbrMetallicRoughness;
|
||||||
pbrMetallicRoughness.SetObject();
|
pbrMetallicRoughness.SetObject();
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,7 +125,6 @@ bool glTF2Importer::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//static void CopyValue(const glTF2::vec3& v, aiColor3D& out)
|
//static void CopyValue(const glTF2::vec3& v, aiColor3D& out)
|
||||||
//{
|
//{
|
||||||
// out.r = v[0]; out.g = v[1]; out.b = v[2];
|
// out.r = v[0]; out.g = v[1]; out.b = v[2];
|
||||||
|
@ -228,8 +227,11 @@ void glTF2Importer::ImportMaterials(glTF2::Asset& r)
|
||||||
|
|
||||||
Material& mat = r.materials[i];
|
Material& mat = r.materials[i];
|
||||||
|
|
||||||
aiString str(mat.id);
|
if (!mat.name.empty()) {
|
||||||
aimat->AddProperty(&str, AI_MATKEY_NAME);
|
aiString str(mat.name);
|
||||||
|
|
||||||
|
aimat->AddProperty(&str, AI_MATKEY_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
SetMaterialColorProperty(r, mat.pbrMetallicRoughness.baseColorFactor, aimat, AI_MATKEY_COLOR_DIFFUSE);
|
SetMaterialColorProperty(r, mat.pbrMetallicRoughness.baseColorFactor, aimat, AI_MATKEY_COLOR_DIFFUSE);
|
||||||
SetMaterialTextureProperty(embeddedTexIdxs, r, mat.pbrMetallicRoughness.baseColorTexture, aimat, aiTextureType_DIFFUSE);
|
SetMaterialTextureProperty(embeddedTexIdxs, r, mat.pbrMetallicRoughness.baseColorTexture, aimat, aiTextureType_DIFFUSE);
|
||||||
|
|
Loading…
Reference in New Issue