Commit Graph

103627 Commits

Author SHA1 Message Date
Jacques Lucke
663aa3538d UI: allocate panel runtime data separately
This results in better separation for what is stored in .blend files and what is not.
Also allows us to potentially use C++ in panel run-time data.

Pull Request: https://projects.blender.org/blender/blender/pulls/113502
2023-10-10 18:17:31 +02:00
Miguel Pozo
e235913c0d Fix: EEVEE-Next: Handle ObjectKey padding bytes 2023-10-10 17:55:23 +02:00
Miguel Pozo
26154aae81 Fix: EEVEE-Next: Bake regression
Missing `hiz_buffer.set_source` call after 80a6a8efe9
2023-10-10 17:40:28 +02:00
Germano Cavalcante
5429d892b7 Merge branch 'blender-v4.0-release' into main 2023-10-10 12:19:37 -03:00
Germano Cavalcante
ab2618e186 Fix compile error due to conversion to 'long unsigned int' from 'int'
Conversion to `long unsigned int` from `int` may change the sign of the
result [-Werror=sign-conversion]
2023-10-10 12:16:31 -03:00
Falk David
559c271a53 Clang-format 2023-10-10 16:59:56 +02:00
Bastien Montagne
a238ab737b Fix (unreported) liboverride: Hierarchy corruption when making some override local.
Making some liboverride local will break/corrupt liboverride hierarchies
in many cases. So that function (or its caller, in some cases) need to
call #BKE_lib_override_library_main_hierarchy_root_ensure to re-validate
(and re-generate if needed) the liboverride hierarchy roots.
2023-10-10 16:56:48 +02:00
Bastien Montagne
c5e10920f9 Fix (studio-reported) liboverride: hierarchy root ensure fails in some cases.
The code ensuring a valid liboverride hierarchy root ID pointer for all
liboverrides in a given Main would fail in some cases, and crash on
asserts (in Debug builds) or due to corrupted data later in code
(release builds).

The main issue fixed here is re-entry in case of dependency loops (a
same ID being checked more than once within the same chain of recursive
calls to ensure its hierarchy root is valid). Solved the usual way now,
using the intermediate 'PROCESSING' flag instead of setting immediately
the 'PROCESSED' one, when recursively processing the chain of
dependencies.

A second issue fixed in that code was that in some cases, it could leave
the invalid existing hierarchy root pointer unchanged, because it could
not find a 'valid enough' alternative.

NOTE: This data corruption is presumably caused by 'make local'
operations on liboverride hierarchy root IDs. This will be addressed as
a second commit.

For reference, issue is reproducible when opening
`/promo/splash/040_0010.lighting.splash.blend` from Pets SVN repo r3106.
2023-10-10 16:56:48 +02:00
Falk David
3931a54e08 GPv3: Initial Geometry Nodes support
This implements the core changes for this design: https://devtalk.blender.org/t/grease-pencil-integration-into-geometry-nodes/31220

The changes include:
* Add `CustomData` for layer attributes
* Add attribute support for the `GreasePencilComponent` to read/write layer attributes. Also introduces a `Layer` domain.
* Implement a `GreasePencilLayerFieldContext` and make `GeometryFieldContext` work with grease pencil layers.
* Implement `Set Position` node for `Grease Pencil`.

Note: These changes are only accessible/visible with the `Grease Pencil 3.0` experimental flag enabled.
Co-authored-by: Jacques Lucke <jacques@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/112535
2023-10-10 16:49:30 +02:00
Germano Cavalcante
7d7ca7b90d Merge branch 'blender-v4.0-release' into main 2023-10-10 11:31:35 -03:00
Germano Cavalcante
02ee5a7693 Fix Snap to Face ignoring back Clip Planes
Snap to Face ignoring some clip planes is an old behavior, but it is
not desirable as the snap is made to non-visible geometry.
2023-10-10 11:30:28 -03:00
Germano Cavalcante
c351de8b2a Fix #113486: Crash snapping with clipping borders
Caused by 2cead79747

The clip_plane count in BLI_kdopbvh.c was incorrectly reduced.

To solve, make the size of the clip_plane array variable.

This eliminates the need to keep values in sync.
2023-10-10 11:30:28 -03:00
Falk David
fa2a05ef86 Fix: GPv3 sometimes crashes when drawing
This was because the size and bounds of points were not properly
checked in some places.
Additionally, the smoothing algorithm should only be run if the
smoothing window is larg enough.
2023-10-10 16:22:25 +02:00
Falk David
cf2ea5979c Fix: GPv3 draw tool sometimes draws a cyclic curve
The issue was that the drawing tool did not write to the "cyclic" attribute.

Resolves #113423.

