Making some liboverride local will break/corrupt liboverride hierarchies
in many cases. So that function (or its caller, in some cases) need to
call #BKE_lib_override_library_main_hierarchy_root_ensure to re-validate
(and re-generate if needed) the liboverride hierarchy roots.
Move the three current 'status variables' (stop, update and progress)
into a single 'WorkerStatus' struct. This is cleaner and will allow for
future workin this area without having to edit tens of 'startjob'
callbacks signatures all the time.
No functional change expected here.
Note: jobs' specific internal code has been modified as little as
possible, in many cases the job's own data still just store pointers to
these three values. Ideally in the future more refactor will be using a
single pointer to the shared `wmJobWorkerStatus` data instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/113343
IME editing would cast GHOST_TEventImeData to wmIMEData then read/write
an additional member that doesn't exist in GHOST_TEventImeData.
In practice it's likely struct padding prevented this from showing up
as a bug. Nevertheless it's bad practice to rely on this.
- Make GHOST_TEventImeData read-only, move the is_ime_composing boolean
into the window.
- Add static assert to ensure both structs are the same size.
- Correct code comments.
This fails to differentiate between active buttons and disabled buttons
for some custom themes (and also in blender light theme)
Instead use text color with 0.5 alpha value for disabled item's text.
(Don't blend between text and inner color)
Pull Request: https://projects.blender.org/blender/blender/pulls/113082
This replaces the older dynamic c arrays with blender::Vector as
appropriate. Many files required minimal changes and the before/after
are quite similar.
There's 3 remaining usages of the old machinery but those will require
more involved changes and design.
See #103343
Pull Request: https://projects.blender.org/blender/blender/pulls/110981
The Grease Pencil 3.0 layers and groups were not properly translated:
- The layers and groups' names were translated during display in the
layer list. Since they are data, they should be left untranslated at
this time.
- On object creation, the names "GP_Layer", "Color", "Lines", and
"Fills" were not translated at all.
This adds DATA_() macros around to translate them if the user has
enabled translation of new data names.
- The functions returning unique names for layers and groups
unique_layer_group_name() and unique_layer_name() would return
"GP_Layer" and "GP_Group" by default.
These defaults are now translated.
- When adding new layers and groups, the name was always hardcoded to
"GP_Layer" and "GP_Group" because the operators' properties for the
names defaulted to that, and prop defaults cannot be translated.
Instead, make them default to a null string, but choose an
appropriate name when executing the op. This name is chosen by
unique_layer_name() and unique_layer_group_name(), whose defaults
are now translated.
Pull Request: https://projects.blender.org/blender/blender/pulls/112930
Improvements to `ui_but_menu_add_path_operators` so that it properly
differentiates between files and directories even if the filepath is
not slash terminated. It will also not add the operators to the menu
if the filepath does not exist.
---
Right-clicking on a pathname input we get a context menu that might contain "Open File Externally" and/or "Open Location Externally". But the first problem is that it does not check if this location exists, and we do have times where the paths do not exist yet. This PR makes this function a bool so that can return false if the files do not exist.
The second problem is that the function does not properly differentiate between a file path and directory path. For a directory path that is not slash terminated it will assume it is a file path. This PR actually checks the path (BLI_is_dir) to see if it really is a directory path.
Pull Request: https://projects.blender.org/blender/blender/pulls/113216
The logic to handle word selection from double clicking ran even when
the event wasn't inside the button. This would pass an invalid position
to BLI_str_cursor_step_bounds_utf8 which hung.
Resolve by limiting word-selection to when the event is inside
the text editing field as well as clamping the position to ensure
it's within the allowed range.
Separate user configuration of subpixel antialiasing from the hinting
options. For example, this allows turning this on while hinting is
"None", or off when hinting is "Full".
Pull Request: https://projects.blender.org/blender/blender/pulls/113027
Copy to selected & Alt-LMB dragging buttons didn't account for
custom properties, An IDProperty from one item was applies to other
items in the selection.
Now ID property paths are resolved up for every selected item.
Don't pass custom property names to RNA_struct_type_find_property
since this meant custom-property names could intentionally collide with
RNA property names.
In Interface text inputs, when double-clicking to select a word, set
the "initial selection position" to the beginning of the word. This way
you can continue to select forward by dragging before releasing mouse.
Pull Request: https://projects.blender.org/blender/blender/pulls/113037
When the tool settings or asset shelf header would draw with some
transparency, the separator line between regions would visibly overlap
the background behind buttons, which looked unpolished. Ensure there is
no overlap (but also no gap, which became visible after accounting for
the separator line in the background drawing).
The `blender-v4.0-release` branch would not build because some parts of grease pencil v3 were still exposed when experimental features are disabled.
This is hiding the relevant parts behind `#ifdef WITH_GREASE_PENCIL_V3` to make sure they are only built when the experimental features is enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/112953
After changing tools (and possibly other context), the buttons section
background drawing would be broken for one redraw, so the full region
would be drawn with a background, rather than just behind the button
boundaries.
This is necessary to let popovers redraw when asynchronously loading
data. For example to display assets or asset catalogs as they get
loaded. Needed for the asset shelf catalog selector popover. Menus
already do the same to allow populating the menu with assets as they get
loaded.
Draw the background of the asset shelf header fully transparent, with an opaque
background with rounded corners behind sections containing buttons. This
reduces the visual space consumed by the asset shelf, and makes the header
follow a tabbed folder metaphor better. Also, this works much better with our
click-through feature, where transparent parts of regions without buttons are
passed through the region under it (we might want to consider unifying code
here a bit).
The edge to drag for region resizing respects the transparent sections.
When there is little space between sections, the sections get merged so that
there are no small gaps in the bar.
Part of #107881.
----
Note that the core of this is implemented in a generic way, so this can be
reused for other regions.
Pull Request: https://projects.blender.org/blender/blender/pulls/112241
It was already called that way in the UI, since it's referring to a
behavior, not a type. Update the code to match that. Note that this is
a BPY compatibility breaking change for 4.0.
In Vulkan (and Metal) it is not possible to use a global as point
size. It needs to be set for each vertex when drawing points. Blender
has specialized shaders for that, but not all code respect those
shaders.
This PR will add an assert inside the vulkan backend when incorrect
usage of shaders are detected.
Pull Request: https://projects.blender.org/blender/blender/pulls/112906
The order of collections in the light linking collection is important
as it is used for tie-breaking when the same object is reachable from
multiple linked collections with different light linking state.
This commit utilizes the generic tree view reordering operations to
allow insertion of elements to a specific location and to re-order
existing objects and collections in the light linking collection.
It is possible to re-order both collections and objects, even tough
re-ordering objects does not really make a difference for the light
linking behavior. It is not possible to place an object before
collections.
Pull Request: https://projects.blender.org/blender/blender/pulls/112849
In preparation of https://projects.blender.org/blender/blender/pulls/112535, we need to make sure all layer tree manipulations are in functions on the `GreasePencil` struct so we can keep the `CustomData` for layers in sync with the layer tree.
This PR makes sure that all the functions that change the layer tree in any way are `protected` on the `LayerGroup` class. The `GreasePencil` struct is declared `friend` with `LayerGroup`.
We also cleanup and remove a lot of code duplication between layers and layer groups and try to write functions in a generic way for `TreeNode` (both layers and layer groups are tree nodes).
Pull Request: https://projects.blender.org/blender/blender/pulls/112837
The goal is to make the search faster to use by dynamically adapting to the user.
This can be achieved using the simple but common approach of showing recently
selected items at the top. Note, that the "matching score" between the query and
each search item still has precedence when determining the order. So the last used
item is only at the top, if there is no other search item that matches the query better.
Besides making the search generally faster to use, my hope is that this can also
reduce the need for manually weighting search items in some places. This is
because while the ordering might not be perfect the first time, it will always be
once the user selected the element that should be at the top once.
This patch includes:
* Support for taking recent searches into account in string searching.
* Keep track of a global list of recent searches.
* Store recent searches on disk similar to recently opened files.
* A new setting in the user preferences that allows disabling the functionality.
This can be used if deterministic key strokes are required, e.g. for automated tests.
In the future this could be improved in different ways:
* Add some kind of separator in the search list to indicate which elements are at
the top because they have been used recently.
* Store the recent search items per search, instead of in a global list. This way
it could adapt to the user even better.
Pull Request: https://projects.blender.org/blender/blender/pulls/110828
The issue was that `event.utf8_buf` is not null-terminated.
In debug builds, it's explicitly filled with `0xff` which let to
the garbage characters. Now check for the size of the first
valid utf8 char and only copy that.
Thanks to PratikPB2123 for the investigation in #112719.