Age | Commit message (Collapse) | Author |
|
Includes fixes to misspelled function names.
Ref D11280
|
|
The term direction was used in 3 different ways in screen editing code,
making it hard to follow:
- 0-3 for as magic numbers mapped to [west,north,east,south].
- `h`, `v` characters for [horizontal,vertical] axes.
- Cycle direction SPACE_CONTEXT_CYCLE_PREV, SPACE_CONTEXT_CYCLE_NEXT
The following changes have been made:
- Add `eScreenDir` for [west,north,east,south], use variable name `dir`.
- Add `eScreenAxis` for [horizontal,vertical] values, use variable name
`dir_axis`.
- Add `eScreenCycle` for existing enum `SPACE_CONTEXT_CYCLE_{PREV/NEXT}`.
- Add macros `SCREEN_DIR_IS_VERTICAL(dir)`,
`SCREEN_DIR_IS_HORIZONTAL(dir)`.
Replacing `ELEM(dir, 1, 3)`, `ELEM(dir, 0, 2)`.
- Move `ED_screen_draw_join_highlight`, `ED_screen_draw_split_preview`
to `screen_intern.h`.
Reviewed By: Severin
Ref D11245
|
|
Move some drawing code from `area.c` and `ed_util.c` into `ed_draw.c`.
This is to support the new generic slider that wil be used in T81785.
No functional changes.
Reviewed By: #animation_rigging, #user_interface, Severin, sybren
Maniphest Tasks: T81785
Differential Revision: https://developer.blender.org/D9313
|
|
Passing 4x arguments for the rectangle,
mixed in with round-box radius & color wasn't very readable.
Instead, pass a `rctf` as the first argument to UI box drawing functions.
|
|
|
|
These functions with many arguments can be unwieldy. Aside from the obvious issues
with rewriting the list of arguments and the opportunities for error and frustration
that presents, the long list of arguments make these systems hard to change. So when
an argument should be added, someone might skip that and add some hack instead.
So, as proposed in T73586#1037210, this patch instead uses a "params" struct for
each of these callbacks.
- Use param argument for `ARegionType.listener`
- Remove unused window field in region listener
- Use param argument for `SpaceType.listener`
- Use params struct for `ARegionType.message_subscribe`
Differential Revision: https://developer.blender.org/D9750
|
|
As proposed in T74432 and already implemented in several commits,
"region" is the preferred name for `ARegion` variables, rather than
any variant of "ar". This commit changes a few "ar" variables that have
popped up over time and also adjusted names of variants like "arnew".
|
|
|
|
After recent changes to the context panel layout (rB187cc5e26d28b1a8),
there has been an error printed when running propery search:
> Error: separator_spacer() not supported in popups.
The layout code thinks it's drawing in a menu because region->visible
isn't properly set for the other tab searches. This patch sets that field
for the temporary searching region, but it also disables searching in the
context breadcrumbs panel, because at best this will just give results
for the names of the active object, etc. This isn't helpful since
those labels are mostly in every tab anyway.
Differential Revision: https://developer.blender.org/D9425
|
|
Differential Revision: https://developer.blender.org/D8660
This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes
Using Curves" project. It adds a submode to greasepencil edit mode that
allows for the transformation of greasepencil strokes using bezier
curves. More information about the project can be found
here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
|
|
The overlap with the `Panel` flags that start with "PNL" was quite
confusing because wasn't clear which enum a flag was from. The
new names are a bit longer, but the clarity is worth it.
|
|
|
|
When outliner datablocks are selected, switch to the corresponding tab
for that datablock in properties editors. Only properties editors
that share an edge with the outliner will change tabs.
Additionally, when modifiers, constraints, and shader effects are
selected from the outliner, the panel will be expanded in all properties
editors.
Part of T77408
Manifest Task: https://developer.blender.org/T63991
Differential Revision: https://developer.blender.org/D8638
|
|
This regression was caused by rB57de5686048f which disabled srgb
transform after the python callback.
The right thing to do is to only rebind the framebuffer once to
reset the no-srgb override.
|
|
|
|
rB78a5895c96 introduced a "use after scope" warning, where a buffer
from a lower scope was used later. The solution is to only use one
variable and store whether to use it more explicitely with a bool.
|
|
|
|
This patch implements panel expansion saving and resetting for property
search. While search is active, the panel expansion is based on whether
or not it has a search result. When the search finishes, the panel
expansion returns to its state before the search started. However, any
panels interacted with during the search won't reset their expansion.
This requires adding a new runtime flag for panels to store whether to
use search result status as expansion. It also requires better handling
for animation when panel expansion changes with another new runtime flag.
`UI_panel_is_closed` gets the search-dependent expansion, but it is
intentionally not used to access expansion in every case-- sometimes it's
necessary to use `PNL_CLOSED` directly.
Differential Revision: https://developer.blender.org/D8984
|
|
This was caused by the sequencer using a sRGB buffer without using
the sRGB transform.
This patch make it so that the framebuffer is rebound using the
sRGB transform before the python draw callbacks.
|
|
|
|
This patch enables property search for all tabs in the property editor.
To make interaction faster, if the editor's current tab doesn't have a
result, the current tab changes to the next tab that has a match.
This patch implements basic code that only searches panels.
While we could run the existing "single tab" property search for every
tab, that would also do everything else related to the layout pass,
which would be less efficient, and maybe more complicated to maintain.
The search match status for every current tab of the property editor is
stored in a runtime bitfield and them displayed later by dimming icons
in the tab selector panel to the left. Using `BLI_bitmap` properly in
the runtime struct required moving it to `buttons_intern.h` and
adding a small API to access the search filter instead.
To make sure the editor isn't influenced by anything that happens while
building the layout for other tabs, most of the context is duplicated
and the new search is run in the duplicated editor.
Note that the tool settings tab works slightly different than the other
tabs, so I've disabled searching it for this commit. That would be a
relatively simple improvement, but would just require a bit of
refactoring of existing code.
Differential Revision: https://developer.blender.org/D8859
|
|
This commit makes the panel expansion set based on the search results
when the active tab in the properties editor changes. The multi-tab
search patch (D8859) actually doesn't handle this because it uses a
different code path.
This feature uncovered a subtle but fairly significant issue with the
implementation of property search (More details in T81113). Basically,
the search needed multiple redraws to properly display the expansion of
panels based on the search results. Because there is no animation of
panel expansion when switching tabs, the problem was exposed only now.
With this commit, hiding of "search only" buttons and panel size
calculation happens in a single final step of the panel layout pass.
The "search only" layout root flag is removed. Instead every button
inside a panel header is in a single "uiButtonGroup" marked with a
specific "in header" flag, an idea which could be generalized in the
future.
Differential Revision: https://developer.blender.org/D9006
|
|
In the 3D view sidebar, the active tool settings panel can be pinned to other
categories, and in those other categories it doesn't redraw when the active
tool changes. This commit checks for pinned panels from the "Tool" category
when checking whether to redraw.
Note that the relatively expensive string comparison is only done for
currently visible pinned panels.
Differential Revision: https://developer.blender.org/D9012
|
|
Since the search is applied all in one phase, there is no need to store
a reference to the search filter in every uiBlock. Instead just pass it
as an argument to UI_block_apply_search_filter.
|
|
While this isn't an issue with the default configuration it's possible
to register extra header types for a single region.
In this case the first header-type to successfully poll is drawn
without drawing other header types.
This issue was raised by T60195.
|
|
This commit makes grid theming more consistent and capable by adding
some new theme colors related to grid rendering.
- Add grid theme color for node editor. `UI_view2d_multi_grid_draw`
is called with TH_GRID instead of a shaded `TH_BACK`.
Also color-blend `TH_NODE_GROUP`.
- Make the movie clip editor's clip preview grid respect grid theme
color (`ED_region_grid_draw` uses color-blended `TH_GRID`).
- Add versioning code to allow fixing existing themes (the resulting
themes should visually look the same as before)
These changes did cause some inconsistencies in the movie clip editor,
even after adjusting the themes accordingly:
1. The alpha slider of the grid color affects the background and not
the grid lines themselves.
2. The grids used by graph and dopesheet mode could already be themed
in the past. Now that the clip preview's grid can also be themed,
two different modes share the same theme color.
Differential Revision: https://developer.blender.org/D8699
|
|
Stack panels (for modifiers, etc..) also get their expansion from their
associated list data. This means that property search expansion needs
to properly update the list data, which can be accomplished by calling
`set_panels_list_data_expand_flag`.
This commit also moves this logic to `UI_panels_end`, where it fits
better.
|
|
This adds a search bar to the properties editor. The full search for
every tab isn't included in this patch, but the interaction with
panels, searching behavior, UI, region level, and DNA changes are
included here.
The block-level search works by iterating over the block's button
groups 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. The search also checks for matching
strings inside enums and in panel labels.
One complication to this that isn't immediately apparent is that
closed panel's subpanels have to be searched too. This adds some
complexity to the area-level panel layout code.
Possible Future Improvements:
- Use the new fuzzy search in BLI
- Reset panels to their expansion before the search started if
the user escape out of the text box.
- Open all child panels of a panel with expansion.
Differential Revision: https://developer.blender.org/D8856
|
|
The ED_region_panels_layout_ex function was quite long, so separating
some pieces of it can make it easier to understand and more modular.
Additionally, the parts that were split off can be reused for future
property search code.
|
|
|
|
For modifier shortcuts we added a "custom_data" field to panels.
This commit uses the same system for accessing the list data that
corresponds to each panel. This way the context is only used once
and the modifier for each panel can be accessed more easily later.
This ends up being mostly a cleanup commit with a few small changes
in interface_panel.c. The large changes in the UI functions are due
to the fact that the panel custom data is now passed around as a
single pointer instead of being created again for every panel.
The list_index variable in Panel.runtime is removed as it's now
unnecessary.
Differential Revision: https://developer.blender.org/D8559
|
|
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`.
Since we always set the clear value before clearing, it is unecessary
to track the clear color state.
Moreover, it makes it clearer what we clear the framebuffer to.
|
|
Differential Revision: https://developer.blender.org/D8653
|
|
Error in rB940b239ad473 left a check for open panels after the
"vertical" check was removed.
|
|
This reverts commit 52f40bcff21b285b7eaa21aaa9c6c7b9d6fa8669.
Apologies for the noise. I caught a problem with this that I hadn't before. I will
commit later after thorough testing.
|
|
Differential Revision: https://developer.blender.org/D8653
|
|
Continuing the work of eb9055a572c3, remove remaining unecessary
variables and arguments that were related tabbing and horizontal
alignment of panels. For example, "vertical" was always true, and
removing that exposed other unused variables.
|
|
|
|
Horizontal panel alignment hasn't been used for years, and we have no
plans to use it in the future. It adds a fair amount of complexity to
the panel code which makes adding features take longer.
This code removes the X closing flag, and all of the logic / variables
unused without it.
This commit includes a file subversion bump.
Differential Revision: https://developer.blender.org/D8601
|
|
|
|
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
|
|
|
|
This make use of the GLStateStack functions for:
- `GPU_blend()`
- `GPU_blend_set_func()`
- `GPU_blend_set_func_separate()`
The goal is to unify them using an explicit state setting.
This will remove the need to use obscure blend functions
|
|
|
|
|
|
Checks for header alignment didn't account for tool-header & header
having different alignment.
There is no reason to use a lookup function on the area
(ED_area_header_alignment) as we already have region.
Check the regions alignment directly, remove access functions.
|
|
|
|
The existing header flip detection didn't account for mixed
tool-header and header flipping & visibility between space-types.
Now alignment syncing handles any combination of header,
tool-header & footer flipped state, in a way that can be extended
to other region types in the future.
|
|
This adds support for panel categories to the instanced panel system
used for modifiers and others. The change is pulled from D7997 where
it is needed for FCurve modifiers, but it is unused now.
The change is simple and basically amounts to checking the panel
category where it was overlooked before.
|
|
|