Pull Request: https://projects.blender.org/blender/blender/pulls/113500
2023-10-10 16:15:43 +02:00
Miguel Pozo
7d28b8cb5b Merge branch 'blender-v4.0-release' 2023-10-10 15:49:56 +02:00
Miguel Pozo
96d6003b92 Cleanup: Draw: max_orphan_cycles clarification 2023-10-10 15:49:28 +02:00
Brecht Van Lommel
46d32d8966 Merge branch 'blender-v4.0-release' into main 2023-10-10 15:36:39 +02:00
Brecht Van Lommel
478e1ab6d3 Fix build error on Windows after BLI_read changes
Don't use posix-only ssize_t in platform independent code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113493
2023-10-10 15:36:15 +02:00
Pratik Borhade
3f3b693bab Merge branch 'blender-v4.0-release' 2023-10-10 18:54:30 +05:30
Pratik Borhade
02b5ad05f6 Update drawtype when forcefield is added to empty object
For consistency, change drawtype of empty when forcefield is added to
fresh empty object.
Found this while checking #113460

Pull Request: https://projects.blender.org/blender/blender/pulls/113471
2023-10-10 15:21:41 +02:00
Jeroen Bakker
25a1cea8e2 EEVEE-Next: Scene Reflection Probe Resolution
This PR reuses the scene specific reflection probe resolution for all
reflection light probes in the scene. The target is to have a automatic
detection for the resolution. But as long as we don't have a mechanism
for detection it is better to not introduce a new UI element that will
be removed within the foreseen future.

This setting is currently used by EEVEE and EEVEE-Next. EEVEE supports
resolutions upto 4096px. This will be clamped to 2048 when using
EEVEE-Next.

The motivation for this is that EEVEE-Next will soon replace
EEVEE and 4096 can then be removed from the choices that the user can
made. Adding as separate option could need synchronization, and that
option would also be temporary as it will be removed by the resolution
detection mechanism.

Pull Request: https://projects.blender.org/blender/blender/pulls/113491
2023-10-10 14:50:17 +02:00
Campbell Barton
57fc3d48b8 Merge branch 'blender-v4.0-release' 2023-10-10 22:49:58 +11:00
Campbell Barton
8d80d611e9 Use BLI_read instead of read to avoid issues with large files
Follow up to fix for #113473, similar issues exist elsewhere.
2023-10-10 22:47:35 +11:00
Campbell Barton
028c4b440c Merge branch 'blender-v4.0-release' 2023-10-10 22:28:53 +11:00
Campbell Barton
fa40724a72 BLI_fileops: Add 'BLI_read' wrapper to ensure the requested data is read
According to the documentation `read` isn't required to read all the
data requested. Although until recently I'd never encountered this and
none of Blender's code checks for read succeeding but not reading the
requested size.

Resolves #113473 where images over 2gb fail to load.

Ref !113474.
2023-10-10 22:27:40 +11:00
Clément Foucault
80a6a8efe9 EEVEE-Next: Ray-Tracing: Add Planar Tracing
This traces planar lightprobe captures just like
the screen-space tracing does.

This is implemented as a separate shader that
loads the ray before the screen trace and
check if it can be traced against any available
planar probe. If it does it marks the ray as
traced (negative pdf) so that the screen tracing
pass does not override the result or try to
trace it.

Pull Request: https://projects.blender.org/blender/blender/pulls/113453
2023-10-10 12:55:18 +02:00
Jason Fielder
d5139065f1 Metal: Improve input latency management
This patch improves the heuristic used to
determine maximum frames-in-flight at
different input latency levels.

Previous values adjusted to better encapsulate
workloads in the 10-20 FPS range which can
manifest excessive latency. Changes improve
total performance throughput and improve
the interactive user experience.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/113020
2023-10-10 12:27:56 +02:00
Jacques Lucke
d5d6da2b1c Cleanup: add comment for why lazy threading hint is send 2023-10-10 12:23:07 +02:00
Sybren A. Stüvel
1ea35a6d4e Merge remote-tracking branch 'origin/blender-v4.0-release' 2023-10-10 12:07:46 +02:00
Sybren A. Stüvel
048625cc1f Anim: make bone colors library-overridable
Pose bone colors should be library-overridable, and now they are.
2023-10-10 12:05:06 +02:00
Jeroen Bakker
9c52b4e606 Fix #113470: EEVEE-Next doesn't stop sampling
After performing a transformation EEVEE-Next non-stops resets the
sampling. The cause is that the `recalc` flag that are stored in the
Object isn't consumed. When transforming it was always filled with
`ID_RECALC_TRANSFORM` and kept on resetting the sampling.

Regression introduced by PR #113252.

Pull Request: https://projects.blender.org/blender/blender/pulls/113484
2023-10-10 11:49:37 +02:00
Hans Goudey
1ccba4d9fe Nodes: Use index instead of reordering for draw order
Currently nodes are reordered so that the "on top" nodes are last in
the list. Node order changing for simple operations like selection
means we either have to reevaluate the node tree data-block on
selections or accept that the evaluated order can be different from the
original. Currently we do the latter (see d76a0e98ba), but
makes it complex to access nodes by index, and is hard to reason about.

