Commit Graph

125768 Commits

Author SHA1 Message Date
Hans Goudey
87b8e2e18d Fix #109471: BMesh to Mesh conversion invalid UV boolean attribute data
First we copied the entire BMesh custom data layout to the Mesh, then we
decided not to copy some boolean layers like UV pinning if every value
was false. But that left the layers uninitialized. Instead, copy the
custom data layout _after_ finding which layers to skip.
2023-07-05 12:36:10 -04:00
Miguel Pozo
6ac86d0e81 Workbench Next: Release overlay depth shader
Avoid memory leak.
2023-07-05 18:30:21 +02:00
Miguel Pozo
3d62888ed6 Workbench Next: Fix Overlay composition
Set "In Front" objects depth to 0,
so overlays are not drawn on top of them.
2023-07-05 18:11:50 +02:00
Miguel Pozo
6335af74f2 Workbench Next: Fix transparent depth
transparency_depth_ps_ object sync was being skipped after
a639ec3afa
2023-07-05 18:11:50 +02:00
Brecht Van Lommel
b96c15172b Cycles: remove Point Density Texture support for surfaces
This is only intended for volumes, and including volume features in the
surface kernels negatively impacts GPU rendering performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/109712
2023-07-05 18:05:25 +02:00
Julian Eisel
0d57495acf Cleanup: remove accidentally added empty line 2023-07-05 18:03:46 +02:00
Julian Eisel
eb1e8cb4cc Pass context to region polls
Needed for #104831. It makes sense to pass this to the polling, since
polling is typically expected to check context.
2023-07-05 17:56:58 +02:00
Hans Goudey
96ad44a462 Cleanup: Use more explicit casting in mesh RNA code
Also increase use of C++ accessor methods and types.
2023-07-05 10:58:59 -04:00
Hans Goudey
53416281bd BLI: Optimize utility for index counting
The utility counts the number of occurrences of each index in an array.
It's used to build offsets for mesh topology maps, or to count the
number of connected elements. Some users are geometry nodes,
the subdivision draw cache, and mesh to curve conversion.

This PR parallelizes the counting to take advantage of multiple
threads. On a Ryzen 7950x, when counting connected edges to
vertices, I observed an improvement from 10.2 to 3.0 ms.
This most likely makes the counting less efficient, but it is
quite a nice performance improvement.

The new code was much slower for me at less than four threads,
so I added a check so that counting remains single threaded in
that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/109628
2023-07-05 16:05:16 +02:00
Hans Goudey
19e2d7cd0e Fix: Incorrect name for calculate simulation job
Copy and paste mistake caused the job to have the same name as baking.
2023-07-05 08:28:00 -04:00
Hans Goudey
b0b5af5dd6 Cleanup: Remove outdated comment for Mesh geometry component 2023-07-05 08:27:03 -04:00
Martijn Versteegh
5201a55ea0 Fix #109057: Only extend polygons present in the mask.
The Texture margin 'adjacent faces' algorithm always used the
full UV map, even if not all polygons were actually part of the
baking. Remedy this by checking the mask if passed in.

Pull Request: https://projects.blender.org/blender/blender/pulls/109500
2023-07-05 14:20:28 +02:00
Falk David
4df8c942f1 Fix: Memory leak when copying a GP drawing
The copy constructor called the constructor of the drawing,
which meant that the `CurvesGeometry` was allocated twice.
2023-07-05 14:04:34 +02:00
Falk David
4d3574a4a5 Curves: Reimplement random selection with mask
Instead of manipulating the selection attribute directly, we get an `IndexMask` of the random elements, and then apply the changes to the selection attribute in the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/109366
2023-07-05 13:48:22 +02:00
Xavier Hallade
d55cdb1b7a Cycles: improve oneAPI requirements text in the UI
Pull Request: https://projects.blender.org/blender/blender/pulls/109644
2023-07-05 12:16:04 +02:00
Falk David
fde2eca1d2 GPv3: Select circle 2023-07-05 12:15:09 +02:00
Falk David
b19aaf6730 Refactor: GPv3: Add frame API 2023-07-05 12:05:23 +02:00
Pratik Borhade
b14435fd93 GPv3: Missing default tool for paint mode
This broke after introduction of new grease pencil
paint mode 3d99d05f00
Entry in `toolsystem_default_tool` was missing

