Commit Graph

136368 Commits

Author SHA1 Message Date
Lukas Stockner
de2ec32927 Cycles: Add test for small mesh light
This kind of setup has caused numerical issues a few times by now.
2024-05-23 02:59:15 +02:00
Jesse Yurkovich
7930c67a65 USD: Add bezier curve to attributes test file 2024-05-22 17:32:18 -07:00
Lukas Stockner
392b84f879 Fix #114515: Cycles: Numerical precision issues in triangle light sampling
The refactor in 97d9bbbc97 changed the way q is computed in the spherical triangle sampling code. While the new approach is more efficient and saves a few operations, it introduces numerical precision issues for skinny/small (spherical) triangles.

Therefore, this change moves the computation of q back to the method from the paper, while keeping the more efficient solid angle computation.

Pull Request: https://projects.blender.org/blender/blender/pulls/119224
2024-05-23 02:27:48 +02:00
Harley Acheson
79847acd0c Cleanup: Make format
Just formatting changes resulting from Make Format.
2024-05-22 16:43:32 -07:00
Lalit Shankar Chowdhury
b561771f50 Fix #122110: Remove long text selection flickering
Fix flickering when selecting long (scrolled) text from the left.

Pull Request: https://projects.blender.org/blender/blender/pulls/122123
2024-05-23 01:41:56 +02:00
Hans Goudey
7be5802187 Cleanup: Remove outdated comment
Pull Request: https://projects.blender.org/blender/blender/pulls/122122
2024-05-22 23:27:22 +02:00
Hans Goudey
a778e3ddc1 Refactor: Avoid "extractors" abstraction for mesh normals GPU data
Part of #116901.
The only non-obvious part is changing from using the `MR_DATA_LOOP_NOR`
flag as a signal to calculate normals and store them in `MeshRenderData` to
a more explicit check that the normals buffer is requested. In the future hopefully
these dependencies will be refactored to be part of the task graph instead.
2024-05-22 15:40:58 -04:00
Hans Goudey
30ec31b550 Refactor: Tweak mesh render data normals update
Move the responsibility of deciding whether to calculate face corner
normals closer to the buffers and iteration, in preparation for replacing
the `data_flag` and `iter_flag` abstractions from the extractors system.
2024-05-22 15:40:58 -04:00
Hans Goudey
bce210578b Mesh: Replace extractor loop for BMesh normals extraction
Part of #116901. Main benefits to this change are reduced function call
overhead and a simpler hot loop when face corner normals are extracted.
Code duplication is also reduced through use of templates. The downside
is that the access patterns aren't clearly better for the BMesh case where
a lot of data is stored array-of-structs style.
2024-05-22 15:40:58 -04:00
Hans Goudey
99bda7670b Cleanup: Remove unused mesh extractor dependency flag
Mesh triangulation is retrieved with the typical `corner_tris()` lazy
calculation function rather than calculated in a special task now.
2024-05-22 15:40:58 -04:00
Hans Goudey
957c2f3df2 Mesh: Avoid calculating vertex normals for drawing flat-shaded meshes
Make better use of the lazy calculation by avoiding storing a reference
to the calculated normals in the mesh render data. This reduces memory
usage from 282 MB to 225 MB in a test file with about 2 million faces.
2024-05-22 15:40:58 -04:00
Hans Goudey
8d4da6063a Draw: Replace extractor abstraction for mesh positions extraction
Part of #116901. The remaining change was to change the BMesh iteration
to not use the extractor callbacks.
2024-05-22 15:40:57 -04:00
Hans Goudey
556c321500 Cleanup: Rearrange code in in mesh draw position extraction
Extract mesh logic to a separate function, and reorder subdiv loose
geometry extraction function. This is mainly to make a future diff
clearer. Also rename a variable to use more typical naming.
2024-05-22 15:40:57 -04:00
Clément Foucault
9ae4f8a598 Fix: EEVEE-Next: Sun: Incorrect shadow tracing distance
This was happening for any surface behind the near plane.
The sample bias is pushing receivers along normals so it
was visible on lights near the clip plane.

