mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 15:25:52 +08:00
add channel.target extensions
This commit is contained in:
parent
a0939550ca
commit
973d9b3394
11
tiny_gltf.h
11
tiny_gltf.h
@ -526,10 +526,12 @@ struct AnimationChannel {
|
|||||||
// "weights"]
|
// "weights"]
|
||||||
Value extras;
|
Value extras;
|
||||||
ExtensionMap extensions;
|
ExtensionMap extensions;
|
||||||
|
ExtensionMap target_extensions;
|
||||||
|
|
||||||
// Filled when SetStoreOriginalJSONForExtrasAndExtensions is enabled.
|
// Filled when SetStoreOriginalJSONForExtrasAndExtensions is enabled.
|
||||||
std::string extras_json_string;
|
std::string extras_json_string;
|
||||||
std::string extensions_json_string;
|
std::string extensions_json_string;
|
||||||
|
std::string target_extensions_json_string;
|
||||||
|
|
||||||
AnimationChannel() : sampler(-1), target_node(-1) {}
|
AnimationChannel() : sampler(-1), target_node(-1) {}
|
||||||
DEFAULT_METHODS(AnimationChannel)
|
DEFAULT_METHODS(AnimationChannel)
|
||||||
@ -4715,6 +4717,13 @@ static bool ParseAnimationChannel(
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
ParseExtensionsProperty(&channel->target_extensions, err, target_object);
|
||||||
|
if (store_original_json_for_extras_and_extensions) {
|
||||||
|
json_const_iterator it;
|
||||||
|
if (FindMember(target_object, "extensions", it)) {
|
||||||
|
channel->target_extensions_json_string = JsonToString(GetValue(it));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
channel->sampler = samplerIndex;
|
channel->sampler = samplerIndex;
|
||||||
@ -6369,6 +6378,8 @@ static void SerializeGltfAnimationChannel(AnimationChannel &channel, json &o) {
|
|||||||
SerializeNumberProperty("node", channel.target_node, target);
|
SerializeNumberProperty("node", channel.target_node, target);
|
||||||
SerializeStringProperty("path", channel.target_path, target);
|
SerializeStringProperty("path", channel.target_path, target);
|
||||||
|
|
||||||
|
SerializeExtensionMap(channel.target_extensions, target);
|
||||||
|
|
||||||
JsonAddMember(o, "target", std::move(target));
|
JsonAddMember(o, "target", std::move(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user