mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Added HDR output file format
This commit is contained in:
@@ -468,21 +468,23 @@ class RadianceRender(bpy.types.Operator):
|
||||
end_time = time.time()
|
||||
print(f"Render completed in {end_time - start_time:.2f} seconds")
|
||||
|
||||
output_hdr_path = os.path.join(output_dir, f"{output_file_name}.{output_file_format.lower()}")
|
||||
output_hdr_path = os.path.join(output_dir, f"{output_file_name}.hdr")
|
||||
print(f"Saving HDR output to: {output_hdr_path}")
|
||||
if output_file_format == "HDR":
|
||||
with open(output_hdr_path, "wb") as wtr:
|
||||
wtr.write(image)
|
||||
else:
|
||||
pass
|
||||
print("Applying tone mapping...")
|
||||
pcond_image = pr.pcond(hdr=output_hdr_path, human=True)
|
||||
with open(output_hdr_path, "wb") as wtr:
|
||||
wtr.write(image)
|
||||
|
||||
if output_file_format == "HDR_TIFF":
|
||||
print("Applying tone mapping...")
|
||||
pcond_image = pr.pcond(hdr=output_hdr_path, human=True)
|
||||
|
||||
tiff_path = os.path.join(output_dir, f"{output_file_name}.tiff")
|
||||
print(f"Saving TIFF output to: {tiff_path}")
|
||||
pr.ra_tiff(inp=pcond_image, out=tiff_path, lzw=True)
|
||||
|
||||
tiff_path = os.path.join(output_dir, f"{output_file_name}.tiff")
|
||||
print(f"Saving TIFF output to: {tiff_path}")
|
||||
pr.ra_tiff(inp=pcond_image, out=tiff_path, lzw=True)
|
||||
print("Radiance rendering process completed successfully.")
|
||||
self.report({"INFO"}, "Radiance rendering completed. Output: {}".format(tiff_path))
|
||||
self.report({"INFO"}, f"Radiance rendering completed. HDR Output: {output_hdr_path}")
|
||||
if output_file_format == "HDR_TIFF":
|
||||
self.report({"INFO"}, f"TIFF Output: {tiff_path}")
|
||||
return {"FINISHED"}
|
||||
|
||||
# def get_active_camera(self, context):
|
||||
|
||||
@@ -342,9 +342,10 @@ class RadianceExporterProperties(PropertyGroup):
|
||||
name="Output File Format",
|
||||
description="Format of the output image file",
|
||||
items=[
|
||||
("HDR", "HDR + Tiff", "High Dynamic Range"),
|
||||
("HDR", "HDR", "High Dynamic Range (HDR) file only"),
|
||||
("HDR_TIFF", "HDR + Tiff", "High Dynamic Range (HDR) and Tiff files"),
|
||||
],
|
||||
default="HDR",
|
||||
default="HDR_TIFF",
|
||||
)
|
||||
|
||||
use_hdr: BoolProperty(
|
||||
|
||||
Reference in New Issue
Block a user