Commit: 4e641517874c63dc483c4a0153e5c3890deb48d1
Author: Dalai Felinto
Date: Mon Feb 13 11:16:07 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB4e641517874c63dc483c4a0153e5c3890deb48d1
Outliner: allow for renaming of collection and small touch ups in the
code
Note: Master Collection should not be renamable, but also, it should be marked
as MasterCollection (with an icon probably)
===================================================================
M source/blender/editors/space_outliner/outliner_select.c
M source/blender/editors/space_outliner/outliner_tree.c
M source/blender/editors/space_view3d/view3d_view.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_select.c
b/source/blender/editors/space_outliner/outliner_select.c
index 1fad5f2621..38b83179e7 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -758,13 +758,12 @@ static eOLDrawState tree_element_active_collection(
bContext *C, TreeElement *te, TreeStoreElem *UNUSED(tselem), const
eOLSetState set)
{
if (set != OL_SETSEL_NONE) {
- Scene *scene = CTX_data_scene(C);
- SceneLayer *slayer = BLI_findlink(&scene->render_layers,
scene->active_layer);
- LayerCollection *collection = te->directdata;
- const int collection_index =
BKE_layer_collection_findindex(slayer, collection);
+ SceneLayer *sl = CTX_data_scene_layer(C);
+ LayerCollection *lc = te->directdata;
+ const int collection_index = BKE_layer_collection_findindex(sl,
lc);
BLI_assert(collection_index >= 0);
- slayer->active_collection = collection_index;
+ sl->active_collection = collection_index;
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
return OL_DRAWSEL_ACTIVE;
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c
b/source/blender/editors/space_outliner/outliner_tree.c
index c96d7f970e..d296a54d5d 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1374,22 +1374,22 @@ static void outliner_add_orphaned_datablocks(Main
*mainvar, SpaceOops *soops)
}
}
-static void outliner_add_collections_recursive(SpaceOops *soops, ListBase
*tree, ListBase *layer_collections,
- TreeElement *parent_ten)
+static void outliner_add_collections_recursive(SpaceOops *soops, ListBase
*tree, Scene *scene,
+ ListBase *layer_collections,
TreeElement *parent_ten)
{
for (LayerCollection *collection = layer_collections->first;
collection; collection = collection->next) {
- TreeElement *ten = outliner_add_element(soops, tree, NULL,
parent_ten, TSE_COLLECTION, 0);
+ TreeElement *ten = outliner_add_element(soops, tree, scene,
parent_ten, TSE_COLLECTION, 0);
ten->name = collection->scene_collection->name;
ten->directdata = collection;
- outliner_add_collections_recursive(soops, &ten->subtree,
&collection->layer_collections, ten);
+ outliner_add_collections_recursive(soops, &ten->subtree, scene,
&collection->layer_collections, ten);
}
}
-static void outliner_add_collections(SpaceOops *soops, SceneLayer *layer)
+static void outliner_add_collections(SpaceOops *soops, SceneLayer *layer,
Scene *scene)
{
- outliner_add_collections_recursive(soops, &soops->tree,
&layer->layer_collections, NULL);
+ outliner_add_collections_recursive(soops, &soops->tree, scene,
&layer->layer_collections, NULL);
}
/* ======================================================= */
@@ -1854,7 +1854,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene,
SceneLayer *sl, SpaceOops
outliner_add_orphaned_datablocks(mainvar, soops);
}
else if (soops->outlinevis == SO_COLLECTIONS) {
- outliner_add_collections(soops,
BLI_findlink(&scene->render_layers, scene->active_layer));
+ outliner_add_collections(soops,
BLI_findlink(&scene->render_layers, scene->active_layer), scene);
}
else {
ten = outliner_add_element(soops, &soops->tree, OBACT_NEW,
NULL, 0, 0);
diff --git a/source/blender/editors/space_view3d/view3d_view.c
b/source/blender/editors/space_view3d/view3d_view.c
index 53c9193691..2da1871009 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1112,7 +1112,7 @@ static void view3d_select_loop(ViewContext *vc, Scene
*scene, SceneLayer *sl, Vi
v3d->xray = true; /* otherwise it postpones drawing */
for (base = sl->object_bases.first; base; base = base->next) {
if ((base->flag & BASE_VISIBLED) != 0) {
- if ((base->object->restrictflag &
OB_RESTRICT_SELECT) ||
+ if (((base->flag & BASE_SELECTABLED) == 0) ||
(use_obedit_skip && (scene->obedit->data ==
base->object->data)))
{
base->selcol = 0;
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs