Action Slots point to the IDs they animate, and after swapping IDs they
also need some swappage (as the Action that first animated `id_a` will
now animate `id_b`, and vice versa).
Instead of doing this in the `id_swap()` function (and requiring
knowledge of how that's supposed to be done), just mark these pointers
as dirty so that they're rebuilt at first use.
This commit contains a little more code than strictly necessary, to add
a function in BKE for this cache invalidation. This avoids having to
have a dependency on the animrig module just for this purpose.
Fixes: #130136
Pull Request: https://projects.blender.org/blender/blender/pulls/131809
Change how `action_foreach_id()` reports action slot users. This contains
two changes:
- Report the correct pointer reference, so that the ID remapping code
can actually change the pointers in the cache (necessary, for example,
to nil pointers to deleted IDs).
- Never report anything when it's known the slot user cache is dirty.
Pull Request: https://projects.blender.org/blender/blender/pulls/131808
Previously, code related to reading/writing movie files via ffmpeg was
scattered around: some under blenkernel, some directly in generic
imbuf headers, some under intern/ffmpeg. Some of the files were named
with not exactly clear names. Some parts not directly related to movies
were including ffmpeg headers directly (rna_scene.cc).
What is in this PR:
Movie and ffmpeg related code is now under imbuf/movie:
- IMB_anim.hh: movie reading, proxy querying, various utility functions.
- IMB_movie_enums.hh: simple enum definitions,
- IMB_movie_write.hh: movie writing functions.
- intern: actual implementation and private headers.
- ffmpeg_compat.h: various ffmpeg version difference handling
utilities,
- ffmpeg_swscale.hh/cc: scaling and format conversion utilities
for ffmpeg libswscale,
- ffmpeg_util.hh/cc: misc utilities related to ffmpeg,
- movie_proxy_indexer.hh/cc: proxies and timecode indexing for movies,
- movie_read.hh/cc: decoding of movies into images,
- movie_write.cc: encoding of images into movies.
- tests: basic ffmpeg library unit tests that previously
lived under intern/ffmpeg.
Interface changes (at C++ level, no Python API changes):
- Mostly just movie related functions that were BKE_ previously, are now IMB_.
- I did one large-ish change though, and that is to remove bMovieHandle
struct that had pointers to several functions. Now that is
IMB_movie_write_begin, IMB_movie_write_append, IMB_movie_write_end
functions using a single opaque struct handle. As a result, usages
of that in pipeline.cc and render_opengl.cc have changed.
Pull Request: https://projects.blender.org/blender/blender/pulls/132074
This patch changes how transformations are realized by adjusting the
computed size of the new domain after transformation. Previously, this
was computed with the lower left corner of the domain as the origin of
transformation, while now, the center of the domain is used as the
origin. Consequently, domains shrinks/grows around their center, which
results in a more stable output as transforms are animated.
A consequence of this change is that we can no longer scale odd sized
domains to even sized domains or vice versa, since it grows/shrinks by
the same amount on both sides. Supporting this case requires further
investigation and will probably require passing down information to the
realization functions themselves.
Better to make sure that these functions operate on the passed in data,
and do not access the current context in some way. Generally that's more
predictable, but also makes sure these functions can be called on
inactive spaces (e.g. to update the active tool in the image editor on
changes in the 3D View, see #131062).
Partial fix for #130861.
Once again the issue is entries from the file list cache that get freed once the
cache exceeds its maximum size. Although we already minimized use of these
entries, we'd still keep a reference to all assets to be displayed in the shelf
for the active catalog.
Instead, only request entries from cache for the few assets that are visible and
scrolled into view. This way we only use the cached entry briefly and don't have
to store it in any way.
Note that the entries from the file list cache are only needed for loading the
previews. #122439 would change this, so it's finally independent of the cache.
This basically reverts 0f8e4b3516 which mitigated the issue quite a bit, but
here we take it further.
Pull Request: https://projects.blender.org/blender/blender/pulls/131750
Mistake in 5f9f3116db, ID name needs to be removed from the runtime ID
name cache data _before_ its library pointer is modified.
Library is an important part of an ID 'namesapce', so trying to remove
it after its library has been changed is trying to remove it from the
wrong namespace, leaving it in the original one.
Pull Request: https://projects.blender.org/blender/blender/pulls/132080
This is more associated with brush assets. When non-brush tool is
selected, active brush in that context is not changed (see:
`toolsystem_ref_link`).
Stencil is drawn if brush has active texture on
it (`paint_draw_tex_overlay`), since the `Brush` is still referenced to
old value, stencil is still drawn. To fix this, make sure active tool is brush
before drawing the stencil.
Also note that, trim and filter tools are not brushes but
they intetionally draws brush cursor e140f263d0.
Pull Request: https://projects.blender.org/blender/blender/pulls/131086
The crash happened because `bNodeSocket.runtime` was a nullptr.
That was because the struct pointer was passed instead of the
resolved pointer. Passing the resolved pointer into `BKE_animsys_nla_remap_keyframe_values`
fixes the issue
Pull Request: https://projects.blender.org/blender/blender/pulls/132012
Geometry instances shouldn't be drawn with cage overlays or other
edit mode overlays since they don't necessarily correspond to original
data. In this case the draw manager thought they were in edit mode
because the object data is copied from the instance parent-- we need
_some_ object for rendering.
Pull Request: https://projects.blender.org/blender/blender/pulls/132081
The returned pointer shouldn't be passed to a function expecting
a null terminated C string. Use the StringRef::copy function instead
which is more efficient anyway since it doesn't have to measure the
size of the string again.
Having this operator in the undo history is unnecessary and misleading;
we do not store the previous BVH state during this operator & the data
is all stored at runtime, so memfile undo has no effect here. Undoing
the operator will have no actual effect, and redoing the operator will
waste user time to rebuild the associated data.
Pull Request: https://projects.blender.org/blender/blender/pulls/132087
Certain color-related operators and brushes are only relevant for certain
modes. Historically, we have performed this check by inspecting the BVH
tree type. To avoid this as a hard requirement and avoid needing to
ensure that the tree is built in these scenarios, this commit changes
the `color_supported_check` to inspect the source of truth for dyntopo
(`SculptSession.bm`) and multires (`BKE_sculpt_multires_active`).
Pull Request: https://projects.blender.org/blender/blender/pulls/132086
As mentioned in cd13f52e75, e072853e63, fb6ac24514 and 9a6beb915d,
`file_draw_preview()` is a rather overloaded and confusing function. I'm
trying to make it more readable.
With the previous changes and all the other logic extracted, it's pretty clear
that the "special icon" drwaing (for the larger folder/file icon with the
folder/file type icon overlayed) also should be split off. Most remaining logic
in `file_draw_preview()` was either for the special icons or normal previews,
but not much code was shared within the function.
Tried to not cause user visible changes. There's a few pixel change in the
horizontal icon placement, but that's because it's centered properly now.
Previously it was just eyeballed I guess.
Until cd13f52e75, the loading icon drawing used to share most of the code for
drawing the "special image", so changes to those unintentionally changed to
loading icon too, e.g. in 1d47e3276b.
Make the loading icon centered where the preview would be, and reduce the size
back to what it was before 1d47e3276b.
This removes the hardcoded values that were temporarily added in cd13f52e75 to
avoid user visible changes.
Followup/correction to a0c0eefd5d.
Since the aim ist to have the text displayed in "constant viewport
size", it should actually not increase with Resoltion scale at all.
So as mentioned in a0c0eefd5d, the scale should be accounted for in
`VoxelSizeEditCustomData` > `text_mat`, and to fix the remaining (false)
influence of Resolution Scale on the size of displayed text, use
`ED_view3d_pixel_size_no_ui_scale`
instead of `ED_view3d_pixel_size` when getting the pixel size.
Pull Request: https://projects.blender.org/blender/blender/pulls/131488
This patch implements Font to Curves, Legacy curves to Grease Pencil and
Font to Grease Pencil conversions.
Note that Font to Grease Pencil is done by converting Font to Curves
then converting Curves to Grease Pencil. Currently we do not have
direct conversion APIs.
Part of #131595 and #130518
Pull Request: https://projects.blender.org/blender/blender/pulls/131612
1) Typing fixes for vector properties (similar to !131855)
2) More specific type for PointerProperty.poll since it's only called if type is ID.
3) Added a note to PointerProperty.poll that it's only checked when property is assigned from the UI.
Pull Request: https://projects.blender.org/blender/blender/pulls/131925
The outputs of the Image node are missing relevant meta-data like
Cryptomatte and vector components, this causes exports through the File
Output node to also miss those meta-data. To fix this, we populate the
metadata of cached images just like we do for render results.
Code for drawing the cursor [this includes drawing the stencil] used to
early out when navigating.
This made it difficult to line up stencil projection with the 3D
geometry, so now still draw it while navigating.
Pull Request: https://projects.blender.org/blender/blender/pulls/131851
Building the FCurve keyframes one at a time leads to quadratic runtime
behavior due to how the underlying BezTriple array is resized in
`animrig::insert_bezt_fcurve`. Instead, pre-allocate the entire array
upfront and assign the keyframes directly since we are already iterating
our time samples in-order.
In the event that fewer keyframes are ultimately assigned, rare since
this indicates some form of bad data which we skip during iteration, we
will reallocate to the appropriate size right before recalculating the
fcurve handles.
Total import time for the 3000 frame Elephant test asset [1] drops from
~4650 ms to 120 ms, a 38x speedup. A more typical 250 frame armature
animation shows a more modest 1.5-2x reduction in overall import time.
[1] https://github.com/usd-wg/assets/tree/main/full_assets/ElephantWithMonochord
Pull Request: https://projects.blender.org/blender/blender/pulls/131921
Caused by 024d7d12e2.
I forgot that the BVH cache value isn't reset to default if it isn't
shared, which can happen after remeshing in some cases. To fix this,
switch to unique_ptr which handles ownership properly on assignment,
removing this class of bug from this code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132040
Caused by 839108f623.
The edit mapping was invalid so we just created a dummy GPU
batch for the selection edit data. But it was invalid because we
weren't in edit mode. The fix just requires tweaking the checks
for this data that's also used outside of edit mode.
The new --disable-liboverride-auto-resync commandline option will prevent
running liboverride auto-resync immediately after loading a blendfile.
This is an alternative way to setting the User Preferences Debug option
`No Override Auto Resync`.
-------
Some quick performances tests:
Loading a Gold production file goes from 26.5s to 25.9s.
Combined with the recent `--disable-depsgraph-on-file-load` option, it
goes from 3.5s to 2.9s, so another nice extra 15% speedup when only
bare-metal blendfile loading is needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/132017
The realize instances code didn't have a way to use the existing
`#BuiltinAttributeProvider::default_value()`s to initialize attributes that
have to be created.
Now this writes default values of builtin attributes to the curve `attribute_fallbacks`.
Removes the need for the code to explicitly write the `resolution` and
`nurbs_weight`.
The other attributes that are written explicitly (like `radius`) don't have
builtin default values unfortunately. Ideally those would also just be provided
by the respective `BuiltinAttributeProvider`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131799
The `double inittime` attribute on strokes is truncated to a `uint32_t`
range. This wasn't done explicitly and the code only did a cast.
The `double` should be clamped to a legal `uint32_t` value before
casting it.
Pull Request: https://projects.blender.org/blender/blender/pulls/131625
We would update the scene frame before we actually stopped the
callback timers for automatic frame sync.
This could lead to a race condition where the set frame would be
overwritten before we stopped the callback timer.
Pull Request: https://projects.blender.org/blender/blender/pulls/132022
The code tried to sync the playback to audio in two places:
1. In the screen_animation_step_invoke function in screen_ops.cc
2. In wm_event_do_handlers which would trigger on every screen refresh/event
However because of some oversight on how the Audaspace API worked,
the wm_event_do_handlers code was only triggered for JACK and CoreAudio.
Remove this code as we shouldn't need to update the current scene frame
in two places.
The wm_event_do_handlers way would also lead to bugs as it would try to
sync regardless if we were playing back audio or not.
This is implemented as macro `sequencer.preview_duplicate_move`. New
macro is needed, because different transform operator is called than in
`sequencer.duplicate_move`
Duplicate operator was modified to handle overlap and to delete sound
strips after duplication.
When strip is duplicated in preview, it will be moved to nearest free
channel above original strip.
Pull Request: https://projects.blender.org/blender/blender/pulls/131529
As mentioned in e072853e63, fb6ac24514 and 9a6beb915d,
`file_draw_preview()` is a rather overloaded and confusing function. I'm
trying to make it more readable.
This splits off the drawing for the loading icon displayed while the
previews are pending/loading still, removing the loading case handling
from `file_draw_preview()`. There was also some implicit logic here:
While loading previews we'd always pass a "special image" to the preview
drawing, so the `is_special_file_image` boolean would always be true.
This is untangled too now, so code paths are more explicit/clear.
`file_add_preview_drag_but()` can't access data returned by
`file_draw_preview()` anymore (it may not be called), so I made it
independent which is an improvement too.
While working on this I noticed the loading icon isn't centered
correctly. For now I made sure the position remains the same, I'll fix
the positioning in a followup.
This changes the `Node.type` and `Node.bl_static_type` properties to be string
instead of enum properties. This allows us to remove another usage of
`NOD_static_types.h`.
Both of these properties were marked as deprecated for a long time already, but
without any way to inform users in a practical way. The result of that is that
especially the `type` property is widely to check if a node has a specific type.
It's used so much that it is impractical to remove it even if it was deprecated.
Instead this patch rephrases these properties as "legacy" (instead of
"deprecated"). This means that they will stay around and won't change in
behavior for existing nodes. For future nodes, we can just return the idname
instead of yet another name specific to these properties so that we can stop
worrying about them.
Pull Request: https://projects.blender.org/blender/blender/pulls/131972
The type check there should not be necessary anymore nowadays. It looks like it
might have been necessary when it was introduced in
eed45d2a23. Back then the object was still passed
into `BKE_mesh_wrapper_ensure_subdivision`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131857
How the new navigation pivot is determined depends a bit on the kind of brush:
* Brushes that deform or remove curves use the 3d-brush position at the start of
the brush.
* Brushes that add new curves set the pivot to the bounding box center of the
new curves.
Finding a good pivot point is not super trivial for curves, but the existing 3d
brush functionality seems to work well. This also has the benefit that almost no
additional computation is needed when the user is using the spherical brush
mode. However, if the projected mode is used, and orbit-around-selection is on,
then we have to compute the spherical brush center now anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/131907
The issue here was sometimes an output socket of a `Group Input` node has a
reference to a data-block. The value stored on these output sockets are never
used, and thus is not exposed in the UI which made it impossible for the user to
find that there still is a data-block reference.
The root cause for this seems to have been fixed a few releases ago. I can
reproduce that the pointer was set in 3.3, but not in 3.6.
This patch only adds some versioning to remove the unnecessary data-block
references to fix old files that might have this issue (e.g. the file from the
report).
Pull Request: https://projects.blender.org/blender/blender/pulls/131900
The autokeying code for cameras used the keyingset code to insert keys.
In the case of "Only Insert Available" turned on this would use the "Available" keyingset.
However, in the case of looking through the camera and moving the viewport
when the camera is not active, the poll function of that keyingset would return false.
Instead of modifying the poll function, the fix is to use the more direct keying code
using `RNAPath`.
This can be backported to 4.2 but not 3.6 due to the changes to the keying code done in 4.0
Pull Request: https://projects.blender.org/blender/blender/pulls/131796