This commit fixes a small bug where the macOS native titlebar file path
icon (often referred to as proxy icon) wouldn't be cleared when creating
a new blank file and would instead retain its previous state. This was
caused by the GHOST setPath() function being short-circuited by the
&& operator, since `has_filepath` was false. The GHOST WindowCocoa
setPath() function was also simplified to remove unneeded exception
handling.
Pull Request: https://projects.blender.org/blender/blender/pulls/132359
Part of #130975: split off overly large VSE effects.cc (almost 4000
lines) into separate source files. No behavior changes.
- Add / Subtract / Multiply all go into one source file,
- Blend Over / Blend Under / Over Drop / other blend modes all go
into one source file,
- Cross and Gamma Cross go into one source file,
- All others go into their own files.
Pull Request: https://projects.blender.org/blender/blender/pulls/132323
The compositor backdrop in certain files always have a size of 256x256
regardless of the actual size of the viewer image. That's because the
compositor writes its result to a different image buffer than the one
the image engine reads its image buffer from. And the image engine
assumes a default size of 256x256. The reason is a bit involved.
For non multi-view images, the image module uses the special cache index
value of IMA_NO_INDEX for the compositor backdrop, which works fine if
the image was detected as a non multi-view image in the first place.
However, this detection fails because the compositor may still write
multi-view images even for non multi-view renders.
In particular, before the compositor writes its viewer image, it ensures
correct views by calling BKE_image_ensure_viewer_views, which first
checks if we need to recreate the views of the viewer image if they
don't match the render views. And in the case of non multi-view image,
that check fails in one case.
Functions like BKE_image_is_multiview checks if a single unnamed view
exists in the image, unnamed being the keyword here. The root issue is
that BKE_image_ensure_viewer_views only checks that a single view
exists, while it should also check that it is unnamed. Which happens
when the user enabled multi-view, added only one view, then disabled
multi-view again.
To fix this, we add a check for the name of the view in case of non
multi-view images. And additionally pull the view matching code into its
own documented utility function for clarity.
Pull Request: https://projects.blender.org/blender/blender/pulls/132348
The Legacy Cryptomatte node asserts when its inputs are not valid,
that's because it is specialized for image inputs and invalid inputs are
single values. To fix this, make sure only valid Cryptomatte layers are
considered.
Caused by 580e0af309
The above commit fixed the condition that caused the hang in #128702 but
it also changed the `while` loop to a `do while`.
The do while loop executes the content of the loop once before checking
the condition of the while.
Whereas a while loop will check the condition first before executing the
content.
As a consequence, we could (falsely) enter the loop and return with a
(false) best direction.
To resolve, keep the check from 580e0af309 but go back to a `while`
loop (instead of the `do while).
Needs to go into 4.2 LTS
Pull Request: https://projects.blender.org/blender/blender/pulls/132270
Delay the creation of the `prim_map` data structure until the last
possible moment. This is more efficient in the majority of cases where
no Import hooks have been defined. Additionally, it removes the need for
locking in the `read_object_data` code path once we implement concurrent
loading.
Pull Request: https://projects.blender.org/blender/blender/pulls/132360
The `math::transform_point` call returns a `float3` which is being fed
into a `float4` matrix row. This causes an out of bounds read to occur.
Use the `float4` constructor taking an explicit `w` parameter to avoid
the issue.
----
To trigger the ASAN error: Add a Metaball to the viewport
```
==61887==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f0ce84c5cac at pc 0x000000b1a6fe bp 0x7ffc5ae10070 sp 0x7ffc5ae10060
READ of size 4 at 0x7f0ce84c5cac thread T0
#0 0xb1a6fd in blender::VecBase<float, 4>::VecBase(float const*) /home/deadpin/source/blender-git/blender/source/blender/blenlib/BLI_math_vector_types.hh:219
#1 0x62ef86e in blender::draw::overlay::BoneInstanceData::BoneInstanceData(blender::MatBase<float, 4, 4, 16> const&, blender::VecBase<float, 3> const&, float, float const*) (/home/deadpin/source/blender-git/build_asan/bin/blender+0x62ef86e) (BuildId: 6ae47f47805212d94d20c0872511ec90333cb6b5)
#2 0x63b2136 in blender::draw::overlay::Metaballs::object_sync(blender::draw::Manager&, blender::draw::ObjectRef const&, blender::draw::overlay::Resources&, blender::draw::overlay::State const&) /home/deadpin/source/blender-git/blender/source/blender/draw/engines/select/../overlay/overlay_next_metaball.hh:85
```
Pull Request: https://projects.blender.org/blender/blender/pulls/132288
- Initialize PLYExportParams/PLYImportParams members
- Use enum class in ePLYVertexColorMode
- Pass import/export params as reference
This kind of fixes#126337: previously in the PLY Import node the
import paramters were all set to zero/false values, instead of sane
defaults. Which meant that it ignored vertex colors.
when selecting a font the current code only shows the folder nicely
with filtering and preview listing when the current folder is blank.
This PR shows it nicely always.
Pull Request: https://projects.blender.org/blender/blender/pulls/132318
This report shows a long report (measures 19,714 pixels) overflowing in
such a way that the banner shows nothing across the entire width of the
window. This PR just adds a maximum width to the banner size so it will
show a subset of the report correctly.
Pull Request: https://projects.blender.org/blender/blender/pulls/132307
Add a node that finds the number of times a substring occurs in a string,
and the position of the start of the first match.
See the PR description for more rational and details.
Pull Request: https://projects.blender.org/blender/blender/pulls/129270
Reading an EXR multi-layer image in the compositor is not thread safe.
That's because the code access the render result without holding a
reference to it. To fix this, acquire the render result when accessing
the render result structure.
Pull Request: https://projects.blender.org/blender/blender/pulls/132300
- Split off audio related code out of movie_write.cc into
movie_write_audio.cc
- Rename very generic PRINT debug logging macro name to FF_DEBUG_PRINT,
and use "ffmpeg:" prefix in the printed messages
- Other tiny simplifications
Pull Request: https://projects.blender.org/blender/blender/pulls/132233
The Cryptomatte node doesn't work with image sequences that starts at a
non-zero frame. That's because the typename of the Cryptomatte is not
necessary updated at a frame that exists in the sequence, so the node
fails entirely.
To fix this, we always compute the typename at the frame of the first
image in the sequence.
As the individual commits say:
- Use Set instead of GSet for tracking proxy builder processed paths
- Use Vector<MovieIndexFrame> to store entries in MovieIndex
- Clearer stdout/stderr printing in movie proxy generation
- Instead of unlink(), use BLI_delete() which does proper utf8 path
conversion on Windows.
Pull Request: https://projects.blender.org/blender/blender/pulls/132174
This extends the `NodeInContext` and `SocketInContext` types with some useful
methods to reduce boilerplate when using them in #132219. Also it moves the
inline functions to the bottom of the file to make the API easier to read.
Pull Request: https://projects.blender.org/blender/blender/pulls/132276
This adds a new `Map.lookup_try` method that returns a `std::optional<Value>`
for a given key. If the key is not in the map, `std::nullopt` is returned. If it
is in the map, then a copy of the value is returned. Note that the copy is
necessary because `std::optional` can't contain reference types.
This method helps a lot in #132219 to reduce boilerplate.
Pull Request: https://projects.blender.org/blender/blender/pulls/132278
I had written a comment years ago mentioning that this behavior would be
preferrable, but I mistakenly assumed it was complicated to implement.
It turns out the sampled points subdividing a Bezier segment will have
symmetric "aligned" handle positions. Generally it's better to keep the
handles aligned where possible since the editing experience is a bit better.
In geometry nodes this shouldn't make an important difference because
the handle types are changed as necessary for in the set handle position
node.
Pull Request: https://projects.blender.org/blender/blender/pulls/132204
Only attribute custom property names are expected to be unique.
But also, it isn't worth asserting over this here, so just use the
regular "add" method instead of "add_new".
Pull Request: https://projects.blender.org/blender/blender/pulls/132277
Avoids some binary noise in saved files, and will some day allow us to use runtime data on read without having to explicitly clean it up (unless we refactor this into an allocated pointer instead!).
Pull Request: https://projects.blender.org/blender/blender/pulls/132190
A link is unavailable when any of its sockets are unavailable. Sometimes such
links are in a weird inbetween state between being there and not being there at
all. Generally, they should be considered to not be there, but sometimes it's
still useful if they automatically come back when toggling the availability of
sockets. We don't have a replacement for this functionality yet.
This patch changes behavior so that unavailable links are treated as not being
there at all in two places:
* When deciding whether to draw an input socket value.
* When deciding what to do when drawing from a socket (to create a link from it
or detach existing links). This is done by simply removing unavailable links
when starting to drag from a corresponding socket. This allows all of the
existing logic to stay the same.
Pull Request: https://projects.blender.org/blender/blender/pulls/132184
For some reason, the file in this report had its second mix shader socket with
the identifier "Socket.001" instead of the current "Socket_001". The age of
the file roughly corresponds to when we switched to the node declaration
system. I'm not sure why it has `.` instead of `_`, since the old socket template
system also used `_` as the deliminator. I vaguely remember some issue like
this but it's been a while and I can't find anything online.
The fix is to just manually change the socket identifier. The subversion bump
isn't conceptually necessary, it's just to stop the versioning from running
more often than necessary once the file is saved again.
Pull Request: https://projects.blender.org/blender/blender/pulls/132199
The `socket->index_in_tree()` method provides a unique index for that socket
in the node tree (it's a cached runtime value). By construction, all input/output
sockets of a node have consecutive numbers, but this (sometimes useful) fact
is currently not exposed in the API.
This patch adds new `input_socket_indices_in_tree` and
`output_socket_indices_in_tree` methods to get the range of indices for all
inputs or outputs of a node.
Previously, the code was O(n^2) because it iterated over all interface sockets,
and for each it tried to find the corresponding index by iterating over all
inputs again. Now, a `VectorSet` is used to make finding the index `O(1)`. The
new utility function may also be useful elsewhere.
Pull Request: https://projects.blender.org/blender/blender/pulls/132272
The image user of the Cryptomatte node does not have an up to date frame
number. That's because the BKE image user walker function which is used
to update image user frames numbers was missing handling for the node.
To fix this, add a case for the Cryptomatte node.
This is a partial fix for #132210.
Pull Request: https://projects.blender.org/blender/blender/pulls/132271