Pull Request: https://projects.blender.org/blender/blender/pulls/109722
2023-07-05 12:03:51 +02:00
Sergey Sharybin
bad41885db Cleanup: Mark unused function arguments as such
A lot of such cases got discovered since recent change to CLang's
compiler flags for C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/109732
2023-07-05 12:02:06 +02:00
Sergey Sharybin
b3cd646a15 CMake: Enable unused-parameter warning for Clang C++
Was already done for C, but not for C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/109724
2023-07-05 09:25:51 +02:00
Sergey Sharybin
7651885a9c Fix copy-paste error in CFlags for Clang
Was harmless, as both C and C++ support this flag.
2023-07-05 09:20:26 +02:00
Campbell Barton
66ea416457 Fix ANIM_SEQUENCE type path encode/decode error
The file-name would be included twice, because an_stringdec worked
differently to BLI_path_sequence_encode.
Use BLI_path_sequence_{encode/decode} to resolve the issue.

While image-sequence `anim` doesn't seem to be relied on, it's
possible to use this code-path by referencing an image from a movie
sequence strip.
2023-07-05 17:05:45 +10:00
Campbell Barton
1b84135fb5 Fix sequencer image cache holding references to freed keys
In some cases, freeing the image cache keys would not update
next/previous links - causing future updates to reference freed memory.

Also assert the `last_key` is never points to freed memory.
2023-07-05 16:49:56 +10:00
Campbell Barton
3195a4cef1 Fix use-after free while transforming sequence strips
Resolve use after free & potential double-free introduced in [0].

[0]: fd51d2f97c
2023-07-05 14:59:24 +10:00
Campbell Barton
28c3a0a980 WM: quiet missing incremental properly warning for "Save As"
The incremental property doesn't exist for "Save As" so don't check
for it.
2023-07-05 14:30:17 +10:00
Campbell Barton
0cb56b7730 Cleanup: make over allocation explicit for PathStore
Use a zero sized member instead of stepping over PathStore and
casting to a char.
2023-07-05 14:30:15 +10:00
Campbell Barton
785bd13b9a Cleanup: spelling in comments 2023-07-05 14:09:33 +10:00
Campbell Barton
39cafb43d3 Cleanup: remove unnecessary use of strncpy 2023-07-05 13:58:02 +10:00
Campbell Barton
093a948322 Cleanup: remove_cc_flag use in CMake
- Pass multiple arguments at once.
- Move comments above each argument.
- Quote the arguments (for consistency).
2023-07-05 13:27:21 +10:00
Campbell Barton
25cc1b3029 Cleanup: disable -Weverything for clang under extern/
This is very noisy and didn't result in useful warnings.
2023-07-05 13:20:53 +10:00
Campbell Barton
a4583f1cb8 Cleanup: quiet clang's missing-variable-declarations warning in RNA
Clang's missing-variable-declarations is useful to set as an error
when variables aren't declared as static when they should be.

C++ support for RNA files [0] caused clang to print many
missing-variable-declarations warnings (which I set to error locally).
This change suppresses the warning for RNA.

This should be resolved but for now suppress the RNA warning so this
can be treated as an error elsewhere.

[0]: d154ebfa83
2023-07-05 13:02:38 +10:00
Campbell Barton
81f2eb3eeb Cleanup: quiet unused variable warning 2023-07-05 13:02:16 +10:00
Germano Cavalcante
1a44120d71 Error importing keymaps prior to version 4.0.3
Caused by 3010f1233b.

The keymap format was incorrect because `extend` was being used instead
of `append`.
2023-07-04 20:19:48 -03:00
Hans Goudey
b0412ad3d1 Cleanup: Fix enum conversion warning in grease pencil code
Also use cast syntax specified by the style guide.
2023-07-04 13:09:19 -04:00
Hans Goudey
7b3097f6ff Cleanup: Various changes in modifier simulation cache
- Remove unused variable added in 397663a7cb
- Fix private/public naming
2023-07-04 13:03:25 -04:00
Iliya Katueshenock
4ae527ccab Cleanup: Move versioning_260.c to C++
- `NULL` -> `nullptr`.
- Remove `UNUSED()` macro for unused arguments.
  Comment name out instead (see style guide).
- Add casting where necessary (`static_cast` and `reinterpret_cast`).
- `MEM_callocN(sizeof(T), ...)` -> `MEM_cnew<T>(...)`.
- `T(socket.default_value)` -> `socket.default_value_typed<T>()`

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/109287
2023-07-04 18:53:40 +02:00
Bastien Montagne
89057c2c50 I18n: Updated translations from SVN trunk (r6617). 2023-07-04 18:25:00 +02:00
Falk David
44ee5b38ac GPv3: Add operator to insert blank frames
This adds a new operator to insert blank keyframes for the new
grease pencil data type.

