Page MenuHome

Spreadsheet: Breadcrumbs and node pinning.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 9 2021, 5:50 PM.

Details

Summary

This is not really ready for testing yet, there are still a couple of rough edges. Pinning specific nodes works already though (although only in one spreadsheet at a time).

I don't really think that we should display the breadcrumbs like this. It only works when the editor is very wide, and few nested node groups are used. Maybe a shortened version of it can be shown in the header, or it is displayed vertically in a dropdown. That is easy to change later on.

Diff Detail

Repository
rB Blender
Branch
spreadsheet-breadcrumbs (branched from master)
Build Status
Buildable 13973
Build 13973: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Apr 9 2021, 5:50 PM
Jacques Lucke (JacquesLucke) created this revision.
  • support multiple pinned spreadsheets
  • support disabling preview
  • improve behavior when setting object evaluation state
  • fix delete bug
  • update pinned breadcrumbs if outdated
  • move breadcrumbs to popover
  • don't unpin automatically
  • unpin only, if no new context is found
  • avoid tagging header for redraw
  • indicate that there are more breadcrumbs with a * (just for testing)
  • remove layout separator
  • hash breadcrumbs
  • try to guess current context after unpinning
  • initial collapsable breadcrumbs

I'm not quite sure what "..." I should use. Just using a label with text looked super ugly and misaligned. We have an icon with three vertical dots, but not horizontal..

Jacques Lucke (JacquesLucke) retitled this revision from Spreadsheet: Breadcrumbs and node pinning (WIP). to Spreadsheet: Breadcrumbs and node pinning..Apr 12 2021, 3:28 PM

Was just looking at T87314. If we want, we can still consolidate the Node and Final methods, probably. It can be part of this patch, but it can also be done separately afterwards.

Spreadsheet: Breadcrumbs with combined node/final evaluation modes.

I think the general behaviour as it is now is nice!
Small request though:
I think after changing the active modifier the context should also update to the state of that new active modifier.

I think after changing the active modifier the context should also update to the state of that new active modifier.

That is doable, but I think I'd rather do it as a bug fix instead, just to keep this patch a little bit simpler.

I think after changing the active modifier the context should also update to the state of that new active modifier.

That is doable, but I think I'd rather do it as a bug fix instead, just to keep this patch a little bit simpler.

Sure, then I'd consider this patch ready from my perspective as a user.
With this we can also close T87314: Decide on design for switching between geometry contexts in regards to the node inspection, I would say.

This revision is now accepted and ready to land.Apr 13 2021, 5:16 PM
Hans Goudey (HooglyBoogly) requested changes to this revision.EditedApr 14 2021, 6:26 AM

I have to say, this works really wonderfully. It's such a pleasure to use now, and while there might be some further tweaking possible, especially in regards to the button in the node header itself, it feels quite close to optimal.

What you did with the context path in the header is great too. It's still a bit prominent IMO, but I can't think of any better way to make it shorter, and that method of clicking on it to make it shorter is clever.


I think breadcrumbs and SpreadsheetBreadcrumb might not be the best names-- "context path" might be clearer, since this is really used to define what the spreadsheet editor's context is.


"Show this node's geometry output in the spreadsheet in Node mode" button label needs updating to remove the reference to "Node mode".


Many of the inline comments are just requesting more comments. I think that's one thing that's missing in general actually, a brief higher level description about which direction updates are tagged in, the flow of information, etc.
That's important since the whole "find all spreadsheet editors and tag them for updates" thing isn't very obvious for someone without all the context we have at this moment. I'm not sure where it would be best to put that though, and I guess it could be a separate commit.

release/scripts/startup/bl_ui/space_spreadsheet.py
71

Unused variable

81

Unused variable

103–105

Why an operator button? This seems simpler. Plus you get a nicer tooltip (and the unused variables above won't be unused)

def draw_breadcrumb_path_icon(self, layout, space, icon='RIGHTARROW_THIN'):
    layout.prop(space, "display_breadcrumbs_collapsed", icon_only=True, emboss=False, icon=icon)
source/blender/blenkernel/intern/screen.c
1365

I would think you would only want to write the breadcrumbs if there is a pinned context, right? Otherwise it's just runtime data.

source/blender/editors/include/ED_spreadsheet.h
33

This isn't used right now. Any reason to keep it around?

source/blender/editors/space_spreadsheet/space_spreadsheet.cc
164

The first question a reader has is "what does outdated mean?" From reading the code it looks like it might mean that the object was deleted? That makes sense, but then I wonder.. what about deleted nodes? Modifiers? The function could have a comment at the top to make its goals clearer.

source/blender/editors/space_spreadsheet/spreadsheet_breadcrumb.cc
264

This is one of those ambiguous cases where one has to read through it to see what's actually being tagged for an update.
It's definitely obvious in most cases, but I do think some simple comment will save someone time in the future. Hopefully more time than it takes to write and address this comment...

A suggestion:

/**
 * Tag any data relevant to the spreadsheet's context for recalculation in order to collect information to display in the editor, which may be cached during evaluation.
 */
source/blender/makesdna/DNA_object_types.h
173 ↗(On Diff #36130)

Well, technically integer keys are "owned" by the map, since they're stored in it, right? It's just trivial ownership?

The point comes across though, no real need to change anything I don't think.

source/blender/makesdna/DNA_space_types.h
1904–1908

Messed up formatting here, and we need another comment.

source/blender/makesrna/intern/rna_nodetree.c
10828

I'll suggest being a bit more clear: "The data passing though the node is previewed in another editor". Something like that at least.

source/blender/makesrna/intern/rna_space.c
6850

Do you want this to be editable?

Actually, is this even used? I didn't find anything with search.

source/blender/modifiers/intern/MOD_nodes.cc
1190–1193

Once I figured this out I saw that this section of the code is actually quite elegant. The explicit typing combined with the way it's broken up-- well done.

However, it would have been a bit faster to figure out with a sentence or two of prose to offer a different perspective than the code. I don't think that's just me, at least I hope not.

Suggest:

/**
 * Based on every visible spreadsheet context path, get a list of sockets that need to have their intermediate geometries cached for display.
 */

Or something like that anyway. Maybe the important thing to realize is that it is not based on any of the flags in the nodes themselves, it's only based on the spreadsheets.

This revision now requires changes to proceed.Apr 14 2021, 6:26 AM

first set of updates, still missing a larger rename

  • fix tooltip
  • remove unused variables
  • use property instead of operator
  • remove unused function
  • comments
  • remove NodeTreePath.node_name from rna
  • comment
  • rename breadcrumbs to context path internally
source/blender/blenkernel/intern/screen.c
1365

It's not just runtime data. The breadcrumbs are the ground truth for what is currently displayed in the spreadsheet. If there are multiple possible contexts for the spreadsheet, the breadcrumbs will remember which one is actually displayed at any moment.

(note getting multiple contexts at the same time is not super easy right now, because pinned node groups don't fully work yet as I just noticed; but that's something that can be fixed a little later)

source/blender/makesdna/DNA_object_types.h
173 ↗(On Diff #36130)

You could argue that the integers are owned by map, but that argument does not seem to help anyone :D

source/blender/makesrna/intern/rna_space.c
6850

Ah right, that is a leftover from when I was doing some stuff in Python that is now in C++.

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/blenkernel/intern/screen.c
1365

Right, thanks.

This revision is now accepted and ready to land.Apr 14 2021, 4:10 PM
source/blender/makesrna/intern/rna_space.c
7489

full -> fully