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:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_outliner/outliner_dragdrop.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c36
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c8
-rw-r--r--source/blender/editors/undo/ed_undo.c8
6 files changed, 56 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 152bbc96281..ab515c0c3a8 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -493,7 +493,7 @@ static bool parent_clear_poll(bContext *C,
case ID_OB:
return ELEM(tselem->type, TSE_MODIFIER_BASE, TSE_CONSTRAINT_BASE);
case ID_GR:
- return event->shift;
+ return event->shift || ELEM(tselem->type, TSE_LIBRARY_OVERRIDE_BASE);
default:
return true;
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 9223da136e1..8c6e4329577 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2180,6 +2180,10 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
data.icon = ICON_MODIFIER_DATA;
data.drag_id = tselem->id;
break;
+ case TSE_LIBRARY_OVERRIDE_BASE:
+ case TSE_LIBRARY_OVERRIDE:
+ data.icon = ICON_LIBRARY_DATA_OVERRIDE;
+ break;
case TSE_LINKED_OB:
data.icon = ICON_OBJECT_DATA;
break;
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index ef152c473f4..8170f1006a5 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -331,7 +331,8 @@ static void do_item_rename(ARegion *region,
TSE_POSEGRP_BASE,
TSE_R_LAYER_BASE,
TSE_SCENE_COLLECTION_BASE,
- TSE_VIEW_COLLECTION_BASE)) {
+ TSE_VIEW_COLLECTION_BASE,
+ TSE_LIBRARY_OVERRIDE_BASE)) {
BKE_report(reports, RPT_WARNING, "Cannot edit builtin name");
}
else if (ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 56eedcd3748..11894548016 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -66,6 +66,7 @@
#include "BKE_idtype.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
+#include "BKE_lib_override.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_outliner_treehash.h"
@@ -640,6 +641,30 @@ static void outliner_add_object_contents(SpaceOutliner *space_outliner,
}
}
+static void outliner_add_library_override_contents(SpaceOutliner *soops, TreeElement *te, ID *id)
+{
+ if (!id->override_library) {
+ return;
+ }
+
+ PointerRNA idpoin;
+ RNA_id_pointer_create(id, &idpoin);
+
+ PointerRNA override_ptr;
+ PropertyRNA *override_prop;
+ int index = 0;
+ LISTBASE_FOREACH (IDOverrideLibraryProperty *, op, &id->override_library->properties) {
+ if (!BKE_lib_override_rna_property_find(&idpoin, op, &override_ptr, &override_prop)) {
+ BLI_assert(false);
+ continue;
+ }
+
+ TreeElement *ten = outliner_add_element(
+ soops, &te->subtree, id, te, TSE_LIBRARY_OVERRIDE, index++);
+ ten->name = RNA_property_ui_name(override_prop);
+ }
+}
+
/* Can be inlined if necessary. */
static void outliner_add_id_contents(SpaceOutliner *space_outliner,
TreeElement *te,
@@ -903,6 +928,17 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner,
default:
break;
}
+
+ const bool lib_overrides_visible = !SUPPORT_FILTER_OUTLINER(space_outliner) ||
+ ((space_outliner->filter & SO_FILTER_NO_LIB_OVERRIDE) == 0);
+
+ if (lib_overrides_visible && ID_IS_OVERRIDE_LIBRARY(id)) {
+ TreeElement *ten = outliner_add_element(
+ space_outliner, &te->subtree, id, te, TSE_LIBRARY_OVERRIDE_BASE, 0);
+
+ ten->name = IFACE_("Library Overrides");
+ outliner_add_library_override_contents(space_outliner, ten, id);
+ }
}
/**
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index c7c207caca0..06946e4c90b 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -112,6 +112,12 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win),
/* context changes */
switch (wmn->category) {
+ case NC_WM:
+ switch (wmn->data) {
+ case ND_LIB_OVERRIDE_CHANGED:
+ ED_region_tag_redraw(region);
+ break;
+ }
case NC_SCENE:
switch (wmn->data) {
case ND_OB_ACTIVE:
@@ -152,8 +158,6 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win),
case NC_OBJECT:
switch (wmn->data) {
case ND_TRANSFORM:
- /* transform doesn't change outliner data */
- break;
case ND_BONE_ACTIVE:
case ND_BONE_SELECT:
case ND_DRAW:
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 2328f7d5256..533416bf85e 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -145,12 +145,14 @@ void ED_undo_push(bContext *C, const char *str)
}
}
+ UndoPushReturn push_retval;
+
/* Only apply limit if this is the last undo step. */
if (wm->undo_stack->step_active && (wm->undo_stack->step_active->next == NULL)) {
BKE_undosys_stack_limit_steps_and_memory(wm->undo_stack, steps - 1, 0);
}
- BKE_undosys_step_push(wm->undo_stack, C, str);
+ push_retval = BKE_undosys_step_push(wm->undo_stack, C, str);
if (U.undomemory != 0) {
const size_t memory_limit = (size_t)U.undomemory * 1024 * 1024;
@@ -160,6 +162,10 @@ void ED_undo_push(bContext *C, const char *str)
if (CLOG_CHECK(&LOG, 1)) {
BKE_undosys_print(wm->undo_stack);
}
+
+ if (push_retval & UNDO_PUSH_RET_OVERRIDE_CHANGED) {
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
+ }
}
/**