Commit Graph

131509 Commits

Author SHA1 Message Date
Bastien Montagne
95b30b3516 Build: Ninja: Move 'Unity builds' to heavy pooljobs.
This commit adds a new helper to define expected properties when a
target needs to use the unity build feature.

That new helper does what was already done for existing cases, and in
addition add the target to the Ninja 'heavy' pooljobs if relevant.

Pull Request: https://projects.blender.org/blender/blender/pulls/116791
2024-01-05 18:35:48 +01:00
Bastien Montagne
fd0ca109b1 Build: Ninja: Enable pooljobs by default.
Using pooljobs with default settings should never have any significant impact
on the build speed, and it makes building full debug with sanitizer builds
safe on (almost) all machines.

Quick test showed no significant difference in Release build time with or
without Ninja pooljobs (on linux, with a 16 cores, 64GBb machine).
2024-01-05 17:09:56 +01:00
66cdc112fc Anim: Bone Collections, replace .move_to_parent() with .child_number
Instead of moving bone collections by absolute index, they can now be
moved by manipulating `.child_number`. This is the relative index of the
bone collection within the list of its siblings.

This replaces the much more cumbersome `collections.move_to_parent()`
function. Since that function is now no longer necessary (it's been
replaced by assignment to `.parent` and `.child_number`), it's removed
from RNA. Note that this function was never part of even a beta build of
Blender.
2024-01-05 16:54:46 +01:00
6444eeb14c Anim: test, improve bone collection name tests
The `expect_bcolls()` function now no longer calls the `EXPECT_EQ` macro,
but returns a `testing::AssertionResult` instead. The function call does
need to be wrapped in an `EXPECT_TRUE()` call now, but that also means that
any failure message points directly to the call site.
2024-01-05 16:54:46 +01:00
Omar Emara
9f076edf5d Fix: Filtering does not work in GPU compositor
Texture filtering does not work in the GPU compositor. That's because
filtering is set after textures are bound. It works in the viewport
compositor because the textures come pre filtered from the DRW texture
pool.
2024-01-05 17:38:10 +02:00
Hans Goudey
517feec7ea Cleanup: Improve some mesh topology map variable naming
Avoid unnecessary abbreviations like `pmap` or `vemap`.
2024-01-05 10:35:39 -05:00
d4ce5d6fc9 Anim: add RNA getter for bone_collection.is_visible_effectively
Add an RNA getter for `bone_collection.is_visible_effectively`. This
value could already be derived from other flags, but now that logic sits
in C++ and doesn't require duplicated logic in Python any more.
2024-01-05 15:33:56 +01:00
a9d9c3b116 Cleanup: Anim, typo fix
Typo fix in a comment. No functional change.
2024-01-05 15:33:40 +01:00
Germano Cavalcante
8460b67ef8 Fix #105460: Overlay "Backwire Opacity" is 0.0 in new 3D Views
The ability to adjust the "Backwire Opacity" was mistakenly removed in
version 2.93 (b365cc017a).

As this issue went unnoticed by most users, it appears reasonable to
completely remove this setting from the code.

By making this change, there is no longer a need to define a default
value for `View3DOverlay::backwire_opacity`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116799
2024-01-05 13:59:02 +01:00
Christoph Lendenfeld
73f968dbe5 Refactor: keyframing unit tests
This PR changes two things

Move setup/cleanup code into `setUp`/`tearDown`

Change the `_fcurve_paths_match` to raise an error instead of returning a bool.
That makes it easier to see what the actual error is.

Pull Request: https://projects.blender.org/blender/blender/pulls/116816
2024-01-05 13:38:45 +01:00
Omar Emara
752e416813 Fix: GPU morphological feather erosion differ from CPU
The GPU implementation of the morphological feather erosion operator is
different from the CPU implementation. This is because the CPU does
erosion by doing dilation sandwiched between two inverse functions. So
this patch fixes the different by following the CPU implementation.
2024-01-05 14:21:31 +02:00
Omar Emara
581f2d3c7d Realtime Compositor: Aspect correct mask inputs
This patch implements aspect ratio correction for mask inputs if the
size mode is set to Render Size.
2024-01-05 14:02:19 +02:00
Bastien Montagne
7de49d5f80 Build: Ninja: Use similar logic for default heavy and regular jobs amount.
Update the regular jobs amount computation to follow the same logic as
for the heavy ones. the main difference is that it uses a '2Gb of RAM
per job' base value.

