From 78bfaf1a4fe1a71408e4dab7268b1af1ed1b88f4 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 21 Sep 2022 10:57:36 +0200 Subject: File Browser: Manual auto-increase name support for output filepaths This functionality was present until Blender 2.80. Basically it adds back the "+" and "-" buttons in the file browser when it stores an output filepath. This is useful for someone rendering multiple versions of an animation (or a composition) to compare. At the moment this is used for the render output, and the File Output node in the compositor. Differential Revision: https://developer.blender.org/D15968 --- source/blender/editors/space_buttons/buttons_ops.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 10fb008049d..a9ce9a3d723 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -337,6 +337,12 @@ static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) RNA_string_set(op->ptr, path_prop, str); MEM_freeN(str); + PropertyRNA *prop_check_existing = RNA_struct_find_property(op->ptr, "check_existing"); + if (!RNA_property_is_set(op->ptr, prop_check_existing)) { + const bool is_output_path = (RNA_property_flag(prop) & PROP_PATH_OUTPUT) != 0; + RNA_property_boolean_set(op->ptr, prop_check_existing, is_output_path); + } + WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; -- cgit v1.2.3