Addresses two improvements to `Snap to Grid` as suggested in #73993:
- Make 'Absolute Grid Snapping' a new Snap Mode
- Snap to Grid in Non-Side View performed at ground level
Implementation details:
- Snap to Grid has no cursor symbol, unless we are in `Set Snap Base`
mode. Similar to the previous 'Absolute Grid Snap' behavior.
- In Non-Side view, Snap to Grid is performed at ground level.
- If `Snap Base` is `Closest`, Snap to Grid uses the transform pivot
point instead. Similar to the previous 'Absolute Grid Snap' behavior.
- The "Absolute Grid Snap" option has been removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/116109
The Sun Beams node is off by half a pixel. That's because we add a half
pixel offset to the initial coordinates, but then sample the texture
with the half pixel. To fix thus, use the texture_bilinear_extend
utility to sample the image, which takes care of the half pixel offset.
Regression since 7a2d04a5c43.
Mask evaluation is part of parameters component, and there is no explicit
tags other than copy-on-eval for masks in a lot of cases.
Restore the previous graph topology for the link from copy-on-eval to the
parameters components of mask ID.
Potential candidate for 4.1.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/119956
The GPU compositor Chroma Key node differs from the reference
implementation. This is caused by a typo, where the acceptance angle was
halved after computing tangent instead of before computing it.
The Lens Distortion node is off by half a pixel because their normalized
coordinates were at the pixel corners as opposed to their centers, where
this patch changes the behavior to the latter.
The Plane Track and Corner Pin nodes are off by half a pixel because
their mask is computed at the pixel corners as opposed to their center,
where this patch changes the behavior to the latter.
The Directional Blur node is off by half a pixel because it transforms
the pixels at their corner as opposed to their center, where this patch
changes the behavior to the latter.
The Movie Distort node is off by half a pixel because it evaluates the
distortion at the corner of pixels as opposed to their center, where
this patch changes the behavior to the latter.
Since v2.5 Blenders viewport view has been tilted by around ~0.8
degrees to the right, resolve this using a lookup table to update
the the defaults.
Ref !113751
The active window in the context may not match the window where GHOST
events are generated. Notifiers for new windows would always be ignored
with the context's window set to null for example.
Noticed while investigating #119871.
Keep each function's declaration in the header file associated with its
module. Arguably mode switching should be more organized, but for now
it's better to just declare functions in more predictable places.
These functions were declared in the editors/mesh module but
defined in the editors/object module. This commit moves them to
a separate header associated with the object editors module.
Previously retrieving a collection from the context like "selected_ids"
would give a linked list of allocated items. Now it returns a vector of
RNA pointers. Though the number of items is typically fairly small,
using contiguous memory and avoiding many small allocations are
typical performance improvements that could still be beneficial
when there are many items. Iteration also becomes much simpler.
Pull Request: https://projects.blender.org/blender/blender/pulls/119939
These functions appear to have been unused for the last 15 years.
They are quite complex with the var_args handling, and may get in
the way of some other cleanups in the area.
There are still a few places that are more complicated where the replacement
to `IDP_New` isn't obvious, but this commit replaces most uses of the ugly
`IDPropertyTemplate` usage.
This limits the number of tilemaps per LOD that can be fed to avoid the
easy to hit "Too many shadow updates" (#119757).
This allows for a max 64 tilemaps to be updated at once at their lowest
requested LOD (so ~10.6667 point lights if every faces of the punctual
shadow map is needed, but likely more in practice).
Unfortunately this is still quite low and will surely be hit quite soon
with directional shadow added to it. One idea to workaround this would
be to time slice the update of some lights, but this opens a whole can
of worms that I'm not ready to open for now so I created #119890 for
future reference.
Some notes, most lights seems to request around 3 LODs. It might help
to allow requesting at least 2 LODs if we are rendering since volumes
might want lower LOD available for volumes.
I added a very simplistic heuristic that also lowers the max tilemaps
when transforming, animation playback or navigating the 3D view to
improve the responsiveness of the engine. Note that this doesn't
only lowers the resolution to the minimum requested one. So it should
be good enough in most cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/119889
Use File Handlers to handle file drag-n-drop in the View 3d. Drop-boxes
still remain since they handle Texture ID drag-n-drop.
This will add-ons to handle drag-n-drop for images and movies while
still providing access to Blender's native support since File Handlers
let users choose which to invoke if there's multiple configured.
Pull Request: https://projects.blender.org/blender/blender/pulls/117728
This PR removes the modal callback for `PAINT_OT_visibility_invert`.
It does not use the provided data, nor is the `modal` function
invoked by a corresponding `invoke`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119930
This PR introduces the ability for users to switch between boolean
solvers while using the sculpt *Trim* tools (*Box Trim* & *Lasso Trim*)
much like the mesh boolean modifier and geometry node. Because the
*Exact* solver has performance issues with larger meshes, the *Fast*
solver is set to be the default.
In my very rough timing tests on my laptop on a mesh with **1.7m**
vertices, a *Trim* operation with the *Fast* solver finishes in roughly
20 seconds as opposed to still being in progress after five minutes
with the *Exact* solver.
Addresses part of #84229
Pull Request: https://projects.blender.org/blender/blender/pulls/119699
Compute an index masks of points to remove to simplify the curve attribute using the Ramer-Douglas-Peucker algorithm.
The Ramer-Douglas-Peucker algorithm finds a set of points in a polyline to remove so that the overall shape of the polyline is similar. How similar can be controlled by the distance `epsilon`.
The function takes a `GSpan` so it can be used with any attribute (that has a type `float`, `float2`, or `float3`).
Pull Request: https://projects.blender.org/blender/blender/pulls/118560
Textures that are GPU-compressed already (in practice: from DDS files
that are DXT1/DXT3/DXT5 compressed) now can stay GPU compressed
in Vulkan, similar to how that works on OpenGL.
Additionally, fixed lack of mipmaps in Vulkan textures. The textures
were created with mipmaps (good), the sampler too (good), but
the vulkan image view was always saying "yo, this is mip 0 only"
because mip range variables were never set to anything than zero.
Pull Request: https://projects.blender.org/blender/blender/pulls/119866
A regression caused by 7a2d04a5c4.
The offending commit made it so selection tag does not imply parameters
update, which also avoids transitive re-evaluation of the curve geometry.
However, the active curve index is stored on a Curve, and curve modifier
stack creates a copy of the curve to hold the evaluation results, which
makes it so evaluated curve object does not intrinsically share the active
spline index.
This change makes it so changes in selection triggers geometry evaluation
on curves, matching the behavior prior to the offending commit.
AN ideal fix would somehow avoid such geometry re-evaluation, but it would
be a bigger change, not suitable for possible corrective release.
Potential candidate for 4.1.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/119918
Every vulkan installation has a vk.xml file containing the vulkan specification
in a machine readable fasion.
This PR uses the vk.xml to generate to_string functions for data types blender uses.
When updating to a new specification or when changing features/extensions we
should re-generate the to_string functions.
The generator is implemented in `vk_to_string.py`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119880
The compositor does not correctly free, wrap, or allocate images. That's
because the resetting mechanism didn't reset all members. This patch
rests all members and only retains the important ones.
This could happen when e.g. overriding context with just the area.
Now add poll functions that check for an active region when running
operators that require a region.
The fix is similar to 72688791dcb2
Alternatively, we could have a fix similar to a8892c726435 (getting the
correct region from the area), this would require less setup by
scripters, however for some operators the usage of the region is a
little further down the line, so implementation would be a bit more
involved. Also: for some of the operators, this would have to be done in
both `invoke` and `exec` (so would be more duplicate code changes).
Pull Request: https://projects.blender.org/blender/blender/pulls/119696