mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 05:00:53 +00:00
A preference to list those classes that are not affected by the 'cut decorator'.
This commit is contained in:
@@ -1650,9 +1650,15 @@ class CutDecorator:
|
|||||||
all_vertex_i_offset = 0
|
all_vertex_i_offset = 0
|
||||||
selected_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"]:
|
for obj in [o for o in bpy.context.visible_objects if o.type == "MESH"]:
|
||||||
if not (element := tool.Ifc.get_entity(obj)):
|
if not (element := tool.Ifc.get_entity(obj)):
|
||||||
continue
|
continue
|
||||||
|
#Skip the elements in the following classes
|
||||||
|
if element.is_a() in classes_no_cut:
|
||||||
|
continue
|
||||||
self.decorate(context, obj, element)
|
self.decorate(context, obj, element)
|
||||||
|
|
||||||
verts, edges = DecoratorData.cut_cache[element.id()]
|
verts, edges = DecoratorData.cut_cache[element.id()]
|
||||||
@@ -1720,6 +1726,9 @@ class CutDecorator:
|
|||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
|
||||||
def decorate(self, context, obj: bpy.types.Object, element: ifcopenshell.entity_instance) -> None:
|
def decorate(self, context, obj: bpy.types.Object, element: ifcopenshell.entity_instance) -> None:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
has_cut_cache = element.id() in DecoratorData.cut_cache
|
has_cut_cache = element.id() in DecoratorData.cut_cache
|
||||||
has_fill_cache = element.id() in DecoratorData.fill_cache
|
has_fill_cache = element.id() in DecoratorData.fill_cache
|
||||||
|
|
||||||
|
|||||||
@@ -449,6 +449,12 @@ class DocProperties(PropertyGroup):
|
|||||||
name="Classes to Wireframe",
|
name="Classes to Wireframe",
|
||||||
description="Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace",
|
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:
|
if TYPE_CHECKING:
|
||||||
should_use_underlay_cache: bool
|
should_use_underlay_cache: bool
|
||||||
|
|||||||
@@ -420,6 +420,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
layout.prop(dprops, "imperial_precision")
|
layout.prop(dprops, "imperial_precision")
|
||||||
layout.prop(dprops, "tolerance")
|
layout.prop(dprops, "tolerance")
|
||||||
layout.prop(dprops, "classes_to_wireframe")
|
layout.prop(dprops, "classes_to_wireframe")
|
||||||
|
layout.prop(dprops, "classes_no_cut")
|
||||||
|
|
||||||
def draw_decorator_colors(self, layout, context):
|
def draw_decorator_colors(self, layout, context):
|
||||||
layout.row().prop(self, "decorations_colour")
|
layout.row().prop(self, "decorations_colour")
|
||||||
|
|||||||
Reference in New Issue
Block a user