1313from bpy .types import Operator , Object , Context , Depsgraph , Mesh , Material , Event
1414from collections import OrderedDict
1515from enum import Enum
16- from typing import cast , List , Optional , Tuple , Set
16+ from typing import cast
1717from bdk_py import Poly , Brush , csg_rebuild , BspBuildOptions
1818import bmesh
1919import bpy
@@ -142,13 +142,13 @@ def draw(self, context):
142142 flow .prop (self , 'poly_flags' )
143143
144144 def execute (self , context ):
145- def set_flags (bsp_brush : BDK_PG_bsp_brush , flags : Set [str ]):
145+ def set_flags (bsp_brush : BDK_PG_bsp_brush , flags : set [str ]):
146146 bsp_brush .poly_flags = flags
147147
148- def add_flags (bsp_brush : BDK_PG_bsp_brush , flags : Set [str ]):
148+ def add_flags (bsp_brush : BDK_PG_bsp_brush , flags : set [str ]):
149149 bsp_brush .poly_flags |= flags
150150
151- def remove_flags (bsp_brush : BDK_PG_bsp_brush , flags : Set [str ]):
151+ def remove_flags (bsp_brush : BDK_PG_bsp_brush , flags : set [str ]):
152152 bsp_brush .poly_flags -= flags
153153
154154 def get_operation_function (operation : str ):
@@ -379,7 +379,7 @@ class BspBrushError(Enum):
379379 TWISTED_FACE = 3
380380
381381
382- def get_bsp_brush_errors (obj : Object , depsgraph : Depsgraph ) -> List [ Tuple [BspBrushError , int ]]:
382+ def get_bsp_brush_errors (obj : Object , depsgraph : Depsgraph ) -> list [ tuple [BspBrushError , int ]]:
383383 """
384384 Check the given object for errors and return a set of all the errors that were found.
385385 """
@@ -746,7 +746,7 @@ def execute(self, context):
746746 for error in result .errors :
747747 self .report ({'WARNING' }, str (error ))
748748
749- def brush_object_filter (obj : Object , instance_objects : List [Object ]):
749+ def brush_object_filter (obj : Object , instance_objects : list [Object ]):
750750 if not obj .bdk .type == 'BSP_BRUSH' :
751751 return False
752752 if self .should_do_only_visible :
@@ -762,9 +762,9 @@ def brush_object_filter(obj: Object, instance_objects: List[Object]):
762762
763763 # This is a list of the materials used for the brushes. It is populated as we iterate over the brush objects.
764764 # We then use this at the end to create the materials for the level object.
765- materials : List [ Optional [ Material ] ] = []
765+ materials : list [ Material | None ] = []
766766
767- def _get_or_add_material (material : Optional [ Material ] ) -> int :
767+ def _get_or_add_material (material : Material | None ) -> int :
768768 try :
769769 return materials .index (material )
770770 except ValueError :
@@ -790,7 +790,7 @@ def _get_or_add_material(material: Optional[Material]) -> int:
790790 # level object and exclude them from BSP surface tool operations.
791791 instanced_brush_indices = []
792792
793- brushes : List [Brush ] = []
793+ brushes : list [Brush ] = []
794794 for brush_index , (brush_object , asset_instances , matrix_world ) in enumerate (brush_objects ):
795795
796796 if asset_instances :
0 commit comments