Commit Graph

131543 Commits

Author SHA1 Message Date
Campbell Barton
5dd91346e1 Cleanup: remove unused imports 2024-01-08 11:40:53 +11:00
Campbell Barton
375c217ea0 Cleanup: apply clang-tidy modernize-deprecated-headers 2024-01-08 11:32:49 +11:00
Campbell Barton
2783af45ee Cleanup: trailing newlines 2024-01-08 11:31:43 +11:00
Campbell Barton
40444b35d1 Cleanup: various non-functional changes for C++ 2024-01-08 11:31:43 +11:00
Campbell Barton
617f7b76df Cleanup: comment block formatting 2024-01-08 11:31:43 +11:00
Campbell Barton
0ba83fde1f Cleanup: spelling in comments 2024-01-08 11:24:37 +11:00
Jesse Yurkovich
268f93d763 Fix: memory leak during Property Search
An early return prevented the property item array from being free'd.

Pull Request: https://projects.blender.org/blender/blender/pulls/116860
2024-01-07 20:37:30 +01:00
Jacques Lucke
797013b7f4 Fix #116866: crash when adding volume
This removed line is not necessary anymore since
3b3b1bb1a75399cf25af2db65ed7fff57538dd5f.

That's because the run-time data is not written to the
.blend file anymore at all.
2024-01-07 13:49:02 +01:00
Jacques Lucke
e983e47616 Cleanup: remove unused simplify level from volume runtime data 2024-01-07 11:03:18 +01:00
Clément Foucault
28356d1f89 Metal: Add debug names to compute pipelines 2024-01-07 22:46:44 +13:00
Thomas Barlow
8b8ca00270 Fix #107634: selecting random hair curves ignores operator settings
There was a second randomization loop after the first loop which ignored
the operator settings. This may have been accidentally left in from when
the operator was being developed.

Removing this second loop makes the operator work as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/116835
2024-01-07 10:22:25 +01:00
Hans Goudey
4b427e1b57 Fix #116843: Multires sculpting crash in undo step creation
The number of multires vertices was wrong after 31435c85c8ee873211cd.
2024-01-06 23:58:14 -05:00
Pratik Borhade
26a629a696 GPv3: Crash deleting end points
Crash is observed when `dst_curve` nums are same as original curve.
`type_count` array in runtime struct of `dst_curve` is not updated after copying
curve attributes hence the crash/assert. In other case (when source and
dst curve_nums are different), type_count is updated when dst.finish()
is called in `gather_attributes()`

Pull Request: https://projects.blender.org/blender/blender/pulls/116839
2024-01-07 05:37:31 +01:00
Clément Foucault
b8b9ed075b Fix: GPU: Crash caused by buffer overflow of name buffer
This was caused by the name buffer not being sized
accordingly. Now counts the specialization constants.
2024-01-07 16:53:56 +13:00
Clément Foucault
8032f85f61 Metal: Allow pretty log for compute shader 2024-01-07 16:48:54 +13:00
Clément Foucault
8dd08d81f4 Fix: GPU: Fix Shader builder
The recent header changes moved the header
containing this function to C++.
2024-01-07 16:48:29 +13:00
Clément Foucault
f2b3403145 EEVEE-Next: Gbuffer Read optimizations
This modify most shader using the GBuffer to use the
`ClosureUndetermined`. This in turn reduces the amount
of duplicated data in the `GBufferReader` structure.

The most important part is the usage of fixed array
indices to access the `GBufferReader.closures[]`.
This avoid the struct to be moved from local register
to device memory and remove a huge performance penalty.

Pull Request: https://projects.blender.org/blender/blender/pulls/116772
2024-01-07 04:46:25 +01:00
Clément Foucault
6f51d7332b EEVEE-Next: Refactor Raytracing to support arbitrary closure
This refactors the whole pipeline to be closure agnostic.

This mean we can have only one raytracing step that covers
any closure type. In practice, it means that there is
3 objects having 1 closure each with a different closure
types each, we can run the raytracing once.

