Nathan Vegdahl d7c6cbc6bf Core: Sanitize ID/struct names when used in path templates
In #139438 we added three path template variables that get their values
from user-specified names:

- `scene_name`
- `camera_name`
- `node_name`

These names can contain characters that are illegal in filenames on some
systems, and also characters like "/" that would be interpreted as path
separators in a filepath. This can lead to unexpected outcomes.

For example, if a node's name is "Hue/Saturation" and the `{node_name}`
variable is used in a path, it would result in a "Hue" directory which
in turn contains a "Saturation" file. This is almost certainly not what
the user intended, because the slash in that name is not semantically
supposed to be a path separator.

This PR addresses this problem by splitting string variables into two
types: strings and filepaths. The contents of string variables are
sanitized to be valid filenames when substituted into a path template,
but the contents of filepath variables are left as-is.

Variables such as `blend_name`, `blend_dir`, etc. that actually
represent path components are then added as filepath variables, while
variables such as `scene_name` that represent plain strings without path
semantics are added as string variables.

Pull Request: https://projects.blender.org/blender/blender/pulls/142679
2025-07-22 14:47:56 +02:00
2025-07-22 11:59:43 +10:00
2025-07-22 14:24:12 +02:00
2023-12-08 13:28:13 +11:00
2025-05-12 11:34:32 +02:00
2025-07-10 12:48:33 +10:00
2025-07-22 16:17:10 +10:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%