Blender Git Commits

Blender Git "property-search-ui-v2" branch commits.

Page: 5 / 11

September 10, 2020, 14:08 (GMT)
Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs
September 10, 2020, 14:07 (GMT)
Merge branch 'property-search-single-tab' into property-search-start-end-operators
September 10, 2020, 13:56 (GMT)
Merge branch 'property-search-add-theme-color' into property-search-single-tab
September 10, 2020, 13:55 (GMT)
Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color
September 10, 2020, 13:54 (GMT)
Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel
September 10, 2020, 13:54 (GMT)
Reapply changes after failed merge
September 10, 2020, 13:53 (GMT)
Merge branch 'properties-pin-operator' into property-search-button-label-pointer
September 10, 2020, 13:48 (GMT)
Remove changes from property-search-button-label-pointer
September 10, 2020, 13:29 (GMT)
Merge branch 'master' into properties-pin-operator
September 10, 2020, 13:26 (GMT)
Merge branch 'properties-pin-operator' into property-search-button-label-pointer
September 10, 2020, 13:26 (GMT)
Merge branch 'master' into properties-pin-operator
Revision 3551b8c by Hans Goudey (property-search-ui-v2)
September 9, 2020, 19:03 (GMT)
Merge branch 'property-search-all-tabs' into property-search-ui-v2
Revision 4a4e36f by Hans Goudey (property-search-ui-v2)
September 9, 2020, 18:46 (GMT)
Property Search: All tabs

This patch enables property search for all tabs in the property editor.
This is definitely the most "crazy" of the changes in terms of code, but
it's also where the new functionality gets good.

There is one piece of funcionality that wasn't obvious when I began the
implementation. In order to make interaction faster, if the editor's
current tab doesn't have a result, the search moves you to the next panel
that does. That way you can just press `ctrl-F`, search, and have the
result appear.

In order to keep the searching safe, to make sure the editor isn't influenced
by anything that happens while building the layout for the other tabs,
the space is duplicated and the new search is run in the duplicated
editor. This also helps isolate this code, which could be fairly invasive
otherwise. Only the layout pass is done in the other tabs, and it works
by just running the regular single tab property search (D8856) and
checking if any of the active panels in the tab match the search filter.

The search match status for every current tab of the property editor is
stored in a runtime field and them displayed later by dimming icons in
the tab selector panel to the left. The functionality for that dimming is
in D8858.

Note that there are currently some issues with the tool tab, where some
context variables end up being `None`. I'm curious if reviewers have any
advice if they encounter this.

**Future Improvements**
This patch does not addresss the performance aspects of searching every
tab. This shouldn't be too bad, but it would be good to make some changes
to improve this, ideally in separate patches. I have done some initial profiling,
and it looks like a significant portion of time is spent doing string comparisons,
so that may be the best place to start. Here are some ideas:
1. Use ghash instead of string lookups for panel types
2. Possibly only search in other tabs while editing search string. I would like
to avoid this though.
3. Look into using ED_region_tag_redraw_no_rebuild for some interactions
like panel dragging.

Differential Revision: https://developer.blender.org/D8859
Revision 44dcc74 by Hans Goudey (property-search-ui-v2)
September 9, 2020, 18:27 (GMT)
Property Search: Add highlight arguments to tab buttons

For searching multiple tabs, we need a way to show which tabs have a search
result, but we still need to be able to show which tab is active. Also, multiple
tabs can be highlighted, so that argument needs be be a bitfield enum. This
requires giving extra arguments to `ui_item_enum_expand_tabs`.

Unforunately this adds a bit of ugly complexity to this function. It would be
better if RNA enum items could have an "active" flag, but that change would
probably have larger scope.

Differential Revision: https://developer.blender.org/D8858
Revision 863ea6a by Hans Goudey (property-search-ui-v2)
September 9, 2020, 18:14 (GMT)
Property Search: Quick start and clear operators

This patch adds quick start and quick clear operators.

`ctrl-F` is obviously necessary, but the clear operator, `alt-F` requires
a bit of explanation. First, it maps nicely to the paradigm of "key to set,
alt-key to clear," which makes it pretty unobtrusive. Second, it can be
a quicker way to clear the search than moving the mouse to the top.
Finally, a future improvement I would like to make to property search
is adding the ability to reset the panels to their expansion before the
search started. Either escaping out of the button while text editing or
pressing `alt-F` would be the way to do that.

Differential Revision: https://developer.blender.org/D8857
Revision 58488c0 by Hans Goudey (property-search-ui-v2)
September 9, 2020, 18:01 (GMT)
Property Search: Single tab

This adds a search bar to the properties editor. The full search for every tab
isn't includede in this patch, but the interaction with panels, searching
behavior, internal UI, region level, and DNA changes are included here.

The block-level search works by iterating over the block's buttons and
checking whether they match the search. If they do, they are tagged with
a flag, and the block's panel is tagged too.

For every update (text edit), the panel's expansion is set to whether the
panel has a result or not.

There is some complications to this that you might no initially think of:
1. Closed panel's subpanels have to be searched too. This adds some
complexity and special cases to the area-level panel layout code.
2. //Maybe more if I think of things to add here//

There might be some methods of simplifying some of the logic, particularly
around choosing whether to highlight panel headers. Also note that automatic
subpanel expansion isn't working right now. I'll look into this, but I want to post
all the patches first.

**Future Improvements**
Here are some improvements possible in the future that won't be part of this patch:
1. Use the new fuzzy search in BLI
2. Reseting panels to their expansion before the search started if you `esc`
out of the text box
3. Open parent panels if their subpanels have a match but they don't. This
requires adding a reference to parent panels for subpanels.

Differential Revision: https://developer.blender.org/D8856
Revision 6a76eea by Hans Goudey (property-search-ui-v2)
September 9, 2020, 17:08 (GMT)
Property Search: Add "Search match" theme color

We use a highlight on panel headers to convey that they have a search match.
It's also conceivable to use this color to highlight the property editor tabs
that have search results.

Normally we don't like adding new theme colors, but this is quite a special
case. For example, the color in the outliner is green. This patch has a blue
highlight so it feels more cohesive though.

Differential Revision: https://developer.blender.org/D8854
Revision f3197de by Hans Goudey (property-search-ui-v2)
September 9, 2020, 16:57 (GMT)
Property Search: Move properties context buttons back to a panel

The context path buttons used to be in a panel in 2.79. Although they look
a bit better in the header, there is not space for them with the property
search field in the header as well.

In the long term, maybe it will be possible to shrink the text button and
then animate it expanding when property search begins, then there
would be enough room for both.

Note that this diff is just for review, Blender won't ever actually have only
the pin button in the header like the following image.

{F8858554 size=full}

Differential Revision: https://developer.blender.org/D8853
September 9, 2020, 16:25 (GMT)
Property Search: Small cleanups
September 9, 2020, 16:17 (GMT)
Merge branch 'property-search-button-label-pointer' into property-search-ui-v2
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021