Commit Graph

117289 Commits

Author SHA1 Message Date
Pratik Borhade
42445ed5c9 Fix #130725: Grease Pencil: Avoid sculpting strokes with locked material
Return editable_elements instead of entire range of points/stroke from
`point/stroke_selection_mask()` function

Pull Request: https://projects.blender.org/blender/blender/pulls/130727
2024-11-22 15:12:45 +01:00
Clément Foucault
0915015437 Cleanup: Overlay-Next: Camera: Code re-organization to follow code stype 2024-11-22 15:00:17 +01:00
Julian Eisel
4651cad73d Cleanup: Move asset library types to own directory
I found the naming of these files awkward, where we prefixed them with
`asset_library_` to keep them grouped together, and then a library type
name. This resulted in rather un-natural names.  Also, there are files
like `asset_library_service.cc`, which is in fact not another asset
library type, but seems like one with the old convention.

Moving these files to an own directory keeps the grouping while allowing
more natural sounding names.
2024-11-22 14:58:48 +01:00
Clément Foucault
fcc04e131f Cleanup: Overlay-Next: Camera: Simplify functions, remove legacy API calls 2024-11-22 14:56:29 +01:00
Jeroen Bakker
48b10a266f Vulkan: Limit NVIDIA drivers to 550 and above.
Older drivers seems to not work correctly and stall on the first frame.
We encourage users to use the latest driver and this driver support
devices from GTX 750 to RTX 4000 series.

NOTE: Later we should review this issue as supporting more drivers is
always better. The current issue could also be related to sending empty
command buffers to the GPU. Ideally we should support 535 as well.
Some Linux distributions don't package 550.

Ref: #129157
Pull Request: https://projects.blender.org/blender/blender/pulls/130737
2024-11-22 14:54:30 +01:00
Jeroen Bakker
b334502168 Vulkan: Make dynamic rendering optional
!129062 introduces a workaround for dynamic rendering. However that
change didn't marked dynamic rendering as an optional feature. GPU that
didn't had dynamic rendering would still not be able to start Blender.

This PR marks dynamic rendering optional so the device will be
considered when searching for compatible GPUs.

Ref: #129157

Pull Request: https://projects.blender.org/blender/blender/pulls/130736
2024-11-22 14:53:09 +01:00
Laurynas Duburas
cc61ab4dbd Refactor: Curves: Various changes to extrude operator
Removes redundant variables and duplicated logic. Some expressions
simplified. Refactored to make use of `OffsetIndices`. For example,
`Span<IndexRange> curve_interval_ranges` is rewritten into
`OffsetIndices<int> intervals_by_curve`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130229
2024-11-22 14:36:28 +01:00
Hans Goudey
076e1150fc Fix #130720: Crash when saving blend file
Regions were created zero initialized in a couple places for rendering,
those need the region runtime reference.
2024-11-22 08:23:25 -05:00
Omar Emara
01af6ffd22 Compositor: Implement Blur node for new CPU compositor
Reference #125968.
2024-11-22 15:22:32 +02:00
Omar Emara
986802fc87 Composite: Implement Van Vliet Gaussian blur for CPU
Reference #125968.
2024-11-22 15:22:32 +02:00
Omar Emara
3379652bfd Compositor: Implement Deriche Gaussian blur for CPU
Reference #125968.
2024-11-22 15:22:32 +02:00
Omar Emara
edbad1fbde Compositor: Implement Symmetric Separable Blur for CPU
Reference #125968.
2024-11-22 15:22:32 +02:00
Falk David
dc6e879d0f Grease Pencil: Setter for drawing property on frame python API
Previously, it wasn't possible to copy a drawing from one frame to another
if that drawing was in another layer or object.

This allows the `frame.drawing` property to be set to any another drawing.
Setting `drawing` to `None` clears the drawing geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/130523
2024-11-22 14:19:20 +01:00
Philipp Oeser
06e1da7230 Fix #130719: Painting face sets does not work with hidden faces
Caused by b2ec10184c

Above commit just used the wrong domain retrieving the "hide_poly"
attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/130724
2024-11-22 13:45:08 +01:00
Jeroen Bakker
30864a975b Vulkan: Incorrect attachment description for sRGB
When binding sRGB textures as attachment to a none-sRGB framebuffer the
attachment description didn't match the image view. This results into a
validation error. This PR makes sure that the description and image view
uses the same VkFormat.

