summaryrefslogtreecommitdiff
path: root/modules/gltf/gltf_state.cpp
diff options
context:
space:
mode:
authorHakim <hakim.rouatbi@gmail.com>2022-08-09 19:39:58 +0200
committerHakim <hakim.rouatbi@gmail.com>2022-08-10 11:17:29 +0200
commit805ffdfbf6841ac19c6fdbf3425a6ff15115bed7 (patch)
tree8d0cf1af26b4316a1a9fe9618a1b53b0cfe9ee90 /modules/gltf/gltf_state.cpp
parent94a8065ae4ae19b814bc9b02d41358d55d3cf813 (diff)
Prevent AnimationPlayer from being added on GLTF import if the option is unchecked. Fixes #63954
Diffstat (limited to 'modules/gltf/gltf_state.cpp')
-rw-r--r--modules/gltf/gltf_state.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/gltf/gltf_state.cpp b/modules/gltf/gltf_state.cpp
index a5f7bcf9d6..8212e4c22f 100644
--- a/modules/gltf/gltf_state.cpp
+++ b/modules/gltf/gltf_state.cpp
@@ -79,6 +79,8 @@ void GLTFState::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_skeletons", "skeletons"), &GLTFState::set_skeletons);
ClassDB::bind_method(D_METHOD("get_skeleton_to_node"), &GLTFState::get_skeleton_to_node);
ClassDB::bind_method(D_METHOD("set_skeleton_to_node", "skeleton_to_node"), &GLTFState::set_skeleton_to_node);
+ ClassDB::bind_method(D_METHOD("get_create_animations"), &GLTFState::get_create_animations);
+ ClassDB::bind_method(D_METHOD("set_create_animations", "create_animations"), &GLTFState::set_create_animations);
ClassDB::bind_method(D_METHOD("get_animations"), &GLTFState::get_animations);
ClassDB::bind_method(D_METHOD("set_animations", "animations"), &GLTFState::set_animations);
ClassDB::bind_method(D_METHOD("get_scene_node", "idx"), &GLTFState::get_scene_node);
@@ -106,6 +108,7 @@ void GLTFState::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_animation_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_animation_names", "get_unique_animation_names"); // Set<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "skeletons", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skeletons", "get_skeletons"); // Vector<Ref<GLTFSkeleton>>
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "skeleton_to_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skeleton_to_node", "get_skeleton_to_node"); // RBMap<GLTFSkeletonIndex,
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "create_animations"), "set_create_animations", "get_create_animations"); // bool
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "animations", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_animations", "get_animations"); // Vector<Ref<GLTFAnimation>>
}
@@ -285,6 +288,14 @@ void GLTFState::set_skeleton_to_node(Dictionary p_skeleton_to_node) {
GLTFTemplateConvert::set_from_dict(skeleton_to_node, p_skeleton_to_node);
}
+bool GLTFState::get_create_animations() {
+ return create_animations;
+}
+
+void GLTFState::set_create_animations(bool p_create_animations) {
+ create_animations = p_create_animations;
+}
+
Array GLTFState::get_animations() {
return GLTFTemplateConvert::to_array(animations);
}