This change is mainly targetted at machines with a relatively low
RAM/cores ratio, since even regular compile jobs can end up using quite
a lot of RAM if many are running in parallel, previous defaults would
likely not work well on machines with e.g. 16Gb of RAM and 16 cores.

Also fix a typo in previous commit (6493d0233c), sorry about that.
2024-01-05 12:51:47 +01:00
Bastien Montagne
6493d0233c Build: Ninja: tweak pooljobs default settings.
This commit simplifies and makes more generic the computation of the
maximum number of parallel heavy build jobs. Essentially, it allows 1
heavy job per 8Gb of RAM.

It also systematically sets the amount of heavy jobs, since we are going
to get more of these in the future (like the 'unity build' units), the
previous heuristic had some loose ends (e,g for a 40Gb RAM, 16 threads
machine, it would not set any limit to heavy jobs, yet said machine
would likely not be able to run 16 3.5+Gb heavy jobs in parallel...).

This is some initial step towards a better handling of 'sanitizer' builds
on the Blender buildbot.
2024-01-05 12:22:00 +01:00
Christoph Lendenfeld
03a66af318 Anim: Unit tests for "Insert Needed"
Add unit tests for the user preference option "Insert Needed"

Basic tests for objects and bones that check if autokeying in
combination with "Insert Needed" only
* keys all location channels on the first key
* keys only the modified channel on the second key

It is supposed to add only keyframes that have been affected
by the used transform operation.
E.g. translating an object will only add keys on translation keys.

The behavior of keying all property array channels first, and then
only add keys on values that have actually changed may change
in the future. Ideally it would only key actual changes to begin
with. But there is no way to do this right now.

Pull Request: https://projects.blender.org/blender/blender/pulls/116419
2024-01-05 09:52:22 +01:00
Hans Goudey
4a95ead054 Cleanup: Miscellaneous C++ changes to file handlers
- Move code to C++ namespace for blenkernel
- Remove unnecessary prefixes based on namespace change
- Remove use of `RawVector` for function-scoped static variable
- Use `StringRef` instead of char pointer
- Use safer `STRNCPY` instead of `strcpy` in tests
- Give span instead of vector to users of API

Pull Request: https://projects.blender.org/blender/blender/pulls/116808
2024-01-05 05:35:29 +01:00
Hans Goudey
709dcc50cf Cleanup: Use C++ math functions instead of macros
And remove the unused or now-unused macros.
2024-01-04 15:42:54 -05:00
Hans Goudey
53e2dcadec Cleanup: Remove unnecessary C default argument macro 2024-01-04 15:42:54 -05:00
Hans Goudey
890f553318 Cleanup: Format 2024-01-04 15:41:58 -05:00
Hans Goudey
d6cfd7d1f4 Cleanup: Remove unnecessary keywords from C++ headers
- Remove unnecessary `struct`
- Use `using` instead of `typedef`
- Remove `void` from `(void)` as function arguments
2024-01-04 15:07:48 -05:00
Hans Goudey
15ae8c3064 Cleanup: Move remaining window manager headers to C++ 2024-01-04 14:30:21 -05:00
Harley Acheson
1ccc958150 UI: Improved Confirmation Dialog for Clear Recent List
Add a nicer, more informative confirmation dialog to the recently-added
operator that clears the Recent File List.

Pull Request: https://projects.blender.org/blender/blender/pulls/116796
2024-01-04 19:31:32 +01:00
Harley Acheson
f40d4e0bda UI: Improved Operator Confirmations
Allow our current simple confirmations to be customized and extended
with callbacks, allowing different behaviors, different icons, and
showing more information. Makes no changes to any existing dialogs.

Pull Request: https://projects.blender.org/blender/blender/pulls/104670
2024-01-04 18:42:21 +01:00
Jonas Holzman
00ef4f9309 Fix: Do not show WM_OT_clear_recent_files on Splash
New operator to clear recent files list should show in the topbar list,
but not be shown on the Splash screen list.

