12 entt::meta_factory<animation_retargeting_mode>{}
13 .type(
"animation_retargeting_mode"_hs)
18 .data<animation_retargeting_mode::index_based>(
"index_based"_hs)
23 .data<animation_retargeting_mode::name_based>(
"name_based"_hs)
32 entt::meta_factory<animation_component::culling_mode>{}
33 .type(
"culling_mode"_hs)
38 .data<animation_component::culling_mode::always_animate>(
"always_animate"_hs)
43 .data<animation_component::culling_mode::renderer_based>(
"renderer_based"_hs)
50 entt::meta_factory<animation_component>{}
51 .type(
"animation_component"_hs)
67 .data<&animation_component::set_autoplay, &animation_component::get_autoplay>(
"auto_play"_hs)
71 entt::attribute{
"tooltip",
"Controls whether the animation should auto start."},
73 .data<&animation_component::set_culling_mode, &animation_component::get_culling_mode>(
"culling_mode"_hs)
77 entt::attribute{
"tooltip",
"Controls how the animation logic should be culled."},
79 .data<&animation_component::set_apply_root_motion, &animation_component::get_apply_root_motion>(
"apply_root_motion"_hs)
84 .data<&animation_component::set_speed, &animation_component::get_speed>(
"speed"_hs)
88 entt::attribute{
"tooltip",
"Controls the playback speed of the animation. 1.0 = normal speed, 2.0 = double speed, 0.5 = half speed."},
92 .data<&animation_component::set_retargeting_mode, &animation_component::get_retargeting_mode>(
"retargeting_mode"_hs)
96 entt::attribute{
"tooltip",
"Bone matching mode: index-based (fast, requires exact match) or name-based (flexible, works with different skeletons)"},
102 try_save(ar, ser20::make_nvp(
"animation", obj.get_animation()));
103 try_save(ar, ser20::make_nvp(
"auto_play", obj.get_autoplay()));
104 try_save(ar, ser20::make_nvp(
"culling_mode", obj.get_culling_mode()));
105 try_save(ar, ser20::make_nvp(
"apply_root_motion", obj.get_apply_root_motion()));
106 try_save(ar, ser20::make_nvp(
"speed", obj.get_speed()));
107 try_save(ar, ser20::make_nvp(
"retargeting_mode", obj.get_retargeting_mode()));
115 if(
try_load(ar, ser20::make_nvp(
"animation", animation)))
117 obj.set_animation(animation);
121 if(
try_load(ar, ser20::make_nvp(
"auto_play", auto_play)))
123 obj.set_autoplay(auto_play);
127 if(
try_load(ar, ser20::make_nvp(
"culling_mode", culling_mode)))
129 obj.set_culling_mode(culling_mode);
132 bool apply_root_motion{};
133 if(
try_load(ar, ser20::make_nvp(
"apply_root_motion", apply_root_motion)))
135 obj.set_apply_root_motion(apply_root_motion);
139 if(
try_load(ar, ser20::make_nvp(
"speed", speed)))
141 obj.set_speed(speed);
145 if(
try_load(ar, ser20::make_nvp(
"retargeting_mode", retargeting_mode)))
147 obj.set_retargeting_mode(retargeting_mode);
auto get_animation() const -> const asset_handle< animation_clip > &
void set_animation(const asset_handle< animation_clip > &animation)
attributes::value_type attribute
std::map< std::string, meta_any > attributes
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
animation_retargeting_mode
Animation retargeting mode for bone matching.
@ name_based
Flexible, works with different skeletons (uses cached hash map)
#define REFLECT_INLINE(cls)
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Thread-safe handle to an asset.