diff options
author | kleonc <9283098+kleonc@users.noreply.github.com> | 2022-07-03 15:31:43 +0200 |
---|---|---|
committer | kleonc <9283098+kleonc@users.noreply.github.com> | 2022-07-03 15:31:43 +0200 |
commit | 73ecd71b7d017612d5c6ab1dd4c180fd57bfe770 (patch) | |
tree | 04b9b91d486cb884d8a8d269743aeae412b57072 /scene/3d | |
parent | 6f024546341fa53eccdafff39e5095979e346c72 (diff) | |
download | redot-engine-73ecd71b7d017612d5c6ab1dd4c180fd57bfe770.tar.gz |
Fix no `hint_string` for `frame` property in `AnimatedSprite`s
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/sprite_3d.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 55b55d924c..cb6354f7a8 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -1034,8 +1034,11 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &property) const { if (property.name == "frame") { property.hint = PROPERTY_HINT_RANGE; - if (frames->has_animation(animation) && frames->get_frame_count(animation) > 1) { + if (frames->has_animation(animation) && frames->get_frame_count(animation) > 0) { property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1"; + } else { + // Avoid an error, `hint_string` is required for `PROPERTY_HINT_RANGE`. + property.hint_string = "0,0,1"; } property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } |