← All ideas
  • Published 13 Dec 2020

Make Blender cli arguments "smarter" by finding the scenario that makes the most sense

Blender's cli arguments are positional. Thanks to this, it's very easy to shoot yourself in the proverbial foot by incorrectly ordering the cli arguments. Notably, Blender will not show any sort of error/notice message if you do this, so it's possible that you'll find out after having spent hours producing an incorrect result.

In light of this, and considering that Blender knows all command-line arguments as soon as it's launched, I do believe there's a number of cases where Blender could correct argument ordering automatically, and possibly emit a notice message about it.

For example: -b file.blend -f 3 -o //something_ makes no sense, but there is only one combination of these arguments that does make sense, and that is -b file.blend -o //something_ -f 3 .

I think Blender could use a little bit of logic to try and figure out if a mistake was made, and either correct it, or emit a warning/notice message that conveys "Hey, heads-up -- this probably isn't what you wanted, man".

Notably, many cli programs follow a general flow of "input processing-parameters output", which makes sense from the logical side of things - take X, do something to it, output processed X. ffmpeg for example does exactly that - if you specify audio bitrate before the audio codec (and the bitrate setting might make sense for a given audio codec, or it might not), it will silently accept that combination and reorder it as it sees fit, possibly emitting an error if the result doesn't make sense.

100%

Development Status: Open

Upvote 1 Downvote 0
egonfreeman
13 Dec 2020

3 Comments

Lauloque

And guess what? Everyone loves ffmpeg's commands. So let's learn from that cat.

egonfreeman Author

* @-L0Lock- * Not sure if genuine or sarcasm.

Regardless - the command line could be a tiny bit smarter when it's fairly obvious what was meant. And by "fairly obvious" I would propose "whenever a supplied option/switch is going to become useless". At the very least, Blender could error out in such situations, save someone some time.

Lauloque

* @egonfreeman * 'twas genuine, I use ffmpeg all the time everywhere.