1.0.0 • Published 3 years ago

@kreativwebdesign/lode-cli v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

lode CLI

This CLI helps to automatically generate LOD artifacts for .gltf files.

Use Package

The package can be used via npm install -D @kreativwebdesign/lode-cli, yarn add -D @kreativwebdesign/lode-cli or just npx @kreativwebdesign/lode-cli

init

To setup a configuration file, run npx @kreativwebdesign/lode-cli init. This will guide you through the setup for the configuration file. If you change the name of the configuration file, make sure to pass the path to the run command.

Configuration file

{
  "source": "**/*.gltf",
  "outputFoldername": "lode-build",
  "watch": false
}

config

Run npx @kreativwebdesign/lode-cli config to configure the level of details for each model. You can pass the following options:

OptionDescriptionDefault
-c, --configPath to config file./lode-cli.config.json
-s, --sourceSource glob pattern**/*.gltf
-a, --allWheter to reconfigure all modelsfalse

\ For each model the following options can be set:\ How many level of details should i generate (min. 2): Set how many level of details the cli should generate for this model. Minimum is two, the first being the original file.\ \ Then for each level of detail the following options can be set:\ For which distance should the artifact "XXX" be used? (-1 for infinity):\ Set the distance, this artifact should be visible. The values stack onto the previous distance. Type -1 for the last artifact to be rendered infinitely (only valid for the last artifact). The first one being the original artifact\ Target scale for the artifact "LOD-X" (0-1):\ Set the target scale for this artifact relative to the original size. Choose a value between 1 (being the same as the original) and 0 (being no polygons). This can not be set for the original artifact.

run

This command runs the LOD generating. You can pass various options to this command. Run npx @kreativwebdesign/lode-cli or npx @kreativwebdesign/lode-cli run to execute it. You can pass various options to the run command. These flags override the configuration file.

OptionDescriptionDefault
-c, --configPath to config file./lode-cli.config.json
-s, --sourceSource glob pattern**/*.gltf
-o, --outputFoldernameOutputfoldernamelode-build
-w, --watchWatch source filesfalse
-h, --helpDisplay help for command

Watch mode (-w) will also automatically start lode server on port 3001.

help

Run npx @kreativwebdesign/lode-cli help to display help.

clean

Run npx @kreativwebdesign/lode-cli clean to clean the output folder. You can pass the same outputFoldername and config option as for the run command.

Dev Usage

Instead of installing the package one can simply run npx @kreativwebdesign/lode-cliyarn start while working on the cli itself.

Dev

Run yarn setup to get up and running

Publish

  • Prepare versions and ensure clean setup state
  • yarn build
  • npm publish --access public

Currently publish workflow is only tested on Mac.