Commit Graph

109299 Commits

Author SHA1 Message Date
Richard Antalik
d1bad9ddfe Fix #120709: VSE retiming depends on Strip start frame
Caused by using timeline frame instead of frame index as argument for
`seq_retiming_evaluate()` in `claculate_speed_table_from_seq()`.
This bug only affected speed transitions in sound strips.

`RetimingRangeData` also incorrectly interpreted segment type after
transition end, which would not cause issues, but was incorrect.
2024-05-10 20:20:06 +02:00
Clément Foucault
bbde7cdcb6 EEVEE-Next: Limit cost of transmission evaluation
This uses specialization constants to compile
optimized deferred lighting shader for when
transmission is not needed.
2024-05-10 20:01:22 +02:00
Clément Foucault
5b903c8624 Cleanup: EEVEE-Next: Use shadow renderpass id instead of boolean
for specialization constant. This is supported by all backends
now.
2024-05-10 19:18:30 +02:00
Jason Fielder
aa994f3cba EEVEE Next: Optimize closure light stack array access
This PR ensures the ClosureLightStack is only accessed
with constant indices. This reduces compiler spill and allows
furhter constant folding, improving the deferred lighting
evaluation performance by 30%.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121124
2024-05-10 19:13:46 +02:00
Aras Pranckevicius
008483fe8a Cleanup: Remove non-working channels parameter of BLF_buffer
BLF_buffer was trying to accept "how many colors channels in output
image?" argument and doing math with it, but in the lowest level code
was always writing out full 4 channels for each pixel.

All the call sites would ever call it with argument of 4 however, and
that is why no one noticed the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/121630
2024-05-10 18:54:53 +02:00
Falk David
30e3f14bcd GPv3: Remove Groups
This implements removing of groups and adds an operator
`GREASE_PENCIL_OT_layer_group_remove`.

Groups can be removed in two ways:
 * Remove the group and keep the children.
 * Remove the group together with all its children.

Based on an earlier attempt by @PratikPB2123 here: !121611

Pull Request: https://projects.blender.org/blender/blender/pulls/121663
2024-05-10 18:39:51 +02:00
Pratik Borhade
9b5f0cb8a2 GPv3: Drag & drop for layer groups
New drag type `WM_DRAG_GREASE_PENCIL_GROUP` introduced for layer group nodes.
Replaced layer struct with `GreasePencilLayerTreeNode` in `wmDragGreasePencilLayer`
so group node can be stored while dragging in `wmdrag->poin`.

Using `can_drop()`, drop operation of layer group node returns `false`
if the target node is its child.

Part of #121390.

Pull Request: https://projects.blender.org/blender/blender/pulls/121654
2024-05-10 18:18:03 +02:00
Sergey Sharybin
7b4232e8aa Compositor: Move Execution Mode and Precision from bNodeTree to Scene
This allows to expose these settings in the Performance panel in the
render buttons. Also moves compositor-specific options away from the
generic node tree structure.

For the backwards-compatibility the options are still present in the
DNA for the bNodeTree. This is to minimize the impact on the Studio
which has used the GPU compositor for a while now. They can be
removed in a future release.

There is no functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/121583
2024-05-10 18:08:33 +02:00
Aras Pranckevicius
52de90d06b Cleanup: redundant namespace, naming, span instead of array ref 2024-05-10 19:07:53 +03:00
Falk David
de037ce3b5 GPv3: Add API functions for active group
This adds the functions `has_active_group` and `get_active_group`,
similar to the `has_active_layer` and `get_active_layer` ones.

Also refactors some of the code to use these new functions instead.
2024-05-10 17:57:54 +02:00
Aras Pranckevicius
a17ce1a1b4 VSE: Optimize text shadow blur / outline options
PR #121478 added options for blurred shadows and text outline for text strips.
However since text strips produce an image that is size of the "whole screen",
applying large blurs or wide outline on that is quite costly.

Make both blur and outline calculations only be performed on the text bounds
(offset and expanded as needed to take into account blur/outline width).

