From 3810bcc1604756f433b5b799b66d8b81645767ca Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 15 Apr 2021 08:57:10 +0200 Subject: Spreadsheet: breadcrumbs and node pinning This introduces a context path to the spreadsheet editor, which contains information about what data is shown in the spreadsheet. The context path (breadcrumbs) can reference a specific node in a node group hierarchy. During object evaluation, the geometry nodes modifier checks what data is currently requested by visible spreadsheets and stores the corresponding geometry sets separately for later access. The context path can be updated by the user explicitely, by clicking on the new icon in the header of nodes. Under some circumstances, the context path is updated automatically based on Blender's context. This patch also consolidates the "Node" and "Final" object evaluation mode to just "Evaluated". Based on the current context path, either the final geometry set of an object will be displayed, or the data at a specific node. The new preview icon in geometry nodes now behaves more like a toggle. It can be clicked again to clear the context path in an open spreadsheet editor. Previously, only an object could be pinned in the spreadsheet editor. Now it is possible to pin the entire context path. That allows two different spreadsheets to display geometry data from two different nodes. The breadcrumbs in the spreadsheet header can be collapsed by clicking on the arrow icons. It's not ideal but works well for now. This might be changed again, if we get a data set region on the left. Differential Revision: https://developer.blender.org/D10931 --- source/blender/blenlib/BLI_multi_value_map.hh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_multi_value_map.hh b/source/blender/blenlib/BLI_multi_value_map.hh index 98b55067a5c..fb52ac78243 100644 --- a/source/blender/blenlib/BLI_multi_value_map.hh +++ b/source/blender/blenlib/BLI_multi_value_map.hh @@ -73,6 +73,12 @@ template class MultiValueMap { vector.append(std::forward(value)); } + void add_non_duplicates(const Key &key, const Value &value) + { + Vector &vector = map_.lookup_or_add_default_as(key); + vector.append_non_duplicates(value); + } + /** * Add all given values to the key. */ -- cgit v1.2.3