diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-27 17:55:00 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-27 18:37:38 +0300 |
commit | b517dc9b2db01ca6e9c7623f8686fd502280343e (patch) | |
tree | b6d39b29df66cefc403634e1b1c3b6fad78f88fa /source/blender/makesrna/intern/rna_wm.c | |
parent | bd80ace2da72256801ca7579ca92cf4fe7a6a513 (diff) |
Fix T53638: View layer renaming crashes 1/2
This fixes renaming via the interface.
This bug was introduced originally in 9515737b554. We need the id of the RNA
property to be the one that owns the data (view layer).
So it can't be the window's id, but the scene one instead.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index d25888e0f93..36f07db727b 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -763,8 +763,10 @@ static PointerRNA rna_Window_view_layer_get(PointerRNA *ptr) Scene *scene = WM_window_get_active_scene(win); WorkSpace *workspace = WM_window_get_active_workspace(win); ViewLayer *view_layer = BKE_workspace_view_layer_get(workspace, scene); + PointerRNA scene_ptr; - return rna_pointer_inherit_refine(ptr, &RNA_ViewLayer, view_layer); + RNA_id_pointer_create(&scene->id, &scene_ptr); + return rna_pointer_inherit_refine(&scene_ptr, &RNA_ViewLayer, view_layer); } static void rna_Window_view_layer_set(PointerRNA *ptr, PointerRNA value) |