15 entt::meta_factory<root_motion_params>{}
16 .type(
"root_motion_params"_hs)
21 .data<&root_motion_params::keep_position_y>(
"keep_position_y"_hs)
25 entt::attribute{
"tooltip",
"Root position t components are not affected by animation."},
27 .data<&root_motion_params::keep_position_xz>(
"keep_position_xz"_hs)
31 entt::attribute{
"tooltip",
"Root position x,z components are not affected by animation."},
33 .data<&root_motion_params::keep_rotation>(
"keep_rotation"_hs)
37 entt::attribute{
"tooltip",
"Root rotation is not affected by animaation."},
39 .data<&root_motion_params::keep_in_place>(
"keep_in_place"_hs)
43 entt::attribute{
"tooltip",
"Keep the animation in place even if it has root motion in it."},
45 .data<nullptr, &root_motion_params::position_node_name>(
"position_node_name"_hs)
49 entt::attribute{
"tooltip",
"Transform node that will be used for root motion."},
51 .data<nullptr, &root_motion_params::rotation_node_name>(
"rotation_node_name"_hs)
55 entt::attribute{
"tooltip",
"Rotation node that will be used for root motion."},
61 try_serialize(ar, ser20::make_nvp(
"keep_position_y", obj.keep_position_y));
62 try_serialize(ar, ser20::make_nvp(
"keep_position_xz", obj.keep_position_xz));
63 try_serialize(ar, ser20::make_nvp(
"keep_rotation", obj.keep_rotation));
64 try_serialize(ar, ser20::make_nvp(
"keep_in_place", obj.keep_in_place));
66 try_serialize(ar, ser20::make_nvp(
"position_node_name", obj.position_node_name));
67 try_serialize(ar, ser20::make_nvp(
"position_node_index", obj.position_node_index));
68 try_serialize(ar, ser20::make_nvp(
"rotation_node_name", obj.rotation_node_name));
69 try_serialize(ar, ser20::make_nvp(
"rotation_node_index", obj.rotation_node_index));
78 entt::meta_factory<animation_channel>{}
79 .type(
"animation_channel"_hs)
84 .data<nullptr, &animation_channel::node_name>(
"node_name"_hs)
89 .data<nullptr, &animation_channel::get_position_keys_count>(
"position_keys_count"_hs)
94 .data<nullptr, &animation_channel::get_rotation_keys_count>(
"rotation_keys_count"_hs)
99 .data<nullptr, &animation_channel::get_position_keys_count>(
"scaling_keys_count"_hs)
108 entt::meta_factory<animation_clip>{}
109 .type(
"animation"_hs)
114 .data<nullptr, &animation_clip::name>(
"name"_hs)
119 .data<nullptr, &animation_clip::duration>(
"duration"_hs)
124 .data<nullptr, &animation_clip::root_motion>(
"root_motion"_hs)
129 .data<nullptr, &animation_clip::channels>(
"channels"_hs)
138 try_save(ar, ser20::make_nvp(
"node_name", obj.node_name));
139 try_save(ar, ser20::make_nvp(
"node_index", obj.node_index));
140 try_save(ar, ser20::make_nvp(
"position_keys", obj.position_keys));
141 try_save(ar, ser20::make_nvp(
"rotation_keys", obj.rotation_keys));
142 try_save(ar, ser20::make_nvp(
"scaling_keys", obj.scaling_keys));
149 try_load(ar, ser20::make_nvp(
"node_name", obj.node_name));
150 try_load(ar, ser20::make_nvp(
"node_index", obj.node_index));
151 try_load(ar, ser20::make_nvp(
"position_keys", obj.position_keys));
152 try_load(ar, ser20::make_nvp(
"rotation_keys", obj.rotation_keys));
153 try_load(ar, ser20::make_nvp(
"scaling_keys", obj.scaling_keys));
160 try_save(ar, ser20::make_nvp(
"name", obj.name));
161 try_save(ar, ser20::make_nvp(
"duration", obj.duration));
162 try_save(ar, ser20::make_nvp(
"channels", obj.channels));
163 try_save(ar, ser20::make_nvp(
"root_motion", obj.root_motion));
172 try_load(ar, ser20::make_nvp(
"name", obj.name));
173 try_load(ar, ser20::make_nvp(
"duration", obj.duration));
174 try_load(ar, ser20::make_nvp(
"channels", obj.channels));
175 try_load(ar, ser20::make_nvp(
"root_motion", obj.root_motion));
184 std::ofstream stream(absolute_path);
188 try_save(ar, ser20::make_nvp(
"animation", obj));
194 std::ofstream stream(absolute_path, std::ios::binary);
198 try_save(ar, ser20::make_nvp(
"animation", obj));
210 try_load(ar, ser20::make_nvp(
"animation", obj));
221 try_load(ar, ser20::make_nvp(
"animation", obj));
stdio-backed input stream. Accepts std::ios open flags (e.g. std::ios::binary) when opening a
attributes::value_type attribute
std::map< std::string, meta_any > attributes
auto create_oarchive_associative(std::ostream &stream)
BinaryInputArchive iarchive_binary_t
auto create_iarchive_associative(std::istream &stream)
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
void save_to_file_bin(const std::string &absolute_path, const animation_clip &obj)
void load_from_file(const std::string &absolute_path, animation_clip &obj)
void save_to_file(const std::string &absolute_path, const animation_clip &obj)
void load_from_file_bin(const std::string &absolute_path, animation_clip &obj)
#define SAVE_INSTANTIATE(cls, Archive)
auto try_serialize(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
#define SERIALIZE_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Struct representing a node animation.
Struct representing an animation.