Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-01-10 18:05:17 +0300
committerSergey Sharybin <sergey@blender.org>2022-01-10 18:54:12 +0300
commit292c2cefe30b3b4798324e0f04e3a4a529829c94 (patch)
treea2ef4c57898f432eedd895c1a83ba1af178e6155 /source
parent20cb2c72a559786b69a3f45695b072dd0beae99a (diff)
Fix T93727: Tiled render error in Cycles after changing temp directory
Consider temporary directory to be variant part of session configuration which gets communicated to the tile manager on render reset. This allows to be able to render with one temp directory, change the directory, render again and have proper render result even with enabled persistent data. For the ease of access to the temp directory expose it via the render engine API (engine.temp_directory). Differential Revision: https://developer.blender.org/D13790
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_render.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index fcb46904e8d..28dcad4444d 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -98,6 +98,7 @@ const EnumPropertyItem rna_enum_bake_pass_type_items[] = {
# include "RNA_access.h"
+# include "BKE_appdir.h"
# include "BKE_context.h"
# include "BKE_report.h"
@@ -420,6 +421,16 @@ static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr)
&RNA_RenderEngine;
}
+static void rna_RenderEngine_tempdir_get(PointerRNA * /*ptr*/, char *value)
+{
+ BLI_strncpy(value, BKE_tempdir_session(), FILE_MAX);
+}
+
+static int rna_RenderEngine_tempdir_length(PointerRNA * /*ptr*/)
+{
+ return strlen(BKE_tempdir_session());
+}
+
static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr)
{
RenderEngine *engine = (RenderEngine *)ptr->data;
@@ -860,6 +871,12 @@ static void rna_def_render_engine(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "resolution_y");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ prop = RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_NONE);
+ RNA_def_function_ui_description(func, "The temp directory used by Blender");
+ RNA_def_property_string_funcs(
+ prop, "rna_RenderEngine_tempdir_get", "rna_RenderEngine_tempdir_length", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
/* Render Data */
prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderSettings");