14 entt::meta_factory<root_motion_params>{}
15 .type(
"root_motion_params"_hs)
20 .data<&root_motion_params::keep_position_y>(
"keep_position_y"_hs)
24 entt::attribute{
"tooltip",
"Root position t components are not affected by animation."},
26 .data<&root_motion_params::keep_position_xz>(
"keep_position_xz"_hs)
30 entt::attribute{
"tooltip",
"Root position x,z components are not affected by animation."},
32 .data<&root_motion_params::keep_rotation>(
"keep_rotation"_hs)
36 entt::attribute{
"tooltip",
"Root rotation is not affected by animaation."},
38 .data<&root_motion_params::keep_in_place>(
"keep_in_place"_hs)
42 entt::attribute{
"tooltip",
"Keep the animation in place even if it has root motion in it."},
44 .data<nullptr, &root_motion_params::position_node_name>(
"position_node_name"_hs)
48 entt::attribute{
"tooltip",
"Transform node that will be used for root motion."},
50 .data<nullptr, &root_motion_params::rotation_node_name>(
"rotation_node_name"_hs)
54 entt::attribute{
"tooltip",
"Rotation node that will be used for root motion."},
60 try_serialize(ar, ser20::make_nvp(
"keep_position_y", obj.keep_position_y));
61 try_serialize(ar, ser20::make_nvp(
"keep_position_xz", obj.keep_position_xz));
62 try_serialize(ar, ser20::make_nvp(
"keep_rotation", obj.keep_rotation));
63 try_serialize(ar, ser20::make_nvp(
"keep_in_place", obj.keep_in_place));
65 try_serialize(ar, ser20::make_nvp(
"position_node_name", obj.position_node_name));
66 try_serialize(ar, ser20::make_nvp(
"position_node_index", obj.position_node_index));
67 try_serialize(ar, ser20::make_nvp(
"rotation_node_name", obj.rotation_node_name));
68 try_serialize(ar, ser20::make_nvp(
"rotation_node_index", obj.rotation_node_index));
77 entt::meta_factory<animation_channel>{}
78 .type(
"animation_channel"_hs)
83 .data<nullptr, &animation_channel::node_name>(
"node_name"_hs)
88 .data<nullptr, &animation_channel::get_position_keys_count>(
"position_keys_count"_hs)
93 .data<nullptr, &animation_channel::get_rotation_keys_count>(
"rotation_keys_count"_hs)
98 .data<nullptr, &animation_channel::get_position_keys_count>(
"scaling_keys_count"_hs)
107 entt::meta_factory<animation_clip>{}
108 .type(
"animation"_hs)
113 .data<nullptr, &animation_clip::name>(
"name"_hs)
118 .data<nullptr, &animation_clip::duration>(
"duration"_hs)
123 .data<nullptr, &animation_clip::root_motion>(
"root_motion"_hs)
128 .data<nullptr, &animation_clip::channels>(
"channels"_hs)
137 try_save(ar, ser20::make_nvp(
"node_name", obj.node_name));
138 try_save(ar, ser20::make_nvp(
"node_index", obj.node_index));
139 try_save(ar, ser20::make_nvp(
"position_keys", obj.position_keys));
140 try_save(ar, ser20::make_nvp(
"rotation_keys", obj.rotation_keys));
141 try_save(ar, ser20::make_nvp(
"scaling_keys", obj.scaling_keys));
148 try_load(ar, ser20::make_nvp(
"node_name", obj.node_name));
149 try_load(ar, ser20::make_nvp(
"node_index", obj.node_index));
150 try_load(ar, ser20::make_nvp(
"position_keys", obj.position_keys));
151 try_load(ar, ser20::make_nvp(
"rotation_keys", obj.rotation_keys));
152 try_load(ar, ser20::make_nvp(
"scaling_keys", obj.scaling_keys));
159 try_save(ar, ser20::make_nvp(
"name", obj.name));
160 try_save(ar, ser20::make_nvp(
"duration", obj.duration));
161 try_save(ar, ser20::make_nvp(
"channels", obj.channels));
162 try_save(ar, ser20::make_nvp(
"root_motion", obj.root_motion));
169 try_load(ar, ser20::make_nvp(
"name", obj.name));
170 try_load(ar, ser20::make_nvp(
"duration", obj.duration));
171 try_load(ar, ser20::make_nvp(
"channels", obj.channels));
172 try_load(ar, ser20::make_nvp(
"root_motion", obj.root_motion));
179 std::ofstream stream(absolute_path);
183 try_save(ar, ser20::make_nvp(
"animation", obj));
189 std::ofstream stream(absolute_path, std::ios::binary);
193 try_save(ar, ser20::make_nvp(
"animation", obj));
199 std::ifstream stream(absolute_path);
203 try_load(ar, ser20::make_nvp(
"animation", obj));
209 std::ifstream stream(absolute_path, std::ios::binary);
213 try_load(ar, ser20::make_nvp(
"animation", obj));
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.