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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index ab4cbc429ce..278d611cc41 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -53,6 +53,8 @@
# include "BKE_node.h"
# include "BKE_scene.h"
+# include "NOD_composite.h"
+
# include "BLI_listbase.h"
# include "DEG_depsgraph_build.h"
@@ -110,13 +112,24 @@ static void rna_LayerObjects_active_object_set(PointerRNA *ptr,
}
}
+size_t rna_ViewLayer_path_buffer_get(ViewLayer *view_layer,
+ char *r_rna_path,
+ const size_t rna_path_buffer_size)
+{
+ char name_esc[sizeof(view_layer->name) * 2];
+ BLI_str_escape(name_esc, view_layer->name, sizeof(name_esc));
+
+ return BLI_snprintf_rlen(r_rna_path, rna_path_buffer_size, "view_layers[\"%s\"]", name_esc);
+}
+
static char *rna_ViewLayer_path(PointerRNA *ptr)
{
- ViewLayer *srl = (ViewLayer *)ptr->data;
- char name_esc[sizeof(srl->name) * 2];
+ ViewLayer *view_layer = (ViewLayer *)ptr->data;
+ char rna_path[sizeof(view_layer->name) * 3];
+
+ rna_ViewLayer_path_buffer_get(view_layer, rna_path, sizeof(rna_path));
- BLI_str_escape(name_esc, srl->name, sizeof(name_esc));
- return BLI_sprintfN("view_layers[\"%s\"]", name_esc);
+ return BLI_strdup(rna_path);
}
static IDProperty **rna_ViewLayer_idprops(PointerRNA *ptr)