This create a huge overhead during the tile classification
stage. This is fixed by #116772 and will be merged separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/116670
2024-01-07 02:52:04 +01:00
Hans Goudey
3eee758c2b Cleanup: Fix build warnings and errors after recent commits
- Add missing include for `std::function` without TBB
- Add include for math define reported in chat (couldn't reproduce that)
2024-01-06 09:06:20 -05:00
Hans Goudey
e90d844dd7 Cleanup: Grammar in comments
"it's own" -> "its own" again. Start new sentences properly.
2024-01-06 09:02:56 -05:00
Hans Goudey
5179e66756 Cleanup: Move array store files to C++ 2024-01-06 09:02:55 -05:00
Jacques Lucke
3b3b1bb1a7 Volume: move volume runtime data to separate allocation
The same is done for other geometry types. This allows us to use C++ types in
the run-time data more easily and avoids dumping runtime data into .blend files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116840
2024-01-06 13:26:59 +01:00
Guillermo Venegas
5b104fb3fa Cleanup: Silence warnings from 1254fee589
Introduced in 1254fee5898ba2a8e21bb6b64ee5f235248ff386

Also remove translation from CLOG statements.

Pull Request: https://projects.blender.org/blender/blender/pulls/116836
2024-01-06 06:53:42 +01:00
Jesse Yurkovich
75c71b78ba Cleanup: Use new OIIO valid_file API
Now that OIIO has proper `valid_file` APIs for the formats we care
about, and which take MemReaders, we can remove the code added to TIFF,
PSD, and PNG as part of 5cc8fea7e99.

Additionally, this change eliminates the recent console spew on startup
where the TIFF loader is asked to load non-TIFF files (it is based on
the ordering of the filetype array)[1]. We now make a `valid_file` check
during open to address this.

[1] `: Not a TIFF or MDI file, bad magic number 12150 (0x2f76).`

Pull Request: https://projects.blender.org/blender/blender/pulls/116826
2024-01-06 05:50:04 +01:00
Guillermo Venegas
1254fee589 IO: Add support for Drag and Drop to FileHandlers
Added support to Drag and Drop to file handlers, part of #111242.

If file handlers are registered with an import operator they can now be
invoked with drag and drop path data.

Import operators must either declare a `filepath` StringProperty or both
a `directory` StringProperty and a `files` CollectionProperty depending
on if they support single or multiple files respectively.

Multiple FileHandlers could be valid for handling a dropped path. When
this happens a menu is shown so the user can choose which exact handler
to use for the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/116047
2024-01-06 03:51:45 +01:00
Hans Goudey
09063a3632 Cleanup: Remove some indirect includes in common headers
The idea is to avoid mistakenly depending on indirect includes,
and avoid compile time overhead from unnecessary header parsing.

Pull Request: https://projects.blender.org/blender/blender/pulls/116664
2024-01-06 01:47:39 +01:00
Jesse Yurkovich
ae02096ad6 Cleanup: Warning fix
Fix warning introduced in b0db5363fac313a5bae87850c6550857b9d86beb

Pull Request: https://projects.blender.org/blender/blender/pulls/116828
2024-01-05 22:44:46 +01:00
Aras Pranckevicius
423e54b000 VSE: Scopes improvements
- Improve the look of them, so they feel less like from year
  1998 (more details and images in the PR).
- Some of the scopes got slightly faster in the process, others
  stayed the same performance (details below).
- Remove VSE Scopes related data from SpaceSeq DNA, move it into
  runtime instead.
2024-01-05 22:03:03 +01:00
Bastien Montagne
3e744db9fe Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.

This does not work, only the last call is effective, all previous
ones have absolutely no effect.

This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.

This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).

NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.

NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
Jesse Yurkovich
b0db5363fa Cleanup: Use blender C++ containers for USD
Use Vector, Map, and Set as appropriate.

The remaining uses of the std:: types come from USD APIs.

Pull Request: https://projects.blender.org/blender/blender/pulls/116801
2024-01-05 20:35:55 +01:00
Hans Goudey
0a8129e0cf Cleanup: Make format 2024-01-05 13:59:07 -05:00
Hans Goudey
549a606383 Cleanup: Improve face corner variable name, simplify iteration 2024-01-05 13:26:22 -05:00
Hans Goudey
ecc3656f72 Cleanup: Move remaining draw geometry extraction code to C++ namespace
Overall the transition to C++ in the draw module is awkwardly half
complete, but moving more code to a C++ namespace makes cleaning up
this code in other ways much easier, and the next C++ cleanup steps
are clear anyway.
2024-01-05 13:26:22 -05:00
Hans Goudey
5b55c1dc10 Cleanup: Move five draw headers to C++ 2024-01-05 13:26:22 -05:00
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