VOXCONVERT: removed --src-palette
parent
c1120a7510
commit
c11729a505
|
@ -25,7 +25,7 @@ Dump the scene graph of the input file.
|
|||
|
||||
.TP
|
||||
\fB\--export-palette\fR
|
||||
Export the used palette data into an image. Use in combination with --src-palette.
|
||||
Export the used palette data into an image.
|
||||
|
||||
.TP
|
||||
\fB\--export-layers\fR
|
||||
|
@ -110,10 +110,6 @@ Apply the given lua script to the output volume.
|
|||
\fB\--split <x:y:z>\fR
|
||||
Slices the volumes into pieces of the given size
|
||||
|
||||
.TP
|
||||
\fB\--src-palette|-p\fR
|
||||
Keep the source palette and don't perform quantization.
|
||||
|
||||
.TP
|
||||
\fB\--translate|-t <x:y:z>\fR
|
||||
Translate the volumes by x (right), y (up), z (back).
|
||||
|
@ -286,7 +282,7 @@ The scripting docs are available at https://mgerhardy.github.io/vengi/LUAScript/
|
|||
.SS Extract palette png
|
||||
Saves the png in the same dir as the vox file:
|
||||
|
||||
\fB@NAME@ --src-palette --export-palette --input infile.vox --output outfile.vox\fP
|
||||
\fB@NAME@ --export-palette --input infile.vox --output outfile.vox\fP
|
||||
|
||||
There will be an \fBinfile.png\fP now.
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ vengi (0.0.20.0-1) UNRELEASED; urgency=low
|
|||
|
||||
* VoxConvert:
|
||||
* Extended --dump to also show the key frames and the voxel count
|
||||
* Removed --src-palette (src palette is always used)
|
||||
|
||||
-- Martin Gerhardy <martin.gerhardy@gmail.com> Sun, 27 Mar 2022 11:59:01 +0200
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ VoxEdit:
|
|||
VoxConvert:
|
||||
|
||||
- Extended `--dump` to also show the key frames and the voxel count
|
||||
- Removed `--src-palette` (src palette is always used)
|
||||
|
||||
## 0.0.19 (2022-03-27)
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ See the [scripting](../LUAScript.md) documentation for further details.
|
|||
|
||||
Saves the png in the same dir as the vox file:
|
||||
|
||||
`./vengi-voxconvert --src-palette --export-palette --input infile.vox --output outfile.vox`
|
||||
`./vengi-voxconvert --export-palette --input infile.vox --output outfile.vox`
|
||||
|
||||
There will be an `infile.png` now.
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
* `--crop`: reduces the volume sizes to their voxel boundaries.
|
||||
* `--export-layers`: export all the layers of a scene into single files. It is suggested to name the layers properly to get reasonable file names.
|
||||
* `--export-palette`: will save the included palette as png next to the source file. Use in combination with `--src-palette`.
|
||||
* `--export-palette`: will save the included palette as png next to the source file.
|
||||
* `--filter <filter>`: will filter out layers not mentioned in the expression. E.g. `1-2,4` will handle layer 1, 2 and 4. It is the same as `1,2,4`. The first layer is `0`. See the layers note below.
|
||||
* `--force`: overwrite existing files
|
||||
* `--image-as-heightmap`: import input images as heightmap (default)
|
||||
|
@ -22,7 +22,6 @@
|
|||
* `--scale`: perform lod conversion of the input volume (50% scale per call)
|
||||
* `--script "<script> <args>"`: execute the given script - see [scripting support](../LUAScript.md) for more details
|
||||
* `--split <x:y:z>`: slices the volumes into pieces of the given size
|
||||
* `--src-palette`: will use the included [palette](../Palette.md) and doesn't perform any quantization to the default palette
|
||||
* `--translate <x:y:z>`: translates the volumes by x (right), y (up), z (back)
|
||||
|
||||
Just type `vengi-voxconvert` to get a full list of commands and options.
|
||||
|
|
|
@ -51,7 +51,7 @@ app::AppState VoxConvert::onConstruct() {
|
|||
registerArg("--crop").setDescription("Reduce the volumes to their real voxel sizes");
|
||||
registerArg("--dump").setDescription("Dump the scene graph of the input file");
|
||||
registerArg("--export-layers").setDescription("Export all the layers of a scene into single files");
|
||||
registerArg("--export-palette").setDescription("Export the used palette data into an image. Use in combination with --src-palette");
|
||||
registerArg("--export-palette").setDescription("Export the used palette data into an image");
|
||||
registerArg("--filter").setDescription("Layer filter. For example '1-4,6'");
|
||||
registerArg("--force").setShort("-f").setDescription("Overwrite existing files");
|
||||
registerArg("--image-as-plane").setDescription("Import given input images as planes");
|
||||
|
@ -69,7 +69,6 @@ app::AppState VoxConvert::onConstruct() {
|
|||
registerArg("--scale").setShort("-s").setDescription("Scale layer to 50% of its original size");
|
||||
registerArg("--script").setDefaultValue("script.lua").setDescription("Apply the given lua script to the output volume");
|
||||
registerArg("--split").setDescription("Slices the volumes into pieces of the given size <x:y:z>");
|
||||
registerArg("--src-palette").setShort("-p").setDescription("Keep the source palette and don't perform quantization");
|
||||
registerArg("--translate").setShort("-t").setDescription("Translate the volumes by x (right), y (up), z (back)");
|
||||
|
||||
_mergeQuads = core::Var::get(cfg::VoxformatMergequads, "true", core::CV_NOPERSIST, "Merge similar quads to optimize the mesh");
|
||||
|
@ -151,7 +150,6 @@ app::AppState VoxConvert::onInit() {
|
|||
_mirrorVolumes = hasArg("--mirror");
|
||||
_rotateVolumes = hasArg("--rotate");
|
||||
_translateVolumes = hasArg("--translate");
|
||||
_srcPalette = hasArg("--src-palette");
|
||||
_exportPalette = hasArg("--export-palette");
|
||||
_exportLayers = hasArg("--export-layers");
|
||||
_changePivot = hasArg("--pivot");
|
||||
|
@ -173,7 +171,7 @@ app::AppState VoxConvert::onInit() {
|
|||
Log::info("* withColor: - %s", _withColor->strVal().c_str());
|
||||
Log::info("* withTexCoords: - %s", _withTexCoords->strVal().c_str());
|
||||
}
|
||||
if (!_srcPalette) {
|
||||
if (!_palette->strVal().empty()) {
|
||||
Log::info("* palette: - %s", _palette->strVal().c_str());
|
||||
}
|
||||
Log::info("* input files: - %s", infilesstr.c_str());
|
||||
|
@ -209,16 +207,12 @@ app::AppState VoxConvert::onInit() {
|
|||
Log::info("* mirror volumes: - %s", (_mirrorVolumes ? "true" : "false"));
|
||||
Log::info("* translate volumes: - %s", (_translateVolumes ? "true" : "false"));
|
||||
Log::info("* rotate volumes: - %s", (_rotateVolumes ? "true" : "false"));
|
||||
Log::info("* use source file palette: - %s", (_srcPalette ? "true" : "false"));
|
||||
Log::info("* export used palette as image: - %s", (_exportPalette ? "true" : "false"));
|
||||
Log::info("* export palette: - %s", (_exportPalette ? "true" : "false"));
|
||||
Log::info("* export layers: - %s", (_exportLayers ? "true" : "false"));
|
||||
Log::info("* resize volumes: - %s", (_resizeVolumes ? "true" : "false"));
|
||||
|
||||
if (!_srcPalette) {
|
||||
voxel::Palette palette;
|
||||
if (!palette.load(_palette->strVal().c_str())) {
|
||||
Log::warn("Failed to init material colors");
|
||||
}
|
||||
if (palette.load(_palette->strVal().c_str())) {
|
||||
voxel::initPalette(palette);
|
||||
}
|
||||
|
||||
|
@ -367,21 +361,6 @@ bool VoxConvert::handleInputFile(const core::String &infile, voxelformat::SceneG
|
|||
return false;
|
||||
}
|
||||
const bool inputIsImage = inputFile->isAnyOf(io::format::images());
|
||||
if (!inputIsImage && _srcPalette) {
|
||||
voxel::Palette palette;
|
||||
io::FileStream palStream(inputFile);
|
||||
Log::info("Load palette from %s", infile.c_str());
|
||||
const size_t numColors = voxelformat::loadPalette(inputFile->name(), palStream, palette);
|
||||
if (numColors == 0) {
|
||||
Log::error("Failed to load palette");
|
||||
return false;
|
||||
}
|
||||
if (!voxel::initPalette(palette)) {
|
||||
Log::error("Failed to initialize material colors from loaded palette");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (inputIsImage) {
|
||||
const image::ImagePtr& image = image::loadImage(inputFile, false);
|
||||
if (!image || !image->isLoaded()) {
|
||||
|
@ -444,9 +423,6 @@ bool VoxConvert::handleInputFile(const core::String &infile, voxelformat::SceneG
|
|||
if (_exportPalette) {
|
||||
const core::String &paletteFile = core::string::stripExtension(infile) + ".png";
|
||||
sceneGraph.firstPalette().save(paletteFile.c_str());
|
||||
if (!_srcPalette) {
|
||||
Log::info(" .. not using the input file palette");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ private:
|
|||
bool _mirrorVolumes = false;
|
||||
bool _rotateVolumes = false;
|
||||
bool _translateVolumes = false;
|
||||
bool _srcPalette = false;
|
||||
bool _exportPalette = false;
|
||||
bool _exportLayers = false;
|
||||
bool _changePivot = false;
|
||||
|
|
Loading…
Reference in New Issue