Commit Graph

103031 Commits

Author SHA1 Message Date
Alexander Gavrilov
2abd026cfe Anim: remove the deprecated use_inherit_scale bone property.
This boolean property has been replaced with an enum all the way
back in 2019, so it is time to remove it completely. It is purely
an RNA wrapper around the real enum property, so the only thing
this change can break is some python scripts and add-ons.

Pull Request: https://projects.blender.org/blender/blender/pulls/112836
2023-09-25 11:13:36 +02:00
Jacques Lucke
8362563949 UI: show recently selected items at the top of searches
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
2023-09-25 10:56:12 +02:00
Jeroen Bakker
676a03cf1e Cleanup: Make format 2023-09-25 09:35:00 +02:00
Campbell Barton
e38ff7c06d Cleanup: use C++ comments for disabled code 2023-09-25 17:06:04 +10:00
Omar Emara
acb88528a5 Realtime Compositor: Implement Inpaint node
This patch implements the Inpaint node for the Realtime Compositor. The
inpainting region is filled by sampling the color of the nearest boundary pixel
if it is not further than the user supplied distance. Additionally, a lateral
blur is applied in the tangential path to the inpainting boundary to smooth out
the inpainted region.

The implementation is not identical to the existing CPU implementation due to
technical infeasibility. In particular, the CPU implementation uses a Manhattan
distance transform, while the GPU implementation uses an Euclidean one, which is
a consequence of the use of the Jump Flooding algorithm. Furthermore, the CPU
uses a serial convolution starting from the boundary outwards, while the GPU
uses a lateral Gaussian blur in the direction tangent to the boundary.

Pull Request: https://projects.blender.org/blender/blender/pulls/111792
2023-09-25 08:45:46 +02:00
Omar Emara
5008938a1c Realtime Compositor: Implement Double Edge Mask node
This patch implements the Double Edge Mask node for the Realtime
Compositor. The implementation is primarily based on the 1+JFA Jump
Flooding algorithm, which was also introduced in this commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/112223
2023-09-25 08:35:42 +02:00
Peng Yan
f59ef84835 Cleanup: avoid redundant loop extruding face regions
Correct typo in bmo_extrude.cc that lead to a redundant loop over
a vertices faces.
2023-09-25 16:02:11 +10:00
Campbell Barton
6c91e1c205 Cleanup: spelling in comments 2023-09-25 15:25:43 +10:00
Campbell Barton
1a5326fe02 Cleanup: remove commented DNA_struct_member_exists check 2023-09-25 13:25:37 +10:00
Campbell Barton
e2c07b64a8 Cleanup: remove references to DNA_struct_find
There is no need to define this for versioning since DNA_struct_exists
is sufficient for versioning checks.
2023-09-25 13:20:17 +10:00
Campbell Barton
ef2d56385e Docs: improve doc-strings & grouping for DNA lookup functions 2023-09-25 13:17:35 +10:00
Campbell Barton
fc6a0e9bd3 Cleanup: prefer using with_alias(..) lookup functions
In these cases it doesn't make a difference as the named match.
Prefer the alias versions to avoid mismatch in the future.
2023-09-25 12:56:00 +10:00
Campbell Barton
e7ced9f595 Cleanup: use aliased struct name for BLO_get_struct_id_by_name
Currently this doesn't make a difference as old script names were never
used. Avoid issues in the future by using aliased names.
2023-09-25 12:39:40 +10:00
Campbell Barton
c5b53dcab4 blenloader: use aliased names for versioning checks
Avoid confusion when checking for DNA members by using the names
in DNA headers ("Light" instead of "Lamp" for e.g.)

Internally SDNA stores names without aliases for compatibility.
The intention with aliasing DNA names is for `dna_rename_defs.h`
to be the only place where the non-aliased names needed to be referenced
however versioning checks also needed to reference the old names.

This wasn't obvious, causing mistakes in versioning checks (now fixed):

- SpaceOutliner::filter
- BrushGpencilSettings::hardness
- bGPDstroke::hardness

Details:

- Alias lookup tables are now ensured for BlendFileData::filesdna.
- DNA_struct_exists & DNA_struct_member_exists now use aliased names
  in versioning code.
2023-09-25 12:26:38 +10:00
Campbell Barton
eb141f1608 DNA: differentiate with/without alias versions of SDNA lookup functions
Use with_alias / without_alias suffix for functions
so it's clear which is intended (no functional changes).

Add macros for versioning checks to avoid noisy changes,
currently they use the non-aliased versions of these functions
but should eventually be moved to use the aliased versions because
it's confusing to use the original names when these should only need
to be referenced from `dna_rename_defs.h`.
2023-09-25 12:25:32 +10:00
Campbell Barton
59210c18bc DNA: add alias version of DNA_struct_exists 2023-09-25 12:25:31 +10:00
Campbell Barton
3f8443ed6b Cleanup: use _with_alias(..) suffix for SDNA functions that uses aliases
Name the lookup functions to make it clear they are versions of the
non-aliased functions that use an alias.

