Expand bone name possibilities.
This commit is contained in:
parent
a6066c5e42
commit
c203fbfa8c
@ -63,7 +63,6 @@
|
|||||||
#ifdef MODULE_GRIDMAP_ENABLED
|
#ifdef MODULE_GRIDMAP_ENABLED
|
||||||
#include "modules/gridmap/grid_map.h"
|
#include "modules/gridmap/grid_map.h"
|
||||||
#endif // MODULE_GRIDMAP_ENABLED
|
#endif // MODULE_GRIDMAP_ENABLED
|
||||||
#include "modules/regex/regex.h"
|
|
||||||
#include "scene/2d/node_2d.h"
|
#include "scene/2d/node_2d.h"
|
||||||
#include "scene/3d/bone_attachment_3d.h"
|
#include "scene/3d/bone_attachment_3d.h"
|
||||||
#include "scene/3d/camera_3d.h"
|
#include "scene/3d/camera_3d.h"
|
||||||
@ -505,25 +504,11 @@ String GLTFDocument::_gen_unique_animation_name(Ref<GLTFState> state, const Stri
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
String GLTFDocument::_sanitize_bone_name(const String &name) {
|
String GLTFDocument::_sanitize_bone_name(const String &p_name) {
|
||||||
String p_name = name.camelcase_to_underscore(true);
|
String name = p_name;
|
||||||
|
name = name.replace(":", "_");
|
||||||
RegEx pattern_nocolon(":");
|
name = name.replace("/", "_");
|
||||||
p_name = pattern_nocolon.sub(p_name, "_", true);
|
return name;
|
||||||
|
|
||||||
RegEx pattern_noslash("/");
|
|
||||||
p_name = pattern_noslash.sub(p_name, "_", true);
|
|
||||||
|
|
||||||
RegEx pattern_nospace(" +");
|
|
||||||
p_name = pattern_nospace.sub(p_name, "_", true);
|
|
||||||
|
|
||||||
RegEx pattern_multiple("_+");
|
|
||||||
p_name = pattern_multiple.sub(p_name, "_", true);
|
|
||||||
|
|
||||||
RegEx pattern_padded("0+(\\d+)");
|
|
||||||
p_name = pattern_padded.sub(p_name, "$1", true);
|
|
||||||
|
|
||||||
return p_name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String GLTFDocument::_gen_unique_bone_name(Ref<GLTFState> state, const GLTFSkeletonIndex skel_i, const String &p_name) {
|
String GLTFDocument::_gen_unique_bone_name(Ref<GLTFState> state, const GLTFSkeletonIndex skel_i, const String &p_name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user