MayaFlagFormatter
Maya Flag Formatter
Install / Use
/learn @maxWiklund/MayaFlagFormatterREADME

Introduction
Command line tool and api to format maya command flags.
The Maya Flag Formatter (mayaff) was created to standardise maya flag names.
When you're working in a team it's likely that some of your colleagues are not as familiar with the maya API as others.
Using long flag names can help unfamiliar developers with code review and debugging.
The mayaff project was implemented to ease development with Maya commands (maya.cmds).
Input
from maya import cmds as abc
source = "..."
abc.textureWindow(source, ra=(
abc.about(ppc=True),
abc.about(li=True),
))
Output
from maya import cmds as abc
source = "..."
abc.textureWindow(source, removeAllImages=(
abc.about(macOSppc=True),
abc.about(linux=True),
))
Contents
Installation
To use mayaff out of the box just install it like a normal python package with a setup.py file. To Generate custom presets got to Generating new configs
git clone https://github.com/maxWiklund/mayaFlagFormatter.git
cd mayaff
python setup.py install
Generating new configs
mayaff is based on config files with all maya flags.
You can find all included configs under mayaff/maya_configs/ directory,
if you want your own maya plugins to be formatted you can generate your own config.
The config generation script can be found in the root of git repo maya_config_generator.py.
To use your own custom config mayaff . --config /path/to/your/config.json.
Python versions
mayaff only supports python 3.7+
Usage
Options:
usage: mayaff [-h] [-v] [-t {2018,2020,2022,2023} | --config CONFIG] [--check] [--diff] [--quiet] [--exclude EXCLUDE] [--exclude-files EXCLUDE_FILES [EXCLUDE_FILES ...]] [--modules MODULES]
[--single-thread]
source [source ...]
Command line tool to find and replace short maya flags.
positional arguments:
source Directory or files you want to format.
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-t {2018,2020,2022,2023}, --target-version {2018,2020,2022,2023}
Target Maya version to use when formatting flags.
--config CONFIG Custom maya config file. If you want to provide a custom config file different to the target options.
--check Don't write to files. Just return the return code.
--diff Don't write the files back, just output a diff for each file to stdout.
--quiet, -q Output nothing to stdout and set return value.
--exclude EXCLUDE A regular expression for file names to exclude.
--exclude-files EXCLUDE_FILES [EXCLUDE_FILES ...]
Exclude files. Separate files with space.
--modules MODULES Maya modules to use for import. Examples: --modules 'maya:cmds,pymel:core'
--single-thread Only execute mayaff on single thread.
mayaff . --exclude-files package.py
Some companies have custom wrappers around cmds. If you want mayaff to find your cmds module somewhere else use --modules.
Example: mayaff . --modules "maya:cmds,custom.module:cmds"
Known limitations
from somthing import cmds
def my_function():
from maya import cmds
cmds.about(...)
# This will break.
cmds.lookThru(q=True) # somthing.cmds module.
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