Fix #121815
2024-05-22 20:29:15 +02:00
Brecht Van Lommel
76590ab626 Fix: Memory leak due to asset shelves merge error 2024-05-22 20:13:43 +02:00
Lalit Shankar Chowdhury
374a84e10e Fix #121944: Overlay Text Shadow not disabled after use
Overlay text shadow not turned off after use, which allowed it to be
sometimes seen elsewhere when unintended. Regression was introduced in
commit 92e0545e.

Pull Request: https://projects.blender.org/blender/blender/pulls/121982
2024-05-22 20:00:05 +02:00
Harley Acheson
643f23f4ed Fix #122047: Correct text selection when text is scrolled
Correct calculation of start of visual string and position of the
selection start when the text is scrolled (showing a subset of the
text) within an input box.

Pull Request: https://projects.blender.org/blender/blender/pulls/122110
2024-05-22 19:40:37 +02:00
Clément Foucault
86c56050f1 Fix: EEVEE-Next: Broken sun shadows when baking
The updated light buffer was not updated to GPU after
computing the correct view bounds phase.
2024-05-22 19:29:35 +02:00
Sergey Sharybin
90b9f90ca7 Cleanup: Code style 2024-05-22 19:14:37 +02:00
Richard Antalik
8c53a18c48 Cleanup: Refactor VSE selection tools keymap
Split single keymap definition into timeline and preview as well as LCS
and RCS definitions.

This improves readability of keymap code.

Tweak and Box Select tools will now use "Sequencer Timeline Tool",
or "Sequencer Preview Tool" entries instead of "Sequencer Tool", so
custom keymaps or scripts have to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/121846
2024-05-22 18:46:53 +02:00
Sergey Sharybin
cccc1ea0eb Fix non-thread-safe access to multilayer image in Compositor
Conversion of compositor node tree to operation is done in a job thread,
and the main thread might modify the image data-block at the same time.

This change fixes it by making it so compositor uses acquire/release
semantic for the image data-block, and making it so the image locks its
render result, preventing other threads from modifying it.

Ref #121761

Pull Request: https://projects.blender.org/blender/blender/pulls/122105
2024-05-22 18:15:19 +02:00
Raul Fernandez
304b862d28 Refactor: Split create_index_grids() into 2 separate functions
Refactor subtask of #121929

Simplified void create_index_grids(const PBVH_GPU_Args &args, bool do_coarse)
with 2 extra functions that account for 2 code path generating faces indices.
This increase code readability and reasoning about its behavior instead of having a single uber function.

Pull Request: https://projects.blender.org/blender/blender/pulls/122020
2024-05-22 18:02:01 +02:00
Hans Goudey
07eac30070 Mesh: Points index buffer improvement
A continuation of #116901. This one doesn't have a performance impact
in my testing. It also adds a bit more code compared to main so it isn't
really obviously "better" like the previous refactors. However it does
get us closer to removing the "extractors" callback iteration loop
(`edit_data` is the only other enabled by default), and I'd argue that
the final code is easier to iterate on in the future since it's more
self-contained.

I made an effort to avoid storing restart indices in the index buffers.
Though this requires a bit more calculation on the CPU (particularly
because the hidden gaps in the IBO need to be compressed out), it
reduces overall CPU->GPU traffic and removes the need to strip the
restart indices on Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/122084
2024-05-22 16:08:55 +02:00
Hans Goudey
77822c158e BLI: Add move construction and copy assignment to BitGroupVector
Pull Request: https://projects.blender.org/blender/blender/pulls/122100
2024-05-22 15:28:35 +02:00
Pratik Borhade
dada0c41ee GPv3: Getter and setter for active node
This adds the functions `get_active_node` and `set_active_node`.
It also changes the the parameter of the `set_active_layer` to be
non-const.

Requested in !121970.