Instead of reordering nodes, store the ui order in the node itself
and sort the nodes before drawing them or doing any processing
that depends on the "depth."

The "selected_nodes" list in the context is no longer ordered by the
recent selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/113419
2023-10-10 10:57:51 +02:00
Omar Emara
203559757a Compositor: Allow variable size Kuwahara
This patch changes the size property of the Kuwahara into a node socket
to allow variable size Kuwahara.

Pull Request: https://projects.blender.org/blender/blender/pulls/112946
2023-10-10 10:10:18 +02:00
Campbell Barton
1a234805d0 Merge branch 'blender-v4.0-release' 2023-10-10 19:05:03 +11:00
Campbell Barton
bb9b60f13d Fix build error Windows with ssize_t not being defined 2023-10-10 19:03:31 +11:00
Jeroen Bakker
f361cfa361 Vulkan: Bundle Immediate Mode Calls
When using Immediate mode emulation the data is stored in a ring buffer.
As data isn't overwritten it is safe to call multiple draw commands in
a single command buffer.

This improves drawing performance when immediate mode is being used, it
mostly improves the readability of the GPU traces in renderdoc.

Pull Request: https://projects.blender.org/blender/blender/pulls/113482
2023-10-10 09:54:35 +02:00
Hans Goudey
012c110222 Merge branch 'blender-v4.0-release' 2023-10-10 09:31:42 +02:00
Hans Goudey
ab9716f058 Cleanup: Access mesh bounds directly
Similar to 4eeabd274e, helps simplify fix to #111120
2023-10-10 09:31:20 +02:00
Jeroen Bakker
d67ec32747 Vulkan: Support for Framebuffer with Missing Attachments
Wireframe mode wasn't working and viewport had flickering artifacts.
Reason was that the render pass creation failed for its framebuffer as
the input data was filled with garbage for attachments that were unused.

Vulkan requires every attachment to be filled upto the highest used attachment
slot. This PR fills missing attachments with a dummy texture.

Pull Request: https://projects.blender.org/blender/blender/pulls/113141
2023-10-10 09:27:07 +02:00
Christoph Lendenfeld
0c2afa7c17 Fix #111553: Double IK constraint not working
It seems that the code only ever converted the
first IK constraint found into a `PoseTree`.
Before #110417 constraints with zero influence were
skipped so it worked, except for the bug with the depsgraph.

After this patch the logic is the following:
From top to bottom of the constraint stack,
keep adding constraints until the first constraint with influence is added.

This ensures, that if there is only one disabled constraint,
it still gets converted into a `PoseTree`,
which is needed for the depsgraph to work correctly.

The resulting behavior from adding the first active constraint is
that the higher in the stack the constraint is, the higher its priority.

To achieve that I split off a helper function `find_ik_constraints`
that populates a vector of `bConstraint` pointers.
The code to create the `PoseTree` is still largely the same,
except I moved a few variables closer to where they are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/113056
2023-10-10 09:06:28 +02:00
Campbell Barton
89efad1dbd Merge branch 'blender-v4.0-release' 2023-10-10 18:02:51 +11:00
Campbell Barton
9ebe1c386f Merge branch 'blender-v4.0-release' 2023-10-10 18:02:48 +11:00
Campbell Barton
780bb012ce Fix integer overflow in ED_draw_imbuf_method
Prevent int overflow calculating the size of an image buffer.
2023-10-10 18:01:13 +11:00
Campbell Barton
34899ec13d Fix crash when the animation player fails to create a texture 2023-10-10 18:00:05 +11:00
Campbell Barton
4afd8ef9a4 Cleanup: add BLI_mmap_get_length, remove duplicate file size access
Remove unnecessary calls to BLI_file_descriptor_size when using
BLI_mmap_open since this stores the file size too.

While accessing the size twice isn't so bad, the additional check
that the file size isn't an error value is unnecessarily verbose.
2023-10-10 15:43:13 +11:00
Campbell Barton
ed8d2d8219 Merge branch 'blender-v4.0-release' 2023-10-10 15:33:47 +11:00
Campbell Barton
7a503d160e BLI_mmap: open now checks for seek failing & exists early
Failure to seek would attempt to MMAP SIZE_T_MAX, while this would
likely fail, prefer an explicit error check instead of relying on
unreasonable requests to be rejected.
2023-10-10 15:32:13 +11:00
Campbell Barton
acd54a2afb Merge branch 'blender-v4.0-release' 2023-10-10 14:57:00 +11:00
Campbell Barton
ae6b1ead4c Fix failure to check the error value for file-size access
Accessing the file size returns -1 on error, for file packing this
was passed directly to an allocation which would wrap around to
SIZE_T_MAX and fail to allocate. In other cases zero was treated
as an error value but -1 wasn't.

Add checks for the error return value, also warn that packing files over
2gb isn't supported.
2023-10-10 14:56:30 +11:00
Campbell Barton
f5d2f520cf Merge branch 'blender-v4.0-release' 2023-10-10 14:25:57 +11:00