Commit Graph

104362 Commits

Author SHA1 Message Date
Clément Foucault
60df70b082 EEVEE-Next: Fix empty layers utiltex
This fixes interpolating of invalid data for
very high roughness.
2023-11-03 11:54:18 +01:00
Christoph Lendenfeld
cfb50a2e2e Cleanup: Comments in animrig
No functional changes.

For all the recently moved keyframing code I did the following:
* Remove comments that just repeat what the code is doing.
* Move comments for public functions to their location in the header file.
* Make sure comments are formatted properly with a capital letter at the start and a dot at the end.

Pull Request: https://projects.blender.org/blender/blender/pulls/114448
2023-11-03 11:53:42 +01:00
Bastien Montagne
d1e732a114 FFMPEG: Cleanup: Remove storage of last FFMPEG frame read as ImBuf in anim data.
The `anim` data (e.g. of a VSE sequence) would store the last frame read from
FFMPEG as an image buffer, increasing its refcounting and preventing it
to be freed until the whole `anim` data itself gets freed.

In current code, there is no reason to keep a reference to this image
buffer in the `anim` data, so removing it. This may also give a few
percent improvement on the memory usage of the VSE in some cases.

Found while investigating #114342.

Pull Request: https://projects.blender.org/blender/blender/pulls/114395
2023-11-03 11:18:21 +01:00
Christoph Lendenfeld
0f5e7c7469 Refactor: Move fcurve functions to animrig
No functional changes.

Moving the following two functions to animrig
`ED_action_fcurve_ensure`
`ED_action_fcurve_find`

Pull Request: https://projects.blender.org/blender/blender/pulls/114445
2023-11-03 11:15:27 +01:00
Bastien Montagne
ba37c59e13 Merge branch 'blender-v4.0-release' 2023-11-03 11:04:23 +01:00
Bastien Montagne
cc6c5cb7f4 Fix #114415: USDZ conversion happens outside of main thread.
USDZ conversion currently requires to change the 'current working
directory', due to internal USD library limitations.

This can only be done from main thread (and is highly discouraged in
general). This implies that USDZ conversion cannot happen from the Job
worker thread.

This commit moves it to the `endjob` callback of the USD export job
instead, as it is guaranteed to be executed from caller thread, i.e.
main thread in this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/114420
2023-11-03 10:55:55 +01:00
Christoph Lendenfeld
5beb513be1 Refactor: move ANIM_setting_get_rna_values to animrig
No functional changes.

Moving `ANIM_setting_get_rna_values` to the animrig folder and into the `blender::animrig namespace`

