125736 Commits

Author SHA1 Message Date
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 397663a7cb517ab04204
- 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 d53862351d042c4c36c7ebb49feb230725e43a0b.

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
Brecht Van Lommel
2ee0c23a82 Fix #109562: Cycles HIP device not found on Debian
Try loading ROCm 5.x libraries specifically, as the .so without version
is only part of the development package.

Thanks to Lee Ringham investigating and proposing this solution.
2023-07-04 14:21:34 +02:00
Brecht Van Lommel
38cc2e2f72 Fix "unknown warning option" message with some Clang versions
Should use distinct variable names per flag.
2023-07-04 13:49:05 +02:00
Nikita Sirgienko
7c4108567b Cycles: Embree: Resolve padding-related issue during buffer creations 2023-07-04 13:41:45 +02:00
Nikita Sirgienko
e73bb628ee Cycles: Fix Out-Of-Bounds issues during Embree BVH building 2023-07-04 13:41:25 +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
Jeroen Bakker
8f00659fb7 Cleanup: make format 2023-07-04 07:51:11 +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
Campbell Barton
9e26960b77 Cleanup: code-comments 2023-07-04 12:36:41 +10:00
Campbell Barton
2b30e5ba05 Cleanup: remove unsafe strcat, strcpy, sprintf in non-blender utilities
Use BLI_string in makesrna, makesdna.
2023-07-04 12:02:26 +10:00
Campbell Barton
9753e70e37 Cleanup: move BLI_str_replace into BLI_string_utils.h
String search & replace is a higher level function (unlike BLI_string.h)
which handlers lower level replacements for printing and string copying.

Also use BLI_string_* prefix (matching other utilities).

This makes it possible to use BLI_string in Blender's internal utilities
without depending on DynStr, MemArena... etc.
2023-07-04 12:02:25 +10:00
Campbell Barton
bcdba3516b Cleanup: remove unused variable 2023-07-04 12:02:24 +10:00
Alice Scarlett
9cd07da339 Fix VSE subtitle export indexing
Some programs have trouble parsing .srt files if first index is 0.

While there doesn't seem to be any official specs for the .srt file
format, all resourses I could find online start indexing at 1. This
commit makes Blender's .srt exports start at 1 instead of 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/107997
2023-07-04 03:55:44 +02:00
Chris Blackbourn
4f6ce68500 UV: Add "Invert Pins" to the menu in the uv editor
Thanks Robert Rioux for the suggestion.

Pull Request: https://projects.blender.org/blender/blender/pulls/109187
2023-07-04 02:46:23 +02:00
Hans Goudey
a3bfd6e20d Cleanup: Extract utility for counting indices
This utility counts the number of occurrences of each index in an array.
This is used for building mesh topology maps offsets, or for counting
the number of connected elements. Some users are geometry nodes,
the subdivision draw cache, and mesh to curve conversion.

See #109628
2023-07-03 18:47:03 -04:00
Clément Foucault
91d15a3613 EEVEE-Next: Fix shader compilation on Metal 2023-07-03 23:08:53 +02:00
Germano Cavalcante
5ea561b51c Cleanup: Use Vector and Matrices types in C++ 2023-07-03 16:20:52 -03:00
Germano Cavalcante
bc3ec100c2 Cleanup: Remove redundant code in Snap To Nearest
Result registration is already done in `SnapData::register_result`.
2023-07-03 16:20:52 -03:00
Brecht Van Lommel
f4da74ed29 Revert "Cycles: Make use of maximum concurrent compilations on Metal"
This reverts commit 63d3fc2dcbe481ec85dfae517cf6a1318971913c, because it
causes a build error on the buildbot.

Ref #109655
2023-07-03 20:30:22 +02:00
Germano Cavalcante
d0bbae8596 Fix #109641: Snapping doesn't respect Clipping Border
The clip planes in `rv3d->clip` were not being added.
2023-07-03 14:37:33 -03:00
Sergey Sharybin
5907ab0364 Fix redefinition SSE2NEON_PRECISE_SQRT on Apple Silicon
After some recent changes BLI_math_base got (indirectly) included
from DNA file, causing defines conflict in Cycles: Cycles wants the
default fast behavior of square root, and BLI color wants it to be
more preciese.

Proposed solution is to move the SSE block away from the math_base
closer to code which uses it. The initial intent was to make those
functions reusable, but for a long long time the color utilities
are the only users of those functions.

This change does not prevent the error from re-occurring in the
future if some code includes sse2neon and BLI color utilities, but
it makes such conflict situation much less likely to happen, for
now.

The downside of this change is that the code now need to include
BLI_simd.h explicitly to access BLI_HAVE_SSE2 instead of relying
on it being included indirectly with math headers. The mitigation
for this is to change semantic of the BLI_HAVE_SSE2: now it is
defined to 1 if SSE2 is supported and to 0 otherwise. This makes
it so the code needs to check if using `#if BLI_HAVE_SSE2` and
if the BLI_simd.h is not included it will generate warning when
using GCC or Clang.

This change in semantic is is something the current patches would
need to ensure is handled correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/109664
2023-07-03 19:18:30 +02:00
Sergey Sharybin
4cd10ddfdb Fix naive 4x4 matrix multiplication C++ implementation
Is not visible on any of the officially platforms, as everywhere
SSE2 is available (on Apple Silicon via sse2neon).

Only got noticed by some intermittent issue during development
which made BLI_HAVE_SSE2 unaccessible.

Seems that transpose was done a bit wrong. Not sure if worth trying
to fold the equation into C++ types, as that requires extra memory
transfers for transpose. Opted for a more naive folding, which
avoids extra copies.

Added a regression test for it, verified against numpy, the BLI
SSE2 implementation.
2023-07-03 19:18:28 +02:00
Sergey Sharybin
baeb314eb7 Fix incorrect EXPECT_M4_NEAR
Seems to be a copy-paste error: the first 3 columns
were only compared as float3, not as float4.

Only affected validness of regression tests which might have
missed an actual mismatch between matrices. Likely, all tests
were valid, and this change did not discover failures.
2023-07-03 19:18:28 +02:00
Sergey Sharybin
46d47e8f9c CMake: Add -Wundef and -Wundef-prefix for Clang compiler
The -Wundef was already added to the GCC compiler, but not
to the Clang compiler.

This allows catching cases when code accesses define variable
which has not been defined yet, for example `#if SOME_VAR` without
having `#define SOME_WAV <value>`.

The exact difference between undef and undef-prefix is not fully
clear, this is just something that seems empirically be needed.

This change discovers access to undefined WITH_METAL in the
GHOST_ContextCGL.mm, which needs to be looked into separately.
2023-07-03 19:18:28 +02:00