Commit Graph

143764 Commits

Author SHA1 Message Date
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
Ray Molenkamp
205fba598d CMake: Windows: Fix grammar mistake in last commit
Spotted by the eagle eyed @ThomasDinges
2024-11-21 14:29:28 -07:00
Hans Goudey
fb17e7f1a0 Fix: Incorrect size for writing new short2 attribute type 2024-11-21 15:23:32 -05:00
Ray Molenkamp
aed5906544 CMake: Windows: Update MSVC 17.6 Blacklist message
Given 17.7 has been out for quite while, it doesn't make a
whole lot of sense to still tell people to downgrade their
compiler.
2024-11-21 12:17:01 -07: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
Christoph Lendenfeld
f75ccd9644 Fix #130308: Missing keymap entry for bone eyedropper
Using the `E` hotkey (`I` for industry compatible) was not possible for the bone eyedropper.
This patch just adds that keymap entry for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/130658
2024-11-21 16:48:09 +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
Hans Goudey
c17b546dac Tests: Add two new geometry nodes triangulate test files 2024-11-21 10:27:48 -05: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
YimingWu
d37a855973 Fix #130569: Grease Pencil tint modifier should use gradient alpha
Grease pencil tint modifier in gradient mode did not do alpha mix with
the original stroke color, making original color completely black even
when gradient color has alpha. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130575
2024-11-21 13:42:02 +01:00
Miguel Pozo
0df7cf4be8 Fix: Overlay-Next: Disable background images on selection
They can't be selected, and default_fb is invalid in selection mode, which causes null dereferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/130627
2024-11-21 12:19:11 +01:00
Sergey Sharybin
c533a7b008 Fix: make_bpy_wheel.py is incompatible with Python 3.9
Buildbot uses Python 3.9, so it needs to be supported.

Arguably, the system-wide Python 3.6 needs to be supported to, but
it is a bit more tricky change, and is not a stopper for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/130664
2024-11-21 11:48:43 +01:00
Jeroen Bakker
5665a9d712 Fix #130555: Vulkan: Crash when using legacy gpu API
Add-ons can still use the legacy API that only works on OpenGL. Vulkan
however was crashing as there is no shader create info available.

Adding a pre-check when finalizing shaders on availability of shader
create info.

Pull Request: https://projects.blender.org/blender/blender/pulls/130660
2024-11-21 11:14:11 +01:00
Sebastian Parborg
1d1811c54b CMake: Linux/Mac: Fix CMP0177 policy warnings
Follow up to: 536937b4d4

Pull Request: https://projects.blender.org/blender/blender/pulls/130602
2024-11-21 11:07:08 +01:00
Julien Duroure
dbc8b29519 glTF: Draco: Fix #130545 - Windows Draco dll was not in right directory
This is a regression by a0f653c002

Pull Request: https://projects.blender.org/blender/blender/pulls/130572
2024-11-21 10:29:20 +01:00
Sergey Sharybin
f0e098cbfb Tools: Add cleaner of bpy install folder for wheel
The goal of this cleaner is to replace all libraries that are symbolic
link with a regular files, and remove all library files that are not
actually used.

This circumvents the situation when wheel packing converts symbolic
links (libraries with ABI in their names) to regular files due to the
limitation of the zip archives. Doing a manual cleanup pass allows to
run regression tests after the cleanup is done. It is implemented as
as standalone tool so that it can be invoked when it is really needed.

In practice this lowers Linux bpy wheel file size from 540 MB down to
around 362 MB.

Pull Request: https://projects.blender.org/blender/blender/pulls/130623
2024-11-21 09:53:36 +01:00
Aras Pranckevicius
ff129ff5f9 UI: Tweak VSE Text Strip UI to use panels for outline/shadow/box
The amount of settings in the text strip UI is quite large now; use collapsible (and closed by default) panels for outline/shadow/box options.

Images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/130449
2024-11-21 09:45:04 +01:00
Philipp Oeser
ba92a25e1c Fix: Crash renaming modifier in Outliner and then toggling a property
If a modifier gets renamed elsewhere (through the UI in the Properties
Editor, python, ...) this ends up calling `rna_Modifier_name_update` --
which went fine because it does the neccessary depsgraph relations
update.

Doing the same from the Outliner missed that which then lead to crashes
in depsgraph modifier evaluation.

To resolve, add a case for `TSE_MODIFIER` in the Outliners
`namebutton_fn` that adds the required depsgraph relations update.

Also adds an appropriate notifier, so the name changes appear
immediately elsewhere in the UI.

Fixes #130536

Pull Request: https://projects.blender.org/blender/blender/pulls/130587
2024-11-21 09:31:49 +01:00
Omar Emara
15cdeae620 Fix: Compile error in Despeckle node for Metal
We can't use the `threshold` uniform name in Metal because it is used as
a local variable in one of the library files, because uniforms are
defines in Metal, so it causes an error. Change the name to
`color_threshold` as a fix.
2024-11-21 09:37:44 +02:00
Jesse Yurkovich
2c3397aa51 Cleanup: replace the removed std::shared_ptr::unique API in C++20
C++20 removes the `std::shared_ptr::unique()` API with the suggestion to
use the `use_count()` method instead.

Note that we are using the unique/use_count APIs in a way that is
generally cautioned against though our usage patterns may be fine.

See: https://en.cppreference.com/w/cpp/memory/shared_ptr/unique
Example errors: https://godbolt.org/z/1j3zzd1hP

Ref #125881
2024-11-21 05:09:35 +01:00
Jesse Yurkovich
39e96d9c0f Fix #130155: Handle opacityThreshold controlled with individual image channels
When EEVEE next removed the Alpha Threshold option a node graph setup
was used instead. Based on a USD test asset[1] the original code was
designed around only using the Image A channel during import to wire
up the nodes. However, the other channels (R, G, or B) are just as
valid.

We now handle this by wiring up the Separate RGB node, that is already
inserted for the scenario in general, to the shader nodes handling the
threshold calculation. Also adds additional test coverage for both
export and import as well.

The Round and LessThan+OneMinus networks remain the only shapes that
will be recognized for the processing.

[1] https://github.com/usd-wg/assets/tree/main/test_assets/AlphaBlendModeTest

Pull Request: https://projects.blender.org/blender/blender/pulls/130346
2024-11-21 03:50:11 +01:00