Intersect mode needs to set everything **outside** of the selection mask
to non-selected and leave the rest untouched.
We already had the comment to "un-set all elements not in the mask" but
that was actually unsetting **everything**.
In theory, we could also early out for `SEL_OP_AND` since the following
`apply_mask_as_` calls are not doing anything for `SEL_OP_AND` really
(but left the change to be minimal).
Pull Request: https://projects.blender.org/blender/blender/pulls/134400
In setups where only very few elements are processed at once, the lazy-threading
hints that come from `parallel_for` are not triggered. However, often it can
still be worth to use multi-threading in such cases. Therefore, we need to find
additional places where the lazy-threading hints are sent. There are many
possibilities and we probably have to add them step by step as we find .blend
files that show missing multi-threading.
In this patch I choose to send the hint at the beginning of evaluating a repeat
zone if it has 10 or more iterations. The exact number here is just a guess and
could be fine tuned over time if necessary.
A slightly modified version of the file in #134230 speeds up from ~1100ms to
~100ms with this change. The exact speedup changes quite a bit each run, but is
always between 5 and 20x, so it's quite noticable.
Pull Request: https://projects.blender.org/blender/blender/pulls/134408
Currently, tree, node and socket types are always freed immediately when the
Python code unregisters them. This is problematic, because there may still be
references to those type pointers in evaluated data owned by potentially various
depsgraphs. It's not possible to change data in these depsgraphs, because they
may be independent from the original data and might be worked on by a separate
thread. So when the type pointers are freed directly, there will be a lot of
dangling pointers in evaluated copies. Since those are used to free the nodes,
there will be a crash when the depsgraph updates. In practice, this does not
happen that often, because typically custom node tree addons are not disabled
while in use. They still used to crash often, but only when Blender exits and
unregisters all types.
The solution is to just keep the typeinfo pointers alive and free them all at
the very end. This obviously has the downside that the list of pointers we need
to keep track of can grow endlessly, however in practice that doesn't really
happen under any normal circumstances.
I'm still getting some other crashes when enabling/disabling Sverchok while
testing, but not entirely reliably and also without this patch (the crash there
happens in RNA code). So some additional work will probably be needed later to
make this work properly in all cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/134360
Previously, all the layers were part of the evaluated state, even if
they were hidden.
Hidden layers should be treated as "disabled" meaning that we should
not evaluate them and/or render them at all.
This fixes this by removing hidden layers from the evaluated data before
layer adjustments and modifier evaluation starts.
As a consequence, hidden layers are no longer accessible in Geometry
Nodes. Technically, this is a breaking change. In the unlikely case that
a user relied on hidden layers to be evaluated within modifiers, they
need to make sure that the layer is visible.
Pull Request: https://projects.blender.org/blender/blender/pulls/133973
In certain setups where passes are used in the viewport compositor,
blender will crash. This happens because passes may not be available
when the compositor first run but then become available in later runs.
Possibly because EEVEE is still compiling shaders. This is problematic
for the compositor because it caches the result of node tree compilation
for the specific data available, like passes, and the compositor does
not get informed when data becomes available like in the case of EEVEE
to invalidate the cached node tree compilation result.
Caching of node tree compilation was always a source of bugs but we
managed to workaround them in the past, so before we work on a fix for
this crash, we first evaluate the removal of caching to see if we can
live without it. Especially since a fix will be rather involved for the
release branch at this stage.
The time it takes to compile the node tree is:
- Small Tree (~10 nodes): 0.3ms.
- Medium Tree (~50 nodes): 0.6ms.
- Huge Tree (~300 nodes): 3ms.
The difference is not noticeable to the eye, probably since as the tree
becomes bigger, the evaluation time becomes more dominant, and small
trees are fast to compile.
It should be noted that we intended to remove caching in the future to
support things like lazy evaluation of node inputs, but we though a few
optimization needs to be done on the GPUMaterial compiler side to make
compilation faster, since it is the main bottleneck during compilation.
So considering this, I think it is acceptable to disable caching of node
tree compilations for the time being. I intend to optimize it such that
it always becomes less than 1ms, but we will have to delay that to 4.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/134394
Not really sure why only type and owner_id were cleared here?
Especially when code like `pyrna_struct_CreatePyObject` would check
for both `data` and `type` to be null to consider the pointer as None...
Happens to 'fix' #134311, since now cleared PointerRNA are 'just'
reset to `PointerRNA_NULL`. Would not work if the data was not an
ID PointerRNA though...
NOTE: In general, what is considered an invalid PointerRNA is still very
loosely designed in our code-base, we'll have to address this.
Pull Request: https://projects.blender.org/blender/blender/pulls/134393
Likely caused by d94a56bdad. In `ANIMDATA_FILTER_CASES` macro,
function call to `animfilter_nla` is not made due to legacy action
condition checks. Since legacy actions are already converted to new
layered action structure in `convert_legacy_animato_actions`, it seems
safe to remove those conditions from macro.
Pull Request: https://projects.blender.org/blender/blender/pulls/134209
Writing a blend file to a path that references a directory wasn't
being handled correctly.
When the save "versions" was greater than zero the directory would
be renamed (adding a 1), otherwise there would be a
"Version backup failed" error.
Resolve by exiting with an error in the unlikely event the user saves
over a directory.
Part of a fix for #134101.
Ref !134384
`environment_mirror_ball.blend` and `image.blend` are both
failling because of mipmap/anisotropic filtering differences
on apple silicon.
The volume tests has issues with lightprobe baking.
Blocking them until we have a workaround.
The `Plane` brush type does not use the original plane/normal
parameters. However, these parameters can be incorrectly retained when
switching type to `Plane` from another brush type where they were
enabled. This commit ensures that they are ignored for the `Plane` brush
type.
Pull Request: https://projects.blender.org/blender/blender/pulls/134255
The use of `GeometryDeformation` is incorrect for computing the bounds:
It contains _evaluated_ positions for the _original_ points, but does not
match the size of evaluated geometry after constructive modifiers like
Line-Art. For the bounds the evaluated positions should be used as-is.
Pull Request: https://projects.blender.org/blender/blender/pulls/134325
f0db870822 added support for tree-views to remember state, but only to
remember their custom height for the start. This change makes the scroll
offset be remembered too.
Not remembering the scroll offset can be very annoying in some cases,
e.g. when working with bone collections and changing the active tab in
the properties editor often. In realistic, non-trivial bone collection
set ups this can lead to a lot of repeated scrolling.
Cherry-picked for the 4.4 release since this solves a real usability
issue with trivial changes. Discussed with Thomas and others.
This is not a complete solution because there may be indirect changes
to the compiler other than the binary that require a rebuild, but this
should catch the simple cases at least.
Original code used the wrong type of `BLI_findstring` function, leading
to the parameters being read incorrectly and the `MaskingLayer `duplicate
check working incorrectly.
This PR changed `BLI_findstring` to `BLI_findstring_ptr`, resulting in the
`LayerMask` names being read correctly and the duplcate check working
as expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/134295
The root cause is still unknown. But this patch disables
rendering of objects that will produce no volumetric effect.
This does fix the issue reported.
Enables building of a Cubin for GPUs based on Blackwell architecture
if CUDA toolkit version 12.8 or higher is installed.
Only added sm_120 to the default set, since it is the one relevant for
consumer GPUs (RTX 5090 etc.) that are generally used with Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/134170
The usual issue of non-trivial C++ data being allocated with C-style
`alloc` code.
Also added more default initializers to some generic RNA-related structs
that embded some `PointerRNA` members.
The removal of the loose uniform made the shader not compile.
This patch adds a new define for these type of shaders and add
back the loose uniform.
Note that these shaders might no longer work on Metal as
the source is not parsed anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/134341
The compositor crashes when the active viewer layers is deleted and
replaced by a new layer. That's because the depsgraph of the compositor
still references the old view layer. To fix this, we need to update the
view layer of the compositor if it changed since it was last created.
Pull Request: https://projects.blender.org/blender/blender/pulls/134326
The symmetric separate blur operation in the compositor is two times
slower in 4.4 compared to 4.3. On Linux, this only happens when Blender
is compiled with GCC, because Clang inlines a small function that GCC
doesn't.
To fix this, we specialize an if statement using templates to help GCC
inline the function. This results in a 3.5 times faster execution.
Pull Request: https://projects.blender.org/blender/blender/pulls/134336
Natural drawing speed fails for strokes that are pasted or duplicated.
This is due to the `init_time` attribute being transferred from previous stroke
to the new, resulted in the same values. This further calculates wrong
`build_factor` inside `get_factor_from_draw_speed`. To further explain
this, `gap_delta_time = -prev_end_time` which evaluates `start_time=0` for
the duplicated curve. To avoid this situation, make sure `gap_delta_time`
is positive. So `start_time` will be > 0.
Pull Request: https://projects.blender.org/blender/blender/pulls/134329
`mouse_over_key_get_from_strip` doubled the hotspot for start and end
fake keys, but this was not reflected in the other use case of
`RETIME_KEY_MOUSEOVER_THRESHOLD`. Fix and add a comment for
documentation.
OpenCollada used to rely on PCRE (a Perl Regexp library). Since
switching to Aras' OpenCollada fork (#122270), the library is no
longer needed, but is still required as a dependency.
This patch cleans this up by completely removing it from our build
system and linux system package installation script. This also lets
us remove it from our pre-compiled library platform repos, making the
process of recompiling our libraries from scratch easier as it wasn't
compiled by our dependency builder anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/134310
As noted in #134241 this modal poll function cannot return false on an
item because there is a conflict in the way the operation is started
versus how it is set to cancel. Doing so also stops the escape key from
canceling the operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/134273
Use float for intermediate values when calculating speed or timeline
frames.
More details on precision improvement itself: In some cases, setting
strip speed to say 70% would result in actual speed being set to say
69.5%. With this change, the number would be closer or equal to 70%.
There few tangentially related changes:
- `SEQ_retiming_key_speed_get` was changed so both functions work in
same time domain.
- `SEQ_retiming_key_speed_set` now expects speed as float factor
instead of percentage. This is consistent with get function return
value.
- Improve variable names, for better code readability.
Pull Request: https://projects.blender.org/blender/blender/pulls/131782