Prepare for explicit with/without alias versions of functions.
2023-09-25 12:25:30 +10:00
Campbell Barton
91e48c9596 DNA: add a DNA offset lookup function that supports aliased names
Prepare for using aliased names in more places (currently unused).
2023-09-25 12:25:28 +10:00
Campbell Barton
d1699a6110 Cleanup: use _by_name(..) suffix for DNA patching functions
Remove _nr(..) suffix, make named funcitons explicit.
2023-09-25 12:25:27 +10:00
Campbell Barton
f9c9981b6b Cleanup: use const SDNA for DNA_struct_member_offset_by_name 2023-09-25 12:25:26 +10:00
Campbell Barton
35b08448c6 DNA: prevent leak running ensure alias functions multiple times
Currently this isn't causing leaks as far as I know however calling
"ensure" funcitons multiple times should be supported.
2023-09-25 12:13:29 +10:00
Campbell Barton
caef976ceb Cleanup: correct typo "hardeness" to "hardness" in DNA & variable names 2023-09-25 12:05:50 +10:00
Campbell Barton
7c614ff11d Cleanup: sort DNA rename defines (as noted in comments) 2023-09-25 12:01:08 +10:00
Campbell Barton
407e2b9f70 Fix crash in geo_node_* tests, missing null check
Missing null check in [0] caused tests
(geo_node_simulation_test_simple_particles & others) to crash.

[0]: 7015d83368
2023-09-25 10:25:48 +10:00
Jacques Lucke
eef2a706b4 Fix: UI: garbage string when invoking search from menu
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.
2023-09-24 22:37:01 +02:00
Jacques Lucke
7015d83368 Cleanup: Geometry Nodes: move functions to a more reusable place 2023-09-24 21:07:56 +02:00
NueSB
4aaae8d0a6 GPencil: Implement nearest neighbor filtering for pixelate effect
The Pixelate effect has an antialiasing switch that cleans up
pixels mostly, but still has some inbetween artifacts that are
a little frustrating to deal with. This makes it so that pixels are
completely hard-edged when AA is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/112605
2023-09-24 16:01:31 +02:00
Campbell Barton
b38a61fa07 Cleanup: rename DNA_genfile.h functions
Rename for clarity in preparation for further refactoring.
Remove the need for `_nr` in function names.

- Rename *_find() functions to *_exists() since they returned a boolean.
- Rename *_find_nr() functions to *_find().
- Rename *_struct_elem_* to *_struct_member_*.
- Rename DNA_elem_size_nr -> DNA_struct_member_size.
- Rename DNA_elem_offset -> DNA_struct_member_offset_by_name.
2023-09-24 16:11:13 +10:00
Campbell Barton
2721b937fb Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
Hans Goudey
c1954f9846 UI: Use "unassigned" icon for assets in modifier and node add menus
Use the same icon as in the asset browser "unassigned" item for
unassigned node group assets exposed in the modifier or node
add menus, helping to make the connection to the asset browser.
The downside is potentially drawing unnecessary attention to these
categories, but ideally they won't exist for most users anyway (since
the assets should be in proper catalogs).
2023-09-23 20:32:52 -04:00
Hans Goudey
4d07c08cc2 Fix: Missing units in quadrilateral node points inputs 2023-09-23 20:32:52 -04:00
Hans Goudey
07f01b5fc2 Curves: Add RNA API to add points
Add a simple function for adding curves to a `Curves` data-block.
The only argument is a list of the number of points in each added
curves. Attribute data is meant to be filled in separately.

It can be used like this: `curves.add_curves([8, 8, 16])`, which will
add two curves with 8 points, and one with 16 points. This API is
chosen in order to make the API generic, and to push users to
add more curves at once, rather than appending a single curve
at a time, which would be slower.

Pull Request: https://projects.blender.org/blender/blender/pulls/112400
2023-09-23 18:27:00 +02:00
Campbell Barton
d4dbbab5d9 Cleanup: locate break statements inside the case body
Follow the convention used almost everywhere in Blender's code.
2023-09-23 21:17:50 +10:00
Pratik Borhade
90f22739f7 Fix #112650: UI: Missing Header Status in Node Editor after Turning off Auto-offset
Caused by 42f8b49581
When auto-offset is OFF, garbage characters was displayed due to
uninitialized string.

Pull Request: https://projects.blender.org/blender/blender/pulls/112657
2023-09-23 12:37:25 +02:00
Campbell Barton
d2c271ec84 CMake: use bf_io_ prefix for IO tests
This simplifies running built-in IO tests with:

  ctest -R bf_io_

Also use "bf_io_" prefix for the libraries since it was already used
by some and it's a useful hint the libraries are used for IO.
2023-09-23 20:22:19 +10:00
Harley Acheson
7c636c1702 Fix #112736: Don't do Subpixel AA if not Antialised
There should be no Subpixel AA if the user has deselected
"Anti-Aliasing". Render target FT_LOAD_TARGET_MONO is strongly
hinted to pixel grid and shouldn't be messed with.

