A preference to list those classes that are not affected by the 'cut decorator'.

This commit is contained in:
Ryan Schultz
2025-05-15 21:45:53 -05:00
parent f39d3d4b9c
commit 9e6320d545
3 changed files with 16 additions and 0 deletions
@@ -1650,9 +1650,15 @@ class CutDecorator:
all_vertex_i_offset = 0
selected_vertex_i_offset = 0
classes_no_cut_str = bpy.context.scene.DocProperties.classes_no_cut
classes_no_cut = [word.strip() for word in classes_no_cut_str.split(",")]
for obj in [o for o in bpy.context.visible_objects if o.type == "MESH"]:
if not (element := tool.Ifc.get_entity(obj)):
continue
#Skip the elements in the following classes
if element.is_a() in classes_no_cut:
continue
self.decorate(context, obj, element)
verts, edges = DecoratorData.cut_cache[element.id()]
@@ -1720,6 +1726,9 @@ class CutDecorator:
batch.draw(shader)
def decorate(self, context, obj: bpy.types.Object, element: ifcopenshell.entity_instance) -> None:
has_cut_cache = element.id() in DecoratorData.cut_cache
has_fill_cache = element.id() in DecoratorData.fill_cache
@@ -449,6 +449,12 @@ class DocProperties(PropertyGroup):
name="Classes to Wireframe",
description="Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace",
)
classes_no_cut: StringProperty(
default="IfcVirtualElement, IfcSpace",
name="Classes that are not cut",
description="The cut decoractor will be turned off for these classes\nEx: IfcVirtualelement, IfcSpace",
)
if TYPE_CHECKING:
should_use_underlay_cache: bool
+1
View File
@@ -420,6 +420,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
layout.prop(dprops, "imperial_precision")
layout.prop(dprops, "tolerance")
layout.prop(dprops, "classes_to_wireframe")
layout.prop(dprops, "classes_no_cut")
def draw_decorator_colors(self, layout, context):
layout.row().prop(self, "decorations_colour")