Hey all,
I’d love to be able to call on my module and have it pass arguments to the internal functionals, but so far I’ve been running into walls trying to get it working. Such functionality is inherent to Python when running scripts through the command line (by accessing the sys.argv list), but it seems to be lost when working within Maya?
Let’s say I’ve written an exporter: exporter.py. What I’m looking for is letting the user simply write “exporter” in the script editor to get going. He could also write “exporter --help” to print out possible arguments. Just like applications usually behave in an OS.
Maybe I’m chasing an imaginary tree here, but it just feels klunky to have to write “exporter.start()” or “.main()” or “.init()” all the time and not having an easy way to know which arguments to pass until pouring through the docstrings. I’d love to be able to write more elegant “applications” that behave in a stable, predictable and versatile manner.
What approach do you take when writing tools that grow byond individual scripts and starts being used in lots of different ways?
Cheers,
Jon