Files
test2/source/creator
Nathan Vegdahl e0beb7afe6 Templates for render output paths
This adds basic templating support to render output paths. By putting
"{variable_name}" in the path string, it will be replaced by the named
variable's value when generating the actual output path. This is similar
to how "//" is already substituted with the path to the blend file's
current directory.

This templating system is implemented for both the primary render output
path as well as the File Output node in the compositing nodes. Support
for using templates in other places can be implemented in future PRs.

In addition to the "{variable_name}" syntax, some additional syntax is
also supported:

- Since "{" and "}" now have special meaning, "{{" and "}}" are now
  escape sequences for literal "{" and "}".
- "{variable_name:format_specifier}", where "format_specifier" is a
  special syntax using "#", which allows the user to specify how numeric
  variables should be formatted:
  - "{variable_name:###}" will format the number as an integer with at
    least 3 characters (padding with zeros as needed).
  - "{variable_name:.##}" will format the number as a float with
    precisely 2 fractional digits.
  - "{variable_name:###.##}" will format the number as a float with at
    least 3 characters for the integer part and precisely 2 for the
    fractional part.

For the primary render output path: if there is a template syntax error,
a variable doesn't exist, or a format specifier isn't valid (e.g. trying
to format a string with "##"), the render that needs to write to the
output path fails with a descriptive error message.

For both the primary and File Output node paths: if there are template
syntax errors the field is highlighted in red in the UI, and a tooltip
describes the offending syntax errors. Note that these do *not* yet
reflect errors due to missing variables. That will be for a follow-up
PR.

In addition to the general system, this PR also implements a limited set
of variables for use in templates, but more can be implemented in future
PRs. The variables added in this PR are:

- `blend_name`: the name of the current blend file without the file
  extension.
- `fps`: the frames per second of the current scene.
- `resolution_x` and `resolution_y`: the render output resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/134860
2025-05-08 15:37:28 +02:00
..
2023-07-26 15:52:54 +10:00
2025-04-08 17:13:59 +02:00