Importing a model that already carries colours was broken for texture
displacement in two ways: the UV layout it was authored against was thrown
away and re-unwrapped, and a bake overwrote the colours it arrived with.
A model's own UV channel is now kept. ModelVolume::texture_uv holds three uvs
per triangle, in the mesh's own triangle order and with V flipped to the
convention DecodedHeightTexture samples in. It is filled from a textured OBJ's
vt data on import and carried across every stage that replaces the mesh - the
colour import's painted mesh, the gizmo's remesh and subdivide, the default
pipeline's rebuild - by transfer_uv_channel(), which gives each new corner the
uv of its closest point on the surface it came from. A new mapping,
TextureProjectionMethod::ModelUV, samples that channel instead of solving an
unwrap, and a new layer on a volume that has one starts there. Its uv is
already normalized, so it keeps the layer's rotation and offset but not the
millimetre tile size (the slider is disabled) or the non-square aspect
correction; with no channel it falls back to Triplanar, as LSCM does when a
patch will not flatten.
A bake with colour off on every layer now leaves the model's colours where
they were. The default pipeline rebuilds the topology, which left
mmu_segmentation_facets describing a triangle set that no longer existed.
ModelVolume::restore_painting() cannot carry it: its remap wants a target
triangle overlapping the source paint to within 0.01 mm, and a baked surface
has moved by the relief depth. transfer_facet_paint() gives each new facet the
state at its own foot point on the pre-bake surface instead, and the bake
commit runs it over all four paint channels. The classic path is untouched,
since there triangle i is still triangle i.
Blend gains an Override entry next to Add: the layer replaces the displacement
under it rather than combining with it, which is what the stack's colour
already does where two layers overlap. The combo's order is the panel's, not
the enum's, so stored blend modes are unaffected.
Measured on a textured OBJ of 85224 triangles (uv_color_probe in the bake
harness): the channel survives import intact, the relief follows the model's
own uv on 98.7% of vertices against 51.3% for a re-unwrap, and a colour-off
bake through the default pipeline keeps the colours on 99.8% of the baked
surface where it previously kept none. Through a coloured 3mf, 100%.
The new Mixed colors setting caps how many mixed filaments a bake adds. They are picked from the
texture's colours, and only the ones the bake paints with are created. Previewing no longer creates
filament slots, both previews show a mix in its slot's colour, and the bake paints each mix with the
slot it actually got.
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced
Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes.
clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.
* Remove Unused Project Includes From Files With Platform-Specific Code
A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block.
* Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass
The platform-file pass treated pchheader.hpp as an ordinary header and
emptied it, and left GUI_Preview.hpp and 14 other files relying on
headers they no longer reached directly.
* Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call
* Include Headers That Files Reached Through Ones the Cleanup Removed
* Drop Includes Duplicated by the Cleanup or by Main's Own Additions
* Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
* Add Missing Includes Across src/slic3r/GUI
Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained.
* Drop the OS-Specific Includes Added Outside Their Platform Guards
GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build.
* Add the clang-tidy Configuration That Generated These Includes
Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly.
* Match Windows Paths in the clang-tidy Ignore List
Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.