Renamed glTF2::Object::extensions to customExtensions to avoid shadowing in other subclasses.

pull/3955/head
Evangel 2021-06-12 13:16:53 +10:00
parent a7a30baf27
commit 3de20af3cc
3 changed files with 7 additions and 7 deletions

View File

@ -408,7 +408,7 @@ struct Object {
std::string id; //!< The globally unique ID used to reference this object
std::string name; //!< The user-defined name of this object
CustomExtension extensions;
CustomExtension customExtensions;
//! Objects marked as special are not exported (used to emulate the binary body buffer)
virtual bool IsSpecial() const { return false; }

View File

@ -369,7 +369,7 @@ inline Value *Object::FindExtension(Value &val, const char *extensionId) {
inline void Object::ReadExtensions(Value &val) {
if (Value *curExtensions = FindObject(val, "extensions")) {
this->extensions = glTF2::ReadExtensions("extensions", *curExtensions);
this->customExtensions = glTF2::ReadExtensions("extensions", *curExtensions);
}
}

View File

@ -1002,9 +1002,9 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector<unsigned int> &
}
}
if (node.extensions) {
if (node.customExtensions) {
ainode->mMetaData = new aiMetadata;
ParseExtensions(ainode->mMetaData, node.extensions);
ParseExtensions(ainode->mMetaData, node.customExtensions);
}
GetNodeTransform(ainode->mTransformation, node);
@ -1498,7 +1498,7 @@ void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) {
const bool hasVersion = !a.asset.version.empty();
const bool hasGenerator = !a.asset.generator.empty();
const bool hasCopyright = !a.asset.copyright.empty();
const bool hasSceneMetadata = a.scene->extensions;
const bool hasSceneMetadata = a.scene->customExtensions;
if (hasVersion || hasGenerator || hasCopyright || hasSceneMetadata) {
mScene->mMetaData = new aiMetadata;
if (hasVersion) {
@ -1511,7 +1511,7 @@ void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) {
mScene->mMetaData->Add(AI_METADATA_SOURCE_COPYRIGHT, aiString(a.asset.copyright));
}
if (hasSceneMetadata) {
ParseExtensions(mScene->mMetaData, a.scene->extensions);
ParseExtensions(mScene->mMetaData, a.scene->customExtensions);
}
}
}