I think this is a great idea, this type of system is always very useful in any software I’ve seen it used. Houdini calls these “filename expressions” because over the years it has evolved into its own miniature expression language. Perhaps there are some things there that can inspire you. One of the cool things you can do with it in Houdini is to access specific data for a given scene- the ‘unparsed’ filename is stored with the file itself, so you can bake out a simulation cache with a tokenized filename, then save a copy of the scene with a different filename and don’t have to worry about your previous cache being overwritten (or go through the work of updating all of your file references and things of that nature).
The shorter the tokens are, the better in my opinion. Houdini uses $X (where X is a single letter representing that particular token), I’ve seen other software use %X or @X, etc.
I like the idea! it might be a good idea to post it on right click select (if you haven’t already) with a mockup image, and see if there is some good user feedback to consider. I like scene and camera as options though!
Actually I hadn’t thought about an addon, but I would like to try to develop it directly in Blender’s code, and if I cannot manage to do it I might switch to an addon as I am a lot more familiar with Python scripting.
I tried a first step with the Blender code, in the file “image.c”, I added this line to the function “do_makepicstring” : string = BLI_str_replaceN(string, "[camera]", "toto");
When I print the string inside this functions I get the correct result (the path with “[camera]” replaced by “toto”), but when the file is saved in “COM_OutputFileOperation.cpp”, it still prints out the path without the change. Am I missing something here ?
If it were me doing these same experiments I think I would start by playing around with BLI_filename_make_safe() and BLI_path_make_safe() in blender\source\blender\blenlib\intern\path_util.c as those two are called fairly reliably all over.
Making your changes there would have the benefit of being able to use an otherwise “invalid” character as a delimiter and so would never be something used in a real path, like “greater than” and “less than” characters (or ?:|*). And I’d consider testure’s advice about using short tokens as it’s best not to hardcode English for something like that in a multilingual program.
Hello everyone! Is there any progress with this feature?
I’ve been looking everywhere for some info about it and found out that Blender can’t do that rn.
I’ve created a proposal, as I can see there was similar before.
Idk maybe people don’t understand the importance of this, but it’s really a must have feature. You might have 20+ iterations of the same project and it’s a pain to manually rename your outputs everytime, especially when you have to rename it in the compositors file output node. Also this feature would allow to bypass the compositor by just having something like that in output “//render/$prj/$pass/$pass” - which will result you having all your passes in a separate folder.
Oh yeah, i feel your pain!
I am working on a project where i have to output around 20 separate passes as exr files from the compositor. With every iteration on the shot i have to spend a few minutes monkey renaming my filepathes.
Output variable tokens would have been a great GSOC project, no?
I haven’t really worked more on that, I am really really new in developing for Blender, but your messages give me some motivation to keep working on it, so I’ll try to push this one as far as I can, hopefully I will succeed in making something that works, at least a proof of concept