On Windows/VS2022/Ryzen5950X machine, with 4K VSE resolution, and text strip
that takes about 900x400 pixels on screen, applying blur 0.4 and outline 0.25,
time to render the text strip goes from 470ms down to 35ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/121644
2024-05-10 17:57:20 +02:00
Clément Foucault
994646f172 Fix: EEVEE-Next: Lingering shadows after shader compilation
This was fixed for transparent issues but still persisted for
volumes and displacement materials.
2024-05-10 17:49:34 +02:00
Aras Pranckevicius
ddc423b81c VSE: Make strip translate/grab tool round resulting position
Make the preview window translate/grab too round the resulting strip positions
to integer pixels. Resulting strip will more often end up using faster
interpolation (without bilinear), and avoids "text edges are too dark"
artifacts with light text strips on light backgrounds.
The latter happens because bilinear filtering does not do full alpha
premultiplication, so a text strip pixel that is just outside the glyph ends up
being (0,0,0,0) which under bilinear filtering sneaks in a dark color into the
glyph edge.

Example images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/121652
2024-05-10 17:46:04 +02:00
Nathan Vegdahl
58cf1a7c44 Refactor: centralize responsibility for "Only Insert Needed"
This moves the responsibility for handling the "Only Insert Needed"
flag from `insert_keyframe_value()` to the lower-level function
`insert_vert_fcurve()`.

We're doing this because `insert_vert_fcurve()` is the common entry
point between the new animation system's and old animation system's
keyframing code. This therefore ensures that both systems will
behave the same way with respect to the "Only Insert Needed" flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/121525
2024-05-10 17:11:19 +02:00
Christoph Lendenfeld
eee32726c7 Fix #121349: Baking adds keys on custom properties that are non-keyable
When keying custom properties that are defined by an addon,
you can't use square brackets. The GUI buttons already reflect that.
The baking code and the keyframe insertion code didn't respect
that and so were able to key properties that are defined as non-keyable.

## Solutions
I've solved the issue on the C++ side by resolving
the path twice, once without and in case that didn't work the
second time with brackets. While that does solve the issue
this feels really dirty and I feel like I am misusing the system here.
**However it is absolutely needed**.
When resolving a path with brackets to a property defined
by an addon, you get an `IDProperty` disguised as a `PropertyRNA`
which will not have the correct flags set.

By checking if a property `is_animatable` in python, all that do not have that can be skipped.
Also making sure the path is passed without brackets in the correct cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/121520
2024-05-10 17:03:52 +02:00
Nathan Vegdahl
fa201712e1 Anim: simplify object/pose autokeying code
Both `autokeyframe_object()` and `autokeyframe_pose_channel()` had an
odd structure where they would call completely different keying
functions depending on whether "Only Insert Available" was toggled on
or not. This not only overcomplicated the code, but also introduced
the possibility for divergent keyframing behavior depending on whether
that flag was set or not, beyond the intended effect of the flag.

This commit changes both functions to call the same keyframing function
(which already handles that flag correctly on its own) regardless of
whether that flag is set or not, unifying the keyframing behavior and
simplifying the code.

As a happy side effect, auto-keyframing failures are now reported even
when "Only Insert Available" is disabled, which wasn't the case before.
(An example of the aforementioned unintentional divergent behavior.)

Pull Request: https://projects.blender.org/blender/blender/pulls/121476
2024-05-10 17:00:03 +02:00
Nathan Vegdahl
44d020771d Anim: include "Only Key Available" in derived auto-keying flags
The flag for "Only Key Available" was weirdly omitted from the flags
returned by `get_autokey_flags()`, always being set to false. This
happens to be okay at the places the function is currently used, but
it is unexpected and a likely footgun for future changes to the code
that uses it.
2024-05-10 16:59:57 +02:00
Bastien Montagne
71d92735bf Refactor: Call same 'after_setup' versioning code for linking as for blendfile reading.
While `do_versions_after_setup` does more than what was previously done
by link/append code (essentially also handles pre-2.50 IPO and sound
proxy conversions), there is no real fundamental reasons to not use it
in linking code.

The IPO and sound proxy conversion codes are likely fully broken for
linked data - but they should then be removed or fixed, since they will
be applied on linked data in blendfile reading case anyway.

And in general, versioning should 'just work' the same when loading a
whole blendfile, or linking some data from a library. Keeping things
separate only makes it harder to work with, and easier to hide issues
with linked data.
2024-05-10 16:00:30 +02:00
Bastien Montagne
d1a5cdfe2c Refactor: BKE_blendfile_link: move link-only code into own function.
While `BKE_blendfile_link` is used in both cases, there is a small
subset of its code only executed in linking case. It now lives into its
own util function, for clarity.

There should be absolutely no functional change in this commit.
2024-05-10 16:00:30 +02:00
Bastien Montagne
401cd2b7a7 Fix (unreported) inverted usage of NDEBUG define in readfile code.
`blo_filedata_free` was doing debug checks in release builds, and
simpler/faster freeing in debug builds.
2024-05-10 16:00:30 +02:00
Bastien Montagne
a6153bb7d5 Fix (unreported) crash when linking data from other endianness files.
Handling of the blendfile handle freeing when linking data from a
blendfile requiring endianness conversion was totally broken, leading
to double-freeing attempts.

Guess that the fact that this was never reported shows how rare
'big-endian' blendfiles are nowadays... But we still have a few in our
test repo.
2024-05-10 16:00:30 +02:00
Sybren A. Stüvel
45bf2eae98 Refactor: Anim: simplify ANIM_remove_driver()
Simplify `ANIM_remove_driver()` by removing unused parameters and handling
simple cases first.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/121655
2024-05-10 15:43:31 +02:00
Jeroen Bakker
40f2df1a81 Vulkan: Render graph clear attachments
Adds support for clear attachments to the render graph.
Clearing attachments require that the command buffer is
being set for rendering (vkCmdBeginRendering).

**What works**

- Clear attachments are working with dynamic rendering and the render graph
- `GPUVulkanTest.framebuffer_clear_color_single_attachment`
- `GPUVulkanTest.framebuffer_clear_color_multiple_attachments`
- `GPUVulkanTest.framebuffer_clear_multiple_color_multiple_attachments`
- `GPUVulkanTest.framebuffer_scissor_test`
- `GPUVulkanTest.framebuffer_clear_depth`

**What still needs to be addressed**

When a command buffer is rendering it cannot do any pipeline
barriers. For clearing attachments this isn't needed, but when
we address drawing we might need to register drawing resource
dependencies to the dependency list of the begin rendering node.
This will be solved when drawing will be implemented. [#121648]

The begin rendering node is large as it has to store data for
framebuffers with 8 color attachments as well. This might
become an overhead and we could solve this by splicing the
data of larger nodes into 2 lists. This will be addressed
after we are able to draw a screen so we can collect data
on this topic. [#121649]

Pull Request: https://projects.blender.org/blender/blender/pulls/121073
2024-05-10 15:39:56 +02:00
Guillermo Venegas
4b2f1b2829 Fix: allow panel drag-collapse in popovers and fix uiBut event handling
Sets missing context menu region in popovers that is required to handle drag collapse
event.

Also fix layout panel header but events handling.

| Main | Fix |
| -------- | -------- |
| <video src="/attachments/03409a9f-751d-4b4c-b464-d62a65b9b477" title="2024-05-08 12-21-14.mp4" controls></video>     | <video src="/attachments/a50be151-8d5e-485d-bc47-3e2c7292c063" title="2024-05-08 12-18-08.mp4" controls></video>     |

Pull Request: https://projects.blender.org/blender/blender/pulls/121594
2024-05-10 14:25:26 +02:00
Jacques Lucke
f920d05820 Cleanup: don't require socket items to store socket type
This change helps when the socket type is not stored explicitly,
but is e.g. derived from a custom data type like `CD_PROP_FLOAT`.
2024-05-10 14:22:15 +02:00
Falk David
2fb752b168 Refactor: GPv3: Return 0 from get_frame_duration_at for implicitly held frames
This function returned the duration in frames for a keyframe, but
for keyframes that are implicitly held until the next keyframe,
it makes more sense to return 0.
For `insert_frame` a duration of 0 also creates an implicit hold
so this is more consistent with this API and removes a few checks
elsewhere.
2024-05-10 13:36:20 +02:00
Falk David
8056a31a7e Cleanup: GPv3: Change order of constructors 2024-05-10 13:36:20 +02:00
Clément Foucault
07e78f613b DRW: Avoid rendering objects with invalid bounds in disabled views
Fix #114752
2024-05-10 13:03:05 +02:00
Jeroen Bakker
f01e84e3a5 EEVEE-Next: Add operator to convert a world volume to mesh
EEVEE-Next world volume are infinite like Cycles. EEVEE-Classic world volumes
end at the clip_end of the camera/viewport. This can lead to confusion as
it would render different then expected.

This PR adds an operator to convert a world volume into a mesh volume. The
operator can be found in the shader editor (world mode) and in the properties
panel/World/Volume.

**Why an operator?**

As this alters the content of the scene we want the artist to be in control of
the conversion. Doing it automatic lead to a lot of complexity and cases that
might not be expected by the user.

Pull Request: https://projects.blender.org/blender/blender/pulls/119734
2024-05-10 12:42:17 +02:00
Clément Foucault
5a76ba9892 Fix: EEVEE-Next: Wrong thickness for Hybrid material
The thickness was evaluated after the surface nodetree.
So the effective thickness for shader to RGB BSDFs was
undefined.

Fix #120791
2024-05-10 12:27:53 +02:00
Pratik Borhade
10c677ba91 GPv3: Group node selection undo debug crash
Debug crash when undoing the selection of layer group. `active_node`
points to garbage memory in this case.
In release mode, undo does not select the group due to missing
`should_be_active`.

Noticed this during !121611

Pull Request: https://projects.blender.org/blender/blender/pulls/121615
2024-05-10 12:02:26 +02:00
Christoph Lendenfeld
b7e93982a7 Fix: Crash on pose propagate with FCurves that are sampled
The code didn't check if the `bezt` property on `FCurve`s is `null`,
which it can be when it has been turned into samples.

Also fix an out of bounds error on `bezt` access

Pull Request: https://projects.blender.org/blender/blender/pulls/121650
2024-05-10 11:45:39 +02:00
Nathan Vegdahl
05bdd6bf34 Cleanup: use "EXPECT" instead of "ASSERT", and rewrap a failure message
I missed some review comments in #120428 that were relevant to the
split-off PR #121517 that recently landed, so am addressing those
comments now as a separate commit:

- Some of the test cases were unnecessarily using ASSERT, and are
  better expressed with EXPECT.
- One of the test-case failure messages needed to be re-wrapped.

Pull Request: https://projects.blender.org/blender/blender/pulls/121528
2024-05-10 11:19:03 +02:00
Jeroen Bakker
ac005ba20e Vulkan: Add dynamic rendering to command buffer API
This PR adds the dynamic rendering function to the command buffer
API.

Pull Request: https://projects.blender.org/blender/blender/pulls/121645
2024-05-10 10:32:55 +02:00
Jeroen Bakker
2f05a24457 Vulkan: Determine image layout from resource access
Currently the image layout was fixed when creating pipeline barriers.
This PR determined the image layout an image is in based on its access
mask.

This extends the usage of the render graph and its pipeline barrier
generation for render attachments. In future it can be extended to
support other layouts.

Pull Request: https://projects.blender.org/blender/blender/pulls/121646
2024-05-10 10:28:02 +02:00
Jeroen Bakker
6ad541c6b9 Cleanup: Remove debug code
Pull Request: https://projects.blender.org/blender/blender/pulls/121643
2024-05-10 10:23:39 +02:00
Jeroen Bakker
79dfe8d37f Vulkan: Enable device feature dynamic rendering
In the near future the legacy framebuffer/renderpass/pipeline drawing
will be replaced by dynamic rendering. Dynamic rendering provide a
flexible API to reuse pipelines between framebuffers if they share
the same image formats.

Dynamic rendering is provided by `VK_KHR_dynamic_rendering` extension
and is supported by all platforms we support (Intel since HD4000, NVIDIA
since 700, AMD since GCN2 and llvmpipe).

Functions provided by extensions are loaded in a struct inside
`VKDevice`.

Pull Request: https://projects.blender.org/blender/blender/pulls/121642
2024-05-10 10:22:58 +02:00
Campbell Barton
7ae77e61cd Cleanup: assert that popup regions are temporary 2024-05-10 11:31:31 +10:00
Campbell Barton
bc5b77b390 Cleanup: rename Context::wm::menu to popup_region
The term "menu" was misleading as this is used for all temporary popups.
2024-05-10 11:27:03 +10:00
Campbell Barton
0196c6330d Cleanup: unused variables 2024-05-10 09:30:45 +10:00
Jesse Yurkovich
b773eca1b5 IO: Use panels for Alembic, OBJ, PLY, and STL
Instead of using "box" layouts for these import/export operators, use
panels instead.

Motivation for doing so is two fold.

Firstly the use of panels instead of boxes is more consistent with other
parts of Blender and with other IO addons implemented in Python (FBX,
glTF, 3ds, etc.)

Secondly, in the case of an Import invoked from drag-n-drop or Export
configured on a Collection, the large number of options often exposed
results in very long layouts. Panels allow us to close some sections by
default and allows the user to open/close panels based on their own
needs in general.

Along the way some effort went into standardizing the layout and wording
used as much as possible.

USD is a bigger change and requires some additional coordination. It
will be submitted and reviewed separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/121557
2024-05-09 22:27:03 +02:00
Jesse Yurkovich
d089b5e6ad Fix #121432: Rework collection exporter UI to prevent panel id collisions
When exporters use layout panels, it was possible for their panel ids to
conflict if more than 1 of the same exporter was configured on the same
collection. The result would be that opening/closing a panel in one
exporter would open/close it for all other exporters of the same type.

This fix changes the layout to avoid the issue entirely by using a list
and only having only one exporter drawn at a time.

A few alternate designs were considered but they would either cause
intrusive changes to each location where a layout panel was used or
would result in tricky disambiguation code inside the UI system itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/121555
2024-05-09 22:25:46 +02:00
Jacques Lucke
9fcf97d978 Geometry Nodes: support matrix in Transform Geometry node
Now the Transform Geometry node either has individual components (location,
rotation and scale) or a matrix as input. In many cases that is just more
convenient when working with matrices. Often this is identical to splitting
the matrix into it's individual components. However, if the matrix contains
shearing, information is lost when splitting it into individual components.

Pull Request: https://projects.blender.org/blender/blender/pulls/121438
2024-05-09 21:34:11 +02:00
Sean Kim
675d429597 Fix #121546: Ensure face set exists before trim operation
This PR ensures that the .sculpt_face_set attribute is created on the
mesh before a Trim operation is applied to it in Sculpt Mode.

Pull Request: #121604
2024-05-09 21:22:33 +02:00
Miguel Pozo
a7ff3ebad1 Fix: GPU: GPUColorBandBuilder memory leak 2024-05-09 19:38:22 +02:00
Clément Foucault
6efb69a5fe EEVEE-Next: Fixing shifted blur for non constant Shutter Curve
The function `cdf_invert` was not doing linear interpolation
between the correct values. This fixes the issue and
make sure that `x` is never perfectly 0 nor 1.

Fixes #117755
2024-05-09 19:20:10 +02:00
Hans Goudey
41a1a0db63 Cleanup: Use return value instead of argument for attribute domain info 2024-05-09 10:21:46 -04:00
Hans Goudey
46e44b6279 Cleanup: Use Span method instead of array macro 2024-05-09 10:13:38 -04:00
Hans Goudey
676bcd3e9f Cleanup: Remove unused array utility macros 2024-05-09 10:13:38 -04:00
Jason Fielder
996014e537 EEVEE Next: Disable TILE_COPY shadow update method
Disabling tile_copy method for shadow update for
stability in scenes with large geometry counts
which may exceed parameter buffer size.

This pass can be re-used in future if the workload
distribution for shadow updates is changed to
better suit this method.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121623
2024-05-09 15:50:53 +02:00