mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 08:05:58 +08:00
Merge pull request #239 from Selmar/channel_target_extensions
Channel target extensions
This commit is contained in:
commit
ac5e09f8c3
11
tiny_gltf.h
11
tiny_gltf.h
@ -526,10 +526,12 @@ struct AnimationChannel {
|
||||
// "weights"]
|
||||
Value extras;
|
||||
ExtensionMap extensions;
|
||||
ExtensionMap target_extensions;
|
||||
|
||||
// Filled when SetStoreOriginalJSONForExtrasAndExtensions is enabled.
|
||||
std::string extras_json_string;
|
||||
std::string extensions_json_string;
|
||||
std::string target_extensions_json_string;
|
||||
|
||||
AnimationChannel() : sampler(-1), target_node(-1) {}
|
||||
DEFAULT_METHODS(AnimationChannel)
|
||||
@ -4754,6 +4756,13 @@ static bool ParseAnimationChannel(
|
||||
}
|
||||
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;
|
||||
@ -6428,6 +6437,8 @@ static void SerializeGltfAnimationChannel(AnimationChannel &channel, json &o) {
|
||||
SerializeNumberProperty("node", channel.target_node, target);
|
||||
SerializeStringProperty("path", channel.target_path, target);
|
||||
|
||||
SerializeExtensionMap(channel.target_extensions, target);
|
||||
|
||||
JsonAddMember(o, "target", std::move(target));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user