Fix/cleanup RNA viewlayer API.

RNA's ViewLayer would present 'first level' of layer collection as a
list (collection property), when it is actually now only a single item,
same as the scene's master collection.

Note: did not try to update view_layer python tests, those are already
fully broken for quiet some time I guess (they still assume
view_layer.collections to be mutable e.g.)...
This commit is contained in:
Bastien Montagne
2018-11-06 17:20:49 +01:00
parent aa9912ec04
commit 7b38df41ae
4 changed files with 30 additions and 39 deletions

View File

@@ -19,7 +19,7 @@ light_object = bpy.data.objects.new(name="New Light", object_data=light_data)
# Link light object to the active collection of current view layer,
# so that it'll appear in the current scene.
view_layer.collections.active.collection.objects.link(light_object)
view_layer.active_layer_collection.collection.objects.link(light_object)
# Place light to a specified location.
light_object.location = (5.0, 5.0, 5.0)