mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
black format
This commit is contained in:
@@ -32,11 +32,11 @@ from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
def draw_attributes(props, layout, copy_operator=None, popup_active_attribute=None):
|
||||
"""you can set attribute active in popup with `active_attribute`
|
||||
"""you can set attribute active in popup with `active_attribute`
|
||||
meaning you will be able to type into attribute's field without having to click
|
||||
on it first
|
||||
"""
|
||||
for attribute in props:
|
||||
for attribute in props:
|
||||
row = layout.row(align=True)
|
||||
if attribute == popup_active_attribute:
|
||||
row.activate_init = True
|
||||
|
||||
@@ -1392,7 +1392,7 @@ class EditTextPopup(bpy.types.Operator):
|
||||
split = rows[i].split(factor=0.1, align=False)
|
||||
split.column()
|
||||
split.label(text=text_lines[i])
|
||||
|
||||
|
||||
def cancel(self, context):
|
||||
# disable editing when dialog is closed
|
||||
bpy.ops.bim.disable_editing_text()
|
||||
@@ -1407,7 +1407,7 @@ class EditTextPopup(bpy.types.Operator):
|
||||
return context.window_manager.invoke_props_dialog(self)
|
||||
else:
|
||||
bpy.ops.bim.edit_text()
|
||||
return {'FINISHED'}
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class EditText(bpy.types.Operator, Operator):
|
||||
|
||||
@@ -424,7 +424,7 @@ class BIMTextProperties(PropertyGroup):
|
||||
attributes: CollectionProperty(name="Attributes", type=Attribute)
|
||||
test_prop: StringProperty(name="test_prop", default="TEXT")
|
||||
# Current text value with evaluated experessions stored in `value`.
|
||||
# The original (Literal) value stored in `attributes['Literal']`
|
||||
# The original (Literal) value stored in `attributes['Literal']`
|
||||
# and can be accessed with `get_text()`
|
||||
value: StringProperty(name="Value", default="TEXT")
|
||||
font_size: EnumProperty(
|
||||
@@ -444,7 +444,7 @@ class BIMTextProperties(PropertyGroup):
|
||||
)
|
||||
|
||||
def get_text(self):
|
||||
text_attribute = self.attributes.get('Literal', None)
|
||||
text_attribute = self.attributes.get("Literal", None)
|
||||
return text_attribute.string_value if text_attribute else self.text
|
||||
|
||||
|
||||
|
||||
@@ -385,7 +385,6 @@ class BIM_PT_text(Panel):
|
||||
row.label(text=props.value)
|
||||
|
||||
|
||||
|
||||
class BIM_PT_annotation_utilities(Panel):
|
||||
bl_idname = "BIM_PT_annotation_utilities"
|
||||
bl_label = "Annotation"
|
||||
|
||||
@@ -334,14 +334,11 @@ class BimToolUI:
|
||||
row.label(text="", icon="EVENT_SHIFT")
|
||||
row.label(text="", icon="EVENT_E")
|
||||
row.operator("bim.hotkey", text="Edit Roof Path").hotkey = "S_E"
|
||||
elif (
|
||||
(TextData.is_loaded or not TextData.load())
|
||||
and TextData.data["attributes"]
|
||||
):
|
||||
elif (TextData.is_loaded or not TextData.load()) and TextData.data["attributes"]:
|
||||
row = cls.layout.row(align=True)
|
||||
row.label(text="", icon="EVENT_SHIFT")
|
||||
row.label(text="", icon="EVENT_E")
|
||||
row.operator("bim.hotkey", text="Edit text").hotkey = "S_E"
|
||||
row.operator("bim.hotkey", text="Edit text").hotkey = "S_E"
|
||||
|
||||
row = cls.layout.row(align=True)
|
||||
row.label(text="", icon="EVENT_SHIFT")
|
||||
@@ -577,10 +574,7 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bpy.context.object.select_set(True)
|
||||
bpy.ops.bim.enable_editing_roof_path()
|
||||
|
||||
elif (
|
||||
(TextData.is_loaded or not TextData.load())
|
||||
and TextData.data["attributes"]
|
||||
):
|
||||
elif (TextData.is_loaded or not TextData.load()) and TextData.data["attributes"]:
|
||||
bpy.context.object.select_set(True)
|
||||
bpy.ops.bim.edit_text_popup()
|
||||
|
||||
|
||||
@@ -564,7 +564,6 @@ class Drawing(blenderbim.core.tool.Drawing):
|
||||
# or if the current font size is not present in classes
|
||||
# (except regular font size because it's default)
|
||||
if different_font_sizes or (font_size_str not in classes_split and font_size_str != "regular"):
|
||||
|
||||
classes_split = [c for c in classes_split if c not in FONT_SIZES] + [font_size_str]
|
||||
classes = " ".join(classes_split)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user