Commit Graph

128268 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
Hans Goudey
26e56d0b52 Fix: Correct UI string in previous fix
Sorry for the noise...
2023-09-24 18:58:08 -04:00
Hans Goudey
15f24bd248 Fix #112814: New geometry nodes always named "Tool" 2023-09-24 18:55:02 -04:00
Harley Acheson
25b9e8b13b UI: Inter Font with regular (non-slashed) zero
Inter font with "tnum" (Tabular numbers), "ss01" (open digits), and
"ss04 (disambiguation w/o zero). Therefore with a regular zero, not
slashed.

Pull Request: https://projects.blender.org/blender/blender/pulls/112819
2023-09-24 22:44:09 +02: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
3cd8b531a0 Fix intern/dualcon error in 2721b937fb 2023-09-24 16:07:49 +10:00
Campbell Barton
2721b937fb Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
Hans Goudey
d1d570d318 Geometry Nodes: Don't require geometry input for "Mode to Nodes"
It's valid for modifier node groups to not have a geometry input, since
they can just be generators. The operator used to give a warning and
cancel itself when there was no geometry input. Now it works, and
skips adding the geometry input and the group input node to the
new group.
2023-09-23 20:32:52 -04: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
Harley Acheson
1be6fb6b07 UI: Inter with Features ss01, ss02, and tnum
Same (current) version of Inter but with some OpenType features set ON:
"Open digits", "Disambiguation", and "Tabular numbers".

Pull Request: https://projects.blender.org/blender/blender/pulls/112795
2023-09-24 00:58:28 +02: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
224e623e3c Fix bf_animation_fcurves tests failing depending on preferences
User preferences could cause this test to fail,
tests should never read the users configuration.
2023-09-23 21:17:50 +10: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
Hans Goudey
652aab0b31 Fix: Swapped icons in node tool header popover 2023-09-22 20:51:34 -04:00
Hans Goudey
2cb34f7c0d UI: Improve geometry nodes tool popover layout
See #101778, #111524

Separate the layout into one popover for object types and another for
object modes. Use checkboxes with icons and full phrases like "Object
Mode". Also rename the modifier popover to "Modifier". Thought
it just has one option right now, so it looks quite weird.

---

![image](https://projects.blender.org/attachments/17e86c35-3c13-48e4-8113-817c5a80fdd3)
![image](https://projects.blender.org/attachments/f92a55a9-e4f0-4c29-8d15-a47a3154ed70)
![image](https://projects.blender.org/attachments/50cd0a93-0abb-4766-819b-62d265251822)

Pull Request: https://projects.blender.org/blender/blender/pulls/112749
2023-09-23 02:33:51 +02: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