diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-02-07 12:18:38 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-02-07 13:11:00 +0300 |
commit | aeb8e81f2741aabc95d14bce7a83cef45481959c (patch) | |
tree | 16a9a4af34f0b7cd114c66ea38625b1ca8e453e6 /source/blender/depsgraph/intern | |
parent | 97fa285ae1b9b320f04ac0ac427917abc2de180a (diff) |
Render Layers and Collections (merge from render-layers)
Design Documents
----------------
* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers
* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised
User Commit Log
---------------
* New Layer and Collection system to replace render layers and viewport layers.
* A layer is a set of collections of objects (and their drawing options) required for specific tasks.
* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.
* All Scenes have a master collection that all other collections are children of.
* New collection "context" tab (in Properties Editor)
* New temporary viewport "collections" panel to control per-collection
visibility
Missing User Features
---------------------
* Collection "Filter"
Option to add objects based on their names
* Collection Manager operators
The existing buttons are placeholders
* Collection Manager drawing
The editor main region is empty
* Collection Override
* Per-Collection engine settings
This will come as a separate commit, as part of the clay-engine branch
Dev Commit Log
--------------
* New DNA file (DNA_layer_types.h) with the new structs
We are replacing Base by a new extended Base while keeping it backward
compatible with some legacy settings (i.e., lay, flag_legacy).
Renamed all Base to BaseLegacy to make it clear the areas of code that
still need to be converted
Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp
* Unittesting for main syncronization requirements
- read, write, add/copy/remove objects, copy scene, collection
link/unlinking, context)
* New Editor: Collection Manager
Based on patch by Julian Eisel
This is extracted from the layer-manager branch. With the following changes:
- Renamed references of layer manager to collections manager
- I doesn't include the editors/space_collections/ draw and util files
- The drawing code itself will be implemented separately by Julian
* Base / Object:
A little note about them. Original Blender code would try to keep them
in sync through the code, juggling flags back and forth. This will now
be handled by Depsgraph, keeping Object and Bases more separated
throughout the non-rendering code.
Scene.base is being cleared in doversion, and the old viewport drawing
code was poorly converted to use the new bases while the new viewport
code doesn't get merged and replace the old one.
Python API Changes
------------------
```
- scene.layers
+ # no longer exists
- scene.objects
+ scene.scene_layers.active.objects
- scene.objects.active
+ scene.render_layers.active.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')
-AddObjectHelper.layers
+ # no longer exists
```
Diffstat (limited to 'source/blender/depsgraph/intern')
5 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 9fea68fc941..373d9dc4348 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -338,7 +338,7 @@ void DepsgraphNodeBuilder::begin_build(Main *bmain) { } void DepsgraphNodeBuilder::build_group(Scene *scene, - Base *base, + BaseLegacy *base, Group *group) { ID *group_id = &group->id; @@ -387,7 +387,7 @@ SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group) return subgraph_node; } -void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob) +void DepsgraphNodeBuilder::build_object(Scene *scene, BaseLegacy *base, Object *ob) { const bool has_object = (ob->id.tag & LIB_TAG_DOIT); IDDepsNode *id_node = (has_object) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index c5035f35f6e..ab66fb90160 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -32,7 +32,10 @@ #include "intern/depsgraph_types.h" -struct Base; +/* XXX: Temporary solution to get proper Baselegacy. */ +#include "DNA_scene_types.h" + +struct BaseLegacy; struct CacheFile; struct bGPdata; struct ListBase; @@ -126,8 +129,8 @@ struct DepsgraphNodeBuilder { void build_scene(Main *bmain, Scene *scene); SubgraphDepsNode *build_subgraph(Group *group); - void build_group(Scene *scene, Base *base, Group *group); - void build_object(Scene *scene, Base *base, Object *ob); + void build_group(Scene *scene, BaseLegacy *base, Group *group); + void build_object(Scene *scene, BaseLegacy *base, Object *ob); void build_object_transform(Scene *scene, Object *ob); void build_object_constraints(Scene *scene, Object *ob); void build_pose_constraints(Object *ob, bPoseChannel *pchan); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc index 99e61692231..507f2572927 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc @@ -79,7 +79,7 @@ void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene) } /* scene objects */ - LINKLIST_FOREACH (Base *, base, &scene->base) { + LINKLIST_FOREACH (BaseLegacy *, base, &scene->base) { Object *ob = base->object; /* object itself */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 054e4103290..2e6fa7b5801 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -45,7 +45,7 @@ #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_operation.h" -struct Base; +struct BaseLegacy; struct bGPdata; struct CacheFile; struct ListBase; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc index 8a3476cff45..8b68516a027 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc @@ -74,7 +74,7 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene) } /* scene objects */ - LINKLIST_FOREACH (Base *, base, &scene->base) { + LINKLIST_FOREACH (BaseLegacy *, base, &scene->base) { Object *ob = base->object; /* object itself */ |