Unravel Engine C++ Reference
Loading...
Searching...
No Matches
animation_importer_meta.cpp
Go to the documentation of this file.
2
4
8
9namespace unravel
10{
11
13{
14 entt::meta_factory<animation_importer_meta::root_motion_meta>{}
15 .type("root_motion_meta"_hs)
17 entt::attribute{"name", "root_motion_meta"},
18 entt::attribute{"pretty_name", "Root Motion Meta"},
19 })
20 .data<&animation_importer_meta::root_motion_meta::keep_position_y>("keep_position_y"_hs)
22 entt::attribute{"name", "keep_position_y"},
23 entt::attribute{"pretty_name", "Keep Position Y"},
24 })
25 .data<&animation_importer_meta::root_motion_meta::keep_position_xz>("keep_position_xz"_hs)
27 entt::attribute{"name", "keep_position_xz"},
28 entt::attribute{"pretty_name", "Keep Position XZ"},
29 })
30 .data<&animation_importer_meta::root_motion_meta::keep_rotation>("keep_rotation"_hs)
32 entt::attribute{"name", "keep_rotation"},
33 entt::attribute{"pretty_name", "Keep Rotation"},
34 })
35 .data<&animation_importer_meta::root_motion_meta::keep_in_place>("keep_in_place"_hs)
37 entt::attribute{"name", "keep_in_place"},
38 entt::attribute{"pretty_name", "Keep In Place"},
39 });
40
41 // Register animation_importer_meta with entt
42 entt::meta_factory<animation_importer_meta>{}
43 .type("animation_importer_meta"_hs)
45 entt::attribute{"name", "animation_importer_meta"},
46 entt::attribute{"pretty_name", "Animation Importer Meta"},
47 })
48 .func<&animation_importer_meta::get_meta_type>("get_meta_type"_hs)
49 .func<&animation_importer_meta::get_static_meta_type>("get_static_meta_type"_hs)
50 .func<&animation_importer_meta::as_derived>("as_derived"_hs)
51 .data<&animation_importer_meta::root_motion>("root_motion"_hs)
52 .custom<entt::attributes>(entt::attributes{
53 entt::attribute{"name", "root_motion"},
54 entt::attribute{"pretty_name", "Root Motion"},
55 });
56}
57
59{
60 try_save(ar, ser20::make_nvp("keep_position_y", obj.keep_position_y));
61 try_save(ar, ser20::make_nvp("keep_position_xz", obj.keep_position_xz));
62 try_save(ar, ser20::make_nvp("keep_rotation", obj.keep_rotation));
63
64 try_save(ar, ser20::make_nvp("keep_in_place", obj.keep_in_place));
65}
68
70{
71 try_load(ar, ser20::make_nvp("keep_position_y", obj.keep_position_y));
72 try_load(ar, ser20::make_nvp("keep_position_xz", obj.keep_position_xz));
73 try_load(ar, ser20::make_nvp("keep_rotation", obj.keep_rotation));
74
75 try_load(ar, ser20::make_nvp("keep_in_place", obj.keep_in_place));
76}
79
81{
82 try_save(ar, ser20::make_nvp("base_type", ser20::base_class<asset_importer_meta>(&obj)));
83 try_save(ar, ser20::make_nvp("root_motion", obj.root_motion));
84}
87
89{
90 try_load(ar, ser20::make_nvp("base_type", ser20::base_class<asset_importer_meta>(&obj)));
91 try_load(ar, ser20::make_nvp("root_motion", obj.root_motion));
92}
95
96} // namespace unravel
attributes::value_type attribute
Definition reflection.h:19
std::map< std::string, meta_any > attributes
Definition reflection.h:18
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
#define REFLECT(cls)
Definition reflection.h:133
#define SAVE_INSTANTIATE(cls, Archive)
#define LOAD(cls)
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 SAVE(cls)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
struct unravel::animation_importer_meta::root_motion_meta root_motion