Pull Request: https://projects.blender.org/blender/blender/pulls/122006
2024-05-22 15:25:00 +02:00
Brecht Van Lommel
918d34a9ed Fix: Still allow unpacking of editable linked datablocks
Don't do it for unpack all, which is about the local blend file. But for
individual buttons for datablocks it should work.

Ref #122092
2024-05-22 15:04:44 +02:00
Philipp Oeser
c6aa1fec2b Fix: Dont unpack resources that are packed in linked files
These remain linked, so data remains to be read/loaded from the packed
version from the library (making this a useless and wasteful
duplication, also changes could be perceived as lost). Tooltip was also
reading "Unpack all files packed **into this .blend** to external ones",
so that bring it in line with the tooltip.

This came up in #122033

Pull Request: https://projects.blender.org/blender/blender/pulls/122092
2024-05-22 14:50:25 +02:00
Clément Foucault
692af3f9aa Fix: EEVEE-Next: Sampling of ortho sun lights
This was broken when introducing the new lod bias
system. This is not compatible with shadow cascade.

Add TODO to implement the bias on CPU when choosing
the Level of detail of the cascade.
2024-05-22 14:45:19 +02:00
Clément Foucault
74a7099160 Cleanup: EEVEE-Next: Shadow
- Use math API for projection
- Avoid uninitialized value even if unused.
2024-05-22 14:07:28 +02:00
Clément Foucault
c3846ac4f3 Fix: EEVEE-Next: Shadow: Broken sun shadow in orthographic camera
This was caused by `int2 * float` returning a `int2`.
Casting before the operation does the right thing.
2024-05-22 14:07:28 +02:00
Campbell Barton
08df46d7cd Extensions: support token access for remote repositories
This introduce a new "secret" per-repository property of type password
as described by #121856.

A token or secret may be used by some non blender.org repositories.

This only shows for remote repositories and is shown in the
"Add Remote Repository" popup.

This commit doesn't implement sending to token to the server which will
be implemented separately.

Ref !121886

Co-authored-by: Dalai Felinto <dalai@blender.org>
2024-05-22 20:40:28 +10:00
Pablo Vazquez
48e3804f3b UI: Make "Text not found" report not a warning
Not finding text should not raise a warning since there's nothing
really critical about it.

Pull Request: https://projects.blender.org/blender/blender/pulls/121794
2024-05-22 12:35:24 +02:00
Campbell Barton
774f59dd07 Cleanup: remove unnecessary check left in last commit
Should have been removed in 236c0f61b1.
2024-05-22 20:22:47 +10:00
Campbell Barton
236c0f61b1 Cleanup: avoid duplicate attribute access in scripts 2024-05-22 20:20:47 +10:00
Campbell Barton
268b2fcc0d Cleanup: follow core-scripts conventions for world.py operators
- Replace f-string with str.format
- Comment type annotations.
- Use double-quote for non-enum strings.
- Use single instead of double-underscores for private functions.
2024-05-22 20:08:02 +10:00
Campbell Barton
97c70883d0 UI: un-indent tooltip text for WORLD_OT_convert_volume_to_mesh 2024-05-22 20:06:21 +10:00
Campbell Barton
57986ad2f9 License headers: add SPDX header 2024-05-22 19:55:33 +10:00
Campbell Barton
54cf0f7f4c Extensions: add support for "build" paths in the manifest
Add an optional `[build]` table, only used for the "build" sub-command.

Supported entries.

- `paths = [..]` list of strings.
  Explicitly list all paths to include.
  Python "wheels" and the manifest are automatically included.

- `paths_exclude_pattern = [..]` list of strings.
  A `.gitignore` compatible list of patterns.

By default "paths_exclude_pattern" is set to:
[".*", "__pycache__"] when the `[build]` table entry isn't found.

