diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-01 16:24:21 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-01 19:15:54 +0300 |
commit | be9e469ead227aee8d4c29b98a125cf599c5c8bb (patch) | |
tree | 381ee3e58a94495a923c575bb8185899d84ab4bc /source/blender/makesrna/intern/rna_group.c | |
parent | e8c15e0ed15f8369d0d0f706b4953fb64e357902 (diff) |
Groups and collection: initial integration
Since we are ditching layers from Blender (2.8) we need a replacement to
control groups visibility. This commit introduces collections as the building
blocks for groups, allowing users to control visibility as well as overrides
for groups.
Features
========
* Groups now have collections
This way you can change the visibility of a collection inside a group, and add
overrides which are part of the group and are prioritized over other overrides.
* Outliner
Groups can inspect their collections, change visibility, and add/remove members.
To change an override of a group collection, you need to select an instance of
the group, and then you can choose "group" in the collection properties editor
to edit this group active collection instead of the view layer one.
* Dupli groups overrides
We can now have multiple instances of the same group with an original "override"
and different overrides depending on the collection the instanced object is part
of.
Technical
=========
* Layers
We use the same api for groups and scene as much as possible.
Reviewers: sergey (depsgraph), mont29 (read/write and user count)
Differential Revision: https://developer.blender.org/D2892
Diffstat (limited to 'source/blender/makesrna/intern/rna_group.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_group.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 2a5a0011279..ec67370b14f 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -49,8 +49,9 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter) { ListBaseIterator *internal = &iter->internal.listbase; - /* we are actually iterating a GroupObject list, so override get */ - return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject *)internal->link)->ob); + /* we are actually iterating a ObjectBase list, so override get */ + Base *base = (Base *)internal->link; + return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object); } static void rna_Group_objects_link(Group *group, ReportList *reports, Object *object) @@ -124,20 +125,17 @@ void RNA_def_group(BlenderRNA *brna) RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER); - RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); - RNA_def_property_array(prop, 20); - RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this group is instanced as a dupli"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL); + RNA_def_property_collection_sdna(prop, NULL, "view_layer->object_bases", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects"); RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_Group_objects_get", NULL, NULL, NULL, NULL); - rna_def_group_objects(brna, prop); + prop = RNA_def_property(srna, "collections", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "view_layer->layer_collections", NULL); + RNA_def_property_struct_type(prop, "LayerCollection"); + RNA_def_property_ui_text(prop, "Layer Collections", ""); } #endif |