Commit Graph

100983 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
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
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
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
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
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
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
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
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
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
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
Clément Foucault
90448b8b5a GPU: Replace std::cout by std::cerr for dependency errors
This allow seeing them during the build process
2023-07-04 12:45:28 +02:00
Clément Foucault
3d76a75d9f GPU: Metal: Make 32bit depth promotion backend side
Doing the promotion on the internal GPU texture format
created a bug in `draw::Texture::ensure_impl` where
the texture would be constantly being recreated.
2023-07-04 12:18:28 +02:00
Damien Picard
445d71a577 I18n: translate missing geometry node attribute tooltips
As remarked by Harley Acheson in !109163, some tooltip lines regarding
geometry nodes attributes were not translated. They are basically just
bullet points followed by an actual line of text so they may not seem
important, but given that list items may not use the same bullet
points in all languages*, and other items are already translatable, it
makes sense to also translate these ones.

* For instance, the bullet point character used in Japanese is the
KATAKANA MIDDLE DOT, a monospaced variant.

Pull Request: https://projects.blender.org/blender/blender/pulls/109384
2023-07-04 09:53:23 +02:00
Jeroen Bakker
bfda24cae3 Fix: Update Stubs for Shader Builder
Issue introduced by recent changes where `BKE_pbvh_count_grid_quads`
required C++ linkage.
2023-07-04 08:09:38 +02:00
Joseph Eagar
3004198866 Sculpt: Fix #109555: Small object scales break sculpt
Caused by floating point overflow.
2023-07-03 22:28:21 -07:00
Jesse Yurkovich
5c37e2123e Fix #109442: Match previous behavior when loading BC5 DDS images
Prior to using OIIO for image loading, DDS files were hard-coded to
always treat files with BC5/ATI2 compression as normal maps[1].

This basically means that the B channel would be reconstructed from the
R,G channels in a particular way. There is a non-standard header flag
(coming from tools like NVTT and various others) that can also be used
to indicate if such processing should take place, and OIIO understands
that flag and acts appropriately.  However, not all files have that flag
set.

This patch reverts to the hard-coded behavior to match prior versions.
If the user has explicitly set the OIIO environment variable to say
otherwise, we will respect that setting instead.

[1] https://projects.blender.org/blender/blender/src/branch/blender-v3.5-release/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp#L870

Pull Request: https://projects.blender.org/blender/blender/pulls/109541
2023-07-04 07:25:42 +02:00
Chris Blackbourn
9da64ac391 Fix #109673: Fix crash in debug builds when using uv unwrapper
Add NULL check to #BLI_rng_free which has `ATTR_NONNULL`
2023-07-04 16:48:06 +12:00
Pratik Borhade
0ade0959d4 Fix: Compiler error due to missing header
Caused by 9753e70e37
`BLI_string_replace_char` is used in thumbs.cc but header
was missing
2023-07-04 09:13:27 +05:30
Joseph Eagar
f031d7fbf3 Cleanup: remove duplicate function declaration. 2023-07-03 20:11:07 -07:00
Joseph Eagar
7e2659e4ab Cleanup: Split BKE_pbvh.h into BKE_pbvh_api.hh
Split much of BKE_pbvh.h into BKE_pbvh_api.hh.
BKE_pbvh.h is included by BKE_paint.h, which in
turn is included by large amounts of code including
RNA.

This makes it extremely difficult to change
or clean up the PBVH API, since each modification
of BKE_pbvh.h can take 20-30 minutes to compile,
even on a quad-core system with an SSD. This
commit fixes that by moving most of BKE_pbvh.h
into another file and just having the core,
external-facing interfaces in BKE_pbvh.h.
2023-07-03 20:01:04 -07:00
Campbell Barton
5c4510d39e Cleanup: update code comment for DNA_struct_get_compareflags
Translate (last?) Dutch text in Blender's source.
2023-07-04 12:37:22 +10:00