Only one of these options is supported at once since it makes to sense
to exclude paths when they're manually listed.
2024-05-22 15:02:12 +10:00
Jesse Yurkovich
d46ce3eb4e Fix: Test failure after updating test data 2024-05-22 06:13:18 +02:00
Leon Schittek
fac97d6c49 Fix: Nodes: Update multi-socket link positions after duplicating
When not all links connecting to a multi-input socket are duplicated
with the multi-input, the link position needs to be updated to avoid
the links being offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/122074
2024-05-22 05:57:35 +02:00
Campbell Barton
124f003fcb Cleanup: correct comments for package building
Also remove an unnecessary exclusion.
2024-05-22 12:35:17 +10:00
Jesse Yurkovich
20450acb94 USD: Add more materials to export test 2024-05-21 19:01:42 -07:00
Jesse Yurkovich
e1211b291a Cleanup: Unnecessary newline in CLOG statement 2024-05-21 22:35:37 +02:00
Charles Wardlaw
36f1a4f94f USD Export: Added option to specify types of XForm ops written.
Different pipelines standardize on different XForm op setups (T-R-S,
T-orient quat-S, Matrix).  Having this options means that this standard
can be chosen at export time instead of having to patch on load.

Speaking from experience, this is a very helpful option.

Co-authored-by: kiki <charles@skeletalstudios.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121627
2024-05-21 22:33:32 +02:00
Harley Acheson
ac33b9f693 UI: Slight Adjustment to Status Bar Mouse Event Icon Spacing
With #121898 the regular (non-drag) mouse event icons are now centered
and therefore the horizontal padding between them needs a bit of
adjustment.

Pull Request: https://projects.blender.org/blender/blender/pulls/122072
2024-05-21 21:52:35 +02:00
Hans Goudey
d93b27a12e Subdiv: Simplify GPU subdivision loose geometry handling
The main change is avoid storage of redundant data in the subdivision
draw cache, mainly by replacing reverse lookup from subdivided edge to
coarse edge. This way loops are structured as iteration over coarse
edges instead of iteration over subdivided edges with optional behavior
for vertices with matching base mesh faces. With that inversion the
information in the draw cache is trivial (or duplicated from an array
in `MeshRenderData`), so it's all removed, except for the subdivided
loose edge positions. That array is also shrunk though, by not
duplicating positions in between each subdivided edge. Its calculation
is more efficient for the same reason too.

Overall, besides code simplification, the effect should be lower
overhead with loose edges with GPU subdivision. Admittedly this isn't
a very important use case, but it's part of a general refactor trying
to use better data oriented design in this area (#116901).

Pull Request: https://projects.blender.org/blender/blender/pulls/122071
2024-05-21 21:46:11 +02:00
Harley Acheson
9cb298f706 UI: Aligned Mouse Event Icons
Existing mouse event icons altered to align vertically with other event
icons, made slightly wider to center align.

Pull Request: https://projects.blender.org/blender/blender/pulls/121898
2024-05-21 20:41:50 +02:00
Julian Eisel
20df089341 Assets: Clear asset data by default on all "Make Local" actions
Fixes #107880.

When making a linked asset local, you typically wouldn't want this new
data-block to suddenly be part of the asset libraries this file is in. To the
user it seems like making such a data-block local also implicitly makes it an
asset.  Appending an asset already handles this, and clears the asset data by
default.

This patch modifies the `bpy.types.ID.make_local()` method, as well as all
internal calls to the make local functions, so that asset data is cleared by
default. The Python method has a new `clear_asset_data` parameter (optional,
true by default). Maybe this should not be optional.

Pull Request: https://projects.blender.org/blender/blender/pulls/110197
2024-05-21 20:41:16 +02:00
Clément Foucault
69e4aac784 EEVEE-Next: Volume Light-Probe: Baking shadow not synced with final camera
We call the `shadow.end_sync()` another time when running
the baking pipeline so that the sun shadow maps can
use the correct camera setup and scene bounds.
2024-05-21 20:26:11 +02:00
Clément Foucault
01308713ff Fix: EEVEE-Next: Shadow: Avoid uninitialized grid_shift
This value was previously used for tagging as dirty.
This is not the case anymore so no reason to not
set it.
2024-05-21 20:26:11 +02:00