First the normal mode was changed, then the custom normal input was
evaluated. That's incorrect because changing the normal mode changes
the output of the normal mode. The fix is to avoid changing the normal
mode until after the normals are calculated.
Some Status Bar icons differ in width, like "Ctrl". For these items we
have to add a spacer before the next item. Unfortunately there is one
code path where this does not happen for modifiers even though it does
for the main icon. This PR fixes this and removes the chance of icons
overlapping on the status bar.
Pull Request: https://projects.blender.org/blender/blender/pulls/131584
For a bit of (somewhat related) history, check 8d590e4b86.
The real problem here is that for non square images, the
`applyAspectRatio` works with "wrong" vectors if translation constraints
(`CON_APPLY`) are used. Then, the passed vector might actually have axis
changed, e.g. constraining to the Y axis does not hold the Y translation
value in dvec[1], but in dvec[0]. This is expected by design, but
`applyAspectRatio` is not aware of this and does wrong things.
The easy way around this is to actually call `applyAspectRatio` before
the `CON_APPLY` stuff takes place.
NOTE: future improvement might be to split (or rename)
`removeAspectRatio` / `applyAspectRatio` becaues these functions also
handle the "conversion" to pixel values which is not obvious atm.
Pull Request: https://projects.blender.org/blender/blender/pulls/131608
Regression from #131134.
The shader still reads `vel.obj.ofs[STEP_NEXT]` even when in the
viewport.
- Ensure that `vel.obj.ofs[STEP_NEXT]` points to a valid memory
location even if the computed value is still wrong.
- Ensure that the viewport always uses a 2 channel vector_tx and all
texture reads are always swizzled.
This also seems to fix the motion vector pass for the realtime compositor.
Pull Request: https://projects.blender.org/blender/blender/pulls/131445
The layer mask used by the armature modifier can be incomplete, in which case
the indices may not match the edit hints list of layer data. The actual
layer index must be used instead.
Also fixes a build error on Win64 ARM which cannot compile a parallel_for_each
over an index range.
Pull Request: https://projects.blender.org/blender/blender/pulls/131620
The Translate node leaks memory when no realization happens. That's
because the code passes the input through, then passes it again inside
the transform algorithm. To fix this, remove the pass through in the
node code and leave potential pass through to the algorithm.
Workbench shaders uses one fragment shaders, but uses different
resources based on the step of the effect. This failed in vulkan as all
defined resources should be found. This PR separates the steps in its
own fragment shader and adds sampler binding per step.
- Removed the max coc input texture as it wasn't used.
- Removed the background texture as it wasn't used.
- Renumbered the resources.
Pull Request: https://projects.blender.org/blender/blender/pulls/131606
The issue was that the `handle_left`, `handle_right` and `position` attribute
are updated one after another and the input field is evaluated again for each
attribute. If the handle positions are updated first, then the tangent will
change in consecutive evaluations.
The fix is to set the three attributes at the same time and to evaluate the
inputs only once.
Pull Request: https://projects.blender.org/blender/blender/pulls/131609
With Slotted Actions, an Action's `idroot` should always be zero,
corresponding to "unspecified". However, there was still some old
leftover code that, when duplicating an Action via the Action Editor,
would set the new Action's `idroot` to either OB or KE, depending
on the editor mode.
In addition to now being incorrect, this was also tripping an assert
elsewhere in the code when trying to then assign that duplicate action
to an ID.
This commit simply removes the outdated code, which is no longer needed,
leaving the `idroot` as the default (unspecified).
Pull Request: https://projects.blender.org/blender/blender/pulls/131601
The generic Action assignment function tries to find a slot to
auto-assign. This would always look at the last-used slot identifier on
the ID's `AnimData` struct, even when assigning to an NLA strip or
Action constraint.
This commit removes the `Action::find_suitable_slot(ID)` method, and
replaces it with a `generic_slot_for_autoassign(ID, action,
last_slot_identifier)` function. That function basically copies the
behaviour of `find_suitable_slot()`, except that it gets the
`last_slot_identifier` from the caller.
Another difference is that it no longer checks whether the Action is
already assigned, and so also never uses the currently-assigned slot
handle. In the only code flow that calls `generic_slot_for_autoassign()`
this situation would never occur, and thus it's better to delete this
dead code.
Pull Request: https://projects.blender.org/blender/blender/pulls/131491
It's a relatively common occurrence to run out of space for the property name
when using the Attribute Node, making it unreadable. A big part of this space is
eaten up by the labels, especially since the space they take up scales up with
the node width.
It can be argued that the info provided by the labels (`Type:` & `Name:`), are
superfluous and not essential. Removing them does not make the node harder to
use, and frees up more space for the user to type longer property names.
This is quite similar to changes done in #127992 for Geometry Nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131543
The issue was that the links was tagged as invalid for one render engine,
because it does not support the output pass. However, switching back
to Cycles did not make the link valid again.
GPUViewport is creating a bunch of framebuffer textures for itself, but
some space types never initialize/use them. E.g. Sequencer, Nodes etc.
only ever use the "overlay" texture. Eventually when viewport is
"drawn", it combines this uninitialized texture data and then only by
luck it happens that most of the time it is black. But not always!
The textures were only cleared (right now) on Metal backend, under
GPU_clear_viewport_workaround as if it was some driver workaround. Stop
doing that, and just clear them always.
However, there was seemingly a performance issue on OpenGL, when this
clear was being done. At least on my machine (Win10, Geforce RTX
3080Ti), the overhead of doing the clears is measurable, and is caused
by usage of GL4.4 glClearTexImage instead of a framebuffer clear. As if
glClearTexImage makes "pixel data to exist" on the CPU side and then
later on binding this framebuffer sends off that data to the GPU, or
somesuch.
More details in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/131518
When a new Action slot is created by keying a property, it is now
named after the last-assigned slot. This is in support of the
following scenario:
- Action `A` is assigned, with slot `Legacy Slot`.
- The slot is renamed to `Main Light`, because that's what being
animated by it.
- Animator wants to try an alternative animation, and unassigns the
Action.
- Animator starts keying the light, which creates Action `B` and a
slot.
- This slot is now also named `Main Light`, independently of the
actual name of the light being animated.
- Animator can switch between actions `A` and `B`, and because the
slots have the same name, the auto-assignment Just Works™.
Pull Request: https://projects.blender.org/blender/blender/pulls/131600
Proportional editing expects `IndexMask` from all Bezier points not only from selection as it affects not only selected curves.
Therefore `selected_editable_strokes` changed `editable_strokes` and initialized with `retrieve_editable_strokes`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131519
Grease Pencil v3 did not have crazyspace support yet. Without this sculpting on
deformed geometry (e.g. on top of an armature modifier) will yield incorrect
offsets because the tool writes to original data based on deformed positions.
This patch adds computation of local deformation matrices which are stored in
the `GeometryComponentEditData`. Those matrices are then used to convert local
deformation of the evaluated geometry back to a deformation of the original
geometry. All the relevant sculpt tools support the crazyspace correction now,
using the `compute_orig_delta` helper function.
Computing the deformation matrices should happen alongside modifier evaluation
for any deforming modifier. This has been implemented for the armature modifier,
others can be added.
A fallback implementation for curves could also be added for modifiers that
don't have an easy way to calculate local transformation. A "natural"
orientation for both the original and deformed positions is calculated, then the
difference yields deform matrices. For meshes the approach is to use the surface
normal and a stable tangent space. For curves the common local coordinate frame
based on parallel transport might be used.
Currently crazyspace correction for the _Clone_ tool does not work because of
#131496.
Pull Request: https://projects.blender.org/blender/blender/pulls/131499
Mutliframe editing wasn't using the falloff.
The fix adds a new field `Vector<float> grease_pencil_falloffs` to
`struct CurvesTransformData`. References it's values with `TransData.extra`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131147
This patch specializes the symmetric separable variable size blur code
for different types. Additionally, now-unused generic type functions
were removed, and unused GPU specialization was removed since they are
no longer free due to CPU support. Gives a 2x improvement.
This patch specializes the symmetric separable blur code for different
types. Additionally, now-unused generic type functions were removed, and
unused float2 specialization was removed since it is no longer free due
to CPU support. Gives a 2x improvement.
Line Art modifier `runtime->object_dependencies` can be empty when first
loaded, this can be triggered when loading as library overrides. This
fix guards this kind of situation.
Pull Request: https://projects.blender.org/blender/blender/pulls/131591
The string `msl_patch_default` can have been read
partially uninitialized or initialized multiple
time and read uncomplete during multithreaded
compilation.
This should fix the GPU tests randomly failing on mac.
While this would never fail when blender runs from the UI (since
UI shaders are init in single threaded manner and always compile
before EEVEE shaders), this race condition could happen when running
EEVEE through background rendering or running tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/131580
It was pointed out that the notification added in #131406 was incorrect
as it added a notification for an intended area rather than the type
of change. This adds a ND_KEYFRAME_AUTO, set on auto keyframe change.
Timeline header already listens for all NC_ANIMATION and tags redraw.
Pull Request: https://projects.blender.org/blender/blender/pulls/131454
The text colors used on the tooltips are hard-coded and calculated
based on that widget's text color. But this is done in such a way that
the colors lose their saturation when used on light themes. This PR
calculates them in a way that allows the active color (light blue) and
the alert color (red) to work with light theme colors.
Pull Request: https://projects.blender.org/blender/blender/pulls/131515