Commit Graph

105655 Commits

Author SHA1 Message Date
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 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
Sybren A. Stüvel 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
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
Sybren A. Stüvel 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
Sybren A. Stüvel 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
Sybren A. Stüvel 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 128eb6cbe9 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
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
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 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
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
Brecht Van Lommel f63accd3b6 Cleanup: move CMake test utility functions into testing.cmake
Combining functions from macros.cmake and Modules/GTestTesting.cmake.
It was unusual to have Blender specific code in the Modules folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/116719
2024-01-03 14:49:11 +01:00
Jacques Lucke 38da27d31e Fix #116585: adding new hook results in crash
The issues was a missing depsgraph tag after adding the hook modifier.
Because of this, the depsgraph did not make a new copy of the object,
which led to a discrepancy between the number of modifiers on the original
and evaluated object.
2024-01-03 14:09:35 +01:00
Brecht Van Lommel d377ef2543 Clang Format: bump to version 17
Along with the 4.1 libraries upgrade, we are bumping the clang-format
version from 8-12 to 17. This affects quite a few files.

If not already the case, you may consider pointing your IDE to the
clang-format binary bundled with the Blender precompiled libraries.
2024-01-03 13:38:14 +01:00
Sergey Sharybin 40953b0e39 Cleanup: Unused calculation in sculpt clay brush
Pull Request: https://projects.blender.org/blender/blender/pulls/116739
2024-01-03 11:18:43 +01:00
Sergey Sharybin 46f3f53b16 Fix #115977: Regression: Sculpt: Clay Thumb brush extra offset
The refactor in cf9fcbf24e used the wrong area coordinate for the
clay brush: the original code used `ss->cache->location` as the
`area_co` passed to the bush callback, and the new code after refactor
used the `area_co` which was calculated as a displaced brush plane.

The calculation of the displaced brush area plane as `area_co` seems
to be unused, and reason for it is not really clear.

This change only restores the `area_co` passed to the brush callback
to the value it used to be prior to the refactor.

Pull Request: https://projects.blender.org/blender/blender/pulls/116738
2024-01-03 11:16:20 +01:00
Jason Fielder cbcb6abfee Fix #116128: Resolve EEVEE Next deferred light sync in Metal
Render to Render workload depedency not correctly syncing
in Metal. PR adds hard pass break where GPU_memory_barrier's
occur during render workloads to ensure non-pixel-local writes
are visible to subsequent render invocations as needed. This is
required to support full pass dependencies on a tile-based GPU
architecture.

Note that these barriers are therefore expensive, so are skipped
where dependencies are local and fragment execution order is
well-represented via either blend order or explicit
raster_order_groups.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116656
2024-01-03 05:38:42 +01:00
Harley Acheson cd4328dd82 UI: Dynamic File Browser Tooltips
Show tooltips in File Browser (both in thumbnail and list views) that
provide extra information and vary by type, like video resolution and
frames, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/104547
2024-01-03 03:56:12 +01:00
Brecht Van Lommel 4ce14a639f Revert "Cleanup: move CMake test utility functions into testing.cmake"
This breaks execution of some Windows tests.

This reverts commit 4190a61020.
2024-01-02 19:06:39 +01:00
Brecht Van Lommel 71474da5fd Fix RNG memory leak on various error conditions
This memory leak shows up in the flaky blendfile_versioning test, and
this may help fix it.
2024-01-02 17:21:30 +01:00
Sybren A. Stüvel cd8f1853ed Anim: replace `bone_collection.find_index()` with `.index` property
Replace the RNA function `bone_collection.find_index()` with a read-only
property `.index`. The functionality is the same, just exposed to RNA
differently.

Note that this property still does an array scan, and thus has complexity
`O(n)` in the number of bone collections. Since this number is relatively
small, this shouldn't be a problem.
2024-01-02 16:55:55 +01:00
Sybren A. Stüvel 631da7a475 WM: document some options of the `bpy.ops.wm.read_homefile` operator
Add documentation for `bpy.ops.wm.read_homefile` options
`use_factory_startup` and `use_empty`.
2024-01-02 16:55:55 +01:00
Brecht Van Lommel 1f3ce2a311 Build: changes to macOS build flags to fix linker warnings
* Different fix for Mantaflow linker warnings that works with new OpenVDB.
* Use new linker for arm64 as it no longer produces warnings with latest
  Xcode. Still use the old one for x86_64 as some warnings remain.
* Fix wrong x86_64 build target in deps builder.

For the upcoming 4.1 libraries.

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/116708
2024-01-02 16:22:48 +01:00
Michael Kowalski c6d61e8586 USD: Support armature and shape key export
New functionality to export armatures and shape keys as USD
skeletons and blend shapes.

Added "Armature", "Only Deform Bones" and "Shape Key" USD export options.

Added USDArmatureWriter class.

Extended USDMeshWriter to write skinned meshes for binding
with skeletons and 'neutral' meshes with blend shape targets.
Specifically, when exporting an armature, a skinned mesh is written
in its pre-modified rest position.  When exporting to blend shapes,
a mesh with shape keys is saved with its vertices in the shape key
basis shape position.

