When removing all constraints from pose bones, just reset the `constflag`
field to `0`, instead of clearing out specific flags. It was already
missing a flag that should have been cleared.
Effectively no functional changes, just a nice cleanup.
Change the definition of the `PCHAN_HAS_CONST` pose channel flag. It used
to mean "has a constraint that is not IK or Spline IK", and now it just
means "has a constraint".
This has no direct effect yet, as the flag is only used in drawing code
when there is no (spline) IK constraint. However, I feel that the flag
name should match its expected behaviour, and IMO, in this case, making
that behaviour simpler is better than documenting more.
Refactor `BKE_pose_channel_copy_data()` so that it iterates over the entire
armature only once (instead of twice), and to use a `switch` instead of
a chain of `if`/`else if`/`else` clauses.
No functional changes.
Just some reordering to simplify things, and to put the cheapest checks
first.
No functional changes, except for the addition of a `BLI_assert()` to
check cases in which this function shouldn't be called anyway.
Add a checkbox to node group inputs to force inputs to be single values
and not accept varying fields. While this could also be done more
automatically, and it could be argued that requiring the flexibility is
helpful for users who want to use attributes, there are cases where the
field inferencing doesn't work, or the "use attribute" option is just
unhelpful. People use workarounds with primitive nodes to get the same
behavior anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/112745
When texture painting on a Non-color byte texture with Texture limit active
(or the texture didn't fit on the GPU) the data for partial updating of a GPU
texture was incorrect.
`gpu_texture_update_scaled` expects an input buffer clipped to
the bounds of the input area that needs to be updated. In case for Byte
textures with Non Color colorspace it received the unmodified input
buffer, resulting in incorrect data to be uploaded to the GPU texture.
This PR fixes this by selecting the non-optimized branch when the
texture is a Byte buffer with Data color space and scaling should
happen.
Pull Request: https://projects.blender.org/blender/blender/pulls/112834
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
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
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
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
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
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.
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`.
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.
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.
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
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.
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).
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
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.
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
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.
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.