17 entt::meta_factory<model_component>{}
18 .type(
"model_component"_hs)
35 .data<&model_component::set_static, &model_component::is_static>(
"static"_hs)
41 .data<&model_component::set_casts_shadow, &model_component::casts_shadow>(
"casts_shadow"_hs)
47 .data<&model_component::set_casts_reflection, &model_component::casts_reflection>(
"casts_reflection"_hs)
51 entt::attribute{
"tooltip",
"Is the model participating in reflection generation?"},
53 .data<&model_component::set_model, &model_component::get_model>(
"model"_hs)
62 try_save(ar, ser20::make_nvp(
"enabled", obj.is_enabled()));
63 try_save(ar, ser20::make_nvp(
"static", obj.is_static()));
64 try_save(ar, ser20::make_nvp(
"casts_shadow", obj.casts_shadow()));
65 try_save(ar, ser20::make_nvp(
"casts_reflection", obj.casts_reflection()));
66 try_save(ar, ser20::make_nvp(
"model", obj.get_model()));
73 bool is_enabled{
true};
74 if(
try_load(ar, ser20::make_nvp(
"enabled", is_enabled)))
76 obj.set_enabled(is_enabled);
80 if(
try_load(ar, ser20::make_nvp(
"static", is_static)))
82 obj.set_static(is_static);
86 if(
try_load(ar, ser20::make_nvp(
"casts_shadow", casts_shadow)))
88 obj.set_casts_shadow(casts_shadow);
91 bool casts_reflection{};
92 if(
try_load(ar, ser20::make_nvp(
"casts_reflection", casts_reflection)))
94 obj.set_casts_reflection(casts_reflection);
97 auto mod = obj.get_model();
98 if(
try_load(ar, ser20::make_nvp(
"model", mod)))
108 entt::meta_factory<bone_component>{}
109 .type(
"bone_component"_hs)
130 try_save(ar, ser20::make_nvp(
"bone_index", obj.bone_index));
137 try_load(ar, ser20::make_nvp(
"bone_index", obj.bone_index));
144 entt::meta_factory<submesh_component>{}
145 .type(
"submesh_component"_hs)
166 try_save(ar, ser20::make_nvp(
"submeshes", obj.submeshes));
173 try_load(ar, ser20::make_nvp(
"submeshes", obj.submeshes));
Class that contains core data for meshes.
void set_enabled(bool enabled)
Sets whether the model is enabled.
auto is_enabled() const -> bool
Checks if the model is enabled.
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
#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
std::vector< uint32_t > submeshes