diff options
Diffstat (limited to 'scene/resources/skin.h')
-rw-r--r-- | scene/resources/skin.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/resources/skin.h b/scene/resources/skin.h index ddc7c655f5..57aaf1afd4 100644 --- a/scene/resources/skin.h +++ b/scene/resources/skin.h @@ -37,7 +37,8 @@ class Skin : public Resource { GDCLASS(Skin, Resource) struct Bind { - int bone; + int bone = -1; + StringName name; Transform pose; }; @@ -58,9 +59,11 @@ public: inline int get_bind_count() const { return bind_count; } void add_bind(int p_bone, const Transform &p_pose); + void add_named_bind(const String &p_name, const Transform &p_pose); void set_bind_bone(int p_index, int p_bone); void set_bind_pose(int p_index, const Transform &p_pose); + void set_bind_name(int p_index, const StringName &p_name); inline int get_bind_bone(int p_index) const { #ifdef DEBUG_ENABLED @@ -69,6 +72,13 @@ public: return binds_ptr[p_index].bone; } + inline StringName get_bind_name(int p_index) const { +#ifdef DEBUG_ENABLED + ERR_FAIL_INDEX_V(p_index, bind_count, StringName()); +#endif + return binds_ptr[p_index].name; + } + inline Transform get_bind_pose(int p_index) const { #ifdef DEBUG_ENABLED ERR_FAIL_INDEX_V(p_index, bind_count, Transform()); |