Age | Commit message (Collapse) | Author |
|
This adds attribute search to the geometry nodes modifier
for the input and output attributes. The "New" search item
is only shown for the output attributes.
Some of the attribute search code is extracted to a new file
in the interface code, to avoid some code duplication.
The UI code required two fixes so that the search would work
for dynamic length strings (IDProperties do not have a fixed size).
Since this does changes to the UI layout of the modifier, I also
addressed T91485 here.
Differential Revisiion: https://developer.blender.org/D12788
|
|
|
|
- New operator property to toggle edge panning in the keymap:
This is disabled by default to avoid edge-panning in cases where it
gets distracting, such as adding a new node. Only the explicit
translate operator(s) (GKEY or drag) have this enabled now.
- Restore the initial view rect on edge pan cancel:
The initial view rect is now stored in the edge pan operator data.
When an operator with edge panning is cancelled it can now call the
`UI_view2d_edge_pan_cancel` function to restore the original View2D
rect.
- Less delay in node editor scrolling:
Delay is useful when scrolling through long lists, such as in the
outliner, but makes node scrolling feel sluggish and unresponsive.
The lower scroll speed here makes a faster response the better option.
- Zoom influence feature:
Somewhat slower scrolling in UI-space when zoomed out. With the 0.5
zoom influence factor nodes behave as if zoom factor is halved,
otherwise it gets too fast when zoomed out. Previously scrolling would
always be constant-speed in UI space, now it's half-way between UI
space and node (view) space.
|
|
|
|
Many ui features for geometry nodes need access to information generated
during evaluation:
* Node warnings.
* Attribute search.
* Viewer node.
* Socket inspection (not in master yet).
The way we logged the required information before had some disadvantages:
* Viewer node used a completely separate system from node warnings and
attribute search.
* Most of the context of logged information is lost when e.g. the same node
group is used multiple times.
* A global lock was needed every time something is logged.
This new implementation solves these problems:
* All four mentioned ui features use the same underlying logging system.
* All context information for logged values is kept intact.
* Every thread has its own local logger. The logged informatiton is combined
in the end.
Differential Revision: https://developer.blender.org/D11785
|
|
Since there is a special callback for assigning the name from the
search box, and the callback doesn't call an operator or something
else that would do an undo push, I think the solution is to do it
manually here.
Another option would be adding the button flag "UI_BUT_UNDO", which
isn't set by default for search buttons, but that gives us ugly names for
the undo steps, so an explicit push is better in this case.
Differential Revision: https://developer.blender.org/D11190
|
|
The function applying the search used the dummy search info for when
the item doesn't exist even when there was no UI data associated with
the node at all.
A fix is to only add the search menu when there is attribute info
stored for the node. This is something I wanted to do anyway, since
it makes it look more purposeful when there are no attribute info
for a node, less like a bug.
Differential Revision: https://developer.blender.org/D11016
|
|
This patch adds domain and data type information to each row of the
attribute search menu. The data type is displayed on the right, just
like how the list is exposed for the existing point cloud and hair
attribute panels. The domain is exposed on the left like the menu
hierarchy from menu search.
For the implementation, the attribute hint information is stored as a
set instead of a multi-value map so that every item (which we need to
point to descretely in the search process) contains the necessary data
type and domain information by itself. We also need to allocate a new
struct for every button, which requires a change to allow passing a
newly allocated argument to search buttons.
Note that the search does't yet handle the case where there are two
attributes with the same name but different domains or data types in
the input geometry set. That will be handled as a separate improvement.
Differential Revision: https://developer.blender.org/D10623
|
|
The information is not exposed in the attribute search yet.
|
|
Because the search didn't run when the menu first opens, the attributes
appeared in a different order than after you typed anything into the
search field. This commit instead runs the search when the menu
is first opened, but it only sorts items without filtering.
|
|
Because pressing enter will choose the current search item from the menu,
and there was no search item with an empty string, it was impossible to
clear the text of an attribute text field. This commit adds a simple "X"
icon in the top row when you delete the string.
|
|
This commit adds a search for existing attributes when you click
on an attribute field. This is useful because otherwise you have
to remember which attributes should be available at each node in
the tree.
The fundamental complication is that this information is not
accessible statically. So the search data is only a cache from
the previous node tree evaluation. The information is added
with `BKE_nodetree_attribute_hint_add`, currently for every
input geometry socket for a single node.
This is only an initial implementation, and later versions will
expose the data type and domain of the attributes.
Differential Revision: https://developer.blender.org/D10519
|