Command-Line interface

Studio version only

This feature is still a work in progress.

The command-line interface allows users to access the same parameters as the graphical user-interface.

The CLI is very powerful since it can automate the processing of large sets of models.

Type the following command to list the available options.

> transmutr cli --help
Command-Line Interface
Positionals:
model Path/to/the/model/to/convert [required]
Options:
--version Show version number [boolean]
--help Show help [boolean]
--output, -o Output path [string]
--scale Scale multiplier [number]
--sourceUnit Unit of the input model [choices: "m", "cm", "mm", "f", "i"]
--up Up-axis of the input model [choices: "x", "y", "z", "nx", "ny", "nz"]
--origin New origin of the output model[choices: "default", "center", "bottomCenter"]
--simplification, -s Simplification level of the output model, as a percentage of the original triangle count [number]
--simplificationPreserveNormals, --sn Simplification will try to preserve face normals [boolean]
--smoothCoplanar, --sc Smooth coplanar faces [boolean]
--proxyVray, --vr The output model will use a V-Ray proxy, the high-resolution vrmesh model will be generated alongside the output model [boolean]
--proxyEnscape, --ens The output model will use an Enscape proxy, the high-resolution skp model will be generated alongside the output model [boolean]
--proxyPreview, --prxprev Type of proxy preview [choices: "billboardcross", "billboardfaceme", "boundingboxfaces", "boundingboxwireframe", "simplifiedgeometry", "skpfile"]
--proxyPreviewSkpFilePath, --prxprevskp Path to the SketchUp file to beused as proxy preview [string]
--proxyPreviewSkpFileFaceMe, --prxprevfaceme Sets if the proxy preview SketchUp file always faces the camera (billboard) [boolean]
Examples:
transmutr cli models/tree.obj --scale 5 --origin bottomCenter
transmutr cli house.dae --sourceUnit i
transmutr cli statue.fbx --up z --simplification 0.25
transmutr cli tree.fbx --prxvr --prxen --prxprev boundingboxwireframe
Copyright Lindale 2018

Ruby example: generate a library of LODs

In the following Ruby script, the CLI is called to convert all the models stored in a directory with three different levels of detail.

# Get the names of all the .obj models in the current directory
models = Dir.glob('*.obj')
# Each model will be exported with 3 levels of detail
# - Original quality
# - Slight simplification (75% triangles)
# - Heavy simplification (25% triangles)
qualities = [1, 0.75, 0.25]
# Convert the models
for model in models
for quality in qualities
# We group models in different folders depending on their simplification level
outputPath = "quality_#{quality}/#{model}.skp"
# Generate the command for this specific model/quality combination
command = "transmutr #{model} --simplification #{quality} --output #{outputPath}"
# Run transmutr
process.spawn(command)
#TODO error check
if TODO
print "Model #{model} successfully converted with quality #{quality}!"
elsif
print "something wrong happened: #{stdoutTODO}"
end
end
end