Fix layers unittest - we cannot use nestted get_pointer calls
authorDalai Felinto <dfelinto@gmail.com>
Mon, 17 Jul 2017 16:44:33 +0000 (18:44 +0200)
committerDalai Felinto <dfelinto@gmail.com>
Mon, 17 Jul 2017 16:46:00 +0000 (18:46 +0200)
Remember to update your //lib/tests folder as well.

Patch by Bastien Montagne(mont29)

tests/python/render_layer/render_layer_common.py

index 1173c1e4f3692ed34a9a2153aadfd34d1fc1fbe3..adc32f062eadfa1c5ffc636193c951ade1735597 100644 (file)
@@ -55,9 +55,15 @@ def get_layer(layer):
     name = layer.get(b'name')
 
     data['name'] = name
-    data['active_object'] = layer.get((b'basact', b'object', b'id', b'name'))[2:]
     data['engine'] = layer.get(b'engine')
 
+    active_base = layer.get_pointer(b'basact')
+    if active_base:
+        ob = active_base.get_pointer(b'object')
+        data['active_object'] = ob.get((b'id', b'name'))[2:]
+    else:
+        data['active_object'] = ""
+
     objects = []
     for link in linkdata_iter(layer, b'object_bases'):
         ob = link.get_pointer(b'object')