summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSilc 'Tokage' Renew <61938263+TokageItLab@users.noreply.github.com>2024-07-26 17:04:56 +0900
committerSilc 'Tokage' Renew <61938263+TokageItLab@users.noreply.github.com>2024-07-26 18:05:34 +0900
commit0235086c14bcf840ce11de4233306933e44704c1 (patch)
tree132d18bef0dd158340518fd36c8f0a8e8af53f4d /modules
parentf0e20efb33adbf9d6d9c111d646685a30bdd8f4f (diff)
downloadredot-engine-0235086c14bcf840ce11de4233306933e44704c1.tar.gz
Add validation to glTF importer for Blendshape and Animation
Diffstat (limited to 'modules')
-rw-r--r--modules/fbx/fbx_document.cpp8
-rw-r--r--modules/gltf/gltf_document.cpp8
2 files changed, 2 insertions, 14 deletions
diff --git a/modules/fbx/fbx_document.cpp b/modules/fbx/fbx_document.cpp
index b9d9ec7b6c..b5ea6302df 100644
--- a/modules/fbx/fbx_document.cpp
+++ b/modules/fbx/fbx_document.cpp
@@ -288,14 +288,8 @@ String FBXDocument::_gen_unique_name(HashSet<String> &unique_names, const String
}
String FBXDocument::_sanitize_animation_name(const String &p_name) {
- // Animations disallow the normal node invalid characters as well as "," and "["
- // (See animation/animation_player.cpp::add_animation)
-
- // TODO: Consider adding invalid_characters or a validate_animation_name to animation_player to mirror Node.
String anim_name = p_name.validate_node_name();
- anim_name = anim_name.replace(",", "");
- anim_name = anim_name.replace("[", "");
- return anim_name;
+ return AnimationLibrary::validate_library_name(anim_name);
}
String FBXDocument::_gen_unique_animation_name(Ref<FBXState> p_state, const String &p_name) {
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index dff1e62e82..4e091736ef 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -472,14 +472,8 @@ String GLTFDocument::_gen_unique_name(Ref<GLTFState> p_state, const String &p_na
}
String GLTFDocument::_sanitize_animation_name(const String &p_name) {
- // Animations disallow the normal node invalid characters as well as "," and "["
- // (See animation/animation_player.cpp::add_animation)
-
- // TODO: Consider adding invalid_characters or a validate_animation_name to animation_player to mirror Node.
String anim_name = p_name.validate_node_name();
- anim_name = anim_name.replace(",", "");
- anim_name = anim_name.replace("[", "");
- return anim_name;
+ return AnimationLibrary::validate_library_name(anim_name);
}
String GLTFDocument::_gen_unique_animation_name(Ref<GLTFState> p_state, const String &p_name) {