mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
black format
This commit is contained in:
@@ -97,7 +97,9 @@ def register():
|
||||
addon_keymaps.append((km, kmi))
|
||||
kmi = km.keymap_items.new("bim.override_object_duplicate_move_linked_macro", "D", "PRESS", alt=True)
|
||||
addon_keymaps.append((km, kmi))
|
||||
kmi = km.keymap_items.new("bim.object_duplicate_move_linked_aggregate_macro", "D", "PRESS", ctrl=True, shift=True)
|
||||
kmi = km.keymap_items.new(
|
||||
"bim.object_duplicate_move_linked_aggregate_macro", "D", "PRESS", ctrl=True, shift=True
|
||||
)
|
||||
addon_keymaps.append((km, kmi))
|
||||
kmi = km.keymap_items.new("bim.override_paste_buffer", "V", "PRESS", ctrl=True)
|
||||
addon_keymaps.append((km, kmi))
|
||||
|
||||
@@ -767,11 +767,13 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if element:
|
||||
if element.is_a("IfcAnnotation") and element.ObjectType == "DRAWING":
|
||||
self.report({'INFO'}, "Did not duplicate. Duplicate drawings through the Drawings and Documents UI.")
|
||||
self.report(
|
||||
{"INFO"}, "Did not duplicate. Duplicate drawings through the Drawings and Documents UI."
|
||||
)
|
||||
obj.select_set(False)
|
||||
continue # For now, don't copy drawings until we stabilise a bit more. It's tricky.
|
||||
elif element.is_a("IfcProject"):
|
||||
self.report({'INFO'}, "Did not duplicate. IFC can only have one project.")
|
||||
self.report({"INFO"}, "Did not duplicate. IFC can only have one project.")
|
||||
obj.select_set(False)
|
||||
continue # Only one IfcProject is allowed.
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ class Geometry(blenderbim.core.tool.Geometry):
|
||||
return styles
|
||||
|
||||
usage_count = [0] * len(obj.material_slots)
|
||||
if not usage_count: # if there are no materials, polygons will still use index 0
|
||||
if not usage_count: # if there are no materials, polygons will still use index 0
|
||||
return []
|
||||
for poly in obj.data.polygons:
|
||||
usage_count[poly.material_index] += 1
|
||||
|
||||
@@ -167,7 +167,7 @@ class TestGetSurfaceRenderingAttributes(NewFile):
|
||||
output = tool.Blender.get_material_node(obj, "OUTPUT_MATERIAL")
|
||||
node = tool.Blender.get_material_node(obj, "BSDF_PRINCIPLED")
|
||||
obj.node_tree.nodes.remove(node)
|
||||
|
||||
|
||||
node = obj.node_tree.nodes.new(type="ShaderNodeBsdfGlossy")
|
||||
node.inputs["Color"].default_value = [0.5, 0.5, 0.5, 0.5]
|
||||
node.inputs["Roughness"].default_value = 0.2
|
||||
@@ -198,7 +198,7 @@ class TestGetSurfaceRenderingAttributes(NewFile):
|
||||
output = tool.Blender.get_material_node(obj, "OUTPUT_MATERIAL")
|
||||
node = tool.Blender.get_material_node(obj, "BSDF_PRINCIPLED")
|
||||
obj.node_tree.nodes.remove(node)
|
||||
|
||||
|
||||
node = obj.node_tree.nodes.new(type="ShaderNodeBsdfDiffuse")
|
||||
node.inputs["Color"].default_value = [0.5, 0.5, 0.5, 0.5]
|
||||
node.inputs["Roughness"].default_value = 0.2
|
||||
@@ -494,4 +494,3 @@ class TestAssignStyleToRepresentationItem(NewFile):
|
||||
# unassigning styles
|
||||
subject.assign_style_to_representation_item(rectangle, None)
|
||||
assert subject.get_representation_item_style(rectangle) == None
|
||||
|
||||
|
||||
@@ -62,9 +62,7 @@ class Usecase:
|
||||
def execute(self):
|
||||
if ifcopenshell.util.constraint.is_attribute_locked(self.settings["resource"], "Usage.ScheduleWork"):
|
||||
return
|
||||
amount_worked = ifcopenshell.util.resource.get_resource_required_work(
|
||||
self.settings["resource"]
|
||||
)
|
||||
amount_worked = ifcopenshell.util.resource.get_resource_required_work(self.settings["resource"])
|
||||
if not amount_worked:
|
||||
return
|
||||
if not self.settings["resource"].Usage:
|
||||
|
||||
Reference in New Issue
Block a user