paint: add padding export option

This commit is contained in:
luboslenco
2026-04-16 11:26:57 +02:00
parent f0e1748638
commit e8ab4bd42b
2 changed files with 19 additions and 1 deletions
+18 -1
View File
@@ -7,6 +7,19 @@ bool _box_export_apply_displacement;
bool _box_export_merge_vertices;
void box_export_tab_export_textures_run(void *_) {
if (g_context->export_padding) {
i32 _dilate_radius = g_config->dilate_radius;
g_config->dilate_radius = 256;
slot_layer_t *_layer = g_context->layer;
for (i32 i = 0; i < project_layers->length; ++i) {
g_context->layer = project_layers->buffer[i];
render_path_paint_dilate(true, true);
}
g_context->layer = _layer;
g_config->dilate_radius = _dilate_radius;
}
export_texture_run(g_context->texture_export_path, _box_export_bake_material);
}
@@ -138,6 +151,8 @@ void box_export_tab_export_textures(char *title, bool bake_material) {
box_export_preset = NULL;
}
ui_row2();
ui_handle_t *layers_destination_handle = ui_handle(__ID__);
layers_destination_handle->i = g_context->layers_destination;
@@ -149,7 +164,9 @@ void box_export_tab_export_textures(char *title, bool bake_material) {
2);
g_context->layers_destination = ui_combo(layers_destination_handle, layers_destination_combo, tr("Destination"), true, UI_ALIGN_LEFT, true);
ui_end_element();
ui_handle_t *h_padding = ui_handle(__ID__);
h_padding->b = g_context->export_padding;
g_context->export_padding = ui_check(h_padding, tr("Padding"), "");
ui_row2();
if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) {
+1
View File
@@ -197,6 +197,7 @@ typedef struct context {
texture_ldr_format_t format_type;
f32 format_quality;
export_destination_t layers_destination;
bool export_padding;
split_type_t split_by;
f32 select_time;
viewport_mode_t viewport_mode;