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 /tests/python/view_layer
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 'tests/python/view_layer')
-rw-r--r--tests/python/view_layer/CMakeLists.txt1
-rw-r--r--tests/python/view_layer/test_view_layer_rename.py33
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/python/view_layer/CMakeLists.txt b/tests/python/view_layer/CMakeLists.txt
index 22cfcd344f3..1c0648afead 100644
--- a/tests/python/view_layer/CMakeLists.txt
+++ b/tests/python/view_layer/CMakeLists.txt
@@ -178,3 +178,4 @@ VIEW_LAYER_TEST(scene_copy_e)
VIEW_LAYER_TEST(scene_copy_f)
VIEW_LAYER_TEST(scene_delete)
VIEW_LAYER_TEST(scene_write_read)
+VIEW_LAYER_TEST(view_layer_rename)
diff --git a/tests/python/view_layer/test_view_layer_rename.py b/tests/python/view_layer/test_view_layer_rename.py
new file mode 100644
index 00000000000..fefb317d0b1
--- /dev/null
+++ b/tests/python/view_layer/test_view_layer_rename.py
@@ -0,0 +1,33 @@
+# ############################################################
+# Importing - Same For All Render Layer Tests
+# ############################################################
+
+import unittest
+import os
+import sys
+
+from view_layer_common import *
+
+
+# ############################################################
+# Testing
+# ############################################################
+
+class UnitTesting(ViewLayerTesting):
+ def test_view_layer_rename(self):
+ """
+ See if we can rename view layers.
+ """
+ import bpy
+ view_layer = bpy.context.view_layer
+ print("View layer name: " + view_layer.name)
+ view_layer.name = "New Name"
+
+
+# ############################################################
+# Main - Same For All Render Layer Tests
+# ############################################################
+
+if __name__ == '__main__':
+ UnitTesting._extra_arguments = setup_extra_arguments(__file__)
+ unittest.main()