When clearing only the depth of a depth/stencil only the depth
part of the image aspect was stored in the node. This is invalid
when the image needed to be transitioned.
Pull Request: https://projects.blender.org/blender/blender/pulls/123713
When having a sequential read image barriers for the same resource
and the second one requires an image layout transition the incorrect
barriers where generated.
This was fixed by aligning the implementation with write image barriers.
Pull Request: https://projects.blender.org/blender/blender/pulls/123712
When changing the URL or access token, re-synchronize remote data
automatically.
This changes automatic synchronization to use a background task that
runs based on a timer instead of a modal operator since the operator
is more intrusive and not so well suited to running based on changes
to RNA.
In some cases, sculpt code currently creates undo steps that are stored
in `step_init` in the undo stack, but then skips actually pushing them.
That can happen when an operator is cancelled (like the transform
operator in #123172) or because pushes in "nested operator calls"
are currently explicitly disabled. That happens when calling the brush
operator from a script.
It turns out the undo code never freed the `step_init`, probably because
it assumed it would be pushed to be part of the stack afterwards.
Personally I'm not convinced that separating undo step creation into
two stages with `step_encode_init` and `step_encode` is a great design
or a necessary one, but I'm trying not to get into that deeper right now.
Fixes#123172
Pull Request: https://projects.blender.org/blender/blender/pulls/123331
Fixes#123612, #123611, #123621
Continue the restructuring in previous commits in this area to avoid
repeating more work for every node. The commit is large for a bug fix
but the best way to fix the issues was to continue making the area more
generally sane. Some specific changes:
- Run the switch for undo type outside of the iteration over nodes.
- Further split multires and base mesh undo so they don't go through
the same per-node functions.
- Replace the node-tagging mechanism with specific loops per undo type.
- Properly assign the step type when pushing a single node at a time.
Calling `MEM_freeN` on data allocated with `MEM_new` is bad, since it
will not call a destructor matching the one invoked as part of
`MEM_new`.
While in practice cases fixed below were 'not a problem' currently, as
they are trivial Cpp types (and therefore their destructor is doing
nothing), `MEM_freeN` has no way to ensure it is dealing with such a
trivial data type, so allowing such mismatch is dirty and dangerous.
Note that almost all fixed cases look more like unintentional mistakes
(mis-usages of `MEM_new` instead of `MEM_cnew`).
NOTE: There is one more (known!) case in the asset code, which fix is
slightly less trivial, and will go through a separate PR.
NOTE: This is a by-product of some work to detect such invalid usages of
`MEM_freeN` on memory chunks allocated with `MEM_new`.
Pull Request: https://projects.blender.org/blender/blender/pulls/123691
This commit adds a new poll function specifically for determining if the
sculpt cursor should be drawn. This function whitelists a hardcoded set
of non-brush operators to display the cursor for.
In testing, this extra check has negligable performance impact. On
average it takes 0.012ms per execution.
Pull Request: https://projects.blender.org/blender/blender/pulls/123570
Mouse and NDOF events are defined in enums that are never used
directly by RNA through RNA_def_property_enum_items. As a result, they
don't get automatically extracted to the translation files and need to
be manually, through N_() macros.
The translation context used is the same as in other places related to
KeyMapItem: "UI_Events_KeyMaps".
Pull Request: https://projects.blender.org/blender/blender/pulls/116390
This adds the `Jitter` draw tool option in the randomize panel.
To make this work in combination with the active smoothing, the jitter of the positions is applied
after active smoothing as an effect on top.
This means that the active smooth will not smooth the jittered points.
In addition, it is also now allowed to raise the `Jitter` factor above 1 for a more extreme effect.
Note: The jittering worked a bit differently in GPv2 (probably because of a bug). In GPv3 we compute the cotangent using the smoothed stroke direction (over time), which is a lot more acurate then using the previous and current position for the direction.
Pull Request: https://projects.blender.org/blender/blender/pulls/123680
The idea is to skip building data-blocks referenced by ID
properties for dependency graphs used by render pipeline and
compositor preview. Those graphs do not use handlers, so it
is not required to have custom references to data-blocks
evaluated.
This solves an initial hicckup and memory usage with file
from #121188 when doing compositor. It also reduces the time
until first pixel when hitting F12 on that file.
Pull Request: https://projects.blender.org/blender/blender/pulls/123439
This make texture coordinates properly work with the primitive tools.
This uses the same placement logic as the draw tool.
Note: Placement is determent by the first point placed and will not be updated if that point is moved.
Pull Request: https://projects.blender.org/blender/blender/pulls/123520
STL/PLY (also Collada) use `BKE_mesh_assign_object` to assign a mesh
(already in main, has a usercount of 1) to a fresh object.
That function does a bunch of (unneeded) things (test modifiers/
materials which is not necessary since these are fresh objects) next to
increasing usercount. Collada steers against this by reducing usercount
again. Other importers such as alembic assign the mesh directly to
object data (which is also what this PR proposes).
Pull Request: https://projects.blender.org/blender/blender/pulls/123558
During ray tracing there is a missing resource. On OpenGL this doesn't
matter as it will reuse the previous binding. But on Metal or Vulkan
each resource needs to be added to update bindings.
Pull Request: https://projects.blender.org/blender/blender/pulls/123655
Internally the image and texture resources where kept in a vector
where the elements were referenced. When using more than 16 images
this vector is reallocated and previous references become invalid.
This is a quick fix and should be changed with something more
stable.
Pull Request: https://projects.blender.org/blender/blender/pulls/123656
`mat4x4f` is not found when loading .blend files which were written
before this struct existed. The buffer-overwrite wrote into the buffer
size of our allocator (`MemHead`).
The ocean modifier uses its Bake operator for both baking and freeing
the cache, based on the `free` operator property.
There are two bugs here:
1. The "Delete Bake" variant of the button was created using the
`WM_OP_EXEC_DEFAULT` operator context. This skips the `invoke`
callback which is crucial for setting the operator `modifier`
property. Without that the modifier will just exit early.
The "Bake" button is drawn using the `uiItemO` function which uses
the invoke context automatically, so it does not have this issue.
2. The `free` property is set for the "Delete Bake" variant, but was
never reset to its initial `false` value. The "Bake" variant has to
also set this property, otherwise it will always execute the "free"
code path.
Pull Request: https://projects.blender.org/blender/blender/pulls/123506
Due to incompatible binding namespaces between Vulkan and OpenGL we
offset the images in the ubo list. In the previous implementation
this could still go wrong as the images and textures bindings where
sequential. When EEVEE binds resources it can also try to bind resources
that aren't valid for the current shader. In this case it was still
possible that the incorrect binding was chosen.
This is fixed by offsetting the images by a large number.
Pull Request: https://projects.blender.org/blender/blender/pulls/123649
With the new closure approach, the code can be simplified and cleaned up quite
a bit.
This also removes four parameters, which is helpful for future additions (!123616)
since the parameter limit appears to be reached.
Pull Request: https://projects.blender.org/blender/blender/pulls/123643
Port `GPENCIL_OT_layer_duplicate_object` operator to new structure.
New function created to duplicate layer and its frames. This could also
be used in duplicate_layer operator later.
Part of #110056
Pull Request: https://projects.blender.org/blender/blender/pulls/123366