Skip to content

Commit

Permalink
Fix target names not being imported on some gLTF2 models
Browse files Browse the repository at this point in the history
  • Loading branch information
Futuremappermydud authored and kimkulling committed Dec 4, 2023
1 parent 769e82c commit a0b3df6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/AssetLib/glTF2/glTF2Asset.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,22 @@ inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) {
}
}
}

if(this->targetNames.empty())
{
Value *curExtras = FindObject(primitive, "extras");
if (nullptr != curExtras) {
if (Value *curTargetNames = FindArray(*curExtras, "targetNames")) {
this->targetNames.resize(curTargetNames->Size());
for (unsigned int j = 0; j < curTargetNames->Size(); ++j) {
Value &targetNameValue = (*curTargetNames)[j];
if (targetNameValue.IsString()) {
this->targetNames[j] = targetNameValue.GetString();
}
}
}
}
}
}
}

Expand Down

0 comments on commit a0b3df6

Please sign in to comment.