mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 00:09:59 +00:00
closes #5086: a preference to assign which classes display as wireframe upon opening the IFC file
This commit is contained in:
@@ -203,6 +203,8 @@ class IfcImporter:
|
|||||||
self.progress = 0
|
self.progress = 0
|
||||||
|
|
||||||
self.material_creator = MaterialCreator(ifc_import_settings, self)
|
self.material_creator = MaterialCreator(ifc_import_settings, self)
|
||||||
|
classes_to_wireframe_str = bpy.context.scene.DocProperties.classes_to_wireframe
|
||||||
|
self.classes_to_wireframe_list = [word.strip() for word in classes_to_wireframe_str.split(",")]
|
||||||
|
|
||||||
def profile_code(self, message: str) -> None:
|
def profile_code(self, message: str) -> None:
|
||||||
if not self.time:
|
if not self.time:
|
||||||
@@ -815,6 +817,10 @@ class IfcImporter:
|
|||||||
obj = bpy.data.objects.new(tool.Loader.get_name(element), mesh)
|
obj = bpy.data.objects.new(tool.Loader.get_name(element), mesh)
|
||||||
self.link_element(element, obj)
|
self.link_element(element, obj)
|
||||||
|
|
||||||
|
for ifcclass in self.classes_to_wireframe_list:
|
||||||
|
if element.is_a(ifcclass):
|
||||||
|
obj.display_type = 'WIRE'
|
||||||
|
|
||||||
if shape:
|
if shape:
|
||||||
# We use numpy here because Blender mathutils.Matrix is not accurate enough
|
# We use numpy here because Blender mathutils.Matrix is not accurate enough
|
||||||
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
|
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
|
||||||
|
|||||||
@@ -402,6 +402,11 @@ class DocProperties(PropertyGroup):
|
|||||||
magic_font_scale: bpy.props.FloatProperty(default=0.004118616, name="Font Scale Factor")
|
magic_font_scale: bpy.props.FloatProperty(default=0.004118616, name="Font Scale Factor")
|
||||||
imperial_precision: StringProperty(default="1/32", name="Imperial Precision")
|
imperial_precision: StringProperty(default="1/32", name="Imperial Precision")
|
||||||
tolerance: bpy.props.FloatProperty(default=0.00001, name="A tolerance used when selecting objects")
|
tolerance: bpy.props.FloatProperty(default=0.00001, name="A tolerance used when selecting objects")
|
||||||
|
classes_to_wireframe: StringProperty(
|
||||||
|
default="IfcVirtualelement",
|
||||||
|
name="Classes to Wireframe",
|
||||||
|
description = "Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class BIMCameraProperties(PropertyGroup):
|
class BIMCameraProperties(PropertyGroup):
|
||||||
|
|||||||
@@ -383,6 +383,8 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
row.prop(context.scene.DocProperties, "imperial_precision")
|
row.prop(context.scene.DocProperties, "imperial_precision")
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(context.scene.DocProperties, "tolerance")
|
row.prop(context.scene.DocProperties, "tolerance")
|
||||||
|
row = self.layout.row()
|
||||||
|
row.prop(context.scene.DocProperties, "classes_to_wireframe")
|
||||||
|
|
||||||
|
|
||||||
# Scene panel groups
|
# Scene panel groups
|
||||||
|
|||||||
Reference in New Issue
Block a user