Bake one continuous texture across every part and stop Close from crashing

Removing a layer clears its paint on every part, tiled and view-projected
textures run on across parts, the projection tools paint every visible part,
relief under a raised part reaches down to where the object rests, and closing
the tool no longer crashes the app.
This commit is contained in:
SoftFever committed 2026-10-22 18:27:32 +08:00
1 parent a83abad59c
commit 7f201f4dba
13 files changed
+382 -116

No files matched your search

@@ -60,8 +60,8 @@ void TextureDisplacementDebugJob::process(Ctl &ctl)
// experimental pipeline refines as part of the bake and has nothing to prepare.
if (m_input.run_prepare && !m_input.options.pipeline_v2) {
const TextureDisplacementPrepareResult prepared =
GLGizmoTextureDisplacement::prepare_mesh(mesh, masks, m_input.layers, uv, m_input.prepare_params,
m_input.color,
GLGizmoTextureDisplacement::prepare_mesh(mesh, masks, m_input.layers, uv, m_input.prepare_texture_frame,
m_input.prepare_params, m_input.color,
// Preparation is roughly half the run; the bake
// takes the progress bar from there.
[&report](int pct) { return report(1 + pct / 2); },
@@ -86,7 +86,8 @@ void TextureDisplacementDebugJob::process(Ctl &ctl)
build_texture_displacement(mesh, m_input.layers, masks, m_input.options,
[&report](int pct) { return report(50 + pct / 2); },
/* color */ nullptr, m_input.volume_to_world, &recorder, /* stats */ nullptr,
uv.empty() ? nullptr : &uv);
uv.empty() ? nullptr : &uv, /* texture_anchor: the volume's own origin */ nullptr,
m_input.resting_drop);
m_stages = recorder.take();
ctl.update_status(100, status); // always finish at 100: this is what closes the notification
@@ -106,6 +107,7 @@ void TextureDisplacementDebugJob::finalize(bool canceled, std::exception_ptr &ep
void queue_texture_displacement_debug(const ModelVolume &volume, const TextureColorSettings &color,
const TextureDisplacementPrepareParams &prepare_params,
const Transform3d &prepare_texture_frame, float resting_drop,
bool run_prepare, bool check_topology,
std::function<void(std::vector<BakeStageSnapshot>)> on_finished)
{
@@ -119,6 +121,8 @@ void queue_texture_displacement_debug(const ModelVolume &volume, const TextureCo
input.check_topology = check_topology;
input.color = color;
input.volume_to_world = texture_displacement_volume_to_world(volume);
input.prepare_texture_frame = prepare_texture_frame;
input.resting_drop = resting_drop;
if (volume.has_texture_uv())
input.model_uv = volume.texture_uv;
for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)