mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(ugc): processor processing option (native, toolbox-blender)
What makes a model's files becomes a processing option like ray_backend and denoise: native (the UGC server) or toolbox-blender (LU Toolbox in Blender). Old stored options parse as before; the retired hidden-face word toolbox is still skipped and is not toolbox-blender. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,21 +74,27 @@ namespace UgcDebounce {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* How a model is made, where there is more than one way to try (docs/UgcServer.md, "Processing options"): what traces
|
* How a model is made, where there is more than one way to try (docs/UgcServer.md, "Processing options"): what traces
|
||||||
* the rays (ray_backend) and whether icons are denoised (denoise). The UGC settings give the defaults; staff may pick
|
* the rays (ray_backend), whether icons are denoised (denoise) and what makes the model's files (processor: the UGC
|
||||||
* others for one make (the dashboard, /reprocessproperty), and each made model records what made it. Written as the
|
* server itself, or LU Toolbox in Blender). The UGC settings give the defaults; staff may pick others for one make (the
|
||||||
* chosen names in this order, separated by spaces ("embree oidn"); a choice left out is the setting's.
|
* dashboard, /reprocessproperty), and each made model records what made it. Written as the chosen names in this order,
|
||||||
|
* separated by spaces ("embree oidn", "toolbox-blender"); a choice left out is the setting's.
|
||||||
*/
|
*/
|
||||||
namespace UgcProcessOptions {
|
namespace UgcProcessOptions {
|
||||||
inline constexpr std::string_view RAYS[] = { "embree", "hiprt", "embree-gpu" };
|
inline constexpr std::string_view RAYS[] = { "embree", "hiprt", "embree-gpu" };
|
||||||
inline constexpr std::string_view DENOISE[] = { "off", "oidn" };
|
inline constexpr std::string_view DENOISE[] = { "off", "oidn" };
|
||||||
|
// native: the UGC server's own pipeline; toolbox-blender: LU Toolbox itself in a headless Blender (UgcToolbox)
|
||||||
|
inline constexpr std::string_view PROCESSOR[] = { "native", "toolbox-blender" };
|
||||||
|
inline constexpr std::string_view NATIVE = PROCESSOR[0];
|
||||||
|
inline constexpr std::string_view TOOLBOX_BLENDER = PROCESSOR[1];
|
||||||
// Hidden-face methods earlier versions' options named (stored options still have them): read and ignored
|
// Hidden-face methods earlier versions' options named (stored options still have them): read and ignored
|
||||||
inline constexpr std::string_view RETIRED[] = { "toolbox", "fast" };
|
inline constexpr std::string_view RETIRED[] = { "toolbox", "fast" };
|
||||||
|
|
||||||
struct Choice {
|
struct Choice {
|
||||||
std::string rays; // one of RAYS, or empty for the setting
|
std::string rays; // one of RAYS, or empty for the setting
|
||||||
std::string denoise; // one of DENOISE, or empty
|
std::string denoise; // one of DENOISE, or empty
|
||||||
|
std::string processor; // one of PROCESSOR, or empty
|
||||||
|
|
||||||
bool Empty() const { return rays.empty() && denoise.empty(); }
|
bool Empty() const { return rays.empty() && denoise.empty() && processor.empty(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
@@ -110,17 +116,18 @@ namespace UgcProcessOptions {
|
|||||||
if (word.empty() || word == "default" || word == "-" || Contains(RETIRED, word)) continue;
|
if (word.empty() || word == "default" || word == "-" || Contains(RETIRED, word)) continue;
|
||||||
// builtin, the ray backend Embree replaced, is embree
|
// builtin, the ray backend Embree replaced, is embree
|
||||||
if (word == "builtin") word = "embree";
|
if (word == "builtin") word = "embree";
|
||||||
std::string* slot = Contains(RAYS, word) ? &choice.rays : Contains(DENOISE, word) ? &choice.denoise : nullptr;
|
std::string* slot = Contains(RAYS, word) ? &choice.rays : Contains(DENOISE, word) ? &choice.denoise
|
||||||
|
: Contains(PROCESSOR, word) ? &choice.processor : nullptr;
|
||||||
if (!slot || !slot->empty()) return false;
|
if (!slot || !slot->empty()) return false;
|
||||||
*slot = std::string(word);
|
*slot = std::string(word);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The choices made, in order ("embree oidn"); empty when all are the settings'
|
// The choices made, in order ("embree oidn", "embree off toolbox-blender"); empty when all are the settings'
|
||||||
inline std::string ToString(const Choice& choice) {
|
inline std::string ToString(const Choice& choice) {
|
||||||
std::string text;
|
std::string text;
|
||||||
for (const auto* part : { &choice.rays, &choice.denoise }) {
|
for (const auto* part : { &choice.rays, &choice.denoise, &choice.processor }) {
|
||||||
if (part->empty()) continue;
|
if (part->empty()) continue;
|
||||||
if (!text.empty()) text += ' ';
|
if (!text.empty()) text += ' ';
|
||||||
text += *part;
|
text += *part;
|
||||||
|
|||||||
Reference in New Issue
Block a user