diff --git a/src/slic3r/GUI/Gizmos/GLGizmoImage.cpp b/src/slic3r/GUI/Gizmos/GLGizmoImage.cpp index 4af7c0b21e..3dbc631e65 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoImage.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoImage.cpp @@ -1,6 +1,7 @@ #include "GLGizmoImage.hpp" #include "libslic3r/Model.hpp" +#include "libslic3r/Point.hpp" #include "libslic3r/TextureDisplacement.hpp" #include "libslic3r/format.hpp" @@ -10,17 +11,22 @@ #include "slic3r/GUI/GUI.hpp" #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/I18N.hpp" +#include "slic3r/GUI/IconManager.hpp" #include "slic3r/GUI/ImGuiWrapper.hpp" #include "slic3r/GUI/Plater.hpp" #include "slic3r/GUI/TextureLibrary.hpp" #include "slic3r/GUI/Shortcuts.hpp" #include "slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp" +#include "slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.hpp" #include "slic3r/GUI/Gizmos/GLGizmoUtils.hpp" #include "slic3r/GUI/Jobs/Worker.hpp" #include #include +#include +#include #include +#include #include #include #include diff --git a/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp b/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp index 24e8c19218..14c04cbc39 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp @@ -3780,6 +3780,7 @@ void GLGizmoTextureDisplacement::ensure_panel_icons() // a monochrome ("normal", grey in the current theme) and an original-colour variant. static const std::vector names = { "texture_displacement_brush.svg", "texture_displacement_face.svg", "texture_displacement_connected_area.svg", + "texture_displacement_pipette.svg", // the Image panel's background dropper "texture_displacement_real_preview.svg", "texture_displacement_fast_preview.svg", "texture_displacement_checker.svg", "texture_displacement_distortion.svg", "texture_displacement_wireframe.svg", "texture_displacement_cross.svg", @@ -3789,8 +3790,7 @@ void GLGizmoTextureDisplacement::ensure_panel_icons() "texture_displacement_add.svg", "texture_displacement_add_negative.svg", "circle_paint.svg", "menu_obj_sphere.svg", "menu_obj_cube.svg", "menu_obj_cylinder.svg", "texture_displacement_map_unwrap.svg", "texture_displacement_map_view.svg", "texture_displacement_tile_repeat.svg", "menu_mirror_x.svg", - "texture_displacement_adjust.svg", "texture_displacement_pipette.svg", "canvas_drag.svg", - "texture_displacement_move_up.svg", + "texture_displacement_adjust.svg", "canvas_drag.svg", "texture_displacement_move_up.svg", "texture_displacement_move_down.svg", "texture_displacement_drag.svg", "texture_displacement_select_all.svg", "texture_displacement_erase_all.svg", // The "type a value instead" icon at the right end of every slider. diff --git a/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.hpp b/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.hpp index 642481c139..b47c908d88 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.hpp @@ -331,6 +331,15 @@ private: // Standard is active so what Preview shows is always what Bake will do. Returns true if it actually // changed something, so the caller can invalidate the preview. bool apply_standard_mode_presets(ModelVolume *mv); + // Standard mode's Bake: remesh to an even density, refine where the texture bends, then displace. + // The order matters and is the whole reason this is one button - a height map can only move + // existing vertices, so the mesh has to be prepared first, and remeshing after painting would drop + // the paint if it were not carried across (see prepare_mesh()). + void bake_standard(); + // Copies the panel's own state (active layer, Standard/Pro) onto the volume, so the project file + // can carry it. Cheap and idempotent - called wherever either of the two changes. + void store_panel_state(); + // Image mode's fixed values, on top of Standard's and pinned the same way (every frame, so the // preview cannot disagree with the bake): zero depth on every layer, and colour on wherever the // picture has any. Those two are what turn the displacement bake into "put this picture on the @@ -360,14 +369,6 @@ private: bool m_image_sec_place = true; bool m_image_sec_color = true; bool m_image_sec_bg = true; - // Copies the panel's own state (active layer, Standard/Pro) onto the volume, so the project file - // can carry it. Cheap and idempotent - called wherever either of the two changes. - void store_panel_state(); - // Standard mode's Bake: remesh to an even density, refine where the texture bends, then displace. - // The order matters and is the whole reason this is one button - a height map can only move - // existing vertices, so the mesh has to be prepared first, and remeshing after painting would drop - // the paint if it were not carried across (see prepare_mesh()). - void bake_standard(); // Queues one prepare_mesh() run on the job worker and commits its result when it lands. Every // mesh-preparation button goes through here - Pro's Remesh, Pro's adaptive Subdivide and Standard's