Pull Request: https://projects.blender.org/blender/blender/pulls/112759
2023-09-23 01:32:49 +02:00
Hans Goudey
e44932473a Fix: Improve button alignment of single value node group operator inputs
Animation decorators aren't used in the redo panel.
2023-09-22 15:33:45 -04:00
Hans Goudey
0e1aca735a UI: Rename "No Catalog" node assets menus to "Unassigned"
After discussion with module members, it was agreed that "Unassigned"
was better because the word is already used in the asset browser, and
because it sounds more natural.
2023-09-22 14:28:35 -04:00
Hans Goudey
70ffc7a2de Fix: Missing "Add Shortcut" for node group operator
The operator uses the relatively new "GEOMETRY_OT" prefix,
which wasn't handled in the function that finds a keymap for an
operator. To support this, choose the 3D View keymap depending
on the current mode for the geometry object types.
2023-09-22 14:28:35 -04:00
Harley Acheson
8e843920d4 Cleanup: Make format
Formatting changes resulting from Make Format
2023-09-22 09:56:26 -07:00
Harley Acheson
0dab5818d7 UI: Discrete Thumbnail Sizes for Menus
Allow menus to select thumbnail sizes in discrete steps.

Pull Request: https://projects.blender.org/blender/blender/pulls/112455
2023-09-22 18:49:01 +02:00
Hans Goudey
f7eb7ced58 Fix: Crashes in geometry nodes group data-block polls
`geometry_node_asset_traits` can be null, that means none
of the flags are set.
2023-09-22 12:25:07 -04:00
Hans Goudey
0fbb958417 Geometry Nodes: Disable viewer node shortcut in tool context
The viewer node doesn't work for tools, this helps clarify that.
2023-09-22 11:59:01 -04:00
Harley Acheson
01c2f72f26 UI: Remove File Browser "small_size" Feature
Remove non-working feature that changes File Browser list view when the
thumbnails are smaller than 64x64.

Pull Request: https://projects.blender.org/blender/blender/pulls/112696
2023-09-22 17:47:42 +02:00
Hans Goudey
1c51f74cb4 Geometry Nodes: Filter data-block buttons for tools and modifiers
In the data-block selectors in the node editor and the header,
apply a few rules to increase the separation between tool and
modifier node groups.
1. The modifier accepts non-asset groups or assets marked
   as modifiers (created in the modifier context). Tool node groups
   cannot be used by modifiers.
2. The tool context can only edit node group assets marked as tools
   (created in the tool context).

When switching contexts, the node group is cleared if the state would
be invalid. The tool node group is still stored in the editor's "root node
tree" property. Since it isn't retrieved from the context, the pin button
is useless, so it isn't displayed in the tool mode.

See #101778, #111526.

Pull Request: https://projects.blender.org/blender/blender/pulls/112389
2023-09-22 17:45:00 +02:00
Sergey Sharybin
015bc7ca4d Light linking: Make list interface look more similar to other places
This change makes it so the list interface in the properties panels looks
closer to things like shape keys, vertex groups and so on: there are two
buttons to add selected objects to the collection and remove active item
from the collection, as well as the "extra" drop down menu.

The add operator adds selected objects to the light linking collection
using the Include policy. For the light linking it means that the objects
are added as receivers that receive the light, and for the shadow linking
it means that objects are added as blockers which cast shadow from the
light.

The communication of the active list element is done via context property
similar to how it was done before. The difference is that these properties
are set on a parent of the list layout, which makes it so they are inherited
by the layout hierarchy needed to place the Remove button.

Pull Request: https://projects.blender.org/blender/blender/pulls/112713
2023-09-22 17:44:25 +02:00
Julian Eisel
427bdc8dcf UI: Remove dead space between tree view items
Part of #107742.

There used to be a small margin between items since the layout feels a
bit crammed otherwise. But this meant the mouse could be between items,
with no item highlighted or reacting to interactions. This was
especially annoying when dragging over items for drag and drop: in
between items dropping wasn't possible, and the drag-tooltip would
disappear, causing notable flickering during motions over the tree view.

The view item is now slightly enlarged to keep a look that is not too
crammed, and still remove the space between items. Item highlights are
still drawn with a smaller height (matching the normal widget height),
since anything else looked odd to me.

This now feels quite consistent with similar UIs (e.g. File Browser list
view or the Outliner), even though we give the items a bit more space.
2023-09-22 17:34:11 +02:00
Hans Goudey
b838c34afa Cleanup: Remove unused sculpt mask expand operator
The "mask expand" operator from 0083c96125 is not exposed in
the UI and is redundant with the addition of the more general "expand"
operator from 82e7032477. The latter commit even mentioned
that the first mask expand operator was made obsolete.

Pull Request: https://projects.blender.org/blender/blender/pulls/112726
2023-09-22 17:30:28 +02:00
Hans Goudey
c6380d772c Fix: Debug build error after recent cleanup
Caused by 8954b70d49
2023-09-22 11:22:30 -04:00
Hans Goudey
5c9b628596 Fix: Extra period in menu descriptions 2023-09-22 11:20:15 -04:00