diff --git a/__init__.py b/__init__.py index be06943..b3a4c11 100644 --- a/__init__.py +++ b/__init__.py @@ -257,7 +257,14 @@ class ABC3D_text_properties(bpy.types.PropertyGroup): #TODO: simply, merge, cut cut cut class ABC3D_data(bpy.types.PropertyGroup): available_fonts: bpy.props.CollectionProperty(type=ABC3D_available_font, name="Available fonts") - active_font_index: bpy.props.IntProperty() + def active_font_index_update(self, context): + if len(self.available_fonts) <= self.active_font_index: + self.active_font_index = len(self.available_fonts) - 1 + + active_font_index: bpy.props.IntProperty( + default=-1, + update=active_font_index_update, + ) available_texts: bpy.props.CollectionProperty(type=ABC3D_text_properties, name="Available texts") def active_text_index_update(self, context): if self.active_text_index != -1: