Data field 0 overrunning bounds of UI_MATERIAL_ANIMATION_LENGTHS bugfix

This commit is contained in:
William Herald Snyder 2022-10-03 10:28:53 -04:00
parent 69e959e7a3
commit 226682de8b
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ def _fill_material_props_data(material, material_properties):
anim_length_index = int(sqrt(material.data[0]))
if anim_length_index < 0:
anim_length_index = 0
elif anim_length_index > len(UI_MATERIAL_ANIMATION_LENGTHS):
elif anim_length_index >= len(UI_MATERIAL_ANIMATION_LENGTHS):
anim_length_index = len(UI_MATERIAL_ANIMATION_LENGTHS) - 1
material_properties.animation_length = UI_MATERIAL_ANIMATION_LENGTHS[anim_length_index][0]