Pull Request: https://projects.blender.org/blender/blender/pulls/116785
2024-01-04 17:50:03 +01:00
Philipp Oeser
5412bd48a9 Alembic: export render resolution on cameras
Blender's cameras don't have specific resolution configured to them,
instead they use the scene's resolution.
This is a problem when exporting a camera using Alembic. Other software
(like Houdini) expects the resolution parameters on the camera itself.

So now store the scene's resolution on each camera that is exported.
Since this is not part of the concept of a camera in alembic itself,
export these as `userProperties` in a way other software can read this.

Fixes #116375

Pull Request: https://projects.blender.org/blender/blender/pulls/116782
2024-01-04 17:49:28 +01:00
6cfbf9ef2f Anim: hierarchical visibility for bone collections
Bone collection visibility now respects their hierarchy.

A bone collection is only visible when it is marked as visible and all
its ancestors (so parents, greatparents, etc.) are visible. Root bone
collections have no ancestors by definition, and only consider their own
visibility.

The effective ancestors' visibility is stored on each bone collection,
in its `BONE_COLLECTION_ANCESTORS_VISIBLE` flag. This makes it possible
to determine the effective visibility from just the flags of the bone
collection itself.

The `BONE_COLLECTION_ANCESTORS_VISIBLE` flag is now stored, with the
other flags, in `BoneCollection::flags`. This means that it's stored in
DNA, even though it's derived data and should actually be stored in a
runtime struct. However, `BoneCollection` doesn't have any runtime
struct yet, and I don't feel that the introduction of this flag is a
good enough reason to introduce that just yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/116784
2024-01-04 17:43:16 +01:00
Michael Jones
31001b67fd Cycles: Enable floating point atomic support in Metal
Utilises native floating point atomic operations if available. Supported in Metal 3.0+ onwards.
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116786
2024-01-04 17:08:29 +01:00
Christoph Lendenfeld
29ed7a69e6 Fix: Set active keying set menu showing wrong label
When opening the menu to set/change the
active keying set, the top entry would
show "Active Keying Set" (if there is one).
(Open the menu with Ctrl+Shift+Alt+I)

Clicking this option would unset the active keying set
though as pointed out by Nika Kutsniashvili in #115798

This PR fixes it by splitting the function that dynamically generates the enum.
The core of the function has been extracted, and only the section
that creates the entry for "Active Keying Set" has been changed.

It now reads "Clear Active Keying Set"

Pull Request: https://projects.blender.org/blender/blender/pulls/116189
2024-01-04 16:38:13 +01:00
Omar Emara
41ba876d78 Fix: Compositor Texture node ignores Z component
The compositor Texture node ignores the Z component. Fix that by
defaulting to zero Z and considering the offset and scale in the node.
2024-01-04 17:05:58 +02:00
29be81ec23 Anim: make RNA property bone_collection.parent writable
Moving a bone collection to another parent is now possible in Python by
assigning to `bone_collection.parent`.

Thanks to Sergey for the implementation.
2024-01-04 15:41:19 +01:00
Matias Mendiola
b165b20cef GPv3: Move set uniform and set opacity operators to Stroke Menu
Due these two operators act on the stroke as a whole and to keep the menu ordering like GPv2

Pull Request: https://projects.blender.org/blender/blender/pulls/116764
2024-01-04 15:25:49 +01:00
6874c87747 Cleanup: Anim, insert section start/end comments
Insert section comments `/* \{ */` and `/** \{ */` to `armature.cc`.

No functional changes.
2024-01-04 14:55:05 +01:00
d12fa306f7 Refactor: Anim, rename function to ANIM_bone_in_visible_collection()
Rename `ANIM_bonecoll_is_visible(armature, bone)` to
`ANIM_bone_in_visible_collection(armature, bone)`, as that reflects the
actual functionality.