Pull Request: https://projects.blender.org/blender/blender/pulls/130730
2024-11-22 13:30:39 +01:00
Clément Foucault
68fa0a031c Overlay-Next: Do not enable outline drawing for selection
Should speed up selection a bit.
2024-11-22 13:04:38 +01:00
Clément Foucault
f08979cb3f Fix #130669: EEVEE: Filter Size of 0 doesn't result in sharp viewport if using pixel scaling
Clamping the filter size when using scaling factor > 1 fixes
the issue.
Without this, the filter becomes a dirac and samples gets
only the fallback weight. This would results in a box
blur instead of no filtering.
2024-11-22 13:04:38 +01:00
Falk David
b8ace9331c Grease Pencil: Add python tests for the layer.frames API
This adds tests for the `frames.new`, `frames.remove`, `frames.copy`,
and `frames.move` python API.

Pull Request: https://projects.blender.org/blender/blender/pulls/130726
2024-11-22 12:47:50 +01:00
Clément Foucault
fb1a8ca654 Fix #130714: Overlay Next: Can't Select Meshes with X-ray On
Xray mode also need to draw the object surfaces.
The only difference is that the depth test is disabled
by `select_bind`. So the prepass do not write to depth
and it is safe to enable.
2024-11-22 12:36:28 +01:00
Jacques Lucke
12c17e9579 Blenloader: use int64_t in API more consistently
This replaces various uses of `int` and `uint` with `int64_t` in the blenloader API.
This will be necessary for #129309.

Pull Request: https://projects.blender.org/blender/blender/pulls/130591
2024-11-22 12:35:27 +01:00
Christoph Lendenfeld
16c2e71ab0 Anim: Symmetrize collection assignments when symmetrizing Armatures
This patch makes it so collection assignments of bones are
symmetrized when the "Symmetrize" operator is run.

* Only collections with names that can be symmetrized are modified.
* Collections are created if they don't exist,
they are created under the same parent as the source collection
* In the case of a "left" bone assigned to a "right" collection the
resulting "right" bone will be assigned to a "left" collection.
The system does explicitly not try to be smart here.

Also adds unit tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/130524
2024-11-22 12:31:29 +01:00
Jeroen Bakker
dfc0d97abf Fix #129678: Vulkan: Synchronization issue
Copying editors to the swap chain is done by a series of draw and copy.
When doing draw, copy, draw the swap chain layout was not matching the
draw command as it resumed previous rendering.

This is solved by validating the pipeline barriers when resuming rendering.
There are also other cases that required this which have been updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/130721
2024-11-22 11:58:23 +01:00
Pratik Borhade
70d30529bf Fix #130571: "Edit lines" mode in fill tool is not working
`eGP_FillDrawModes` case is ignored. When it's edit line, set
`radius_scale` to 0. Otherwise, vertex buffer will write value for thickness
attribute in vertex buffer inside `draw_grease_pencil_stroke`. Looking at
the `gpu_shader_gpencil_stroke_vert.glsl`, thickness attribute is later used
to tweak vertex position.

Pull Request: https://projects.blender.org/blender/blender/pulls/130578
2024-11-22 10:02:46 +01:00
Jeroen Bakker
e440828221 Fix #130588: Vulkan: Depth stencil readback
Functionality like snapping cursor requires readback of depth stencil
textures. This was not supported yet. This PR will add readback of depth
stencil textures to float.

Fixes: #128624, #130588

Pull Request: https://projects.blender.org/blender/blender/pulls/130717
2024-11-22 09:45:38 +01:00
Hans Goudey
fb17e7f1a0 Fix: Incorrect size for writing new short2 attribute type 2024-11-21 15:23:32 -05:00
Hans Goudey
2b20871216 Cleanup: Move region UI block name map from GHash to Map 2024-11-21 14:04:34 -05:00
Hans Goudey
129a2aa0f4 Refactor: Move region runtime data out of DNA
Pull Request: https://projects.blender.org/blender/blender/pulls/130303
2024-11-21 19:34:53 +01:00
Hans Goudey
fd97477529 Fix: Incorrect assignment of original edit mesh to evaluated mesh
This is incorrect after the changes in 839108f623.
It was only happening for non edit-mode object evaluation anyway
so it likely didn't have any effect in practice.
2024-11-21 13:18:58 -05:00
Clément Foucault
409012956f Overlay-Next: Enable by default and add option to enable legacy code
The legacy option is turned off by default and will be removed
in the following weeks. It is only there to check for
regression for a short period of time. Afterward checking
for regression will require to use 4.3 as a reference.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/130683
2024-11-21 18:55:39 +01:00
Miguel Pozo
d724ba1f24 Fix: Overlay-Next: v2d depth 2024-11-21 18:51:12 +01:00
Clément Foucault
b36a11aee2 Overlay-Next: Fix discrepancy with xray fade and in-front
This require another depth buffer for correct merging
of overlays. Hopefully we can remove this mandatory
allocation later.
2024-11-21 18:38:02 +01:00
Miguel Pozo
e13504f435 Fix: Overlay-Next: Paint mode wireframes 2024-11-21 18:07:38 +01:00
Clément Foucault
80031a7659 Fix: Overlay-Next: In-front overlays not intersecting the grid correctly
For this to work, we sample the infront second depth and mix it appropriately
to occlude the grid.

