Merge pull request #55943 from jvanmourik/master

glTF animation parsing: Changed the 'loop' and 'cycle' animation name keywords to be case-insensitive
This commit is contained in:
Rémi Verschelde 2022-07-31 17:28:43 +02:00 committed by GitHub
commit 602e967ba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4938,7 +4938,8 @@ Error GLTFDocument::_parse_animations(Ref<GLTFState> state) {
if (d.has("name")) {
const String name = d["name"];
if (name.begins_with("loop") || name.ends_with("loop") || name.begins_with("cycle") || name.ends_with("cycle")) {
const String name_lower = name.to_lower();
if (name_lower.begins_with("loop") || name_lower.ends_with("loop") || name_lower.begins_with("cycle") || name_lower.ends_with("cycle")) {
animation->set_loop(true);
}
animation->set_name(_gen_unique_animation_name(state, name));