No functional changes.
2024-01-04 14:45:29 +01:00
Christoph Lendenfeld
86555838f1 Fix #116367: Scale snapping not working in Graph Editor
The issue was that the "Affect" options from the 3D viewport
were also used for the Graph Editor.
This was discussed in the Animation & Rigging module meeting.
https://devtalk.blender.org/t/2023-12-21-animation-rigging-module-meeting/32748

The consensus was that the Animation Editors should have their own copy of the "Affect" flags.

For this commit I opted for a more immediate solution that ignores the "Affect" flag in the animation editors.
The adding of the flag can be left for a feature PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116781
2024-01-04 14:03:57 +01:00
Omar Emara
d096927139 Compositor: Fallback to render size for viewing values
Fallback to the render size when a single value is connected to the
viewer node. Giving the user the ability to easily view values.
2024-01-04 11:12:45 +02:00
Philipp Oeser
472cf44166 Alembic: read velocities on Points
This is reusing the generic system from 128eb6cbe928 which at that time
was only done for the mesh reader and is now done for the point reader
as well.

This allows for rendering with proper motion blur for alembic points
(which of course are still imported as meshes - were just lacking the
velocity attribute) when directly rendering as points in Cycles.

Came up in #109185 (where instancing is used - which is still not
supported, this patch is just for direct point rendering in Cycles).

Unsure about the status of https://archive.blender.org/developer/D11591
but until that lands, having velocities for points sounds useful enough
to support this now.

Fixes #95945

Pull Request: https://projects.blender.org/blender/blender/pulls/116749
2024-01-04 09:25:24 +01:00
Brecht Van Lommel
ac70bc3611 Fix: temporarily disable Cycles patch map assert to avoid failing test
After recent 4.1 libraries update update for macOS ARM.
2024-01-04 04:06:19 +01:00
Brecht Van Lommel
8131a636fb Build: bump supported Python version to 3.11 on macOS
Now that the precompiled libraries have been updated.
2024-01-04 02:51:44 +01:00
Harley Acheson
0b0e0601a1 UI: Recent Menu Previews
Recent Menu item tooltips showing details and preview image.

Pull Request: https://projects.blender.org/blender/blender/pulls/112644
2024-01-04 00:46:48 +01:00
Clément Foucault
0cda1f4c0d EEVEE-Next: Bypass shadow update pipeline if shadow is disabled
This avoid a lot of overhead but also allows smaller GPU
captures & replay.
2024-01-04 11:00:06 +13:00
Ray Molenkamp
0da2ebf644 make: fix clang-format detection
we're on 17.0.6, not 17.0.0 which resulted in a warning message
being emitted.
2024-01-03 13:29:40 -07:00
Jonas Holzman
a1bcba0598 UI: Implement a Clear Recent Files List Operator
Add a "Clear Recent Files List" item to the bottom of the File / Open
Recent List.

Pull Request: https://projects.blender.org/blender/blender/pulls/116494
2024-01-03 21:26:15 +01:00
Aras Pranckevicius
986f493812 Audaspace: faster audio resampling
Previously in Audaspace there was choice between linear resampler (okay
for preview, but not great for final mix), or "extremely high quality
preset" for rendering the final mix; with nothing in between. I have just
landed "medium" and "low" resampler quality levels in upstream Audaspace
(see https://github.com/audaspace/audaspace/pull/18 with details and
quality spectograms, also comparison with Audacity resampler).

This PR updates Audaspace to latest upstream, and switches to use the newly
added "medium" quality resampler. There's no audible difference (nor visible
one in spectrograms), as far as I can tell.

Timings, rendering out frames 1000-3000 of Sprite Fright Edit blender
studio data set:
- Windows (Ryzen 5950X, VS2022): 92 -> 73 sec
- Mac (M1 Max, clang 15): 70 -> 62 sec

i.e. using a faster audio resampler makes the _whole render process_ be
10-20% faster (however, this from VSE where it combines already pre-rendered
image strips).

Pull Request: https://projects.blender.org/blender/blender/pulls/116059
2024-01-03 21:23:24 +01:00
Aras Pranckevicius
10bea077ae Fix: VSE: image strip outline sometimes not matching image
This is only visible for very low resolution image strips; the math was
operating on integers as image size but doing division by two to get the
outline. For non-even image sizes the outline could be off by a pixel due
to rounding.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116605
2024-01-03 21:20:03 +01:00
Brecht Van Lommel
364beee159 Tests: add option to build one binary per GTest file
Bundling many tests in a single binary reduces build time and disk space
usage, but is less convenient for running individual tests command line
as filter flags need to be used.

