Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2021-07-04 08:23:52 +0300
committerYimingWu <xp8110@outlook.com>2021-07-04 08:23:52 +0300
commit442f269a72e8f07393fd246f642e210171a1c9bc (patch)
treeecab515215209172245f7709a0c07c1b14dab96c /source/blender/editors/space_outliner
parent87dae08dd3f2a80dd208576b130cabaca21c9912 (diff)
parent2d146b61d8583ec7169c5c04263d475a542b06ce (diff)
Merge remote-tracking branch 'origin/master' into lineart-bvh
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c8
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c12
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c1
-rw-r--r--source/blender/editors/space_outliner/tree/tree_display_libraries.cc4
-rw-r--r--source/blender/editors/space_outliner/tree/tree_display_view_layer.cc68
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element_overrides.cc4
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element_overrides.hh1
8 files changed, 67 insertions, 33 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 328a787c768..69680f57d98 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1090,7 +1090,8 @@ static void outliner_draw_restrictbuts(uiBlock *block,
RestrictPropertiesActive props_active = props_active_parent;
if (te->ys + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && te->ys <= region->v2d.cur.ymax) {
- if (tselem->type == TSE_R_LAYER && (space_outliner->outlinevis == SO_SCENES)) {
+ if (tselem->type == TSE_R_LAYER &&
+ ELEM(space_outliner->outlinevis, SO_SCENES, SO_VIEW_LAYER)) {
if (space_outliner->show_restrict_flags & SO_RESTRICT_RENDER) {
/* View layer render toggle. */
ViewLayer *layer = te->directdata;
@@ -2355,6 +2356,9 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
case eGpencilModifierType_Texture:
data.icon = ICON_TEXTURE;
break;
+ case eGpencilModifierType_Weight:
+ data.icon = ICON_MOD_VERTEX_WEIGHT;
+ break;
/* Default */
default:
@@ -3125,7 +3129,7 @@ static void outliner_draw_tree_element(bContext *C,
*te_edit = te;
}
- /* Icons can be ui buts, we don't want it to overlap with restrict .*/
+ /* Icons can be UI buts, we don't want it to overlap with restrict. */
if (restrict_column_width > 0) {
xmax -= restrict_column_width + UI_UNIT_X;
}
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 50f089f894a..b14a3cdb91d 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1816,7 +1816,7 @@ static TreeElement *outliner_find_rightmost_visible_child(SpaceOutliner *space_o
return te;
}
-/* Find previous visible element in the tree */
+/* Find previous visible element in the tree. */
static TreeElement *outliner_find_previous_element(SpaceOutliner *space_outliner, TreeElement *te)
{
if (te->prev) {
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index f809bb13b42..d59d04b6ac2 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -86,6 +86,8 @@
#include "UI_resources.h"
#include "UI_view2d.h"
+#include "../../blender/blenloader/BLO_readfile.h"
+
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -930,8 +932,14 @@ static void id_override_library_resync_fn(bContext *C,
te->store_elem->id->tag |= LIB_TAG_DOIT;
}
- BKE_lib_override_library_resync(
- bmain, scene, CTX_data_view_layer(C), id_root, NULL, do_hierarchy_enforce, true, reports);
+ BKE_lib_override_library_resync(bmain,
+ scene,
+ CTX_data_view_layer(C),
+ id_root,
+ NULL,
+ do_hierarchy_enforce,
+ true,
+ &(struct BlendFileReadReport){.reports = reports});
WM_event_add_notifier(C, NC_WINDOW, NULL);
}
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 728be1ccaaf..a2032fa1dc0 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -331,6 +331,7 @@ static SpaceLink *outliner_create(const ScrArea *UNUSED(area), const Scene *UNUS
space_outliner->outlinevis = SO_VIEW_LAYER;
space_outliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
space_outliner->flag = SO_SYNC_SELECT | SO_MODE_COLUMN;
+ space_outliner->filter = SO_FILTER_NO_VIEW_LAYERS;
/* header */
region = MEM_callocN(sizeof(ARegion), "header for outliner");
diff --git a/source/blender/editors/space_outliner/tree/tree_display_libraries.cc b/source/blender/editors/space_outliner/tree/tree_display_libraries.cc
index 91b690d35fa..c6b700318dd 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_libraries.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_libraries.cc
@@ -138,8 +138,8 @@ TreeElement *TreeDisplayLibraries::add_library_contents(Main &mainvar,
}
}
- /* We always want to create an entry for libraries, even if/when we have no more IDs from
- * them. This invalid state is important to show to user as well.*/
+ /* We always want to create an entry for libraries, even if/when we have no more IDs from them.
+ * This invalid state is important to show to user as well. */
if (id != nullptr || is_library) {
if (!tenlib) {
/* Create library tree element on demand, depending if there are any data-blocks. */
diff --git a/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc b/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc
index f00cf3c34c0..402526bbe8d 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc
@@ -71,33 +71,56 @@ ListBase TreeDisplayViewLayer::buildTree(const TreeSourceData &source_data)
{
ListBase tree = {nullptr};
- view_layer_ = source_data.view_layer;
+ Scene *scene = source_data.scene;
show_objects_ = !(space_outliner_.filter & SO_FILTER_NO_OBJECT);
const bool show_children = (space_outliner_.filter & SO_FILTER_NO_CHILDREN) == 0;
- if (space_outliner_.filter & SO_FILTER_NO_COLLECTION) {
- /* Show objects in the view layer. */
- for (Base *base : List<Base>(view_layer_->object_bases)) {
- TreeElement *te_object = outliner_add_element(
- &space_outliner_, &tree, base->object, nullptr, TSE_SOME_ID, 0);
- te_object->directdata = base;
+ for (auto *view_layer : ListBaseWrapper<ViewLayer>(scene->view_layers)) {
+ if (space_outliner_.filter & SO_FILTER_NO_VIEW_LAYERS) {
+ if (view_layer != source_data.view_layer) {
+ continue;
+ }
}
- if (show_children) {
- outliner_make_object_parent_hierarchy(&tree);
+ TreeElement &te_view_layer = *outliner_add_element(
+ &space_outliner_, &tree, scene, nullptr, TSE_R_LAYER, 0);
+ TREESTORE(&te_view_layer)->flag &= ~TSE_CLOSED;
+ te_view_layer.name = view_layer->name;
+ te_view_layer.directdata = view_layer;
+ view_layer_ = view_layer;
+
+ if (space_outliner_.filter & SO_FILTER_NO_COLLECTION) {
+ /* Show objects in the view layer. */
+ for (Base *base : List<Base>(view_layer_->object_bases)) {
+ TreeElement *te_object = outliner_add_element(&space_outliner_,
+ &te_view_layer.subtree,
+ base->object,
+ &te_view_layer,
+ TSE_SOME_ID,
+ 0);
+ te_object->directdata = base;
+ }
+
+ if (show_children) {
+ outliner_make_object_parent_hierarchy(&tree);
+ }
}
- }
- else {
- /* Show collections in the view layer. */
- TreeElement &ten = *outliner_add_element(
- &space_outliner_, &tree, source_data.scene, nullptr, TSE_VIEW_COLLECTION_BASE, 0);
- ten.name = IFACE_("Scene Collection");
- TREESTORE(&ten)->flag &= ~TSE_CLOSED;
-
- add_view_layer(ten.subtree, ten);
- if (show_children) {
- add_layer_collection_objects_children(ten);
+ else {
+ /* Show collections in the view layer. */
+ TreeElement &ten = *outliner_add_element(&space_outliner_,
+ &te_view_layer.subtree,
+ source_data.scene,
+ &te_view_layer,
+ TSE_VIEW_COLLECTION_BASE,
+ 0);
+ ten.name = IFACE_("Scene Collection");
+ TREESTORE(&ten)->flag &= ~TSE_CLOSED;
+
+ add_view_layer(ten.subtree, ten);
+ if (show_children) {
+ add_layer_collection_objects_children(ten);
+ }
}
}
@@ -149,8 +172,9 @@ void TreeDisplayViewLayer::add_layer_collections_recursive(ListBase &tree,
add_layer_collection_objects(ten->subtree, *lc, *ten);
}
- const bool lib_overrides_visible = !SUPPORT_FILTER_OUTLINER(&space_outliner_) ||
- ((space_outliner_.filter & SO_FILTER_NO_LIB_OVERRIDE) == 0);
+ const bool lib_overrides_visible = !exclude && (!SUPPORT_FILTER_OUTLINER(&space_outliner_) ||
+ ((space_outliner_.filter &
+ SO_FILTER_NO_LIB_OVERRIDE) == 0));
if (lib_overrides_visible && ID_IS_OVERRIDE_LIBRARY_REAL(&lc->collection->id)) {
outliner_add_element(
diff --git a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
index c5d254242c6..731beb3956e 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
@@ -94,9 +94,7 @@ void TreeElementOverridesBase::expand(SpaceOutliner &space_outliner) const
TreeElementOverridesProperty::TreeElementOverridesProperty(TreeElement &legacy_te,
TreeElementOverridesData &override_data)
- : AbstractTreeElement(legacy_te),
- id_(override_data.id),
- override_prop_(override_data.override_property)
+ : AbstractTreeElement(legacy_te), override_prop_(override_data.override_property)
{
BLI_assert(legacy_te.store_elem->type == TSE_LIBRARY_OVERRIDE);
diff --git a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
index c3caab8e268..0067db6ea56 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
@@ -40,7 +40,6 @@ class TreeElementOverridesBase final : public AbstractTreeElement {
};
class TreeElementOverridesProperty final : public AbstractTreeElement {
- ID &id_;
IDOverrideLibraryProperty &override_prop_;
public: