Cleaned up formatting to align with master v0.6 branch

This commit is contained in:
Kristoffer
2020-11-09 13:40:14 +01:00
parent 2a585c98d8
commit 26510de9e0
3 changed files with 76 additions and 79 deletions
@@ -146,8 +146,7 @@ class SelectGlobalId(bpy.types.Operator):
index = obj.BIMObjectProperties.attributes.find("GlobalId") index = obj.BIMObjectProperties.attributes.find("GlobalId")
if ( if (
index != -1 index != -1
and obj.BIMObjectProperties.attributes[ and obj.BIMObjectProperties.attributes[index].string_value == bpy.context.scene.BIMProperties.global_id
index].string_value == bpy.context.scene.BIMProperties.global_id
): ):
obj.select_set(True) obj.select_set(True)
break break
@@ -425,7 +424,7 @@ class QAHelper:
for source_line in source: for source_line in source:
if ( if (
"Scenario: " in source_line "Scenario: " in source_line
and bpy.context.scene.BIMProperties.scenario == source_line.strip()[len("Scenario: "):] and bpy.context.scene.BIMProperties.scenario == source_line.strip()[len("Scenario: ") :]
): ):
is_in_scenario = True is_in_scenario = True
elif is_in_scenario: elif is_in_scenario:
@@ -716,7 +715,7 @@ class ActivateBcfViewpoint(bpy.types.Operator):
def hex_to_rgb(self, value): def hex_to_rgb(self, value):
value = value.lstrip("#") value = value.lstrip("#")
lv = len(value) lv = len(value)
t = tuple(int(value[i: i + lv // 3], 16) for i in range(0, lv, lv // 3)) t = tuple(int(value[i : i + lv // 3], 16) for i in range(0, lv, lv // 3))
return [t[0] / 255.0, t[1] / 255.0, t[2] / 255.0, 1] return [t[0] / 255.0, t[1] / 255.0, t[2] / 255.0, 1]
@@ -2978,8 +2977,7 @@ class AddSectionPlane(bpy.types.Operator):
section.show_in_front = True section.show_in_front = True
if bpy.context.active_object.select_get() and isinstance(bpy.context.active_object.data, bpy.types.Camera): if bpy.context.active_object.select_get() and isinstance(bpy.context.active_object.data, bpy.types.Camera):
section.matrix_world = ( section.matrix_world = (
bpy.context.active_object.matrix_world @ Euler((radians(180.0), 0.0, 0.0), bpy.context.active_object.matrix_world @ Euler((radians(180.0), 0.0, 0.0), "XYZ").to_matrix().to_4x4()
"XYZ").to_matrix().to_4x4()
) )
else: else:
section.rotation_euler = Euler((radians(180.0), 0.0, 0.0), "XYZ") section.rotation_euler = Euler((radians(180.0), 0.0, 0.0), "XYZ")
@@ -3703,7 +3701,7 @@ class GuessQuantity(bpy.types.Operator):
elif bpy.context.scene.unit_settings.system == "METRIC": elif bpy.context.scene.unit_settings.system == "METRIC":
if bpy.context.scene.unit_settings.length_unit == "METERS": if bpy.context.scene.unit_settings.length_unit == "METERS":
return None, "METRE" return None, "METRE"
return bpy.context.scene.unit_settings.length_unit[0: -len("METERS")], "METRE" return bpy.context.scene.unit_settings.length_unit[0 : -len("METERS")], "METRE"
class ExecuteBIMTester(bpy.types.Operator): class ExecuteBIMTester(bpy.types.Operator):
@@ -4346,8 +4344,8 @@ class RemoveFromPresentationLayer(bpy.types.Operator):
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"}
+4 -5
View File
@@ -398,7 +398,7 @@ def getScenarios(self, context):
lines = feature_file.readlines() lines = feature_file.readlines()
for line in lines: for line in lines:
if "Scenario:" in line: if "Scenario:" in line:
s = line.strip()[len("Scenario: "):] s = line.strip()[len("Scenario: ") :]
scenarios_enum.append((s, s, "")) scenarios_enum.append((s, s, ""))
return scenarios_enum return scenarios_enum
@@ -666,7 +666,7 @@ class DrawingStyle(PropertyGroup):
name: StringProperty(name="Name") name: StringProperty(name="Name")
raster_style: StringProperty(name="Raster Style") raster_style: StringProperty(name="Raster Style")
render_type: EnumProperty( render_type: EnumProperty(
items=[("NONE", "None", ""), ("DEFAULT", "Default", ""), ("VIEWPORT", "Viewport", ""), ], items=[("NONE", "None", ""), ("DEFAULT", "Default", ""), ("VIEWPORT", "Viewport", ""),],
name="Render Type", name="Render Type",
default="VIEWPORT", default="VIEWPORT",
) )
@@ -739,7 +739,7 @@ class BIMTextProperties(PropertyGroup):
name="Font Size", name="Font Size",
) )
symbol: EnumProperty( symbol: EnumProperty(
items=[("None", "None", ""), ("rectangle-tag", "Rectangle Tag", ""), ("door-tag", "Door Tag", ""), ], items=[("None", "None", ""), ("rectangle-tag", "Rectangle Tag", ""), ("door-tag", "Door Tag", ""),],
update=refreshFontSize, update=refreshFontSize,
name="Symbol", name="Symbol",
) )
@@ -1532,7 +1532,7 @@ class BIMProperties(PropertyGroup):
name="Temporary Section Cutaway Colour", subtype="COLOR", default=(1, 0, 0), min=0.0, max=1.0 name="Temporary Section Cutaway Colour", subtype="COLOR", default=(1, 0, 0), min=0.0, max=1.0
) )
ifc_import_filter: EnumProperty( ifc_import_filter: EnumProperty(
items=[("NONE", "None", ""), ("WHITELIST", "Whitelist", ""), ("BLACKLIST", "Blacklist", ""), ], items=[("NONE", "None", ""), ("WHITELIST", "Whitelist", ""), ("BLACKLIST", "Blacklist", ""),],
name="Import Filter", name="Import Filter",
) )
ifc_selector: StringProperty(default="", name="IFC Selector") ifc_selector: StringProperty(default="", name="IFC Selector")
@@ -1603,7 +1603,6 @@ class BIMProperties(PropertyGroup):
presentation_layers: CollectionProperty(name="Presentation Layers", type=PresentationLayer) presentation_layers: CollectionProperty(name="Presentation Layers", type=PresentationLayer)
class BCFProperties(PropertyGroup): class BCFProperties(PropertyGroup):
bcf_file: StringProperty(default="", name="BCF File") bcf_file: StringProperty(default="", name="BCF File")
topics: CollectionProperty(name="BCF Topics", type=BcfTopic) topics: CollectionProperty(name="BCF Topics", type=BcfTopic)
+2 -2
View File
@@ -1717,7 +1717,7 @@ class BIM_PT_bcf(Panel):
layout.label(text="Document References:") layout.label(text="Document References:")
for index, doc in enumerate(props.topic_document_references): for index, doc in enumerate(props.topic_document_references):
row = layout.row(align=True) row = layout.row(align=True)
row.prop(doc, "name", text=f"File {index + 1} URI") row.prop(doc, "name", text=f"File {index+1} URI")
if doc.is_external: if doc.is_external:
row.operator("bim.open_bcf_document_reference", icon="URL", text="").data = "{}/{}".format( row.operator("bim.open_bcf_document_reference", icon="URL", text="").data = "{}/{}".format(
props.topic_guid, index props.topic_guid, index
@@ -1727,7 +1727,7 @@ class BIM_PT_bcf(Panel):
props.topic_guid, index props.topic_guid, index
) )
row = layout.row(align=True) row = layout.row(align=True)
row.prop(doc, "description", text=f"File {index + 1} Description:") row.prop(doc, "description", text=f"File {index+1} Description:")
layout.label(text="Related Topics:") layout.label(text="Related Topics:")
for topic in props.topic_related_topics: for topic in props.topic_related_topics: