First issue is that `BKE_modifiers_uses_armature` wasnt working for GP
objects and the second one is that vgroup names are stored in
CurvesGeometry for GP (so that needs special handling, now done, same as
in `BKE_object_defgroup_set_name`).
Pull Request: https://projects.blender.org/blender/blender/pulls/129794
Curve maps in nodes like RGB Curves are not drawn nor evaluated outside
of clipping range. This is a regression in 8812be59a4, where the range
of the curve didn't account for points that lie outside of the clipping
range. That's because the table_range variable was initialized before
the loop that updates the minimum and maximum points of the table.
To fix this, we move the table_range initialization after the loop that
updates the minimum and maximum points of the table.
Pull Request: https://projects.blender.org/blender/blender/pulls/129777
Build modifier should start building strokes at a key frame, not always
assume a starting frame of 0.
Frame restriction works the same way as GPv2, which uses absolute
frame number.
Pull Request: https://projects.blender.org/blender/blender/pulls/129774
When grease pencil has no actions (ale->adt), id data block channel is
still added due to `ANIMFILTER_ANIMDATA`. This would lead to crash if
operator is accessing the AnimData (ale->adt). To fix this, make sure
adt exists before creating an animchannel.
Pull Request: https://projects.blender.org/blender/blender/pulls/128841
The 4x4 matrix type has a larger alignment requirement of 16 bytes
than the default, but it was stored in a generic vector of bytes. There
are a few solutions that reduce the memory reuse in this code path--
the chosen solution uses a custom allocator which always allocates
with an alignment that should be large enough for anything.
Generally I think this resampling loop could be rewritten to be a bit
simpler, avoiding these problems in the first place. Some performance
testing would show whether this "fancy" memory use between types
and loop structure is actually worth it. For now though, just correcting
the existing logic seems like the best choice.
Pull Request: https://projects.blender.org/blender/blender/pulls/129628
The input `md_eval` is invalidated when calling `BKE_scene_graph_update_for_newframe`.
The fix uses `BKE_modifier_get_original` to pass the original modifier
to `apply_grease_pencil_for_modifier_all_keyframes` then calls `BKE_modifier_get_evaluated`
after `BKE_scene_graph_update_for_newframe` to ensure the `md_eval` pointer is valid.
Pull Request: https://projects.blender.org/blender/blender/pulls/129732
Introduced in 1bc5c488d4
The value used in DNA_scene_defaults.h was out of sync with the actual
default startup value. In all currently supported and in development
versions (3.6 LTS, 4.2 LTS, 4.3, and 4.4), the `UNIFIED_PAINT_ALPHA`
bit value is set to false.
Pull Request: https://projects.blender.org/blender/blender/pulls/129711
Replace plain-text type information with the type syntax used
for Python's type annotations as it's more concise, especially for
callbacks which often didn't include useful type information.
Note that this change only applies to inline doc-strings,
generated doc-strings from RNA need to be updated separately.
Details:
- Many minor corrections were made when "list" was incorrectly used
instead of "sequence".
- Some type information wasn't defined in the doc-strings and has been
added.
- Verbose type info would benefit from support for type aliases.
For C/C++ doc-strings should be located in headers,
move function comments into the headers, in some cases merging
with existing doc-strings, in other cases, moving implementation
notes into the function body.
With the brush assets project, many paint tools are no longer specified
by tool. To maintain functionality, this commit inspects the brush type
instead of hardcoding against the paint tool to ensure that no matter
which tool is being used, the UI displays correctly based on the brush.
Pull Request: https://projects.blender.org/blender/blender/pulls/129654
Fixes#128751.
As asset libraries were added or removed (through the UI or BPY), the
"All" asset library wouldn't refresh to reflect the changes. In general
this wasn't handled well. Even a manual refresh wouldn't give the right
result.
There were multiple issues really:
- Only the first load of the "All" library would query the preferences
for the available libraries. Further loads would only refresh the
catalogs, ignoring any added/removed libraries.
- Operators and BPY functions didn't clear the asset libraries to
enforce a re-fetch.
- When clearing an asset library, the "All" library wasn't cleared in
some cases, it would show the old state still.
- The API function to clear an asset library's asset list would not
clear the storage of asset browsers so they wouldn't refresh. It makes
no sense to only do one, so let the API handle both cases.
The way we handle asset library updating could be improved generally,
and be more internal to the asset system. For now this explicit clearing
seems fine.
We also need to handle removal of libraries better still, I think they
remain in memory.
Pull Request: https://projects.blender.org/blender/blender/pulls/129541
The preview template (`UILayout.template_preview()`) to display previews
for materials, textures or similar would only work correctly in the
Properties editor. This had explicit logic to trigger rerendering on
changes. When displaying such previews elsewhere (e.g. in the 3D View
sidebar), the only way to have changes reflected would be by resizing
the preview.
This fix makes sure such previews are tagged as dirty and refreshed on
changes to the underlying ID. We do this the same way as tagging the ID
previews as dirty, through a function called by the dependency graph for
such updates.
Pull Request: https://projects.blender.org/blender/blender/pulls/129641
There are two issues here. First, the instanced panel freeing uses
the panel type after it's been freed a few lines up in this function.
Second, while panel types are registered for a single space type,
there are cases where they're used in multiple space/region types
anyway. Because of that, removing the dangling pointer of the freed
type from just the registered region & space type combination isn't
enough, we need to process all regions.
Pull Request: https://projects.blender.org/blender/blender/pulls/129676
Running Xcode memory graphs and the Instruments tools revealed
memory leaks caused, in the main, by over-retained objects.
This removes the unnecessary 'retains' and adds some asserts
to guard against over-retaining in the future.
There are a few memory leaks remaining involving PyUnicode_DecodeUTF8
but I am unable to identify the cause of these at this time.
Authored by Apple: James McCarthy
Pull Request: https://projects.blender.org/blender/blender/pulls/129117
There were lot of places, where timeline frame was incorrectly
mapped to frame index.
For deleting transitions, internal function `seq_retiming_add_key`
was added. It can work in frame index domain directly. This is to avoid
adding more complexity, since key positions are stored and re-created
later. Going through index to frame and back to index would introduce
float precision errors.
Pull Request: https://projects.blender.org/blender/blender/pulls/129305
The issue was that when inserting a key, other keys weren't deselected
even though that feature was implemented with 6ef77a0d22
That only happened if no FCurve channel was selected in the channel list.
It turns out, that the intent of using the animfilter flags from
the editor was wrong. The animfilter code already checks the editor
flags based on the `bAnimContext` that is passed in.
In fact the drawing code itself has hardcoded flags.
So the fix is to use hardcoded flags as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/129636
The primitive tool didn't write to the `fill_opacity` attribute meaning that primitives wouldn't
show up correctly when using fill materials with a strength < 1.
The fix does multiple things:
* Make sure to create and write to the `fill_opacity` attribute if necessary.
* Remove the `skipped_attribute_ids` function and build the set of attributes to skip
where the attributes are written to. This is more flexible.
Pull Request: https://projects.blender.org/blender/blender/pulls/129644
Snapping the 3D cursor to a grease pencil selection would include
locked layers in the computation of the centroid. This is inconsistent
with 4.2.
The fix makes sure that we skip over layers that are locked.
Pull Request: https://projects.blender.org/blender/blender/pulls/129639
Previously, we initialized the layers and groups to hide masks.
For layers this makes sense, because they don't have any masks
by default, but for groups it makes more sense to show masks
by default for all the layers inside.
Pull Request: https://projects.blender.org/blender/blender/pulls/129528
In lieu of fixing the root cause, this commit requires the object to be
in object mode to duplicate particle systems, which works around the
issue because the problem is with particle edit data. This is a pragmatic
choice to focus development efforts on replacing the particle system.
Introduced with 5fff95f519.
There were several issues:
* The indices into `edit_points_vflag` are incorrect. They need to be offset
by the start offset of the drawing.
* The code was writing to `edit_points_vflag` even if the layer is locked.
But the size of the `edit_points_vflag` buffer is not counting locked layers.
Pull Request: https://projects.blender.org/blender/blender/pulls/129625
Rotating an edge deletes the edge and creates a new edge
however these edges were being iterated over and had their indices
checked.
In practice this wasn't causing use-after-free errors because the
edges are part of a BLI_mempool, nevertheless using freed elements of a
memory-pool should be avoided.
FONT_OT_style_toggle returned `true` instead of the canceled flag
causing it to run as a modal operator which leak memory from it's
reports when called from Python.