Dev:2.8/Source/LayersCollections/API-Changes

提供: wiki
移動先: 案内検索

Blender 2.8 API Changes

-scene.layers
+# no longer exists
-context.scene.objects
+context.render_layer.objects
-context.scene.objects.active
+context.render_layer.objects.active
-bpy.context.scene.objects.link()
+bpy.context.scene_collection.objects.link()
-bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)
-bpy.context.object.select
-bpy.context.object.select = True
-bpy.context.object.select = False

+bpy.context.object.select_get()
+bpy.context.object.select_set(action='SELECT')
+bpy.context.object.select_set(action='DESELECT')
-bpy.context.object.hide
+not bpy.context.object.visible_get()
-bpy.context.object.hide = False
+# no longer exists, use collection.hide instead
-AddObjectHelper.layers
rna_Scene_ray_cast requires a scene_layer argument.


Gotchas

scene_collection

If you copy context and override scene_layer, but not scene_collection what's going to be the override scene_collection?

It depends!

Is the original context.scene_collection linked (directly, or indirectly via nesting) into the overridden scene_layer? Then this is still the one you will get.

Is it not? In this case you get the active collection of the overridden scene_layer.