This adds WITH_TESTS_SINGLE_BINARY to generate one executable file per
source file. Note that enabling this option requires a significant amount
of disk space.

Due to refactoring, the resulting ctest names are a bit different than
before. The number of tests is also a bit different depending if this
option is used, as one uses gtests discovery and the other is organized
purely by filename, which isn't always 1:1.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114604
2024-01-03 18:35:50 +01:00
Germano Cavalcante
81017772f5 Fix #112599: Blender freezes for half a minute when opening File Browser
The delay is caused by `Shortcut->Resolve(0, SLR_NO_UI | SLR_UPDATE)`
to locate potentially moved or renamed paths.

The issue was resolved by adding the `SLR_NOSEARCH` flag.

This eliminates the delay without sacrificing functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/116692
2024-01-03 18:26:23 +01:00
bsavery
d2e91fb0d7 Cycles: add ROCm 6 compatibility for HIP
ROCm 6 brings some changes to the HIP API. This pull request is meant to be
backward and forward compatible.

That is Blender could be compiled with either ROCM 6 or 5 and run on either.
The main change is the hipMemoryType enum, which we check based on the
runtime version to use the correct enum values.

Without this, HIP will not work on Windows with upcoming 23.40 driver.

Pull Request: https://projects.blender.org/blender/blender/pulls/116713
2024-01-03 18:16:07 +01:00
Sergey Sharybin
d86d86f729 Fix heap buffer overflow in Cycles IES parser
The IES parser in Cycles would lead to heap buffer overflow error
when non-supported or invalid data is provided to it.

The error was caused by the way how stirng is copied to vector
skipping the last null-terminator. Later C-style string utilities
are used for parsing, and they expect the data to be null-terminated.

It is unclear why data needs to be stored as vector: storing it as
string simplifies initialization.

Easiest to reproduce the issue is to use Blender build with address
sanitizer enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/116752
2024-01-03 18:00:41 +01:00
Richard Antalik
534a1c9ecd Fix #115655: Removing transition keys is buggy
This also fixes crash when deleting keys.

Issue was caused by incorrect implementation of batch deleting with
`SEQ_retiming_remove_multiple_keys()` function. It tried to remove data
from different strips, when it should work with one strip at the time.
Also transitions and freeze frames were treated as normal keys, but they
do need special handling.

Pull Request: https://projects.blender.org/blender/blender/pulls/116722
2024-01-03 17:01:53 +01:00
Sergey Sharybin
f0d6346c9a Fix compilation error with WITH_COMPILER_ASAN=ON on macOS
This change solves the following linker error:

  ld: warning: __eh_frame section too large (max 16MB) to encode dwarf unwind offsets in compact unwind table

Proposed solution is to disable unwind table when building Blender with
address sanitizer enabled.

It is stated in the comment in the code, but to make it explicit there
could some side-effects of code which relies on frame walking:

- backtrace()
- __attribute__((__cleanup__(f)))
- __builtin_return_address(n), for n > 0
- pthread_cleanup_push when it is implemented using
  __attribute__((__cleanup__(f)))

From the local tests it seems that backtrace() provides the same
output as prior to this change (but with classic linker used, as prior
to this change it is not possible to link Blender).

The rest of the possibly functionality is not used by Blender, but
it is a bit hard to tell if it is used by any of the dependent
libraries. However, if the libraries are compiled dynamically, there
will be no affect on them with this change.

I am unable to run the full test suit as some of the tests are
failing prior to this change with classic linker. Overall it seems
to be no unwanted side effects on Blender development.

Note that the change only affects debug builds with ASAN enabled,
so it is a low risk of causing some real problem so might as well
just give it a whirl and see if some unpredicted issue arises.

Pull Request: https://projects.blender.org/blender/blender/pulls/116745
2024-01-03 16:39:05 +01:00