mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-07-29 19:12:00 +08:00
Merge pull request #492 from danwillm/inverse-bind-matrix
Make inverseBindMatrices optional
This commit is contained in:
commit
cfbec35dc7
BIN
tests/issue-492.glb
Normal file
BIN
tests/issue-492.glb
Normal file
Binary file not shown.
@ -1182,3 +1182,21 @@ TEST_CASE("images-as-is", "[issue-487]") {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("inverse-bind-matrices-optional", "[issue-492]") {
|
||||
tinygltf::Model model;
|
||||
tinygltf::TinyGLTF ctx;
|
||||
std::string err;
|
||||
std::string warn;
|
||||
|
||||
bool ret = ctx.LoadBinaryFromFile(&model, &err, &warn, "issue-492.glb");
|
||||
if (!warn.empty()) {
|
||||
std::cout << "WARN:" << warn << std::endl;
|
||||
}
|
||||
if (!err.empty()) {
|
||||
std::cerr << "ERR:" << err << std::endl;
|
||||
}
|
||||
|
||||
REQUIRE(true == ret);
|
||||
REQUIRE(err.empty());
|
||||
}
|
@ -5660,7 +5660,7 @@ static bool ParseSkin(Skin *skin, std::string *err, const detail::json &o,
|
||||
skin->skeleton = skeleton;
|
||||
|
||||
int invBind = -1;
|
||||
ParseIntegerProperty(&invBind, err, o, "inverseBindMatrices", true, "Skin");
|
||||
ParseIntegerProperty(&invBind, err, o, "inverseBindMatrices", false, "Skin");
|
||||
skin->inverseBindMatrices = invBind;
|
||||
|
||||
ParseExtrasAndExtensions(skin, err, o,
|
||||
|
Loading…
x
Reference in New Issue
Block a user