mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 09:35:53 +08:00
Do not write negative skeleton
id(skeleton is not assigned).
Also ensure `inverseBindMatrices` should not be -2 or other negative values.
This commit is contained in:
parent
08a7dd8dad
commit
d07b976d59
14
tiny_gltf.h
14
tiny_gltf.h
@ -7243,11 +7243,17 @@ static void SerializeGltfScene(Scene &scene, json &o) {
|
||||
}
|
||||
|
||||
static void SerializeGltfSkin(Skin &skin, json &o) {
|
||||
if (skin.inverseBindMatrices != -1)
|
||||
SerializeNumberProperty("inverseBindMatrices", skin.inverseBindMatrices, o);
|
||||
|
||||
// required
|
||||
SerializeNumberArrayProperty<int>("joints", skin.joints, o);
|
||||
SerializeNumberProperty("skeleton", skin.skeleton, o);
|
||||
|
||||
if (skin.inverseBindMatrices >= 0) {
|
||||
SerializeNumberProperty("inverseBindMatrices", skin.inverseBindMatrices, o);
|
||||
}
|
||||
|
||||
if (skin.skeleton >= 0) {
|
||||
SerializeNumberProperty("skeleton", skin.skeleton, o);
|
||||
}
|
||||
|
||||
if (skin.name.size()) {
|
||||
SerializeStringProperty("name", skin.name, o);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user