Commit Graph

120055 Commits

Author SHA1 Message Date
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
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
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
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
Harley Acheson
7c81ec922c UI: Calm Warning in #130617 About Variable Mismatch
Fix compiler warning about variable mismatch (int versus uint) in
commit bc5fcbe1c3.

Pull Request: https://projects.blender.org/blender/blender/pulls/130633
2024-11-20 22:58:43 +01:00
Jesse Yurkovich
2523958e0e USD: Add support for animated point instancers
The existing point instancer reader is slightly refactored to allow for
animated setups. The primary change is simply to inherit from
`USDGeomReader` rather than `USDXformReader`. This allows access to the
`read_geometry` API used by the cache modifier.

The existing `read_object_data` method is split into two parts with
`read_geometry` loading per-frame USD data and `read_object_data`
coordinating the initial loading process, including creating the GN node
tree just once.

A new test has been added (a variation of the nested point instancer
file) with time samples on various attributes and on both point
instancers. This also fixes #129502 and the file provided in that issue.

----
The already added test file is `tests/data/usd/usd_point_instancer_anim.usda`

Pull Request: https://projects.blender.org/blender/blender/pulls/129881
2024-11-20 22:03:32 +01:00
Harley Acheson
8bcb714b9e UI: Face Orientation Front Color Transparent
This PR changes the default theme color for TH_FACE_FRONT, used by the
Face Orientation overlay, to have zero alpha. That way, by default, it
can be used always and not interfere with the display of (normal) front
faces.

Pull Request: https://projects.blender.org/blender/blender/pulls/130618
2024-11-20 21:39:40 +01:00
Sean Kim
94fda917de Cleanup: Avoid comparing bool to int value
Pull Request: https://projects.blender.org/blender/blender/pulls/130483
2024-11-20 20:48:42 +01:00
Sean Kim
9945d511a9 Fix #130548: Crash on selecting brush tool in older blender version file
This commit adds extra filtering when applying versioning code to older
files to support the Image Editor paint brushes with brush assets.

Previously, the versioning code updated all of the View3D space tools
that used a paint context to have a specific hardcoded tool name - this
unfortunately misses the default startup.blend Texture Paint brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/130560
2024-11-20 20:34:02 +01:00
Harley Acheson
bc5fcbe1c3 UI: Notification When Hiding Objects
This shows a "2 object(s) hidden" notification on the status bar when
hiding objects, the same as we do when deleting objects.  Pressing "H"
can be done accidentally so this is at least some indication of what
happened, both on the status bar in Info Editor. Obviously does nothing
if nothing is selected when you press "H"

Pull Request: https://projects.blender.org/blender/blender/pulls/130617
2024-11-20 20:10:51 +01:00
Clément Foucault
32696991f1 Fix: Overlay-Next: Armature custom shapes have no anti-aliasing
The uniform value was not set properly.
2024-11-20 19:24:16 +01:00
Miguel Pozo
03909f2691 Fix: Overlay-Next: Images
Several fixes for Camera and Empty images.

Pull Request: https://projects.blender.org/blender/blender/pulls/130345
2024-11-20 19:05:22 +01:00
Harley Acheson
f339ab4325 UI: Minimum Docking Target Size
When dragging an area to a new location, current code limits the size
of the target area to AREAMINX and HEADERY, which is the minimum sizes
that an area can occupy. This is too small and results in frustration
for some users. When moving an existing area you are unlikely to want
it to be an unusable size. This PR makes the minimum target size 3X
wider. If an area is not large enough to be bisected into two such
areas then it won't be offered as a docking target in that orientation.

Pull Request: https://projects.blender.org/blender/blender/pulls/130546
2024-11-20 19:02:42 +01:00
Harley Acheson
09e6bab7bc UI: Changes to Docking Operation Descriptions
Changes to the text descriptions shown when dragging an area to a new
location. "Split Area" -> "Move area here", "Replace Area" -> "Replace
this area".  Removes some confusion regarding "split" since we normally
use that word for a different operation. The "this" and "here" help to
remove ambiguation with the word "area" (source or target).

Pull Request: https://projects.blender.org/blender/blender/pulls/130554
2024-11-20 18:27:29 +01:00
Clément Foucault
29356e2bf7 Fix: Overlay-Next: Loose edges is drawn with less intensity when selected
This was caused by the fresnel effect darkening the selection
color when there was no normal attribute available.
Now default to no darkening when no attribute is available.
2024-11-20 18:25:59 +01:00
Clément Foucault
b35fdac069 Fix: Overlay-Next: Broken light cone display
The depth test was not set correctly for the front pass.
The shader was writting to the antialiasing buffer. Using
a dedicated shader avoid breaking the renderpass to bind
another framebuffer.
2024-11-20 17:35:18 +01:00
Clément Foucault
2b72bc142c Fix: Overlay-Next: Armature custom shapes have no anti-aliasing
Blend state was incorrect for shape wires.
2024-11-20 17:04:38 +01:00
Clément Foucault
b6ba86d3e2 Fix: Overlay-Next: Stipple pattern difference
Was caused by reversed order of provoking vertex.
2024-11-20 16:23:23 +01:00
Clément Foucault
cc85ac20bd Fix: Overlay-Next: Wireframe always drawn in sculpt mode 2024-11-20 16:07:27 +01:00
Clément Foucault
1e7e776b34 Fix: Overlay-Next: Broken edit mode on some Nvidia GPU / drivers
One of the framebuffer output was not written to.
2024-11-20 16:04:01 +01:00
Bastien Montagne
406e93525f Fix #130535: Name of Object not updated in viewport when name clashes.
Now that another ID can be renamed (again), it also needs to be properly
tagged as needing resync in the depsgraph too.

This commit:
* Moves/add depsgraph tagging to `BKE_id_rename`.
* Moves the WM notifier creation to `ED_id_rename`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130596
2024-11-20 15:24:46 +01:00
Omar Emara
e49498a795 Compositor: Implement Classic Kuwahara for new CPU compositor
Reference #125968.
2024-11-20 16:15:49 +02:00
Omar Emara
71e971700c Compositor: Implement Summed Area Table for new CPU compositor
Reference #125968.
2024-11-20 15:57:39 +02:00
Omar Emara
f4767bea72 Compositor: Implement Pixelate for new CPU compositor
Reference #125968.
2024-11-20 15:56:21 +02:00
Omar Emara
11a5e362d4 Compositor: Implement Denoise for new CPU compositor
Reference #125968.
2024-11-20 15:55:33 +02:00
Omar Emara
5e806db594 Compositor: Implement Despeckle for new CPU compositor
Reference #125968.
2024-11-20 15:53:28 +02:00
Omar Emara
e5352b11da Cleanup: Use is_equal method in Despeckle node 2024-11-20 15:52:17 +02:00
Omar Emara
5036c5338b Compositor: Implement Sun Beams for new CPU compositor
Reference #125968.
2024-11-20 15:51:30 +02:00
Clément Foucault
c365f08b39 Fix #130467!: Overlay-Next: Selection overlay missing GP vertex paint mode
It was unimplemented feature.
2024-11-20 14:41:34 +01:00