mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 22:16:41 +00:00
Light/ Ran black formatting
This commit is contained in:
@@ -162,12 +162,12 @@ class ExportOBJ(bpy.types.Operator):
|
|||||||
# exported by _export_linked_models() via the IFC serializer.
|
# exported by _export_linked_models() via the IFC serializer.
|
||||||
instance_parents = set()
|
instance_parents = set()
|
||||||
for obj in bpy.data.objects:
|
for obj in bpy.data.objects:
|
||||||
if obj.instance_type == 'COLLECTION' and obj.instance_collection is not None:
|
if obj.instance_type == "COLLECTION" and obj.instance_collection is not None:
|
||||||
if not obj.visible_get():
|
if not obj.visible_get():
|
||||||
continue
|
continue
|
||||||
# Check if this collection contains linked IFC objects
|
# Check if this collection contains linked IFC objects
|
||||||
coll = obj.instance_collection
|
coll = obj.instance_collection
|
||||||
is_linked_ifc = any("guids" in child for child in coll.all_objects if child.type == 'MESH')
|
is_linked_ifc = any("guids" in child for child in coll.all_objects if child.type == "MESH")
|
||||||
if is_linked_ifc:
|
if is_linked_ifc:
|
||||||
print(f"Skipping collection instance '{obj.name}' (linked IFC model, exported via IFC serializer)")
|
print(f"Skipping collection instance '{obj.name}' (linked IFC model, exported via IFC serializer)")
|
||||||
continue
|
continue
|
||||||
@@ -200,7 +200,7 @@ class ExportOBJ(bpy.types.Operator):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
eval_obj = dep_inst.object
|
eval_obj = dep_inst.object
|
||||||
if eval_obj.type != 'MESH':
|
if eval_obj.type != "MESH":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -252,7 +252,7 @@ class ExportOBJ(bpy.types.Operator):
|
|||||||
"""
|
"""
|
||||||
non_ifc_meshes = []
|
non_ifc_meshes = []
|
||||||
for obj in bpy.data.objects:
|
for obj in bpy.data.objects:
|
||||||
if obj.type != 'MESH':
|
if obj.type != "MESH":
|
||||||
continue
|
continue
|
||||||
if not obj.visible_get():
|
if not obj.visible_get():
|
||||||
continue
|
continue
|
||||||
@@ -338,7 +338,9 @@ class ExportOBJ(bpy.types.Operator):
|
|||||||
mtl_file_path = os.path.join(output_dir, "model.mtl")
|
mtl_file_path = os.path.join(output_dir, "model.mtl")
|
||||||
|
|
||||||
visible_elements = self._get_exportable_elements(ifc_file, filter_visibility=True)
|
visible_elements = self._get_exportable_elements(ifc_file, filter_visibility=True)
|
||||||
mats = self._export_ifc_to_obj(ifc_file, obj_file_path, mtl_file_path, settings, serializer_settings, visible_elements)
|
mats = self._export_ifc_to_obj(
|
||||||
|
ifc_file, obj_file_path, mtl_file_path, settings, serializer_settings, visible_elements
|
||||||
|
)
|
||||||
ifc_materials.extend(mats)
|
ifc_materials.extend(mats)
|
||||||
|
|
||||||
self.report({"INFO"}, f"Exported main model OBJ to: {obj_file_path}")
|
self.report({"INFO"}, f"Exported main model OBJ to: {obj_file_path}")
|
||||||
@@ -451,9 +453,15 @@ class CleanupRadianceFiles(bpy.types.Operator):
|
|||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
cleanup_patterns = (
|
cleanup_patterns = (
|
||||||
"model.obj", "model.mtl", "model.rtm",
|
"model.obj",
|
||||||
"sky.rad", "materials.rad", "scene.rad",
|
"model.mtl",
|
||||||
"ascene.oct", "mascene.oct", "ascene.amb",
|
"model.rtm",
|
||||||
|
"sky.rad",
|
||||||
|
"materials.rad",
|
||||||
|
"scene.rad",
|
||||||
|
"ascene.oct",
|
||||||
|
"mascene.oct",
|
||||||
|
"ascene.amb",
|
||||||
)
|
)
|
||||||
cleanup_extensions = (".hdr", ".tiff", ".rad", ".dat")
|
cleanup_extensions = (".hdr", ".tiff", ".rad", ".dat")
|
||||||
cleanup_prefixes = ("instance_", "linked_", "blender_meshes")
|
cleanup_prefixes = ("instance_", "linked_", "blender_meshes")
|
||||||
|
|||||||
@@ -78,4 +78,3 @@ class RemoveIESLight(bpy.types.Operator):
|
|||||||
|
|
||||||
self.report({"WARNING"}, "Invalid IES light index")
|
self.report({"WARNING"}, "Invalid IES light index")
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
|
|||||||
@@ -254,10 +254,15 @@ class PrepareRadianceScene(bpy.types.Operator):
|
|||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
sky_data = {
|
sky_data = {
|
||||||
"year": sun_props.year, "month": sun_props.month, "day": sun_props.day,
|
"year": sun_props.year,
|
||||||
"hour": sun_props.hour, "minute": sun_props.minute,
|
"month": sun_props.month,
|
||||||
"latitude": sun_props.latitude, "longitude": sun_props.longitude,
|
"day": sun_props.day,
|
||||||
"UTC_zone": sun_props.UTC_zone, "sun_year": sun_pos_props.year,
|
"hour": sun_props.hour,
|
||||||
|
"minute": sun_props.minute,
|
||||||
|
"latitude": sun_props.latitude,
|
||||||
|
"longitude": sun_props.longitude,
|
||||||
|
"UTC_zone": sun_props.UTC_zone,
|
||||||
|
"sun_year": sun_pos_props.year,
|
||||||
"sky_condition": props.sky_condition,
|
"sky_condition": props.sky_condition,
|
||||||
"ground_reflectance": props.ground_reflectance,
|
"ground_reflectance": props.ground_reflectance,
|
||||||
"turbidity": props.turbidity,
|
"turbidity": props.turbidity,
|
||||||
@@ -286,26 +291,30 @@ class PrepareRadianceScene(bpy.types.Operator):
|
|||||||
ies_light_data.append(None)
|
ies_light_data.append(None)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
ies_light_data.append({
|
ies_light_data.append(
|
||||||
"ies_file_path": ies_light.ies_file_path,
|
{
|
||||||
"lamp_type": ies_light.lamp_type,
|
"ies_file_path": ies_light.ies_file_path,
|
||||||
"lamp_color": ies_light.lamp_color,
|
"lamp_type": ies_light.lamp_type,
|
||||||
"multiply_factor": ies_light.multiply_factor,
|
"lamp_color": ies_light.lamp_color,
|
||||||
"radius": ies_light.radius,
|
"multiply_factor": ies_light.multiply_factor,
|
||||||
"rotation_z": ies_light.rotation_z,
|
"radius": ies_light.radius,
|
||||||
"positions": positions,
|
"rotation_z": ies_light.rotation_z,
|
||||||
"is_enabled": ies_light.is_enabled,
|
"positions": positions,
|
||||||
})
|
"is_enabled": ies_light.is_enabled,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
# Collect material mapping data (must be on main thread)
|
# Collect material mapping data (must be on main thread)
|
||||||
material_mappings = []
|
material_mappings = []
|
||||||
for m in props.materials:
|
for m in props.materials:
|
||||||
material_mappings.append({
|
material_mappings.append(
|
||||||
"style_id": m.style_id,
|
{
|
||||||
"is_mapped": m.is_mapped,
|
"style_id": m.style_id,
|
||||||
"category": m.category,
|
"is_mapped": m.is_mapped,
|
||||||
"subcategory": m.subcategory,
|
"category": m.category,
|
||||||
})
|
"subcategory": m.subcategory,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
linked_exports_snapshot = list(linked_model_exports)
|
linked_exports_snapshot = list(linked_model_exports)
|
||||||
|
|
||||||
@@ -315,17 +324,30 @@ class PrepareRadianceScene(bpy.types.Operator):
|
|||||||
self._error = None
|
self._error = None
|
||||||
|
|
||||||
import bonsai.bim.module.light.shared as shared
|
import bonsai.bim.module.light.shared as shared
|
||||||
|
|
||||||
shared.scene = None
|
shared.scene = None
|
||||||
|
|
||||||
self._thread = threading.Thread(
|
self._thread = threading.Thread(
|
||||||
target=self._prepare_worker,
|
target=self._prepare_worker,
|
||||||
args=(
|
args=(
|
||||||
output_dir, obj_file_path, sky_file_path,
|
output_dir,
|
||||||
use_hdr, choose_hdr_image, hdr_image_path, hdr_mask_path, sky_map_cal_path,
|
obj_file_path,
|
||||||
sky_data, ies_light_data, material_mappings,
|
sky_file_path,
|
||||||
|
use_hdr,
|
||||||
|
choose_hdr_image,
|
||||||
|
hdr_image_path,
|
||||||
|
hdr_mask_path,
|
||||||
|
sky_map_cal_path,
|
||||||
|
sky_data,
|
||||||
|
ies_light_data,
|
||||||
|
material_mappings,
|
||||||
linked_exports_snapshot,
|
linked_exports_snapshot,
|
||||||
camera_position, camera_direction, camera_up,
|
camera_position,
|
||||||
camera_type, camera_fov, camera_ortho_scale,
|
camera_direction,
|
||||||
|
camera_up,
|
||||||
|
camera_type,
|
||||||
|
camera_fov,
|
||||||
|
camera_ortho_scale,
|
||||||
aspect_ratio,
|
aspect_ratio,
|
||||||
),
|
),
|
||||||
daemon=True,
|
daemon=True,
|
||||||
@@ -337,41 +359,80 @@ class PrepareRadianceScene(bpy.types.Operator):
|
|||||||
wm.modal_handler_add(self)
|
wm.modal_handler_add(self)
|
||||||
|
|
||||||
self.report({"INFO"}, "Scene preparation started in background...")
|
self.report({"INFO"}, "Scene preparation started in background...")
|
||||||
context.window.cursor_set('WAIT')
|
context.window.cursor_set("WAIT")
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
def _prepare_worker(
|
def _prepare_worker(
|
||||||
self, output_dir, obj_file_path, sky_file_path,
|
self,
|
||||||
use_hdr, choose_hdr_image, hdr_image_path, hdr_mask_path, sky_map_cal_path,
|
output_dir,
|
||||||
sky_data, ies_light_data, material_mappings,
|
obj_file_path,
|
||||||
|
sky_file_path,
|
||||||
|
use_hdr,
|
||||||
|
choose_hdr_image,
|
||||||
|
hdr_image_path,
|
||||||
|
hdr_mask_path,
|
||||||
|
sky_map_cal_path,
|
||||||
|
sky_data,
|
||||||
|
ies_light_data,
|
||||||
|
material_mappings,
|
||||||
linked_exports_snapshot,
|
linked_exports_snapshot,
|
||||||
camera_position, camera_direction, camera_up,
|
camera_position,
|
||||||
camera_type, camera_fov, camera_ortho_scale,
|
camera_direction,
|
||||||
|
camera_up,
|
||||||
|
camera_type,
|
||||||
|
camera_fov,
|
||||||
|
camera_ortho_scale,
|
||||||
aspect_ratio,
|
aspect_ratio,
|
||||||
):
|
):
|
||||||
"""Runs in a background thread — no Blender API calls allowed here."""
|
"""Runs in a background thread — no Blender API calls allowed here."""
|
||||||
try:
|
try:
|
||||||
self._do_prepare(
|
self._do_prepare(
|
||||||
output_dir, obj_file_path, sky_file_path,
|
output_dir,
|
||||||
use_hdr, choose_hdr_image, hdr_image_path, hdr_mask_path, sky_map_cal_path,
|
obj_file_path,
|
||||||
sky_data, ies_light_data, material_mappings,
|
sky_file_path,
|
||||||
|
use_hdr,
|
||||||
|
choose_hdr_image,
|
||||||
|
hdr_image_path,
|
||||||
|
hdr_mask_path,
|
||||||
|
sky_map_cal_path,
|
||||||
|
sky_data,
|
||||||
|
ies_light_data,
|
||||||
|
material_mappings,
|
||||||
linked_exports_snapshot,
|
linked_exports_snapshot,
|
||||||
camera_position, camera_direction, camera_up,
|
camera_position,
|
||||||
camera_type, camera_fov, camera_ortho_scale,
|
camera_direction,
|
||||||
|
camera_up,
|
||||||
|
camera_type,
|
||||||
|
camera_fov,
|
||||||
|
camera_ortho_scale,
|
||||||
aspect_ratio,
|
aspect_ratio,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._error = str(e)
|
self._error = str(e)
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
def _do_prepare(
|
def _do_prepare(
|
||||||
self, output_dir, obj_file_path, sky_file_path,
|
self,
|
||||||
use_hdr, choose_hdr_image, hdr_image_path, hdr_mask_path, sky_map_cal_path,
|
output_dir,
|
||||||
sky_data, ies_light_data, material_mappings,
|
obj_file_path,
|
||||||
|
sky_file_path,
|
||||||
|
use_hdr,
|
||||||
|
choose_hdr_image,
|
||||||
|
hdr_image_path,
|
||||||
|
hdr_mask_path,
|
||||||
|
sky_map_cal_path,
|
||||||
|
sky_data,
|
||||||
|
ies_light_data,
|
||||||
|
material_mappings,
|
||||||
linked_exports_snapshot,
|
linked_exports_snapshot,
|
||||||
camera_position, camera_direction, camera_up,
|
camera_position,
|
||||||
camera_type, camera_fov, camera_ortho_scale,
|
camera_direction,
|
||||||
|
camera_up,
|
||||||
|
camera_type,
|
||||||
|
camera_fov,
|
||||||
|
camera_ortho_scale,
|
||||||
aspect_ratio,
|
aspect_ratio,
|
||||||
):
|
):
|
||||||
"""The actual preparation logic (no Blender API)."""
|
"""The actual preparation logic (no Blender API)."""
|
||||||
@@ -379,8 +440,7 @@ class PrepareRadianceScene(bpy.types.Operator):
|
|||||||
|
|
||||||
# --- Generate sky file ---
|
# --- Generate sky file ---
|
||||||
if sky_data is not None:
|
if sky_data is not None:
|
||||||
dt = datetime(sky_data["year"], sky_data["month"], sky_data["day"],
|
dt = datetime(sky_data["year"], sky_data["month"], sky_data["day"], sky_data["hour"], sky_data["minute"])
|
||||||
sky_data["hour"], sky_data["minute"])
|
|
||||||
|
|
||||||
print(f"Sun position data for Radiance gensky:")
|
print(f"Sun position data for Radiance gensky:")
|
||||||
print(f" DateTime: {dt}")
|
print(f" DateTime: {dt}")
|
||||||
@@ -559,8 +619,7 @@ ground_glow source ground
|
|||||||
file.write("\n# Linked Models\n")
|
file.write("\n# Linked Models\n")
|
||||||
for link_idx, (link_rtm_path, link_matrix) in enumerate(linked_rtm_files):
|
for link_idx, (link_rtm_path, link_matrix) in enumerate(linked_rtm_files):
|
||||||
is_identity = all(
|
is_identity = all(
|
||||||
abs(link_matrix[i][j] - (1.0 if i == j else 0.0)) < 1e-6
|
abs(link_matrix[i][j] - (1.0 if i == j else 0.0)) < 1e-6 for i in range(4) for j in range(4)
|
||||||
for i in range(4) for j in range(4)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if is_identity:
|
if is_identity:
|
||||||
@@ -647,7 +706,7 @@ ground_glow source ground
|
|||||||
print("Scene preparation complete.")
|
print("Scene preparation complete.")
|
||||||
|
|
||||||
def modal(self, context, event):
|
def modal(self, context, event):
|
||||||
if event.type == 'TIMER':
|
if event.type == "TIMER":
|
||||||
if self._thread is not None and self._thread.is_alive():
|
if self._thread is not None and self._thread.is_alive():
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
@@ -655,7 +714,7 @@ ground_glow source ground
|
|||||||
self._cleanup_timer(context)
|
self._cleanup_timer(context)
|
||||||
props = tool.Blender.get_radiance_exporter_props()
|
props = tool.Blender.get_radiance_exporter_props()
|
||||||
props.is_preparing = False
|
props.is_preparing = False
|
||||||
context.window.cursor_set('DEFAULT')
|
context.window.cursor_set("DEFAULT")
|
||||||
|
|
||||||
if self._error:
|
if self._error:
|
||||||
self.report({"ERROR"}, f"Scene preparation failed: {self._error}")
|
self.report({"ERROR"}, f"Scene preparation failed: {self._error}")
|
||||||
@@ -666,11 +725,11 @@ ground_glow source ground
|
|||||||
print(f"Scene preparation completed in {elapsed:.2f} seconds")
|
print(f"Scene preparation completed in {elapsed:.2f} seconds")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
elif event.type == 'ESC':
|
elif event.type == "ESC":
|
||||||
self._cleanup_timer(context)
|
self._cleanup_timer(context)
|
||||||
props = tool.Blender.get_radiance_exporter_props()
|
props = tool.Blender.get_radiance_exporter_props()
|
||||||
props.is_preparing = False
|
props.is_preparing = False
|
||||||
context.window.cursor_set('DEFAULT')
|
context.window.cursor_set("DEFAULT")
|
||||||
self.report({"WARNING"}, "Scene preparation cannot be cancelled mid-operation")
|
self.report({"WARNING"}, "Scene preparation cannot be cancelled mid-operation")
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class RadianceRender(bpy.types.Operator):
|
|||||||
wm.modal_handler_add(self)
|
wm.modal_handler_add(self)
|
||||||
|
|
||||||
self.report({"INFO"}, "Radiance render started in background...")
|
self.report({"INFO"}, "Radiance render started in background...")
|
||||||
context.window.cursor_set('WAIT')
|
context.window.cursor_set("WAIT")
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
def _render_worker(self, render_scene, output_dir, res_x, res_y, quality, detail, variability, ambient_bounces):
|
def _render_worker(self, render_scene, output_dir, res_x, res_y, quality, detail, variability, ambient_bounces):
|
||||||
@@ -114,14 +114,14 @@ class RadianceRender(bpy.types.Operator):
|
|||||||
os.chdir(cwd_saved)
|
os.chdir(cwd_saved)
|
||||||
|
|
||||||
def modal(self, context, event):
|
def modal(self, context, event):
|
||||||
if event.type == 'TIMER':
|
if event.type == "TIMER":
|
||||||
if self._thread is not None and self._thread.is_alive():
|
if self._thread is not None and self._thread.is_alive():
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
self._cleanup_timer(context)
|
self._cleanup_timer(context)
|
||||||
props = tool.Blender.get_radiance_exporter_props()
|
props = tool.Blender.get_radiance_exporter_props()
|
||||||
props.is_rendering = False
|
props.is_rendering = False
|
||||||
context.window.cursor_set('DEFAULT')
|
context.window.cursor_set("DEFAULT")
|
||||||
|
|
||||||
if self._error:
|
if self._error:
|
||||||
self.report({"ERROR"}, f"Radiance render failed: {self._error}")
|
self.report({"ERROR"}, f"Radiance render failed: {self._error}")
|
||||||
@@ -156,11 +156,11 @@ class RadianceRender(bpy.types.Operator):
|
|||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
elif event.type == 'ESC':
|
elif event.type == "ESC":
|
||||||
self._cleanup_timer(context)
|
self._cleanup_timer(context)
|
||||||
props = tool.Blender.get_radiance_exporter_props()
|
props = tool.Blender.get_radiance_exporter_props()
|
||||||
props.is_rendering = False
|
props.is_rendering = False
|
||||||
context.window.cursor_set('DEFAULT')
|
context.window.cursor_set("DEFAULT")
|
||||||
self.report({"WARNING"}, "Render cancelled by user. Background process may still be running.")
|
self.report({"WARNING"}, "Render cancelled by user. Background process may still be running.")
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
@@ -210,9 +210,11 @@ class FalseColorRadiance(bpy.types.Operator):
|
|||||||
# fc (foot-candles) = 16.629..., lux & cd/m2 = 179.0
|
# fc (foot-candles) = 16.629..., lux & cd/m2 = 179.0
|
||||||
multiplier = 179.0 if props.false_color_label in ("lux", "cd/m2") else 16.629505759940542
|
multiplier = 179.0 if props.false_color_label in ("lux", "cd/m2") else 16.629505759940542
|
||||||
|
|
||||||
print(f"False color parameters: label={props.false_color_label}, scale={fc_scale}, "
|
print(
|
||||||
f"steps={props.false_color_steps}, multiplier={multiplier}, "
|
f"False color parameters: label={props.false_color_label}, scale={fc_scale}, "
|
||||||
f"contour={props.false_color_contour_lines}")
|
f"steps={props.false_color_steps}, multiplier={multiplier}, "
|
||||||
|
f"contour={props.false_color_contour_lines}"
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fc_output_name = props.false_color_output_name
|
fc_output_name = props.false_color_output_name
|
||||||
@@ -229,9 +231,12 @@ class FalseColorRadiance(bpy.types.Operator):
|
|||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
else:
|
else:
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
falsecolor_bin = shutil.which("falsecolor") or shutil.which("falsecolor.exe")
|
falsecolor_bin = shutil.which("falsecolor") or shutil.which("falsecolor.exe")
|
||||||
if not falsecolor_bin:
|
if not falsecolor_bin:
|
||||||
self.report({"ERROR"}, "Set the Radiance Bin path in False Color settings, or add Radiance to system PATH.")
|
self.report(
|
||||||
|
{"ERROR"}, "Set the Radiance Bin path in False Color settings, or add Radiance to system PATH."
|
||||||
|
)
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
radiance_bin_dir = os.path.dirname(falsecolor_bin)
|
radiance_bin_dir = os.path.dirname(falsecolor_bin)
|
||||||
|
|
||||||
@@ -299,5 +304,6 @@ class FalseColorRadiance(bpy.types.Operator):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.report({"ERROR"}, f"Failed to generate false color image: {str(e)}")
|
self.report({"ERROR"}, f"Failed to generate false color image: {str(e)}")
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ from bonsai.bim.module.light.data import SolarData
|
|||||||
# Root panel (replaces the old "Radiance Exporter" nested panel)
|
# Root panel (replaces the old "Radiance Exporter" nested panel)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_exporter(bpy.types.Panel):
|
class BIM_PT_radiance_exporter(bpy.types.Panel):
|
||||||
bl_label = "Radiance Exporter"
|
bl_label = "Radiance Exporter"
|
||||||
bl_idname = "BIM_PT_radiance_exporter"
|
bl_idname = "BIM_PT_radiance_exporter"
|
||||||
@@ -47,6 +48,7 @@ class BIM_PT_radiance_exporter(bpy.types.Panel):
|
|||||||
# 1. Scene Setup
|
# 1. Scene Setup
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_scene_setup(bpy.types.Panel):
|
class BIM_PT_radiance_scene_setup(bpy.types.Panel):
|
||||||
bl_label = "Scene Setup"
|
bl_label = "Scene Setup"
|
||||||
bl_idname = "BIM_PT_radiance_scene_setup"
|
bl_idname = "BIM_PT_radiance_scene_setup"
|
||||||
@@ -80,6 +82,7 @@ class BIM_PT_radiance_scene_setup(bpy.types.Panel):
|
|||||||
# 2. Materials
|
# 2. Materials
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_materials(bpy.types.Panel):
|
class BIM_PT_radiance_materials(bpy.types.Panel):
|
||||||
bl_label = "Materials"
|
bl_label = "Materials"
|
||||||
bl_idname = "BIM_PT_radiance_materials"
|
bl_idname = "BIM_PT_radiance_materials"
|
||||||
@@ -125,6 +128,7 @@ class BIM_PT_radiance_materials(bpy.types.Panel):
|
|||||||
# 3. Lighting (Environment + IES)
|
# 3. Lighting (Environment + IES)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_lighting(bpy.types.Panel):
|
class BIM_PT_radiance_lighting(bpy.types.Panel):
|
||||||
bl_label = "Lighting"
|
bl_label = "Lighting"
|
||||||
bl_idname = "BIM_PT_radiance_lighting"
|
bl_idname = "BIM_PT_radiance_lighting"
|
||||||
@@ -161,10 +165,7 @@ class BIM_PT_radiance_lighting(bpy.types.Panel):
|
|||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.operator("radiance.add_ies_light", text="", icon="ADD")
|
col.operator("radiance.add_ies_light", text="", icon="ADD")
|
||||||
|
|
||||||
if (
|
if len(props.ies_lights) > 0 and 0 <= props.active_ies_light_index < len(props.ies_lights):
|
||||||
len(props.ies_lights) > 0
|
|
||||||
and 0 <= 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]
|
||||||
|
|
||||||
col = box.column(align=True)
|
col = box.column(align=True)
|
||||||
@@ -198,6 +199,7 @@ class BIM_PT_radiance_lighting(bpy.types.Panel):
|
|||||||
# 4. Render Settings
|
# 4. Render Settings
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_render_settings(bpy.types.Panel):
|
class BIM_PT_radiance_render_settings(bpy.types.Panel):
|
||||||
bl_label = "Render Settings"
|
bl_label = "Render Settings"
|
||||||
bl_idname = "BIM_PT_radiance_render_settings"
|
bl_idname = "BIM_PT_radiance_render_settings"
|
||||||
@@ -236,6 +238,7 @@ class BIM_PT_radiance_render_settings(bpy.types.Panel):
|
|||||||
# 5. Pipeline (Steps 1-4 + Cleanup)
|
# 5. Pipeline (Steps 1-4 + Cleanup)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_pipeline(bpy.types.Panel):
|
class BIM_PT_radiance_pipeline(bpy.types.Panel):
|
||||||
bl_label = "Pipeline"
|
bl_label = "Pipeline"
|
||||||
bl_idname = "BIM_PT_radiance_pipeline"
|
bl_idname = "BIM_PT_radiance_pipeline"
|
||||||
@@ -318,6 +321,7 @@ class BIM_PT_radiance_pipeline(bpy.types.Panel):
|
|||||||
# Solar Panel (unchanged)
|
# Solar Panel (unchanged)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_solar(bpy.types.Panel):
|
class BIM_PT_solar(bpy.types.Panel):
|
||||||
"""Creates a Panel in the render properties window"""
|
"""Creates a Panel in the render properties window"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user