Fix errors reregistering Bonsai

Items generators were exhausted at the first register leading to errors like 'TypeError: EnumProperty(..., default='-'): not found in enum members' preventing reregistration.
This commit is contained in:
Andrej730
2024-11-19 12:44:51 +05:00
parent 837f9e82e2
commit 213b6ed3c3
2 changed files with 2 additions and 2 deletions
@@ -498,7 +498,7 @@ class AlignProduct(bpy.types.Operator):
AlignType = Literal["CENTERLINE", "POSITIVE", "NEGATIVE"] AlignType = Literal["CENTERLINE", "POSITIVE", "NEGATIVE"]
align_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration] align_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
items=((i, i, "") for i in get_args(AlignType)) items=[(i, i, "") for i in get_args(AlignType)]
) )
if TYPE_CHECKING: if TYPE_CHECKING:
+1 -1
View File
@@ -245,7 +245,7 @@ class PsetProperties(PropertyGroup):
active_pset_name: StringProperty(name="Pset Name") active_pset_name: StringProperty(name="Pset Name")
active_pset_type: EnumProperty( active_pset_type: EnumProperty(
name="Active Pset Type", name="Active Pset Type",
items=((i, i, "") for i in ("-", "PSET", "QTO")), items=[(i, i, "") for i in ("-", "PSET", "QTO")],
default="-", default="-",
) )
properties: CollectionProperty(name="Properties", type=IfcProperty) properties: CollectionProperty(name="Properties", type=IfcProperty)