When right clicking on any of the image editor tool buttons,
`WM_keymap_guess_from_context` would be called but lack of `space_type`
will cause `WM_keymap_find_all` to return `nullptr`. Assigning it to
`SPACE_IMAGE` fixes the issue.
Mask layers were added (unnecessarily) in these cases:
- calling `Mask Slice` without having a mask even (now return
`OPERATOR_CANCELLED` early)
- calling `Mask Extract` without having a mask even (now return
`OPERATOR_CANCELLED` early)
- `Extract Face Set` was also adding a mask layer (only because both
extracts used `geometry_extract_apply`), moved mask specific stuff into
`paint_mask_extract_exec` (see above also)
Came up in !123888
Pull Request: https://projects.blender.org/blender/blender/pulls/133435
This reverts commit 19e9092cb6. The
minimum requirement is for builds that Blender officially provides. We
still need to maintain code for none SSE builds.
`TextVars::text` is only 512 bytes and does not include string ending
byte, and `sequencer_text_edit_paste_exec` uses a very simple truncation
that didn't guarantee valid UTF-8 sequence at the end. This is now fixed
by using `BLI_str_utf8_invalid_strip` after truncating the string.
Pull Request: https://projects.blender.org/blender/blender/pulls/133416
After confirming a cut, the tool goes into `MODE_IDLE`.
In `knifetool_undo`, the `KnifePosData` `prev` (drawn as the "red point"
in question in `knifetool_draw`) was only set to the `KnifeUndoFrame`
pos when we are in `MODE_DRAGGING` though -- this is now changed to also
be done for `MODE_IDLE`.
NOTE: it might be questionable to even draw this bigger red dot once a
cut is confirmed (will attach another small diff to the PR that does
this)
Pull Request: https://projects.blender.org/blender/blender/pulls/133430
* Some libraries like Alembic and OpenColorIO for a long time removed
header dependencies on Boost.
* No need to have BOOST_LIBRARIES anymore, only BOOST_PYTHON_LIBRARIES
is a direct dependency through USD headers.
* OpenVDB is no longer a static library, no need to link its dependencies.
Pull Request: https://projects.blender.org/blender/blender/pulls/133424
Having a small voxel size meant typing in zero would clamp the
voxel size to a small number which was often small enough to hang
calculating large voxels which would eventually fail to allocate
memory & crash.
Instead, allow a zero value but bypass calculation.
See #130526.
Reason for this is that all the brushes in essentials assets have a zero
default `mask_stencil_pos` / `mask_stencil_dimension`.
At that time, they have been created resetting a brush to defaults and
using that as a starting point.
At that time though, these settings didnt have a default (which
b2dd308dca fixed, so that method should not result in those settings
being zero).
The brushes in essentials assets still do though, now correct these in
versioning code.
Pull Request: https://projects.blender.org/blender/blender/pulls/133374
Behavior was not consistent across modifiers
- Opacity
-- strokes were using inverted weights only when
MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR was OFF, fills however
when MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR was ON
- Tint
-- strokes and fills were using inverted weights only when
MOD_GREASE_PENCIL_TINT_USE_WEIGHT_AS_FACTOR was ON
- others (Envelope, Lattice, Noise, Offset ) were ignoring inverting the
influence vertex group alltogether (but that is reported in #133055 and
will be handled separately, see below)
- others (Hook, ... ) were always inverting it, which is correct
This pull requeset only corrects this for Opacity and Tint (in the way
that now weights are always inverted, no matter if "Use Weight As
Factor" is used).
This also paves the way to a more general fix for #133055 (which intends
to move the weight inversion to the very general
greasepencil::get_influence_vertex_weights)
Pull Request: https://projects.blender.org/blender/blender/pulls/133310
Without boost::locale, there seems no particular reason to modify the
global locale, we can just translate strings ourselves.
Other locale facets like numeric and time are also left unchanged
from the default, which is the "C" locale. This appears to match
previous Blender behavior with boost::locale. That protects against
bugs where formatting floats for I/O unexpectedly depends on the
system language.
Pull Request: https://projects.blender.org/blender/blender/pulls/133347
This bug occurs when the user deletes the rightmost stop on a
color ramp with 2 stops. After doing this, the color ramp appears
to stop updating its results.
This bug is due to a shader optimization for color ramps. For ramps
with 2 stops or less, the first and second stops are hardcoded as
inputs to get the results of the color ramp. When deleting the
rightmost stop, the stop's data isn't actually changed. The ramp
just updates its total stop number. Because of this, the result of
the color ramp won't change.
This is fixed by only allowing this optimization when a ramp has
exactly 2 stops. This solution works well since it keeps color ramp
code neat and concise. It also makes more logical sense to only allow
this optimization to work with 2 stops since it uses 2 hardcoded values
from the color ramp. It's also unlikely this will lead to adverse
performance problems since it doesn't make sense to use a color ramp
with 1 color stop. In that case, the user should just use an RGB node.
Another possible solution for this problem would be to update the data
for the second stop in the color ramp to exactly match the first when
deleting the second stop. However, this is undesirable since the code
wouldn't make much sense to those who don't know about the color ramp
optimizations.
Pull Request: https://projects.blender.org/blender/blender/pulls/132951
`BKE_unit_value_as_string` was modified in e949ff7334
to include a `BKE_unit_value_as_string_scaled` version, some places on
the interface needs to use the scaled version to show the string, this
includes ruler gizmo length text.
Pull Request: https://projects.blender.org/blender/blender/pulls/133373
Avoid breaking with a partially initialized `highpoly` as this
could cause complications when freeing members in the future.
Also use variables for brevity.
Changes in [0] broke baking to objects with animated render visibility,
causing render visibility override not to work.
Resolve by disabling visibility optimizations.
Ref !133358
[0]: 0dcee6a386
Prior to the brush refactor in 4.3, the cavity automasking feature
had an implicit dependency on stable position values. In many cases,
such as during brush evaulation, this was upheld by the usage of the
proxy system, which meant that even if a vertex's neighbor was changed
during a stroke in paralell, these changes would not be accessed until
after a stroke finished.
With the new method of brush evaulation removing the proxy system, this
introduced subtle artifacts on BVH node boundaries, as vertices were
guaranteed to change and cause differences as there was no temporary
storage to use the "old" position data. This effect was most noticable
in 4.3 and beyond in multires sculpting, though similar artifacts can be
seen when using the mesh filter in all prior versions.
To fix these issues, instead of calculating the internal cavity factor
during a stroke or during deformations, we calculate it ahead of time
based on the affected nodes of a stroke. This has the benefit of now
behaving consistently for a given mesh and given brush or filter
application.
From a performance perspective, this change should have no noticeable
impact, as each BVH node, and by extension each vertex, only has its
corresponding cavity factor calculated once, when the stroke would
affect the node.
Related: #102745
Pull Request: https://projects.blender.org/blender/blender/pulls/133224
This can be useful when going from a selection of curves to the corresponding
selection of points.
The simple implementation given here should work quite well in the majority of
cases. There is still optimization potential for some cases involving masks with
many gaps. The implementation is also single threaded for now. Using
multi-threading is possible, but should ideally be done in some way to still
lets us exploit the fact that the index ranges are already in sorted order.
Pull Request: https://projects.blender.org/blender/blender/pulls/133323
Color to grayscale conversions should take into account the colorspace,
and these are considered to be in scene linear colorspace.
Note the RBG to BW node implementation is used for implicit conversions,
so that is covered as well.
No change with the default configuration.
Pull Request: https://projects.blender.org/blender/blender/pulls/133368
Color to grayscale conversions should take into account the colorspace,
and these are considered to be in scene linear colorspace.
No change with the default configuration.
Pull Request: https://projects.blender.org/blender/blender/pulls/133368
This builds on top of 80441190c6 to gray output
unused inputs of the Mix and Mix Shader node. These nodes have unused inputs if
their mix factor is 0 or 1 (+ some special cases for non-uniform vector mixing
and blend modes).
Pull Request: https://projects.blender.org/blender/blender/pulls/133369
When there was an empty (no keyframes) track in the motion tracker's
dopesheet, Blender would crash when running the Frame All operator.
The issue was that the code computing the frame range was trying to
access non-existant data on the empty track, leading to a null pointer
dereference.
This fixes the issue by guarding that code with a nullptr check.
Pull Request: https://projects.blender.org/blender/blender/pulls/133371
The MaskLayer.invert property has "Restrict View" as its label. I
suspect this was an error during the commit that introduced the
feature. This commit simply renames it to "Invert".
Reported by Gabriel Gazzán.
Pull Request: https://projects.blender.org/blender/blender/pulls/132521
VKRenderGraphNode is 892 bytes and most of the bytes are used for
specific nodes. By storing large structs in separate vectors we can
reduce the needed memory and improve cache pre-fetching.
With this change the VKRenderGraphNode is reduced to 64 bytes.
On a (50 frames shader_balls.blend) the end user performance is improved by
2%.
| **Platform** | **Before** | **After** |
| ---------------- | ---------- | --------- |
| AMD W7700 | 1409 ms | 1383 ms |
| NVIDIA RTX 6000 | 1443 ms | 1428 ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/133317
Both Image and Sequencer vectorscopes used YUV U,V coordinates
as-is, but their possible ranges are different: +-0.436 and
+-0.615 respectively.
It looks like more other software (ffmpeg, shotcut, etc.)
re-scales the vectorscope UV to fill up a square, i.e. streches
out the horizontal values, so do the same.
This fixes the "skin tone indicator" line, which at 123 degrees
(90 + 33 degrees to match positive I axis of YIQ color space) was
placed assuming the UV values fill up a square. So it was at the
wrong angle before.
The vectorscope horizontal scaling and skin tone indicator line now
matches other open source (ffmpeg, shotcut) and commercial (davinci
resolve, final cut pro) software packages.
Images in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/133316
The interpolate tool was using a linear re-sampling of the curves, which changes
non-uniform point distributions can causes unexpected shifts in points along the
curve, even very close to an input stroke (mix factor ~0 or ~1).
This patch adds an alternative interpolation function with explicit segment
indices and fractions, which can then be computed by the interpolation tool.
The point segment factors are chosen such that each point of the input strokes
has an exact matching point in the interpolation. When the factor is close to
0 or 1 the shape of the curve thus matches the respective input exactly.
This approach is more similar to what GPv2 did, except instead of sub-dividing
each segment it simply generates a _local_ uniform sample to fit more points
into the same segment. These extra points are colinear at the extremes of the
mix factor range, so the curve matches the input curves visually.
Pull Request: https://projects.blender.org/blender/blender/pulls/130594
GPv2 used the depth buffer at the end of a stroke drawing operation to project points and interpolated between detected values. This does not work in GPv3 because the strokes are added directly to drawings. Depth projection has to happen continuously, updating points between the last depth value and the next when a new hit is recorded.
Resolves#125258.
Pull Request: https://projects.blender.org/blender/blender/pulls/131842
This patch automatically grays out input values which can't affect the output
currently. It works with inputs of group nodes, geometry nodes modifiers and
node tools.
To achieve this, it analyses the node tree and partially evaluates it to figure
out which group inputs are currently not linked to an output or are disabled by e.g.
some switch node.
Original proposal: https://devtalk.blender.org/t/dynamic-socket-visibility/31874
Related info in blog post:
https://code.blender.org/2023/11/geometry-nodes-workshop-november-2023/#dynamic-socket-visibility
Follow up task for designing a UI that allows hiding sockets: #132706
Limitations:
* The inferencing does not update correctly when a socket starts being
animated/driven. I haven't found a good way to invalidate the cache in a good
way reliably yet. It's only a very short term problem though. It fixes itself
after the next modification of the node tree and is only noticeable when
animating some specific sockets such as the switch node condition.
* Whether a socket is grayed out is not exposed in the Python API yet. That will
be done separately.
* Only a partial evaluation is done to determine if an input affects an output.
There should be no cases where a socket is found to be unused when it can actually
affect the output. However, there can be cases where a socket is inferenced to be used
even if it is not due to some complex condition. Depending on the exact circumstances,
this can either be improved or the condition in the node tree should be simplified.
Pull Request: https://projects.blender.org/blender/blender/pulls/132219
This PR adds new RNA properties that deprecate and replace any `sequence` property.
The old prooperties are still there and fully functional, but the description is changed
to indicate that these will be removed in the future and that the new properties should
be used instead.
| Deprecated property | Replacement property |
| --------------------------------- | ----------------------------------- |
| `context.active_sequence_strip` | `context.active_strip` |
| `context.selected_editable_sequences` | `context.selected_editable_strips` |
| `context.selected_sequences` | `context.selected_strips` |
| `context.sequences` | `context.strips` |
| `SequenceEditor.sequences` | `SequenceEditor.strips` |
| `SequenceEditor.sequences_all` | `SequenceEditor.strips_all` |
| `MetaStrip.sequences` | `MetaStrip.strips` |
Previously, rna paths for animation data on strips started with `sequence_editor.sequences`.
This PRadds versioning for the rna paths to make sure to use
the new naming scheme. This does mean that in previous versions of blender,
the animations don't show but the data is not lost (even if the file is saved in the older version).
Also do some cleanup of existing python scripts inside the source to use the
new properties.
Part of #132963.
Pull Request: https://projects.blender.org/blender/blender/pulls/133156
If source drawings are on different frames, operator is squashing them in
first frame on dst layer. Now fixed with corrected condition. If value
does not exist at given frame_number/key inside frames() map, add a new
frame on dst layer.
Pull Request: https://projects.blender.org/blender/blender/pulls/133361