Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
// One undoable UV edit on the active Part (the uv_* commands, core/UvCommands.cpp, and the UV Editor's drags,
// app/PanelUvEditor.cpp): construct it before changing Document::mesh's UVs or seams, commit() after. The step
// holds the old UVs and flags (UvUndo) and, with keepTexture on a painted Part, moves the texture onto the new
// layout so the model looks the same (core/TextureTransfer.h), the old texture in the same step.
#pragma once
#include "core/Commands.h"
#include "core/Document.h"
#include "core/Uv.h"
#include <string>
namespace sf {
class UvEditStep {
public:
UvEditStep(Document& doc, std::string label, bool keepTexture);
UvEditStep(const UvEditStep&) = delete;
UvEditStep& operator=(const UvEditStep&) = delete;
// The UVs as they were when the step began.
const std::vector<glm::vec2>& before() const { return record_.uv->uvs; }
// Pushes the step if anything changed; returns the texture note ("; paint moved to the new UVs ...").
std::string commit();
private:
Document& doc_;
bool texture_;
UndoRecord record_;
};
// The uv_pack command's options from its arguments, and the status line it ends with (core/UvCommands.cpp; the
// UV Editor's Pack, which runs on a worker thread, uses them too).
UvPackOptions uvPackOptions(const Document& doc, const Args& args);
std::string uvPackNote(const UvPackResult& result, const UvPackOptions& options);
} // namespace sf