Performing an off-screen draw call while drawing the viewport isn't
supported, add a check that raises an exception when called from Python
instead of crashing.
Ref: !118780
This was reported as #93410 & fixed with [0] however the fix didn't
help for animated logic (with region overlap enabled).
Resolve by adding a function ED_region_visibility_change_update_ex which
is called by the animated and non-animated region hiding functions.
[0]: 8f69c91408
Blender would crash if the input of the Classic Kuwahara node is
translated. This is due to an out of bound access due to the miss-use of
IndexRange, where it was assumed to have a start-end constructor, while
it was in fact a start-size one. Fix this by computing the size from the
area and supplying it to the constructor.
This patch unifies the Keying node between the CPU and GPU. The
difference was due to imprecision when computing pixel saturation in the
CPU code. This typically happens when the pixel is gray-scale, and
should have a zero saturation, but it came out negative due to
imprecision. To fix this, reorder the mix expression so that the minimum
and maximum values are differenced first.
Ideally, the code shouldn't have such abrupt conditionals and should be
more robust to tiny imprecisions, but that would break the behavior and
should be evaluated separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/118625
The GPU compositor Blur node truncates the filter kernel if the blur
radius is lower than the base radius. That's because it evaluated the
filter kernel only up to the desired radius. To fix this, we evaluate
at the entire kernel for all radii using a texture sampler for the
weights.
Enums are stored as uints, but due to a missing implementation they
where stored in shaders as ints. As draw manager now supports uints
as specialization constants we can update these constants to be
stored as uints on the shader side as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118788
Operators that added themselves as modal handlers would crash if there
was a Python exception in the script before returning.
Now modal handlers are removed an exception occurs in exec & invoke
operator callbacks.
This currently contains some types I personally needed
more types can be added if people desire them.
Due to the .natvis being added to creator, Visual Studio
will automatically pick up on these types and show the
improved visualizers while debugging.
vscode can also use this file, but you'll have to check
its documentation on how to set that up.
Pull Request: https://projects.blender.org/blender/blender/pulls/118576
Properly handle exceptions from STL and PLY code to prevent crashes on
invalid file paths.
This will now also Report errors/warnings to the callers of these
formats as well. For the UI this means a Report banner and Info editor
entry. For Python scripts this means an exception instead of silently
continuing.
Related to #117881
Pull Request: https://projects.blender.org/blender/blender/pulls/118731
These expose internal data for unit testing purposes. While it might be
better to avoid this entirely, at least make the returned data const, so
there's no unexpected modification from outside the catalog service
internals.
Making this thread safe is quite trivial now. Note that for building the
tree we iterate the catalogs map, which may still be modified from
another thread in parallel. Making this thread safe is kept for a
separate commit.
Armature deformation modifier for Grease Pencil v3.
Changes compared to GPv2:
- `multi` DNA field was unused and was removed.
- `vert_coords_prev` array is unused and was removed (gets passed to
armature functions but never gets allocated).
- GPv3 modifier uses the common `influence` struct to store the vertex
group name, for consistency. The
`GREASE_PENCIL_INFLUENCE_INVERT_VERTEX_GROUP` flag is copied to
`deformflag` as `ARM_DEF_INVERT_VGROUP` before evaluation, which is
used internally by armature functions.
- `BKE_armature_deform_coords_with_curves` is added as another variant
of the deform function, but uses C++ parameter types (spans instead
of raw pointers). It gets a `Span<MDeformVert>` directly instead of
deducing it internally from the object type. This is because we want
to do this curve-by-curve and already use arbitrary vector spans for
positions.
Pull Request: https://projects.blender.org/blender/blender/pulls/118752
When a new liboverride is created from the IDTemplate UI widget, in case
its hierarchy root is different than the liboverride itself, ensure that
it is also instanciated in the scene, if possible (i.e. if it's an
object or collection).
Should allow for better representation of liboverride hierarchies
created that way, and reduce the risk of getting key liboverrides hidden
from the scene's hierarchy (in the Outliner ViewLayer view e.g.).
LibOverride creation code wrapper when called from the IDTemplates in
the UI was a tad too permissive in its attempts to find the best
possible liboverride hierarchy root, leading to potential invalid linked
ID selection.
Crash happens in `action_group_colors_set_from_posebone` /
`ANIM_bonecolor_posebone_get` on a `bPoseChannel` without a `bone`.
If I am not mistaken a new `bPoseChannel` (e.g. after duplication) will
only get its `bone` after leaving editmode.
So in a way the situation is similar to 2a8ce1f121
Behavior of `animchan_sync_group` is not reliable in a way that getting
a `bPoseChannel` from an `bActionGroup` will guarantee these are really
corresponding. So usually, if you dulplicate/symmetrize a bone, there
would be no corresponding `bActionGroup` and nothing would happen
really. But you could for example group fcurves from `Bone` under a
group called `Bone.001` and vice versa. This is totally allowed to do.
In this case, `animchan_sync_group` is doing nothing totally helpful, so
it could find the "wrong" `bPoseChannel`. And it could try
`action_group_colors_set_from_posebone` with that `bPoseChannel` which
still does not have a `bone` and then crash.
So now only do this if we have a valid `bone`.
Pull Request: https://projects.blender.org/blender/blender/pulls/118676
`RootPChanMap` will be nullptr when building DEG object-level
constraints (as as opposed to bone constraints where this map is built
prior), and in that case we don't need to check for the common chains in
`bone_target_opcode`.
Thx @sergey for additional confirmation
Pull Request: https://projects.blender.org/blender/blender/pulls/118745
On lower end hardware the film accumulation has bad performance. Sometimes
upto 10ms. This PR improves the performance somewhat by adding a
specialization constant around the renderpasses that are actually needed for
rendering, the number of samples and if reprojection is enabled.
`enabled_categories`: Based on the enabled render passes some outer loops are
enabled/disabled that handle the specific render passes. This improves the performance
as no memory will be reserved for branches that are never accessed.
`samples_len` & `use_reprojection`: GPU compilers tend to optimize texture fetches
when they to the outer loop. This is only possible when the inner loop can be unrolled.
In the case of the film accumulation the inner loop couldn't be unrolled. By adding a
specialization constant would allow unrolling of the inner loop.
On old or low-end devices the improvement is around 40%. On newer devices
the improvement is 50+%. Performance of this shader is similar to
the godot.
| GPU | Before | New |
|----------------------|--------|-------|
| NVIDIA GTX 760 | 3.5ms | 2.4ms |
| GFX1036 (RDNA2 iGPU) | 9.9ms | 6.2ms |
| AMD Radeon Pro W7500 | 2.1ms | 0.9ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/118385