Constructor Function.
47 {
49
51
52 UUID defaultMaterialName;
53 for (int i = 0; i < data.size(); i++)
54 {
56 Json::object_t json = data[i];
57
58 if(json.find("pbrMetallicRoughness") != json.end())
59 {
60 Json::object_t factor = json["pbrMetallicRoughness"];
61 if(factor.find("baseColorTexture") != factor.end())
62 {
63 item.baseColorTexture = factor["baseColorTexture"]["index"];
64 }
65
67
68 if(factor.find("metallicRoughnessTexture") != factor.end())
69 {
70 item.metallicRoughnessTexture = factor["metallicRoughnessTexture"]["index"];
71 }
72 }
73
74 if(json.find("normalTexture") != json.end())
75 {
76 item.normalTexture = json["normalTexture"]["index"];
77 }
78
79 if(json.find("emissiveTexture") != json.end())
80 {
81 item.emissiveTexture = json["emissiveTexture"]["index"];
82 }
83
84 if(json.find("occlusionTexture") != json.end())
85 {
86 item.occlusionTexture = json["occlusionTexture"]["index"];
87 }
88
90
91 std::stringstream ss;
92 ss << defaultMaterialName.ToString() << "_" << i;
94 }
95
96 std::stringstream ss;
97 ss << "Materials Counts: " << data.size();
98
99 SPICES_CORE_INFO(ss.str())
100 }
#define SPICES_PROFILE_ZONE
static glm::vec4 GetElementVector(Json::object_t &root, const char *path, glm::vec4 pDefault)
Get vec4 value in Json::object_t.
static std::string GetElementString(const Json::object_t &root, const char *path, const std::string &pDefault)
Get string value in Json::object_t.
std::vector< Item > m_MaterialsData
Data of Gltf Json Materials.
GltfObject(const Json &data)
Constructor Function.