Pull Request: https://projects.blender.org/blender/blender/pulls/114444
2023-11-03 10:55:10 +01:00
Iliya Katueshenock
510a5d3403 Fix: Nodes: Float draw position for sockets
Here is too many inconsistencies in used data type for coordinates.
That commit change int to float for socket draw. There is still many
node/text/other ui draw code with mix up int's and clamped floats
(to looks like int's). That fix is just small step to finally just use float.

Pull Request: https://projects.blender.org/blender/blender/pulls/114114
2023-11-03 10:36:20 +01:00
Hans Goudey
44b79af4fc Cleanup: Sculpt: Simplify face and face set iteration
This commit removes knowledge about face sets from the PBVH,
and changes iteration over faces to not depend on the PBVH face
iterator abstraction. Though this adds slightly more boilerplate to
iteration over faces, it makes the whole process more data oriented
and allows use of index-based utilities like `gather` and `scatter`
in the mesh case, and simpler iteration over BMesh faces for
dynamic topology.

Setting face sets is now specialized per PBVH type in a few places
in a similar way. The general goal is to reduce branching and function
calls at the lowest level of hot loops, and to make code more aware
of the data structures it uses, both for performance and clarity.

Since the remaining uses of the face iterator are removed,
the iterator itself is removed too.

Related commits:
- 97f2b01ea9
- 756dea7ca1
- a6a2af5fdd

Pull Request: https://projects.blender.org/blender/blender/pulls/114417
2023-11-03 10:27:38 +01:00
Philipp Oeser
9faf0bbeba Merge branch 'blender-v4.0-release' 2023-11-03 09:46:08 +01:00
Aras Pranckevicius
42ee315b60 Fix #114304: OBJ import crash when some faces have normals, and others do not
The file that reproduces this had some faces of a mesh with vertex
normals, while some other faces were without vertex normals.
The parsing code assigns INT32_MAX as a fallback of "I could not parse
the normal index as a number" case, but later on code was not
catching this "normal index might be invalid" case. Fixes #114304
2023-11-03 09:45:32 +01:00
Iliya Katueshenock
3d971feb36 Curves: Sculpt mode frame selected operator support
Implementation of Frame Selected operator for curves sculpt mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/109924
2023-11-03 09:42:56 +01:00
Philipp Oeser
0a3b44ed64 Fix #114358: Trace Image to Grease Pencil misses first frame in sequence
Off by one when it comes to setting `ImageUser` > `framenr`

Pull Request: https://projects.blender.org/blender/blender/pulls/114365
2023-11-03 09:42:41 +01:00
Hans Goudey
df4df75317 Cleanup: Simplify construction of Group ID VectorSet 2023-11-03 09:35:38 +01:00
Sergey Sharybin
783eb3f390 Merge branch 'blender-v4.0-release' 2023-11-03 09:28:36 +01:00
Sergey Sharybin
e24c7f1954 Fix #114129: Crashes on boolean operation macOS Intel
The issue crash was caused by non-safe cast from a bare C array
float[4][4] to float4x4*. Such cast is not safe because it might
break alignment.

Modified the code so that the transform matrices are passed by
value.

Technically it could mean higher memory usage, but odds that the
actual geometry which is a part of boolean operation consumes much
more memory. Additionally, avoiding indirection could potentially
lead to better performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/114421
2023-11-03 09:27:59 +01:00
Hans Goudey
0ff4060cd3 Cleanup: Remove unnecessary struct keywords in sequences headers
Also remove const for non-pointer arguments which is meaningless in
the declaration, move a scene enum to the "enums.hh" header, and add
missing forward declaration of structs.
2023-11-03 09:05:31 +01:00
Aras Pranckevicius
d59c6d3e5c PLY: fix unreported crash when exporting multiple objects with different presence of vertex colors
Similar to e98cc412e, exporting PLY essentially merges all meshes into
one. And if any of them has vertex colors to export, they all
should get a fake/dummy vertex color entry.
2023-11-03 08:52:36 +02:00
Richard Antalik
21ea67f962 Merge branch 'blender-v4.0-release' 2023-11-03 02:06:08 +01:00
Richard Antalik
5d765a0d31 Fix #114342: Crash when opening too many movies at once
Adding strips or changing filepaths caused thatde movie files were loaded,
but memory was only released after new frame was rendered. Since FFmpeg
can take a lot of memory per strip, this can cause crash.

Free memory for each strip immediately after it is not needed after
these operations.

Pull Request: https://projects.blender.org/blender/blender/pulls/114381
2023-11-03 02:01:17 +01:00
Richard Antalik
4d37fb80b1 Cleanup: Convert VSE headers from .h to .hh 2023-11-03 01:33:54 +01:00
Aras Pranckevicius
e98cc412ef Fix #114346: PLY export crash with multiple objects that have different custom attributes
Custom attribute export (#114320) code did not realize that
PLY exports everything as one single "mesh" with the same vertex
data for everything. So if exporting several input meshes and they
have different vertex attributes, the result needs to have a union
of all present attributes, with fake/zero data for the ones
that were not actually present. Fixes #114346.
2023-11-02 22:58:26 +02:00
Aras Pranckevicius
afe297231d Fix #114304: OBJ import crash when some faces have normals, and others do not
The file that reproduces this had some faces of a mesh with vertex
normals, while some other faces were without vertex normals.
The parsing code assigns INT32_MAX as a fallback of "I could not parse
the normal index as a number" case, but later on code was not
catching this "normal index might be invalid" case. Fixes #114304
2023-11-02 21:35:02 +02:00
Aras Pranckevicius
539b0fd4b5 Unbreak build from missing headers 2023-11-02 21:07:04 +02:00
Clément Foucault
0684b68eb4 EEVEE-Next: Make Ambient Occlusion Pass use Horizon Scan
This adds a new way of computing occlusion using visibility bitmask. To
make it more algorithm agnostic, we name it horizon scan.
This cleans-up / simplify the code compared to the Horizon based solution.
There is no more trickery for fading influence of distant samples which
makes the result match cycles closer.

This introduces a new thickness option. Maintaining it relatively low
makes it possible to avoid over occlusion because of in front geometry.
Making it too low will cause under occlusion.

Related #112979

Pull Request: https://projects.blender.org/blender/blender/pulls/114150
2023-11-02 19:22:01 +01:00
Brecht Van Lommel
14f470cdae Merge branch 'blender-v4.0-release' into main 2023-11-02 19:02:35 +01:00
Hans Goudey
937b12e983 Fix: Missing include in previous commit 2023-11-02 18:36:21 +01:00
Hans Goudey
b8c5af45ba Fix: Use native path separator for node tools redo panel title
Use the platform dependent `SEP_STR` instead of a hardcoded back slash.
2023-11-02 18:35:35 +01:00
Falk David
91db8fc5a0 GPv3: Multi-frame editing
Adds a new scene tool setting `use_grease_pencil_multi_frame_editing`.

The `foreach_*_drawing` functions are moved to the `ed::greasepencil` namespace in the editor, since they are now context sensitive and depend on the toolsetting. They are now named `retrieve_editable_drawings` and `retrieve_visible_drawings` and return
an array of drawings instead of calling a callback function.

Pull Request: https://projects.blender.org/blender/blender/pulls/114283
2023-11-02 17:10:59 +01:00
Falk David
05d6818aa2 Fix #110038: Crash when sculpting on GP object with modifier
When trying to sculpt a Grease Pencil object with a line art modifier
(other modifiers probably also casue issues), Blender would crash.
I wasn't able to track down the exact issue but it's related to how
the update-cache stores pointers to original data.

This reverts part of e2befa425a to not make use of the update
cache while sculpting. Combined with modifiers, this approach
is just too unstable right now.

Pull Request: https://projects.blender.org/blender/blender/pulls/114410
2023-11-02 17:08:36 +01:00
Miguel Pozo
b679ea939a EEVEE-Next: Per probe viewport display
* Add viewport display support for Sphere and Plane probes.
* Make all probe display options per object instead of per scene.
  (Uses the already existing `LIGHTPROBE_FLAG_SHOW_DATA`
   and adds a new `data_display_size ` property to the `LightProbe` DNA)
* Python `show_data` property has been deprecated and renamed to
   `use_data_display` (`data_display_size ` has been exposed as well).

Pull Request: https://projects.blender.org/blender/blender/pulls/114176
2023-11-02 17:08:13 +01:00
Hans Goudey
d8f59dce26 Merge branch 'blender-v4.0-release' 2023-11-02 16:41:40 +01:00
Hans Goudey
db5cae78b7 Fix: Sculpt redo crash after undoing addition of mask
Fixes a crash in the following case:
Enter sculpt mode -> draw face set -> draw sculpt -> undo * 3 -> redo * 3
2023-11-02 16:40:38 +01:00
Hans Goudey
6935cd0798 BLI: Add "scatter" array_utils function
This function, the opposite of `gather`, would have been useful a
few times in the past. For now, just use it once in sculpt undo code.
2023-11-02 16:33:11 +01:00
Jeroen Bakker
0f5abc5a8b Vulkan: Readback Texture Views
When using EEVEE-Next the final render data is readback from texture
views. This wasn't implemented yet.

This PR adds support for reading back texture views. It also makes sure
the correct layer is read when reading back data from framebuffers and
adds internal support to read back a partial texture.

Pull Request: https://projects.blender.org/blender/blender/pulls/114411
2023-11-02 15:55:05 +01:00
Bastien Montagne
40a46629a2 Merge branch 'blender-v4.0-release' 2023-11-02 14:35:56 +01:00
Bastien Montagne
67445c2353 Fix #114152: Blender crashes when loading files with unknown IDProperty types.
Issue was reported with a 3.6 file crashing 3.3LTS, but the underlying
problem still exists in current codebase, and could also potentially be
caused by other edge-cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/114397
2023-11-02 14:33:04 +01:00
Hans Goudey
22e706e87a Cleanup: Use utility function to fill triangle face offsets 2023-11-02 13:48:13 +01:00
Jeroen Bakker
d4262071b1 Fix #114224: Bones Disappear In Pose/Edit Mode
Previous fix partially fixed the issue, there were still some left over
issues where that alpha channel wasn't loaded correctly and therefore
could lead to fully transparent stick bones.

Previous fix: 3da63377fc

Pull Request: https://projects.blender.org/blender/blender/pulls/114393
2023-11-02 13:36:44 +01:00
Lukas Tönne
fdd702d2c9 Merge branch 'blender-v4.0-release' 2023-11-02 12:56:33 +01:00
Lukas Tönne
578d91b9db Fix #113919: Avoid crashes with unsupported new socket types
Blender 4.0 added new socket types that get written into legacy node
group interfaces by forward compatibility code. Such unsupported socket
types have to be handled by the socket declaration system and ignored
during execution.

Ported blender-v3.6-release fix #114056

Pull Request: https://projects.blender.org/blender/blender/pulls/114401
2023-11-02 12:55:37 +01:00
Bastien Montagne
730b5057a7 Fix #114237: USD import crashes on reporting during cache handling.
This usage of the whole USD `USDStageReader` as 'cache handle' feels a
bit... uncomfortable to me. It implicitely assumes that all data in this
owned by the reader (or has a lifetime that contains the whole handle
lifetime). IMHO, if such struct is expected to have a long lifetime, it
should be documented, and probably needs better design for sub-data
handling then. Am curious to know if there is a good reason why the
handle itself is not a simple trivial class, able to re-generate an
actual complete USD reader on demand?

Or maybe we need to find a better place to store the `wmJobWorkerStatus`
data?

Anyway, for now this PR addresses the issue by ensuring that the
`worker_status` stored in the `USDImportParams` is not `nullptr` before
trying to access it for the reports.

This is more of a short-term solution though, imho there should be a way
to pass a reportlist to this codepath, and ensure the `wmJobWorkerStatus`
is always valid?

Pull Request: https://projects.blender.org/blender/blender/pulls/114337
2023-11-02 12:45:29 +01:00
Omar Emara
1500a594ad Realtime Compositor: Immediately realize wrapped translations
This patch changes how wrapped translations are handled by the Realtime
Compositor. Previously, translations were always stored on the result
and delayed until automatically realized later. The wrapping status was
also stored to control this later automatic realization.

This patch changes that such that translations are immediately realized
for the axes that has enabled wrapping. Consequently, the image will not
get translated, but its content will, in a clip on one side, wrap on the
opposite side manner.

Another change is that wrapping information is no longer propagated to
future automatic realizations, so tilling or repeating an image is no
longer possible. An alternative method of repetition will be introduced
in a later patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/113669
2023-11-02 12:39:41 +01:00
Campbell Barton
6a9684afd7 Unbreak build from missing headers 2023-11-02 22:26:06 +11:00
Gilberto Rodrigues
dfd1b63cc7 UI: improve mesh edge highlighting
Changes to edit mode mesh overlays, use hue shift instead of color
fading/darkening for selection mode visual differentiation, and some
theme changes to improve the display of mesh edges and faces with good
selection visibility.

- Removed "edge" toggle from edit mode overlays panel.
- No longer halves the edge and face alpha depending on selection mode.
  Half the face alpha in wire-frame mode. For better visibility on most
  themes.

Ref !111431
2023-11-02 22:09:17 +11:00
Omar Emara
b54a26ede4 IMB: Support rgba and V channels in single-layer EXR
Currently, the EXR reader only considers uppercase RGBA channel names in
single-layer EXRs, which leaves out the lower case rgba channel names we
started using for data and vector passes in Cycles and the compositor.
Further, a single V channel was also ignored, which is by convention
used for BW passes.

This patch extends the single-layer channel recognition methods to
include lowercase rgba and V channels.

Pull Request: https://projects.blender.org/blender/blender/pulls/114339
2023-11-02 11:08:35 +01:00
Hans Goudey
7760641689 Merge branch 'blender-v4.0-release' 2023-11-02 09:39:32 +01:00
Hans Goudey
0f9dcafa76 Fix #112973: Node tools: Incorrect redo behavior in sculpt mode
When there is a non-sculpt mode undo step before the operation,
redoing the node tool operation doesn't work correctly-- the undo
that happens before repeating the operator doesn't work.

The fix is using the sculpt geometry undo step system. Theoretically
this should be cheap because implicit sharing will avoid copying most
of the attribute layers. However in the future it would be good to avoid
a PBVH rebuild after the operation in some cases.
2023-11-02 09:38:36 +01:00
Iliya Katueshenock
5552ac1832 Cleanup: Use utility to fill index range in curve node
Pull Request: https://projects.blender.org/blender/blender/pulls/114375
2023-11-02 09:07:34 +01:00
Campbell Barton
6983c14955 Cleanup: spelling in comments, use doxygen doc-strings 2023-11-02 16:43:04 +11:00