The content of the infront framebuffer can be undefined in this
case, so we clear it when appropriate.

Pull Request: https://projects.blender.org/blender/blender/pulls/130625
2024-11-21 18:02:36 +01:00
Miguel Pozo
6d61fff240 Fix: Overlay-Next: Facedot size 2024-11-21 17:51:08 +01:00
Miguel Pozo
66590ff52a Overlay-Next: Space Image/Node paths
Split the draw paths between node, v2d and v3d.
Fixes most Image space issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/130628
2024-11-21 17:22:36 +01:00
Hans Goudey
a4c9b691a0 Attributes: Add 2D 16 bit integer type
Add a `short2` attribute type, intended to store the existing
`CD_CUSTOMLOOPNORMAL` custom data type in order to move the custom
normal storage to generic attributes. This type probably won't get much
use besides that, but generally we don't have reasons not to add these
generic types, besides binary size. In the future we should consolidate
usage of `convert_to_static_type` to avoid large binary size increases
(about 700KB here) for this sort of addition.

This is the first step of #130484.

Pull Request: https://projects.blender.org/blender/blender/pulls/130530
2024-11-21 17:02:05 +01:00
Clément Foucault
0323fafd61 Overlay-Next: Implement Grease Pencil material name display
Rel #129961
2024-11-21 17:00:23 +01:00
Christoph Lendenfeld
04b6eae37f Refactor: remove editor includes from animrig
No functional changes intended.

Modify the code so that no `ED_` includes are needed in animrig.
The function `reevaluate_fcurve_errors` was just moved to its only used
place and made static.

For `animdata_fcurve_delete` the `bAnimContext` argument
is no longer needed because it was only used to check if an `FCurve` is
for a driver which you can also get from `FCurve.driver`.

**Note** that this still leaves `../editors/include` in `CMakeLists.txt`
but that is needed for bone colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/130338
2024-11-21 16:50:48 +01:00
Hans Goudey
839108f623 Fix #113377: Pass edit mesh pointer through modifiers
Currently replacing the Mesh during evaluation with the object info node
can cause us to use invalid original indices when the source object is
in edit mode. This is really a more fundamental problem though: we have
no way to tell whether an evaluated mesh actually corresponds to the
object's original mesh.

This commit changes to explicitly propagating the edit mesh pointer
through copied and changed meshes during modifier and nodes evaluation,
instead of just blindly copying the edit mode pointer from the original
mesh to the evaluated mesh. A benefit of not writing to the evaluated
mesh means it can be shared, potentially offering a future performance
improvement for uses of the object info node.

When we detect an invalid correspondence between the evaluated/original
meshes, we skip extracting the cage mesh's data and skip extracting edit
mesh data from the evaluated object.

This commit also moves the source of "object is in edit mode" truth in
the draw module from whether the evaluated mesh has an edit mode pointer
to the object's mode flag. That's a simplification that's also helpful
to reduce the strong linking between BMesh and edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/120999
2024-11-21 16:42:00 +01:00
Nathan Vegdahl
1dcd435a87 Fix #130216: GPv3: Crash in render due to slotted Actions
The root cause of this bug can be traced to:

- `ANIM_nla_mapping_get(ac, ale)` conditionally returns an `AnimData *adt`.
- This can be `nullptr` in various cases, depending on the editor (in `ac`) and
  the type & source of data (in `ale`).
- This `nullptr` has different meanings:
  1. There is not enough information to return an `adt` (like `ac` or `ale`
     being `nullptr` themselves).
  2. NLA time remapping should not be done. For example for NLA control F-Curves
     (like animated strip influence), or Grease Pencil (because that doesn't use
     the NLA).