This uses the newly added `insert_frame` API.
2023-07-04 18:04:05 +02:00
Ray Molenkamp
39b3a95efb CMake: Enable CMAKE_OPTIMIZE_DEPENDENCIES by default
Ever since #107858 landed builds of a single library from a clean state
were significant heavier than they used to the since the full dependency
chain is being build. While this is desired behavior since some projects
emit artefacts (like bf_dna's dna_type_offsets.h) for others given we
are building static libraries that don't actually get linked until the
very end this is unneeded. CMake offers a flag here to optimize this
called CMAKE_OPTIMIZE_DEPENDENCIES. See the CMake docs for details
what this exactly does.

This diff changes the default for CMAKE_OPTIMIZE_DEPENDENCIES from
Off to On for all CMake versions that support it. If people desire to
do so, this flag can still be changed though CMakeCache.txt

Pull Request: https://projects.blender.org/blender/blender/pulls/109672
2023-07-04 17:38:02 +02:00
Sergey Sharybin
b441a28ea0 Cleanup: Remove unused z_buffer from render result and view
They are not needed since the #109687

Pull Request: https://projects.blender.org/blender/blender/pulls/109702
2023-07-04 17:24:49 +02:00
Sergey Sharybin
d70de7c289 Cleanup: Remove unused ImBufIntBuffer
Pull Request: https://projects.blender.org/blender/blender/pulls/109705
2023-07-04 17:23:11 +02:00
Sergey Sharybin
e1b60fdb91 Remove Z Buffer from ImBuf
It was only used by OpenEXR and Iris images, and saving the Z Buffer
in those formats was disabled by default. This option comes from the
times prior to the addition of the Multilayer EXR.

It also worth noting that it was not possible to save Iris with Depth
pass from Blender as internally it is called IRIZ format and it was
not exposed. But even after exposing this format option something still
was missing as saving and loading ITIZ did not show up the Depth pass.

The reason of removal is to make it a more clear match of the ImBuf
with a render pass, and use it instead of a custom type in the render
result and render pass API. This will simplify the API and also avoid
stealing buffers and making shallow copies when showing the render
result.

For the cases when Depth is needed a Multilayer EXR is to be used,
as most likely more than just the Depth will be needed.

On a user level this change:

- Removes the "Z Buffer" option from the interface.

- It preserves existing sockets in compositor nodes, but it will
  output black image. Also changing the image data-block will
  remove the socket unless a Multilayer EXR with Depth pass image
  is selected.

- Removes "Depth" socket of the Viewer and Composite nodes.

Ref #108618

Pull Request: https://projects.blender.org/blender/blender/pulls/109687
2023-07-04 17:03:02 +02:00
Falk David
61d5ff1409 GPv3: Add function to insert frames with duration
Adds a new function to insert a frame with a duration on a layer.
Also adds tests for the edge cases.

This introduces the concept of a `null-frame`.
It can be created with `GreasePencilFrame::null()` and checked for with
`is_null()`.
The purpose of a `null` frame is to indicate the end of whatever frame
comes before it. This way, the frames map does not need to store
the duration of frames. The duration is always implied by the distance
to the next frame.
2023-07-04 16:38:55 +02:00
Bastien Montagne
715bc6b200 Outliner: Fix assert on unreachable code in LibOverride view.
Collections also suport replacing their values in some case (e.g. when
it's a collection of ID pointers).
2023-07-04 16:36:32 +02:00
Ray Molenkamp
fac69131ab Cleanup: make format 2023-07-04 08:26:24 -06:00
Brecht Van Lommel
948fccbd35 Fix #109598: Xcode build with Address Sanitizer failing
When using ASAN without WITH_COMPILER_ASAN, for example when enabling it
in Xcode, some symbols would be missing from makesdna. Instead just always
include them, there's no harm in it.

Also deduplicate some code.

Pull Request: https://projects.blender.org/blender/blender/pulls/109666
2023-07-04 15:22:33 +02:00
Julian Eisel
417011a2a3 Fix MSVC compile error and warning on Clang 2023-07-04 15:15:18 +02:00
Michael Jones
24ebf489d6 Cycles: Make use of maximum concurrent compilations on Metal
This patch queries the MTLDevice `maximumConcurrentCompilationTaskCount` property (macOS >= 13.3) to spawn more compilation threads if available.

Pull Request: https://projects.blender.org/blender/blender/pulls/109689
2023-07-04 15:01:48 +02:00
Germano Cavalcante
c0d230e0b8 Revert "Transform: Allow navigation by default"
This reverts commit d53862351d.

After conducting tests with artists at the studio, it was observed that
altering the Transform Modal Maps caused significant disruption due to
the heavy reliance on the "Proportional Editing" and "Automatic
Constraint" features.

Considering this, it is now deemed more beneficial to provide users
with the choice of adapting their muscle memory to the new changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109660
2023-07-04 14:53:39 +02:00
Hans Goudey
1b4b90f5f7 Cleanup: Remove unnecessary C API for asset representation
Now that almost all code is in C++, this is unnecessary and
just confuses things with multiple entry points to the same code.

Pull Request: https://projects.blender.org/blender/blender/pulls/109661
2023-07-04 14:46:19 +02:00