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:
authorDalai Felinto <dfelinto@gmail.com>2017-12-27 18:32:30 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-12-27 18:39:28 +0300
commit110373de6a52a20eb759aea9a11e4c45fcdb619b (patch)
tree8bc7eb7eee593496a84888e2d5b9de296f65fd3f /source/blender/makesrna/intern/rna_context.c
parentb517dc9b2db01ca6e9c7623f8686fd502280343e (diff)
Fix T53638: View layer renaming crashes 2/2
This fixes renaming the view layer via Python. This bug was introduced originally in 3a95bdfc65d. Although I suspect it was around for longer, since this commit didn't touch this part of the code. But basically we need the id of the RNA property to be the one that owns the data (view layer).
Diffstat (limited to 'source/blender/makesrna/intern/rna_context.c')
-rw-r--r--source/blender/makesrna/intern/rna_context.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index 3df114282fd..bcd805b0f3a 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -132,7 +132,11 @@ static PointerRNA rna_Context_scene_get(PointerRNA *ptr)
static PointerRNA rna_Context_view_layer_get(PointerRNA *ptr)
{
bContext *C = (bContext *)ptr->data;
- return rna_pointer_inherit_refine(ptr, &RNA_ViewLayer, CTX_data_view_layer(C));
+ Scene *scene = CTX_data_scene(C);
+ PointerRNA scene_ptr;
+
+ RNA_id_pointer_create(&scene->id, &scene_ptr);
+ return rna_pointer_inherit_refine(&scene_ptr, &RNA_ViewLayer, CTX_data_view_layer(C));
}
static PointerRNA rna_Context_view_render_get(PointerRNA *ptr)