- The above-returned `adt` is passed to other functions. Some of them are aware
  of the "`nullptr` means no NLA time remapping" scenario, and gracefully handle
  it. Other code, however, just gets "an adt" from the caller and handles it as
  normal (and likely crashes on `nullptr`). Other cases start out as the first,
  but somewhere in the call stack shift over to the second.

The approach taken in this PR to fix the bug is to (generally) stop signaling
"do not use NLA time remapping" via `adt = nullptr`, and instead explicitly
indicate/check whether remapping should be done.

In most cases this means passing a `bAnimListElem *` instead of an `AnimData *`,
because the former has the information needed to determine if time remapping
should be done or not. However, in some cases there is no `bAnimListElem *` to
pass, and instead other information determines whether remapping is needed. In
those cases we add a `bool` parameter or field in the appropriate place so that
calling code can explicitly indicate whether remapping should be done or not.

To accomplish this a variety of functions have been added to help handle things
correctly.  Of particular note:

- `AnimData *ANIM_nla_mapping_get(ac, ale)` (that conditionally returned an
  `adt`) has been removed entirely in favor of the new
  `bool ANIM_nla_mapping_allowed(ale)` function that simply returns whether
  nla remapping should be done or not.
- `ANIM_nla_tweakedit_remap(ale, …)` has been added, which wraps
  `BKE_nla_tweakedit_remap(adt, …)` and only performs the remapping when
  `ANIM_nla_mapping_allowed()` indicates that it's allowed.
- `ANIM_nla_mapping_apply_if_needed_fcurve(ale, …)` has been added, which is an
  alternative to `ANIM_nla_mapping_apply_fcurve(adt, …)` that also only performs
  the remapping when `ANIM_nla_mapping_allowed()` indicates that it's allowed.

Note that even with this PR there are still a couple of places remaining that
use `adt = nullptr` to indicate "don't remap", because they appear to be correct
and would require larger changes to make explicit. In those cases comments have
been added to explain the situation, with a reference to this PR.  In the future
we way want to take the time to change those as well.

Also of minor note: this PR moves the definition of the type `slot_handle_t`
from ANIM_action.hh to BKE_action.hh. This is due to `BKE_nla.hh` (which needs
that definition) now being included directly and indirectly in a lot more
places. Moving the definition to BKE_action.hh prevents all of those new places
from gaining dependencies on the animrig module.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/130440
2024-11-21 16:37:13 +01:00
YimingWu
3dd4642db0 Fix #130570: Use full opacity when temporarily using draw tool from fill tool
If draw tool is invoked temporarily from the fill bucket tool, grease pencil
should not take pen pressure into account and should always use solid
fill. This patch does not change the pressure behavior of the draw tool
for fill opacities.

Pull Request: https://projects.blender.org/blender/blender/pulls/130678
2024-11-21 16:16:37 +01:00
Omar Emara
ea767aa242 Refactor: Compositor: Eliminate branching in blur shader 2024-11-21 16:58:55 +02:00
Omar Emara
90fba1aaf4 Fix: Shader compile error in Defocus Blur
A shader compile error due to conflicting function names in two
different included headers. Use the math_vector_lib header to resolve
the issue.
2024-11-21 16:56:59 +02:00
Omar Emara
bb61b6fde9 Compositor: Implement Symmetric Separable Blur Weights for CPU
Reference #125968.
2024-11-21 16:48:27 +02:00
Omar Emara
80a054c15d Compositor: Implement Symmetric Blur Weights for new CPU compositor
Reference #125968.
2024-11-21 16:40:03 +02:00
Omar Emara
715b80e68f Cleanup: Compositor: Refactor blur gamma correction
Avoid condition selection for negative data and use max function
instead.
2024-11-21 16:33:11 +02:00
Omar Emara
afdbef449b Cleanup: Compositor: Remove redundant includes 2024-11-21 16:26:49 +02:00
Omar Emara
0d83aafd4b Compositor: Implement Bilateral Blur for new CPU compositor
Reference #125968.
2024-11-21 16:24:21 +02:00
Omar Emara
8b720eb6ea Compositor: Implement Filter node for new CPU compositor
Reference #125968.
2024-11-21 16:22:43 +02:00
Hans Goudey
c497d5c3fa Refactor: Move quad triangulation function to blenlib
Make this available for a Mesh-based triangulation implementation
implemented elsewhere. Part of #112264.
2024-11-21 08:30:28 -05:00