mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Minor fixes to new presentation layer features by Krande
This commit is contained in:
@@ -206,8 +206,8 @@ if bpy is not None:
|
|||||||
operator.SetNorthOffset,
|
operator.SetNorthOffset,
|
||||||
operator.GetNorthOffset,
|
operator.GetNorthOffset,
|
||||||
operator.AddPresentationLayer,
|
operator.AddPresentationLayer,
|
||||||
operator.AddToPresentationLayer,
|
operator.AssignPresentationLayer,
|
||||||
operator.RemoveFromPresentationLayer,
|
operator.UnassignPresentationLayer,
|
||||||
operator.RemovePresentationLayer,
|
operator.RemovePresentationLayer,
|
||||||
operator.UpdatePresentationLayer,
|
operator.UpdatePresentationLayer,
|
||||||
operator.AddDrawingStyleAttribute,
|
operator.AddDrawingStyleAttribute,
|
||||||
@@ -319,7 +319,6 @@ if bpy is not None:
|
|||||||
ui.BIM_UL_generic,
|
ui.BIM_UL_generic,
|
||||||
ui.BIM_UL_clash_sets,
|
ui.BIM_UL_clash_sets,
|
||||||
ui.BIM_UL_constraints,
|
ui.BIM_UL_constraints,
|
||||||
ui.BIM_UL_presentation_layers,
|
|
||||||
ui.BIM_UL_document_information,
|
ui.BIM_UL_document_information,
|
||||||
ui.BIM_UL_document_references,
|
ui.BIM_UL_document_references,
|
||||||
ui.BIM_UL_topics,
|
ui.BIM_UL_topics,
|
||||||
|
|||||||
@@ -975,10 +975,10 @@ class IfcParser:
|
|||||||
def load_presentation_layer_assignments(self):
|
def load_presentation_layer_assignments(self):
|
||||||
for representation in self.representations.values():
|
for representation in self.representations.values():
|
||||||
if representation["presentation_layer"]:
|
if representation["presentation_layer"]:
|
||||||
pl = representation["presentation_layer"]
|
layer = representation["presentation_layer"]
|
||||||
if pl.name == '':
|
if layer.name == "":
|
||||||
continue
|
continue
|
||||||
self.presentation_layer_assignments.setdefault(pl.name, []).append(representation)
|
self.presentation_layer_assignments.setdefault(layer.name, []).append(representation)
|
||||||
|
|
||||||
def load_representations(self):
|
def load_representations(self):
|
||||||
if not self.ifc_export_settings.has_representations:
|
if not self.ifc_export_settings.has_representations:
|
||||||
@@ -1110,7 +1110,9 @@ class IfcParser:
|
|||||||
"is_native": mesh.BIMMeshProperties.is_native if hasattr(mesh, "BIMMeshProperties") else False,
|
"is_native": mesh.BIMMeshProperties.is_native if hasattr(mesh, "BIMMeshProperties") else False,
|
||||||
"is_swept_solid": mesh.BIMMeshProperties.is_swept_solid if hasattr(mesh, "BIMMeshProperties") else False,
|
"is_swept_solid": mesh.BIMMeshProperties.is_swept_solid if hasattr(mesh, "BIMMeshProperties") else False,
|
||||||
"is_generated": False,
|
"is_generated": False,
|
||||||
"presentation_layer": obj.BIMObjectProperties.presentation_layer if hasattr(obj, "BIMObjectProperties") else None,
|
"presentation_layer": obj.BIMObjectProperties.presentation_layer
|
||||||
|
if hasattr(obj, "BIMObjectProperties")
|
||||||
|
else None,
|
||||||
"attributes": {"Name": mesh.name},
|
"attributes": {"Name": mesh.name},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2034,23 +2036,31 @@ class IfcExporter:
|
|||||||
def create_presentation_layer_assignments(self):
|
def create_presentation_layer_assignments(self):
|
||||||
scene_props = bpy.context.scene.BIMProperties
|
scene_props = bpy.context.scene.BIMProperties
|
||||||
for name, assigned_items in self.ifc_parser.presentation_layer_assignments.items():
|
for name, assigned_items in self.ifc_parser.presentation_layer_assignments.items():
|
||||||
if name == '':
|
if name == "":
|
||||||
continue
|
continue
|
||||||
pl = scene_props.presentation_layers[name]
|
layer = scene_props.presentation_layers[name]
|
||||||
print("Presentation Export: ", name, pl.identifier, pl.layer_on)
|
|
||||||
|
|
||||||
with_style = False
|
with_style = False
|
||||||
if pl.layer_on is False:
|
if layer.layer_on is False:
|
||||||
with_style = True
|
with_style = True
|
||||||
|
|
||||||
if with_style is False:
|
if with_style is False:
|
||||||
self.file.createIfcPresentationLayerAssignment(
|
self.file.createIfcPresentationLayerAssignment(
|
||||||
name, pl.description, [i["ifc"].MappedRepresentation for i in assigned_items], pl.identifier
|
name,
|
||||||
|
layer.description or None,
|
||||||
|
[i["ifc"].MappedRepresentation for i in assigned_items],
|
||||||
|
layer.identifier or None,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.file.createIfcPresentationLayerWithStyle(
|
self.file.createIfcPresentationLayerWithStyle(
|
||||||
name, pl.description, [i["ifc"].MappedRepresentation for i in assigned_items], pl.identifier,
|
name,
|
||||||
pl.layer_on, pl.layer_frozen, pl.layer_blocked, pl.layer_styles
|
layer.description or None,
|
||||||
|
[i["ifc"].MappedRepresentation for i in assigned_items],
|
||||||
|
layer.identifier or None,
|
||||||
|
layer.layer_on,
|
||||||
|
layer.layer_frozen,
|
||||||
|
layer.layer_blocked,
|
||||||
|
None,
|
||||||
)
|
)
|
||||||
|
|
||||||
def create_materials(self):
|
def create_materials(self):
|
||||||
@@ -3245,7 +3255,7 @@ class IfcExporter:
|
|||||||
"Profile": self.create_material_profile_def(profile),
|
"Profile": self.create_material_profile_def(profile),
|
||||||
"Priority": profile.priority,
|
"Priority": profile.priority,
|
||||||
"Category": profile.category or None,
|
"Category": profile.category or None,
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return results
|
return results
|
||||||
|
|||||||
@@ -480,6 +480,7 @@ class IfcImporter:
|
|||||||
self.add_project_to_scene()
|
self.add_project_to_scene()
|
||||||
self.profile_code("Add project to scene")
|
self.profile_code("Add project to scene")
|
||||||
self.get_presentation_layers()
|
self.get_presentation_layers()
|
||||||
|
self.profile_code("Get presentation layers")
|
||||||
if self.ifc_import_settings.should_clean_mesh and len(self.file.by_type("IfcElement")) < 10000:
|
if self.ifc_import_settings.should_clean_mesh and len(self.file.by_type("IfcElement")) < 10000:
|
||||||
self.clean_mesh()
|
self.clean_mesh()
|
||||||
self.profile_code("Mesh cleaning")
|
self.profile_code("Mesh cleaning")
|
||||||
@@ -1328,23 +1329,31 @@ class IfcImporter:
|
|||||||
].hide_viewport = True
|
].hide_viewport = True
|
||||||
|
|
||||||
def get_presentation_layers(self):
|
def get_presentation_layers(self):
|
||||||
for f in self.file.by_type("IfcPresentationLayerAssignment"):
|
for assignment in self.file.by_type("IfcPresentationLayerAssignment"):
|
||||||
pl = bpy.context.scene.BIMProperties.presentation_layers.add()
|
layer = bpy.context.scene.BIMProperties.presentation_layers.add()
|
||||||
pl.name = f.Name
|
layer.name = assignment.Name
|
||||||
pl.description = f.Description
|
layer.description = assignment.Description or ""
|
||||||
pl.identifier = f.Identifier
|
layer.identifier = assignment.Identifier or ""
|
||||||
if f.is_a() == "IfcPresentationLayerWithStyle":
|
if assignment.is_a() == "IfcPresentationLayerWithStyle":
|
||||||
pl.layer_on = f.LayerOn if f.LayerOn is not None else True
|
layer.layer_on = assignment.LayerOn if assignment.LayerOn is not None else True
|
||||||
pl.layer_frozen = f.LayerFrozen if f.LayerFrozen is not None else False
|
layer.layer_frozen = assignment.LayerFrozen if assignment.LayerFrozen is not None else False
|
||||||
pl.layer_blocked = f.LayerBlocked if f.LayerBlocked is not None else False
|
layer.layer_blocked = assignment.LayerBlocked if assignment.LayerBlocked is not None else False
|
||||||
|
|
||||||
for item in f.AssignedItems:
|
for item in assignment.AssignedItems:
|
||||||
guid = item.OfProductRepresentation[0].ShapeOfProduct[0].GlobalId
|
# TODO: This is a simplified and incorrect implementation of assigning presentation layers to objects
|
||||||
|
# themselves, and will need to be rewritten in the future. See bug #1109. This code also does not
|
||||||
|
# consider mapped representations.
|
||||||
|
guids = []
|
||||||
|
if not hasattr(item, "OfProductRepresentation"):
|
||||||
|
continue # TODO: At the moment we ignore representation items
|
||||||
|
for product_representation in item.OfProductRepresentation:
|
||||||
|
for product in product_representation.ShapeOfProduct:
|
||||||
|
guids.append(product.GlobalId)
|
||||||
for obj in bpy.context.selectable_objects:
|
for obj in bpy.context.selectable_objects:
|
||||||
global_id = obj.BIMObjectProperties.attributes.get("GlobalId")
|
global_id = obj.BIMObjectProperties.attributes.get("GlobalId")
|
||||||
if global_id and global_id.string_value == guid:
|
if global_id and global_id.string_value in guids:
|
||||||
obj.BIMObjectProperties.presentation_layer.name = pl.name
|
obj.BIMObjectProperties.presentation_layer.name = layer.name
|
||||||
obj.hide_set(not pl.layer_on)
|
obj.hide_set(not layer.layer_on)
|
||||||
|
|
||||||
def clean_mesh(self):
|
def clean_mesh(self):
|
||||||
obj = None
|
obj = None
|
||||||
|
|||||||
@@ -2149,8 +2149,6 @@ class UnassignClassification(bpy.types.Operator):
|
|||||||
index = obj.BIMObjectProperties.classifications.find(key)
|
index = obj.BIMObjectProperties.classifications.find(key)
|
||||||
if index != -1:
|
if index != -1:
|
||||||
obj.BIMObjectProperties.classifications.remove(index)
|
obj.BIMObjectProperties.classifications.remove(index)
|
||||||
|
|
||||||
obj.BIMObjectProperties.classification = ""
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -4324,34 +4322,28 @@ class GetNorthOffset(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class AddToPresentationLayer(bpy.types.Operator):
|
class AssignPresentationLayer(bpy.types.Operator):
|
||||||
bl_idname = "bim.add_to_presentation_layer"
|
bl_idname = "bim.assign_presentation_layer"
|
||||||
bl_label = "Add To Presentation Layer"
|
bl_label = "Assign Presentation Layer"
|
||||||
index: bpy.props.IntProperty()
|
index: bpy.props.IntProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
presentation_layer = bpy.context.scene.BIMProperties.presentation_layers[self.index]
|
presentation_layer = bpy.context.scene.BIMProperties.presentation_layers[self.index]
|
||||||
|
|
||||||
# vl = bpy.context.scene.view_layers[presentation_layer.name]
|
|
||||||
|
|
||||||
for obj in bpy.context.selected_objects:
|
for obj in bpy.context.selected_objects:
|
||||||
|
# TODO: assign using a different strategy than name association
|
||||||
obj.BIMObjectProperties.presentation_layer.name = presentation_layer.name
|
obj.BIMObjectProperties.presentation_layer.name = presentation_layer.name
|
||||||
elem_name = obj.BIMObjectProperties.attributes["Name"].string_value
|
|
||||||
obj.hide_set(not presentation_layer.layer_on)
|
obj.hide_set(not presentation_layer.layer_on)
|
||||||
print(f'Adding "{elem_name}" to View/Presentation Layer "({self.index} - {presentation_layer.name})"')
|
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class RemoveFromPresentationLayer(bpy.types.Operator):
|
class UnassignPresentationLayer(bpy.types.Operator):
|
||||||
bl_idname = "bim.remove_from_presentation_layer"
|
bl_idname = "bim.unassign_presentation_layer"
|
||||||
bl_label = "Remove Selected From Presentation Layer"
|
bl_label = "Unassign Presentation Layer"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for el in bpy.context.selected_objects:
|
for el in bpy.context.selected_objects:
|
||||||
if el.BIMObjectProperties.presentation_layer.name != "":
|
if el.BIMObjectProperties.presentation_layer.name != "":
|
||||||
el.BIMObjectProperties.presentation_layer.name = ""
|
el.BIMObjectProperties.presentation_layer.name = ""
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -4361,15 +4353,10 @@ class AddPresentationLayer(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
new = bpy.context.scene.BIMProperties.presentation_layers.add()
|
new = bpy.context.scene.BIMProperties.presentation_layers.add()
|
||||||
|
|
||||||
# Default values of a new presentation layer
|
|
||||||
new.name = "New Presentation Layer"
|
new.name = "New Presentation Layer"
|
||||||
new.description = "A Description"
|
|
||||||
new.identifier = "Something"
|
|
||||||
new.layer_on = True
|
new.layer_on = True
|
||||||
new.layer_frozen = False
|
new.layer_frozen = False
|
||||||
new.layer_blocked = False
|
new.layer_blocked = False
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -4380,7 +4367,6 @@ class RemovePresentationLayer(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
bpy.context.scene.BIMProperties.presentation_layers.remove(self.index)
|
bpy.context.scene.BIMProperties.presentation_layers.remove(self.index)
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -799,7 +799,6 @@ class PresentationLayer(PropertyGroup):
|
|||||||
layer_on: BoolProperty(name="LayerOn", default=True)
|
layer_on: BoolProperty(name="LayerOn", default=True)
|
||||||
layer_frozen: BoolProperty(name="LayerFrozen", default=False)
|
layer_frozen: BoolProperty(name="LayerFrozen", default=False)
|
||||||
layer_blocked: BoolProperty(name="LayerBlocked", default=False)
|
layer_blocked: BoolProperty(name="LayerBlocked", default=False)
|
||||||
layer_styles: EnumProperty(items=[], name="LayerStyles")
|
|
||||||
|
|
||||||
|
|
||||||
class Constraint(PropertyGroup):
|
class Constraint(PropertyGroup):
|
||||||
@@ -1680,6 +1679,7 @@ class BIMObjectProperties(PropertyGroup):
|
|||||||
qto_name: EnumProperty(items=getQtoNames, name="Qto Name")
|
qto_name: EnumProperty(items=getQtoNames, name="Qto Name")
|
||||||
has_boundary_condition: BoolProperty(name="Has Boundary Condition")
|
has_boundary_condition: BoolProperty(name="Has Boundary Condition")
|
||||||
boundary_condition: PointerProperty(name="Boundary Condition", type=BoundaryCondition)
|
boundary_condition: PointerProperty(name="Boundary Condition", type=BoundaryCondition)
|
||||||
|
# TODO: presentation layers should belong to a mesh, not an object
|
||||||
presentation_layer: PointerProperty(name="Presentation Layer", type=PresentationLayer)
|
presentation_layer: PointerProperty(name="Presentation Layer", type=PresentationLayer)
|
||||||
structural_member_connection: PointerProperty(name="Structural Member Connection", type=bpy.types.Object)
|
structural_member_connection: PointerProperty(name="Structural Member Connection", type=bpy.types.Object)
|
||||||
representation_contexts: CollectionProperty(name="Representation Contexts", type=Subcontext)
|
representation_contexts: CollectionProperty(name="Representation Contexts", type=Subcontext)
|
||||||
@@ -1724,7 +1724,6 @@ class BIMMeshProperties(PropertyGroup):
|
|||||||
is_swept_solid: BoolProperty(name="Is Swept Solid")
|
is_swept_solid: BoolProperty(name="Is Swept Solid")
|
||||||
swept_solids: CollectionProperty(name="Swept Solids", type=SweptSolid)
|
swept_solids: CollectionProperty(name="Swept Solids", type=SweptSolid)
|
||||||
is_parametric: BoolProperty(name="Is Parametric", default=False)
|
is_parametric: BoolProperty(name="Is Parametric", default=False)
|
||||||
presentation_layer: PointerProperty(name="Presentation Layer", type=PresentationLayer)
|
|
||||||
geometry_type: StringProperty(name="Geometry Type")
|
geometry_type: StringProperty(name="Geometry Type")
|
||||||
ifc_definition: StringProperty(name="IFC Definition")
|
ifc_definition: StringProperty(name="IFC Definition")
|
||||||
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
||||||
|
|||||||
@@ -141,10 +141,9 @@ class QtoCalculator:
|
|||||||
if len(tf.vertices) == 3:
|
if len(tf.vertices) == 3:
|
||||||
tf_tris = ((me.vertices[tfv[0]], me.vertices[tfv[1]], me.vertices[tfv[2]]),)
|
tf_tris = ((me.vertices[tfv[0]], me.vertices[tfv[1]], me.vertices[tfv[2]]),)
|
||||||
else:
|
else:
|
||||||
tf_tris = (me.vertices[tfv[0]], me.vertices[tfv[1]], me.vertices[tfv[2]]), (
|
tf_tris = (
|
||||||
me.vertices[tfv[2]],
|
(me.vertices[tfv[0]], me.vertices[tfv[1]], me.vertices[tfv[2]]),
|
||||||
me.vertices[tfv[3]],
|
(me.vertices[tfv[2]], me.vertices[tfv[3]], me.vertices[tfv[0]],),
|
||||||
me.vertices[tfv[0]],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for tf_iter in tf_tris:
|
for tf_iter in tf_tris:
|
||||||
|
|||||||
@@ -8,11 +8,7 @@ from odf.style import Style
|
|||||||
|
|
||||||
class Scheduler:
|
class Scheduler:
|
||||||
def schedule(self, infile, outfile):
|
def schedule(self, infile, outfile):
|
||||||
self.svg = svgwrite.Drawing(
|
self.svg = svgwrite.Drawing(outfile, debug=False, id="root",)
|
||||||
outfile,
|
|
||||||
debug=False,
|
|
||||||
id="root",
|
|
||||||
)
|
|
||||||
self.padding = 1
|
self.padding = 1
|
||||||
self.margin = 1
|
self.margin = 1
|
||||||
doc = load(infile)
|
doc = load(infile)
|
||||||
|
|||||||
@@ -450,9 +450,7 @@ class SvgWriter:
|
|||||||
)
|
)
|
||||||
|
|
||||||
transform = "rotate({}, {}, {})".format(
|
transform = "rotate({}, {}, {})".format(
|
||||||
angle,
|
angle, (text_position * self.scale)[0], (text_position * self.scale)[1],
|
||||||
(text_position * self.scale)[0],
|
|
||||||
(text_position * self.scale)[1],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if text_obj.data.BIMTextProperties.symbol != "None":
|
if text_obj.data.BIMTextProperties.symbol != "None":
|
||||||
|
|||||||
@@ -196,12 +196,7 @@ class BIM_PT_object_material(Panel):
|
|||||||
row.prop(material, "category")
|
row.prop(material, "category")
|
||||||
elif props.material_type == "IfcMaterialProfileSet":
|
elif props.material_type == "IfcMaterialProfileSet":
|
||||||
row.template_list(
|
row.template_list(
|
||||||
"MATERIAL_UL_matslots",
|
"MATERIAL_UL_matslots", "", set_props, "material_profiles", set_props, "active_material_profile_index",
|
||||||
"",
|
|
||||||
set_props,
|
|
||||||
"material_profiles",
|
|
||||||
set_props,
|
|
||||||
"active_material_profile_index",
|
|
||||||
)
|
)
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.operator("bim.add_material_profile", icon="ADD", text="")
|
col.operator("bim.add_material_profile", icon="ADD", text="")
|
||||||
@@ -821,29 +816,22 @@ class BIM_PT_presentation_layer_data(Panel):
|
|||||||
return
|
return
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
elem_props = context.active_object.BIMObjectProperties.presentation_layer
|
elem_props = context.active_object.BIMObjectProperties.presentation_layer
|
||||||
scene_props = context.scene.BIMProperties
|
props = context.scene.BIMProperties
|
||||||
|
|
||||||
if elem_props.name != "":
|
if elem_props.name != "":
|
||||||
layout.label(text=f'Object is part of Presentation layer "{elem_props.name}"')
|
layout.label(text=f'Object is part of Presentation layer "{elem_props.name}"')
|
||||||
layout.row().operator("bim.remove_from_presentation_layer")
|
layout.row().operator("bim.unassign_presentation_layer")
|
||||||
else:
|
else:
|
||||||
layout.label(text="Not included in any presentation layer")
|
if not props.presentation_layers:
|
||||||
|
layout.label(text=f"No presentation layers are available")
|
||||||
|
return
|
||||||
|
|
||||||
if scene_props.presentation_layers:
|
|
||||||
layout.template_list(
|
layout.template_list(
|
||||||
"BIM_UL_presentation_layers",
|
"BIM_UL_generic", "", props, "presentation_layers", props, "active_presentation_layer_index",
|
||||||
"",
|
|
||||||
scene_props,
|
|
||||||
"presentation_layers",
|
|
||||||
scene_props,
|
|
||||||
"active_presentation_layer_index",
|
|
||||||
)
|
)
|
||||||
pres_layer = scene_props.presentation_layers[scene_props.active_presentation_layer_index]
|
if props.active_presentation_layer_index < len(props.presentation_layers):
|
||||||
if pres_layer.name in bpy.context.scene.BIMProperties.presentation_layers:
|
op = layout.row().operator("bim.assign_presentation_layer")
|
||||||
op = layout.row().operator("bim.add_to_presentation_layer")
|
op.index = props.active_presentation_layer_index
|
||||||
op.index = scene_props.active_presentation_layer_index
|
|
||||||
else:
|
|
||||||
layout.label(text="Presentation Layer is invalid")
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_material(Panel):
|
class BIM_PT_material(Panel):
|
||||||
@@ -964,41 +952,36 @@ class BIM_PT_presentation_layers(Panel):
|
|||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
props = context.scene.BIMProperties
|
props = context.scene.BIMProperties
|
||||||
|
|
||||||
layout.row().prop(props, "presentation_layers")
|
|
||||||
layout.row().operator("bim.add_presentation_layer")
|
layout.row().operator("bim.add_presentation_layer")
|
||||||
|
|
||||||
if props.presentation_layers:
|
if not props.presentation_layers:
|
||||||
layout.template_list(
|
return
|
||||||
"BIM_UL_presentation_layers", "", props, "presentation_layers", props, "active_presentation_layer_index"
|
|
||||||
)
|
layout.template_list(
|
||||||
pres_layer = props.presentation_layers[props.active_presentation_layer_index]
|
"BIM_UL_generic", "", props, "presentation_layers", props, "active_presentation_layer_index"
|
||||||
|
)
|
||||||
|
|
||||||
|
if props.active_presentation_layer_index < len(props.presentation_layers):
|
||||||
|
layer = props.presentation_layers[props.active_presentation_layer_index]
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(pres_layer, "name")
|
row.prop(layer, "name")
|
||||||
if pres_layer.name in bpy.context.scene.BIMProperties.presentation_layers:
|
row.operator(
|
||||||
pres_layer = bpy.context.scene.BIMProperties.presentation_layers[pres_layer.name]
|
"bim.remove_presentation_layer", icon="X", text=""
|
||||||
row.operator(
|
).index = props.active_presentation_layer_index
|
||||||
"bim.remove_presentation_layer", icon="X", text=""
|
row = layout.row()
|
||||||
).index = props.active_presentation_layer_index
|
row.prop(layer, "description")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(pres_layer, "description")
|
row.prop(layer, "identifier")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(pres_layer, "identifier")
|
row.prop(layer, "layer_on")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(pres_layer, "layer_on")
|
row.prop(layer, "layer_frozen")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(pres_layer, "layer_frozen")
|
row.prop(layer, "layer_blocked")
|
||||||
row = layout.row()
|
|
||||||
row.prop(pres_layer, "layer_blocked")
|
|
||||||
row = layout.row()
|
|
||||||
row.prop(pres_layer, "layer_styles")
|
|
||||||
|
|
||||||
op = layout.row().operator("bim.update_presentation_layer")
|
op = layout.row().operator("bim.update_presentation_layer")
|
||||||
op.index = props.active_presentation_layer_index
|
op.index = props.active_presentation_layer_index
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
layout.label(text="Presentation Layer is invalid")
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_drawings(Panel):
|
class BIM_PT_drawings(Panel):
|
||||||
@@ -2073,15 +2056,6 @@ class BIM_UL_constraints(bpy.types.UIList):
|
|||||||
layout.label(text="", translate=False)
|
layout.label(text="", translate=False)
|
||||||
|
|
||||||
|
|
||||||
class BIM_UL_presentation_layers(bpy.types.UIList):
|
|
||||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
|
||||||
ob = data
|
|
||||||
if item:
|
|
||||||
layout.prop(item, "name", text="", emboss=False)
|
|
||||||
else:
|
|
||||||
layout.label(text="", translate=False)
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_UL_document_information(bpy.types.UIList):
|
class BIM_UL_document_information(bpy.types.UIList):
|
||||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||||
ob = data
|
ob = data
|
||||||
@@ -2378,7 +2352,9 @@ class BIM_PT_debug(Panel):
|
|||||||
row.prop(attribute, "name", text="")
|
row.prop(attribute, "name", text="")
|
||||||
row.prop(attribute, "string_value", text="")
|
row.prop(attribute, "string_value", text="")
|
||||||
if attribute.int_value:
|
if attribute.int_value:
|
||||||
row.operator("bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text="").step_id = attribute.int_value
|
row.operator(
|
||||||
|
"bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text=""
|
||||||
|
).step_id = attribute.int_value
|
||||||
|
|
||||||
if props.inverse_attributes:
|
if props.inverse_attributes:
|
||||||
layout.label(text="Inverse attributes:")
|
layout.label(text="Inverse attributes:")
|
||||||
@@ -2388,7 +2364,9 @@ class BIM_PT_debug(Panel):
|
|||||||
row.prop(attribute, "name", text="")
|
row.prop(attribute, "name", text="")
|
||||||
row.prop(attribute, "string_value", text="")
|
row.prop(attribute, "string_value", text="")
|
||||||
if attribute.int_value:
|
if attribute.int_value:
|
||||||
row.operator("bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text="").step_id = attribute.int_value
|
row.operator(
|
||||||
|
"bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text=""
|
||||||
|
).step_id = attribute.int_value
|
||||||
|
|
||||||
|
|
||||||
def ifc_units(self, context):
|
def ifc_units(self, context):
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
!ifcopenshell.pth
|
|
||||||
!OCC.pth
|
|
||||||
!svgwrite.pth
|
|
||||||
Reference in New Issue
Block a user