Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/src/nodes/impl/dds.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def save_as_dds(
minimal_compression: bool = False,
maximum_compression: bool = False,
dx9: bool = False,
separate_alpha: bool = False,
):
"""
Saves an image as DDS using texconv.
Expand Down Expand Up @@ -145,6 +146,9 @@ def save_as_dds(
if dds_format in __SRGB_DDS_FORMATS:
args.append("-srgbi")

if separate_alpha:
args.append("-sepalpha")

args.append(tempPng)
__run_texconv(args, "Unable to write DDS")
finally:
Expand Down
15 changes: 14 additions & 1 deletion backend/src/nodes/nodes/image/save_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ def __init__(self):
"conditional-enum",
{
"enum": 4,
"conditions": [["jpg", "webp"], "jpg", "jpg", "dds", "dds", "dds"],
"conditions": [
["jpg", "webp"],
"jpg",
"jpg",
"dds",
"dds",
"dds",
"dds",
],
},
)(
SliderInput(
Expand Down Expand Up @@ -118,6 +126,9 @@ def __init__(self):
BoolInput("Dithering", default=False).with_id(8),
),
DdsMipMapsDropdown().with_id(10),
group("conditional-enum", {"enum": 10, "conditions": [0]})(
BoolInput("Separate Alpha for Mip Maps", default=False).with_id(13),
),
),
]
self.category = ImageCategory
Expand All @@ -143,6 +154,7 @@ def run(
dds_error_metric: DDSErrorMetric,
dds_dithering: bool,
dds_mipmap_levels: int,
dds_separate_alpha: bool,
) -> None:
"""Write an image to the specified path and return write status"""

Expand Down Expand Up @@ -180,6 +192,7 @@ def run(
minimal_compression=dds_bc7_compression == BC7Compression.BEST_SPEED,
maximum_compression=dds_bc7_compression == BC7Compression.BEST_QUALITY,
dx9=legacy_dds,
separate_alpha=dds_separate_alpha,
)
return

Expand Down