Added USDHierarchyIterator::process_usd_skel() function to
finish processing skeleton and blend shape export after the
writer instances completed writing.  This is necessary because
some of the export operations require processing multiple prims
at once.

Extended USDTransformWriter::do_write() to write transforms
sparsely, to avoid saving redundant transform values when exporting
armatures.

Added a create_skel_roots() function, called on the stage at the
end of the export.  This function attempts to ensure that skinned
prims and skeletons are encapsulated under SkelRoot primitives,
which is required in USD for correct skinning behavior.

When exporting blend shape animations for multiple meshes bound
to a single skeleton, we need to merge the blend shape time samples
of the different meshes into a single animation primitive at the end
of the export.  This requires some tricky book keeping, where the weight
time samples for a given mesh are initially saved by the mesh writer to a
temporary attribute on the mesh and are later copied to the animation
primitive as one of the final steps.

When writing blend shapes and skinned meshes, the pre-modified mesh
is exported.  This is to ensure that the number of blend shape offsets
matches the number of points, and so that the skinned mesh is saved in
its rest position.

Because the pre-modified mesh must be exported, modifiers in addition
to Armature modifiers will not be applied.  This still allows the round trip
UsdSkel -> Blender -> UsdSkel, but some additional setup might be
required to export to UsdSkel when there are multiple modifiers (for
example, applying mirroring modifiers that precede the armature
modifier).

Exporting bendy bones or absolute shape keys isn't currently
supported.

Co-authored-by: Charles Wardlaw <charleswardlaw@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/111931
2024-01-02 15:51:39 +01:00
Brecht Van Lommel 4190a61020 Cleanup: move CMake test utility functions into testing.cmake
Combining functions from macros.cmake and Modules/GTestTesting.cmake.
It was unusual to have Blender specific code in the Modules folder.
2024-01-02 15:34:52 +01:00
Sybren A. Stüvel 9f38c6e887 Anim: Add `bone_collection.parent` accessor to RNA
Add a read-only property `bone_collection.parent` to RNA that returns
the parent bone collection.

This performs two scans of the array (one to find the bone collection's
index, and the other to find the parent index). This might look bad, but
as long as `Object.children` still loops, in Python, over all of
`bpy.data.objects`, this should also be acceptable.
2024-01-02 12:49:04 +01:00
Clément Foucault 86d008d112 Metal: Fix missing new line characters
This broke compilation of some shaders
2024-01-01 11:29:04 +13:00
Clément Foucault 1c96d0d861 Metal: Improve shader logging
This adds some `#line` directive between the
source file injection so that the log parser knowns
which file the errors originated from.

This is then followed by a scan over the combined
source to find out the real row number.

This needed some changes in the `Shader::plint_log`
to skip lines to avoid outputing redundant information.
2024-01-01 00:43:09 +13:00
Clément Foucault 1e7a2fe483 GPU: Fix wrong error lines in tests
This was caused by the addition of the
license headers. This is not very
important but allow debugging failling
tests.
2024-01-01 00:34:29 +13:00
Clément Foucault f639a6fd03 EEVEE-Next: Replace gl_LocalInvocationID by gl_LocalInvocationIndex
This saves some uneeded operations in many cases.
2023-12-31 20:13:28 +13:00
Clément Foucault 6e42b6e7c7 Fix: EEVEE-Next: Broken surfel cluster shader compilation
This was because of a missing flag.
2023-12-31 20:09:15 +13:00
Clément Foucault fa5c9ae0b2 Metal: Remove warning about dummy attribute
This dummy attribute is never in an interface
and is there only to workaround the strict
requirement of a VBO in a GPUBatch.
2023-12-31 18:58:04 +13:00
Hans Goudey 854d7afa1e Cleanup: Use FunctionRef instead of std::function
This is clearer about the lack of need for ownership of callback
data and can be faster as well.
2023-12-30 20:16:03 -05:00
Jason Fielder d721dcd767 Metal: Resolve texture atomic compilation issue
Resolves small issue with native texture
atomic support after addition of fallback path.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116657
2023-12-31 01:07:47 +01:00
Hans Goudey 715c829290 Fix #116647: Sculpt smooth brushes ineffective with low strength
Logic mistake in ac15db443f.
2023-12-30 13:51:33 -05:00
Hans Goudey 255ac188a9 Fix #115400: "Face Sets from Visible" missing undo and redraw
Now that we only redraw (and push undo steps for) changed PBVH nodes,
we need to do that for the case where everything is visible and we
remove the face set attribute. Extract that to a separate function in
order to keep the optimization to only do work for changed PBVH nodes.
2023-12-30 12:36:29 -05:00
laurynas 6f5139cdca Fix: all curves drawn cyclic if "cyclic" attribute exists
All curves are drawn cyclic despite "Cyclic" state in redo panel if at
least one was created cyclic. Also patch adds support of "Cyclic" in
redo panel for "Poly" curves. It is ignored in "old curve" draw tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/116638
2023-12-30 15:55:21 +01:00