Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert uvatlastool to use GNU-style long options #189

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Conversation

walbourn
Copy link
Member

Embraces the -so vs. --long-option GNU-like pattern for the command-line tool.

This also adds -o=value which is the GNU standard and the tool already supported -o:value or -o value.

This is a hybrid of the Windows style and GNU-like pattern. For example, you can't combine single-characters together such as -yl with this tool like you can with GNU-style argument syntax. Not all multi-character options use -- which would be the GNU standard.

The tool already supports the -- escape so you can start filenames with / or -

@walbourn walbourn self-assigned this Oct 27, 2024
@walbourn
Copy link
Member Author

The help output for uvatlastool now reads:

Microsoft (R) UVAtlas Command-line Tool Version 188 (library)
Copyright (C) Microsoft Corp.
*** Debug build ***

Usage: uvatlas <options> [--] <files>

   Input file type must be Wavefront Object (.obj)

   -ft <filetype>, --file-type <filetype>  output file type
       sdkmesh:  DirectX SDK .sdkmesh format (default)
       sdkmesh2: sdkmesh format version 2 (PBR materials)
       cmo:      Visual Studio Content Pipeline .cmo format
       vbo:      Vertex Buffer Object (.vbo) format
       obj:      WaveFront Object (.obj) format

   -r                  wildcard filename search is recursive
   -flist <filename>, --file-list <filename>
                       use text file with a list of input files (one per line)

   -q <level>, --quality <level>       sets quality level to DEFAULT, FAST or QUALITY
   -n <number>, --max-charts <number>  maximum number of charts to generate (def: 0)
   -st <float>, --max-stretch <float>  maximum amount of stretch 0.0 to 1.0 (def: 0.16667)
   -lms, --limit-merge-stretch         enable limit merge stretch option
   -lfs, --limit-face-stretch          enable limit face stretch option
   -g <float>, --gutter-width <float>  the gutter width betwen charts in texels (def: 2.0)
   -w <number>, --width <number>       texture width (def: 512)
   -h <number>, --height <number>      texture height (def: 512)

   -nn, --normal-by-angle   -na, --normal-by-area   -ne, --normal-by-equal
                                  generate normals weighted by angle/area/equal
   -tt, --tangents                generate tangents
   -tb, --tangent-frame           generate tangents & bi-tangents
   -cw, --clockwise               faces are clockwise (defaults to counter-clockwise)

   -ta, --topological-adjacency -or- -ga, --geometric-adjacency
                                  generate topological vs. geometric adjacency (def: ta)

   -c, --color-mesh               generate mesh with colors showing charts
   -t, --uv-mesh                  generates a separate mesh with uvs - (*_texture)
   -vn, --visualize-normals       with -t creates per vertex colors from normals
   -m, --output-remap             generates a text file with vertex remapping (*_map)

   -it <filename>, --imt-tex-file <filename>
                                  calculate IMT for the mesh using this texture map
   -iv <channel>, --imt-vertex <channel>
                                  calculate IMT using per-vertex data
                                      NORMAL, COLOR, TEXCOORD

   -nodds                         prevents extension renaming in exported materials
   -flip, --flip-face-winding     reverse winding of faces
   --flip-u                       inverts the u texcoords
   --flip-v                       inverts the v texcoords
   --flip-z                       flips the handedness of the positions/normals
   -o <filename>                  output filename
   -l, --to-lowercase             force output filename to lower case
   -y, --overwrite                overwrite existing output file (if any)
   -nologo                        suppress copyright message

       (sdkmesh/sdkmesh2 only)
   -ib32, --index-buffer-32-bit   use 32-bit index buffer
   -fn <normal-format>, --normal-format <normal-format>
                                  format to use for writing normals/tangents/binormals
   -fuv <uv-format>, --uv-format <uv-format>
                                  format to use for texture coordinates
   -fc <color-format>, --color-format <color-format>
                                  format to use for writing colors
   -uv2                           place UVs into a second texture coordinate channel

   '-- ' is needed if any input filepath starts with the '-' or '/' character

   <normal-format>: float3 float16_4 r11g11b10 

   <uv-format>: float2 float16_2 

   <color-format>: bgra rgba float4 float16_4 rgba_10 r11g11b10 

All the existing older switches are still accepted, but are deprecated per this table:

Old switch New switch
-sdkmesh -ft sdkmesh
--file-type sdkmesh
-sdkmesh2 -ft sdkmesh2
--file-type sdkmesh2
-cmo -ft cmo
--file-type cmo
-vbo -ft vbo
--file-type vbo
-wf -ft obj
--file-type obj
-flipu --flip-u
-flipv --flip-v
-flipz --flip-z

@walbourn
Copy link
Member Author

walbourn/uvatlastest#11

@walbourn walbourn added the tools Applies to uvatlastool label Oct 27, 2024
@walbourn walbourn merged commit bb9921c into main Oct 28, 2024
62 checks passed
@walbourn walbourn deleted the gnucommandline branch October 28, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Applies to uvatlastool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants