Commit Graph

109278 Commits

Author SHA1 Message Date
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
Hans Goudey
e6ccff1044 Cleanup: Use fmt instead of stringstream for node tooltips 2024-05-09 09:35:02 -04:00
Hans Goudey
be0b08f6f8 Fix #121621: Memory leak with new node description
Error in 6176e66636
The description wasn't copied to new node trees, and it wasn't freed.
2024-05-09 09:35:02 -04:00
Clément Foucault
c988b4a9cf EEVEE-Next: Shadow: Remove sun shadow trace distance
This has no effect anymore after #121616.
2024-05-09 13:58:24 +02:00
Clément Foucault
1c97e97aef EEVEE-Next: Shadow: Use atan_fast instead of atan 2024-05-09 13:58:24 +02:00
YimingWu
8e39b2d095 Fix #121412: Use even frame dimension for proxy
ffmpeg h.264 proxy requires frame dimension to be an even number,
previously the proxy building process didn't respect this, which will
cause proxy builidng failure. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121460
2024-05-09 13:49:35 +02:00
Pratik Borhade
71157c998a Fix #121257: Only insert available not working for VSE transform
It is possible to exit early from `autokeyframe_property` when fcurve
is nullptr and `only_if_property_keyed` boolean is true. Pass status of
`AUTOKEY_FLAG_INSERTAVAILABLE` instead of "false" to only add keys in
existing channels when "only insert available" is enabled in
preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/121299
2024-05-09 13:39:18 +02:00
Clément Foucault
b1c9be51b3 EEVEE-Next: Compute maximum safe trace distance for sun shadow
We only trace in a radius of 1 tile. This removes the
need for a dedicated distance parameter for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/121616
2024-05-09 13:38:15 +02:00
Clément Foucault
86a2664246 Fix: EEVEE-Next: Sun shadows incorrectly sharp
The cone sampling function was broken.
2024-05-09 12:46:30 +02:00
Clément Foucault
b02ccbca9b DRW: Fix drw_print on metal
Metal doesn't use the same Y direction for the
point coordinate. Since this is only used for this
shader, do a local fix.
2024-05-09 12:46:29 +02:00
Clément Foucault
732d0c56df GPU: Add atan_fast 2024-05-09 12:33:13 +02:00
Clément Foucault
94a83bcf04 EEVEE-Next: Make Specular BSDF work
This removes the ambient occlusion socket as this
have no use in EEVEE-Next.

Add correct material flags for noiseless clear coat
and fix transparency.
2024-05-09 11:59:27 +02:00
Jason Fielder
e97e06ea2c Metal: Re-enable loadstore config for EEVEE Next framebuffer
A previous PR resolved the loadstore config setup on bind, so
we can now re-enable load-store config with clearing of the
header texture via render pass.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121610
2024-05-09 11:27:37 +02:00
Omar Emara
b42e973320 Cleanup: Clarify Fog Glow Glare code 2024-05-09 11:44:21 +03:00
Campbell Barton
742a8b47cd PyAPI: expose the popup region in the context
Expose the region used for a temporary popup to the context so it's
possible for scripts to access the popup-region they're being drawn in.

Note that the internal naming is currently "menu" which is misleading
as these are used for all kinds of dialogs & popups. The RNA member is
called `region_popup` in this commit,
we could consider changing the name internally too.

Needed so it's possible for scripts to access the splash screen
so it can be refreshed, see: #120612.
2024-05-09 12:56:43 +10:00
Campbell Barton
fa27d2fe65 PyAPI: expose Region.tag_refresh_ui
Expose ED_region_tag_refresh_ui to the Python API.
This allows scripts to trigger regions to refresh which was previously
only accessible indirectly (via wmOperatorType::check).

Needed so scripts can make the splash screen refresh using a timer,
see #120612.
2024-05-09 12:50:09 +10:00
Campbell Barton
cdc0d422a0 Cleanup: use capitalized type names for RNA callbacks
Follow surrounding code by capitalizing the type prefix of callbacks.
2024-05-09 12:23:58 +10:00
Campbell Barton
9e481b484e Cleanup: don't use boolean literals to set flag members
This could be renamed as it reads like a boolean but is a flag.
2024-05-09 12:11:46 +10:00
Campbell Barton
38d11482f5 UI: set the context's menu on creation
Set the context menu when first creating the popup,
not only when refreshing it.

Previously `Context::wm::menu` was set when a popups draw function ran
after being tagged RGN_REFRESH_UI, however the first time the draw
function ran this would be null. Ensure this is set in both cases
so logic that requires accessing the popup region can rely on it
being set.

Needed so the splash region is always accessible to implement #120612.
2024-05-09 12:03:21 +10:00
Ahmed Essam
0ca1386426 Fix assert in debug mode when built as Python module
Ref: !121500
2024-05-09 09:51:11 +10:00
Harley Acheson
03cd8b359b UI: Edge Slide Status Display
While using Edge Slide show only changing values in the area header and
only keymap entries on the Status Bar

Pull Request: https://projects.blender.org/blender/blender/pulls/121585
2024-05-09 00:06:31 +02:00
Jacques Lucke
4dfc1ede58 Geometry Nodes: output transform matrix from object info node
This adds a new `Transform` output socket of matrix type to the Object Info node.

This is clearly useful, but we did not do this before for a couple of reasons:
* It's redundant with the location, rotation and scale outputs.
* We might want separate `Object Transform` and `Object Geometry` nodes.

For now just adding the socket is probably useful enough to justify it. Even more
so because it's addition doesn't really block other designs in the future either.

Pull Request: https://projects.blender.org/blender/blender/pulls/121437
2024-05-08 22:03:09 +02:00