Use std::function instead of separately allocated arguments and
function pointers. This improves type safety and makes the code less
verbose. It also moves us closer to not having two methods of adding
button callbacks.
So far, when deleting a library (either explicitely, or through e.g.
relocation), its dependencies would get a `nullptr` parent, and
therefore become 'directly used' libraries.
This commit adds a new util to rebuild the libraries hieararchy, and
calls it when a Library ID is deleted.
NOTE: While logic is somewhat similar to what liboverride resync does to
sort the libraries by indirect levels
(`lib_override_libraries_index_define`), there are some key differences
here, notably the fact that if a library has a valid `parent` pointer,
it is not replaced, even if a 'better' parent (less indirect library)
could be found.
for a camera ray, compute the actual range of the hair width that the
current pixel covers, and only integrate that subset, to prevent a
ribbon-like appearance in close-up looks.
When the hair covers less than one pixel on the screen or when the ray
is not camera ray, the model works the same as before.
Pull Request: https://projects.blender.org/blender/blender/pulls/116094
Due to a recent change the name of a layer is passed using a string ref
but the check if it is filled was done by checking if the first char
was zero. This fails as string ref first does the bound checks.
This is fixed by using `!is_empty()`. There might be more places, but this
one fired when loading production files.
Issue introduced by a39e8a4ab9
Pull Request: https://projects.blender.org/blender/blender/pulls/118605
This simple node finds the values of a volume grid at
positions in the local space used in geometry nodes
evaluation. There are three interpolation modes to
choose how to mix values between neighboring voxels.
For the implementation, first the values are sampled
with the grid's type directly, then implicit type conversions
are used to get the final type. This makes gives us flexibility
in case there aren't exact matches in support between grid
types and Blender types.
Pull Request: https://projects.blender.org/blender/blender/pulls/118397
Similar to 2e6223d90f, but potentially 16 times more effective.
The new attribute is named "instance_transform". It isn't displayed in the
spreadsheet since that wouldn't really be useful. This simplifies a lot of
code since it doesn't have to handle transforms specially anymore. But
complexity is added in the store named attribute node and attribute input
node to keep the old "position" attribute working for compatibility.
Pull Request: https://projects.blender.org/blender/blender/pulls/118531
Original code was very confusing, with seemingly indecisive logic.
I hope, that it is less confusing now, however there is still some
indecisiveness present. This is because multiview configuration may not
be correct, so there must be fallback and only some multiview settings
require loading of multiple files. Perhaps be better wording could be
used for `open_anim_file_multiview()`.
Fortunately this is now expressed within 5 lines of code instead of 100.
Further this can be improved by checking if the file exists, since now
VSE crashes when right eye image is missing, because loading code
does not try to actually open the file.
Pull Request: https://projects.blender.org/blender/blender/pulls/118580
Add this data as a layer attribute. It's usage was already implemented
by the modifier filtering generic code, but data itself did not yet
exist in GPv3 data.
Also add RNA accessors and handle it in conversion code.
Pull Request: https://projects.blender.org/blender/blender/pulls/118495
The issue described was that the motion path didn't display the last frame
of a scene.
This PR makes the user facing motion path range inclusive on both ends.
E.g. when the user specifies a motion path from 1-24 the will now get all 24
frames, whereas previously the motion path would end at frame 23.
This also makes the `Scene Frame Range` option work properly since that
had the same issue. Now it displays the actual full scene range.
Internally, the `bMotionPath` is still exclusive on the upper bound.
It is just the `bAnimVizSettings` range that has been modified.
Pull Request: https://projects.blender.org/blender/blender/pulls/118611
When the resolution of the reflection probes changes the change
was only applied when the reflection probes where updated. To improve
the workflow this change will tag the reflection probes when the
resolution is modified.
Pull Request: https://projects.blender.org/blender/blender/pulls/118607
Rewrite the code so that users get an error message when trying to
rename something to an existing file in the file browser. Before this
change Blender would not print any notifications on why the rename
failed if a file with the same name already existed.
Pull Request: https://projects.blender.org/blender/blender/pulls/118571
Not all filesystems on linux supports the RENAME_NOREPLACE flag.
If we get a EINVAL return value, retry with a non atomic operation.
RENAME_NOREPLACE was introduced in 050d48edfc, so this is a regression
fix as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118571
This change makes it so build system and update utilities for Blender builds
are using pre-compiled libraries and other resources attached as Git modules
instead of using checkout of SVN repositories in the parent folder.
The directory layout:
```
* release/datafiles/
* assets/ -> blender-assets.git
* publish/
* ...
* README.txt
* lib/
* darwin_x64/ -> lib-darwin_x64.git
* darwin_arm64/ -> lib-darwin_arm64.git
* linux_x64/ -> lib-linux_x64.git
* windows_x64/ -> lib-windows_x64.git
* tests/
* data/ -> blender-test-data.git
```
The changes about configuring the actual Git sub-modules are not included
into this patch, as those require repository to actually exist before it
can be used.
The assets submodule is enabled by default, and the rest of them are
disabled. This means that if someone runs `git submodule update --init`
they will not get heavy libraries. The platform-specific and tests
related submodules are enabled when using `make update` or `make test`.
All the submodules are tracked: this means that when new commits are
done to the submodule, the blender.git repository is to be updated to
point them to the new hash. This causes some extra manual work, but it
allows to more easily update Blender and its dependencies to known good
state when performing operations like bisect.
Ref #108978
Pull Request: https://projects.blender.org/blender/blender/pulls/117946
Unless you're very familiar with `IndexRange`, it's often hard to know what
e.g. `IndexRange(10, 15)` means. Without more context, one could think
that it means `10-14`, `10-15` or `10-24`. This patch adds named constructors
to `IndexRange` to make the behavior more obvious when writing and when
reading the code. With those one can use `IndexRange::from_begin_end(10, 15)`,
`IndexRange::from_begin_end_inclusive(10, 15)` or `IndexRange::from_begin_size(10, 15)`
respectively. While being a bit more verbose, the explicitness makes code easier to
understand and also allows abstracting away some common index computations.
The old unnamed constructor that takes a begin and size is not removed by this patch,
as that would make the patch significantly bigger. I think it's reasonable to generally
use the named constructors going forward and to change the existing usages of the
old constructor over time.
Pull Request: https://projects.blender.org/blender/blender/pulls/118606
`IndexMaskSegment` has more invariants (sorted unique indices) than a plain `OffsetSpan`.
This also allows us to add methods to `IndexMaskSegment` that wouldn't fit in `OffsetSpan`.
Pull Request: https://projects.blender.org/blender/blender/pulls/118603
Blender uses some vertex attributes that are not (and sometimes
never) supported by a GPU. OpenGL silently converted these changes
but for Metal/Vulkan we need to convert then when uploading the
data.
This PR will write to console invalid usages which we should remove
from Blender code-base. Note it is still possible to create attributes
that still need conversions by using the PyGPU API.
Add generic handling of all potential FCurves, with custom callbacks to
perform the actual conversion (typically, some RNA paths will need to
be updated).
Currently implements only remapping of modifiers' animation.
This commit only handles Object-level animations, GreasePencil
data will be handled in a separate commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/118500
When starting to play back a movie strip, there was a "oh, let's figure out if
this is a video file?" check, immediately followed by "let's initialize the
machinery to decode a video file". The first one is kinda redundant, since if
it will happen to not be a video file, the latter check will nicely fail.
Addressed that by removing (seemingly unused at all?) functionality from
`ImBufAnim`, now it is only used for video file playback. Details:
- It looks like `ImBufAnim` is only ever used to play back "video files", so
remove all the other modes of operation from it ("image sequence").
- Which makes `ImBufAnim::curtype` be not needed, it only needs to store state
of whether it's initialized already.
- Which means there's no need to call `imb_get_anim_type` (which does very
costly `isffmpeg`) when starting to play ImBufAnim.
- Remove some other variables from `ImBufAnim` that were just flat out unused.
In Gold previs playback between 1:41-1:55, on Windows/Ryzen5950X:
- Slowest 3 frames went from 276, 195, 168ms -> 222, 174, 147ms (saves 20+ ms
per frame). All of these frames are camera cuts where multiple new video
clips start playing.
- In the whole playback, total amount of time taken by `imb_get_anim_type`:
234ms -> zero! Since that is no longer used.
- There are still stalls when starting to play a movie clip, and that is
actually initializing ffmpeg things. But now at least right before
"initialize ffmpeg" there's no additional redundant work.
Pull Request: https://projects.blender.org/blender/blender/pulls/118503
This patch implements the Legacy Cryptomatte node for the Realtime
Compositor. The only difference in logic between the new and legacy
Cryptomatte nodes is the source of the layers, so we share the same code
using a base class and specialize layer retrieval as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/118570
extensions.blender.org is using redirects which which means the
file-extension can't be used to detect dropping extensions.
Add an additional check which tests the URL shares a prefix with a
known remote repository.
Often in previs setups, you have several "variations" of image/movie strips
for review, where the topmost one completely covers the others under it. VSE
rendering already had an optimization where if there's a fully opaque strip
that covers the whole screen, then the lower strips are skipped from
processing/rendering. However, it was not handling the case of non-fullscreen
strips (e.g. you'd have a Color strip near top & bottom for letterboxing, and
an opaque strip "in the middle").
This adds a simple "occluder tracking", and skips strips that are completely
covered by any single opaque strip that is above it (like outlined in #117790
task).
Playback of Gold previs between 1:42 and 1:55, on Windows/Ryzen5950X:
- Average frame time 28.5ms -> 23.8ms
- Median frame time 24.1ms -> 21.5ms
- Two slowest frames: 263->189ms, 194->178ms
Rendering the Gold previs movie: 325s -> 304s (93% of previous time)
Pull Request: https://projects.blender.org/blender/blender/pulls/118396
- Remove unused members.
- Use C++ vector types.
- Rename variables.
- Avoid redundant calls.
- Pass the modified value as a function return parameter.
The issue here is that the `parent` pointer of indirectly linked
libraries would not be propoerly cleared when their current parent was
deleted.
Note that this fix will leave effectively indirectly linked libraries
shown as directly used ones in the UI, until the blendfile is saved and
reloaded. This is not a new issue though, deleting a parent library in
the Outliner has the same effect.