Ran balck Formatting

This commit is contained in:
Chirag Singh
2025-11-15 21:43:48 +05:30
parent a570d81fd7
commit 39839cff66
2 changed files with 20 additions and 10 deletions
+16 -5
View File
@@ -237,7 +237,9 @@ class PrepareRadianceScene(bpy.types.Operator):
sun_props = tool.Blender.get_solar_props() sun_props = tool.Blender.get_solar_props()
sun_pos_props = tool.Blender.get_sun_props() sun_pos_props = tool.Blender.get_sun_props()
if not sun_pos_props: if not sun_pos_props:
self.report({"ERROR"}, "Sun position addon not available. Enable 'Sun Position' addon or disable 'Use Sun'.") self.report(
{"ERROR"}, "Sun position addon not available. Enable 'Sun Position' addon or disable 'Use Sun'."
)
return {"CANCELLED"} return {"CANCELLED"}
# Build datetime for Radiance gensky # Build datetime for Radiance gensky
@@ -584,7 +586,9 @@ class FalseColorRadiance(bpy.types.Operator):
# Check if the main render HDR exists # Check if the main render HDR exists
hdr_path = os.path.join(output_dir, f"{output_file_name}.hdr") hdr_path = os.path.join(output_dir, f"{output_file_name}.hdr")
if not os.path.exists(hdr_path): if not os.path.exists(hdr_path):
error_msg = f"HDR file not found at: {hdr_path}. Please run 'Radiance Render' first to generate the HDR output." error_msg = (
f"HDR file not found at: {hdr_path}. Please run 'Radiance Render' first to generate the HDR output."
)
self.report({"ERROR"}, error_msg) self.report({"ERROR"}, error_msg)
print(f"ERROR: {error_msg}") print(f"ERROR: {error_msg}")
return {"CANCELLED"} return {"CANCELLED"}
@@ -592,7 +596,11 @@ class FalseColorRadiance(bpy.types.Operator):
print(f"Generating false color image from: {hdr_path}") print(f"Generating false color image from: {hdr_path}")
# Build false color parameters # Build false color parameters
fc_scale = str(int(props.false_color_scale)) if props.false_color_scale == int(props.false_color_scale) else str(props.false_color_scale) fc_scale = (
str(int(props.false_color_scale))
if props.false_color_scale == int(props.false_color_scale)
else str(props.false_color_scale)
)
# Determine contour mode # Determine contour mode
contour_mode = "l" if props.false_color_contour_lines else None contour_mode = "l" if props.false_color_contour_lines else None
@@ -680,9 +688,10 @@ class FalseColorRadiance(bpy.types.Operator):
f.write(fc_image) f.write(fc_image)
print(f"Tone-mapped HDR saved to: {fc_hdr_path}") print(f"Tone-mapped HDR saved to: {fc_hdr_path}")
self.report({"WARNING"}, self.report(
{"WARNING"},
"falsecolor binary not found. Generated tone-mapped HDR instead. " "falsecolor binary not found. Generated tone-mapped HDR instead. "
"Ensure Radiance/bin folder is present in the light module directory." "Ensure Radiance/bin folder is present in the light module directory.",
) )
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
@@ -711,6 +720,7 @@ class FalseColorRadiance(bpy.types.Operator):
print(f"ERROR: {error_msg}") print(f"ERROR: {error_msg}")
print(f"Traceback:") print(f"Traceback:")
import traceback import traceback
traceback.print_exc() traceback.print_exc()
return {"CANCELLED"} return {"CANCELLED"}
@@ -783,6 +793,7 @@ class ConvertHDRToFootCandles(bpy.types.Operator):
print(f"ERROR: {error_msg}") print(f"ERROR: {error_msg}")
print(f"Traceback:") print(f"Traceback:")
import traceback import traceback
traceback.print_exc() traceback.print_exc()
return {"CANCELLED"} return {"CANCELLED"}
+4 -5
View File
@@ -142,8 +142,6 @@ class BIM_PT_radiance_exporter(bpy.types.Panel):
row = box.row() row = box.row()
row.prop(props, "choose_hdr_image") row.prop(props, "choose_hdr_image")
layout.separator() layout.separator()
# Sky Generation Settings # Sky Generation Settings
@@ -158,7 +156,6 @@ class BIM_PT_radiance_exporter(bpy.types.Panel):
row = box.row() row = box.row()
row.prop(props, "turbidity") row.prop(props, "turbidity")
layout.separator() layout.separator()
# IES Light Fixtures # IES Light Fixtures
@@ -170,8 +167,10 @@ class BIM_PT_radiance_exporter(bpy.types.Panel):
col.operator("radiance.add_ies_light", text="", icon="ADD") col.operator("radiance.add_ies_light", text="", icon="ADD")
# Properties panel for selected IES light # Properties panel for selected IES light
if len(props.ies_lights) > 0 and props.active_ies_light_index >= 0 and props.active_ies_light_index < len( if (
props.ies_lights len(props.ies_lights) > 0
and props.active_ies_light_index >= 0
and props.active_ies_light_index < len(props.ies_lights)
): ):
active_light = props.ies_lights[props.active_ies_light_index] active_light = props.ies_lights[props.active_ies_light_index]