Ran black formatting

This commit is contained in:
Chirag Singh
2024-08-29 19:15:29 +05:30
parent 50f21fe1b1
commit 3ad41cfba6
2 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -27,17 +27,17 @@ with open(os.path.join(os.path.dirname(__file__), "spectraldb.json"), "r") as f:
class MATERIAL_UL_radiance_materials(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
if self.layout_type in {"DEFAULT", "COMPACT"}:
row = layout.row(align=True)
# Adding color preview or glass icon
if item.category == "Glass":
row.label(icon='SHADING_TEXTURE')
row.label(icon="SHADING_TEXTURE")
else:
color_rect = row.row()
color_rect.prop(item, "color", text="")
color_rect.scale_x = 0.3
row.prop(item, "name", text="", emboss=False, icon_value=icon)
if item.is_mapped:
row.label(text=f"{item.category} - {item.subcategory}")
@@ -565,7 +565,7 @@ class RefreshIFCMaterials(bpy.types.Operator):
if render_item.is_a("IfcSurfaceStyleRendering"):
style_id = f"IfcSurfaceStyleRendering-{render_item.id()}"
style_name = style.Name or f"Unnamed Style {render_item.id()}"
# Extract color and transparency
color = (1.0, 1.0, 1.0) # Default white
transparency = 0.0 # Default opaque
@@ -573,15 +573,15 @@ class RefreshIFCMaterials(bpy.types.Operator):
color = (
render_item.SurfaceColour.Red,
render_item.SurfaceColour.Green,
render_item.SurfaceColour.Blue
render_item.SurfaceColour.Blue,
)
if hasattr(render_item, 'Transparency') and render_item.Transparency is not None:
if hasattr(render_item, "Transparency") and render_item.Transparency is not None:
transparency = render_item.Transparency
# Add material with color
material = props.add_material_mapping(style_id, style_name)
material.color = color
# If transparency is high, consider it as glass
if transparency > 0.5:
material.category = "Glass"