Commit Graph

113307 Commits

Author SHA1 Message Date
Jacques Lucke
c31893ed87 Fix: inconsistent socket identifiers in reroute nodes 2024-09-23 18:44:16 +02:00
Jesse Yurkovich
9be3c356d1 Fix: allow use of UDIM tile 1100 in USD
The UsdPreviewSurface spec was recently[1] updated to version 2.5 where
they now specify a full 10x10 grid as being supported. This just makes a
minor change on our side to accommodate this adjustment (as rare as it
may be).

[1] Looks to have been added as part of USD 23.11
https://openusd.org/release/spec_usdpreviewsurface.html#version-2-5-current-head

Pull Request: https://projects.blender.org/blender/blender/pulls/127989
2024-09-23 18:22:15 +02:00
Bastien Montagne
f2038b6664 Fix (unreported) bug in prehistoric IPO conversion code.
One of the multiple code paths converting deprecated IPOs to modern
Actions/FCurves was for some reason not ensuring that the ID had a valid
AnimationData...
2024-09-23 18:18:52 +02:00
Hans Goudey
576843aa92 Refactor: Sculpt: Simplify fake neighbors API
Remove the unnecessary "enabled/disabled" toggle in the struct.
That's unnecessary because they're practically always recalculated
anyway. Also remove outdated comments and move documentation
to the header.
2024-09-23 11:27:12 -04:00
Hans Goudey
78a88ef6ad Cleanup: Sculpt: Reorder undo functions
It's a bit more typical to have "_ex" versions of functions above.
2024-09-23 10:44:48 -04:00
Hans Goudey
5589974b04 Cleanup: Sculpt: Remove old undo debug prints
Working in this area I haven't found this debugging code helpful--
it's too confusing and specific.
2024-09-23 10:44:48 -04:00
Hans Goudey
ed9939ab29 Refactor: Sculpt: Use newer position writing API for undo step restore
Use the API added in d15681a459. Also use multithreading
for the position restore and avoid processing the entire mesh when only
parts of it were changed.
2024-09-23 10:44:48 -04:00
dupoxy
e98e6eda5d Fix #127736: Create new scene with AgX Color Management View Transform
Create new scene with AgX Color Management View Transform to be consistent with the default scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/127750
2024-09-23 16:38:43 +02:00
Sybren A. Stüvel
6115132998 Anim: migrate Action assignments to the new API
Instead of assigning Actions by direct pointer manipulation (and the
corresponding juggling of user counts), call `animrig::assign_action()`
and `animrig::unassign_action()`.

These functions not only correctly handle user counts, but also ensure
that slot assignments & user tracking works. The former always happens,
the latter only when building with experimental features enabled.

Because (un)assigning slotted Actions need the animated ID (instead of
just the `AnimData *`), more functions now require an `OwnedAnimData`.

Note that there is still some user count juggling. This is caused by
`BKE_id_new()`, and by extension `BKE_action_add`, returning an ID with
user count = 1, even though that ID is not yet used. A todo task #128017
has been made to change `BKE_action_add()` so that the Action it returns
can be directly fed into `animrig::assign_action()`.

This PR updates the following areas:

- Creating a node group by grouping animated nodes, as this has to move
  the animation data. This PR just handles the assignment of a new
  Action.
- Temporary Action creation for ungrouping node groups.
- Versioning of pre-2.5 animation data.

No functional changes.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128026
2024-09-23 15:53:32 +02:00
Sybren A. Stüvel
cd1c7039ac Anim: correctly assign Action in id_action_ensure()
Fix two bugs by replacing direct assignment to `adt->action` with a call
to `animrig::assign_action()`:

- If a related Action was found, its user count was not incremented.
- If a new Action is created, its `idroot` was not properly set.

Pull Request: https://projects.blender.org/blender/blender/pulls/128030
2024-09-23 15:48:47 +02:00
Sybren A. Stüvel
99d4c3c44d Refactor: Anim, improve Action assignment functions
The `animrig::assign_action(action, id)` function now takes a `bAction`
pointer (instead of its C++ wrapper `animrig::Action`). This makes it
easier to call from code that just deals with the DNA/C struct.

Also an override was added that takes an `OwnedAnimData` struct instead
of just the ID. This saves the lookup of the AnimData, to be used in cases
where the caller already has it.

Pull Request: https://projects.blender.org/blender/blender/pulls/128030
2024-09-23 15:48:45 +02:00
Sybren A. Stüvel
ee2d8ec8db Anim: add slotted Action support to animdata_copy_id_action
Instead of simply reassigning the `adt->action` and `adt->tmpact` pointers,
the code now uses the `animrig::assign_action()` and `assign_tmpaction()`.
This way the slot user maps should be properly updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/128030
2024-09-23 15:48:42 +02:00
Sybren A. Stüvel
0dc71a653d Refactor: BKE_animdata_action_ensure_idroot compat with layered Actions
Make `BKE_animdata_action_ensure_idroot()` do the right thing when a
layered Action is passed in.

Pull Request: https://projects.blender.org/blender/blender/pulls/128030
2024-09-23 15:48:40 +02:00
Sybren A. Stüvel
6daccf1d15 Cleanup: remove unnecessary call to BKE_animdata_from_id()
The call was followed by `BKE_animdata_ensure_id(id)`, which already
returns any existing animdata.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/128030
2024-09-23 15:48:37 +02:00
Julian Eisel
a91ec1ddb0 Cleanup: Use enum type for brush type switch
This way we'll get a compiler warning when a new brush type is added,
and not handled in the switch. Plus a runtime warning when an invalid
value is cast to the enum. Both can help catching errors.
2024-09-23 15:46:14 +02:00
Aras Pranckevicius
ecce5f45ac Cleanup: rename MAXSEQ -> SEQ_MAX_CHANNELS and make it C++ constexpr
When I was learning VSE code, MAXSEQ constant (a preprocessor define!) was
confusing. It makes it sound like it is "max sequences", but it is actually
"max channels". So rename it to SEQ_MAX_CHANNELS and make it C++ constexpr int
instead of preprocessor macro.

Pull Request: https://projects.blender.org/blender/blender/pulls/128024
2024-09-23 15:43:45 +02:00
Aras Pranckevicius
a8767d943d VSE: Faster strip fcurve lookup for drawing the timeline
Finding which F-Curve (if any) drives the blend factor or volume of a strip is
fairly expensive (it has to search all the curves to find the one matching the
name). Speed that up by:

- Doing the f-curve lookups in parallel for all the visible strips,
- The found curve is stored in StripDrawContext, so this also avoids finding
  the "volume" curve twice for the same strip (once for waveform, once for
  fcurve overlay).

Viewing Sprite Fright Edit v135 whole timeline on Ryzen 5950X (Win10/VS2022):
timeline repaint 18.5ms -> 7.7ms

Pull Request: https://projects.blender.org/blender/blender/pulls/128015
2024-09-23 15:42:40 +02:00
Jeroen Bakker
fe18daacda Vulkan: Validation error when using de-interleaved vertex buffers
De-interleaved vertex buffers offsets the attribute in the buffer to
the de-interleaved position. The vertex attribute offset is limited by a
constrained and would raise an error when the buffers just a bit larger.

*VUID-VkVertexInputAttributeDescription-offset-00622*:  offset must
be less than or equal to `VkPhysicalDeviceLimits::maxVertexInputAttributeOffset`

This PR fixes this by offsetting the buffer in stead of the attribute.
Offsetting buffers is limited by the amount of memory.

Pull Request: https://projects.blender.org/blender/blender/pulls/128031
2024-09-23 15:10:57 +02:00
Charlie Jolly
bf04513dec Geometry Nodes: new Integer Math node
Provide building block support for integer operations.

Manipulation of integer based data should not be limited to using float math nodes.
Using float math comes with accuracy issues for larger integers and requires unnecessary
type conversions.

The node also adds some integer specific operations like GCM and LCD.

Pull Request: https://projects.blender.org/blender/blender/pulls/110735
2024-09-23 15:01:31 +02:00
YimingWu
801a73887a Fix #128032: GPv3: Texture mapping modifier name typo
Was previously "TimeOffset" which obviously wasn't correct. Corrected to
"TextureMapping".
2024-09-23 20:58:32 +08:00
Iliya Katueshenock
c40dc9aa03 Nodes: use node storage to store type of reroute node
The reroute node used to be a bit special in the sense that its data type was
only stored in the sockets. However, typically, the ground truth data should be
stored in the node storage and then the socket types are derived from that.

For users, there should not be a noticable difference. However, from Python
it's not possible to modify the socket type directly on the socket anymore.
This is forbidden for other built-in nodes already too.

Instead, one can use the new `reroute_node.socket_idname` property to change
the type of a node. This internally also recreates the sockets with the correct
type.

Pull Request: https://projects.blender.org/blender/blender/pulls/121146
2024-09-23 14:47:05 +02:00
Falk David
3c8d4becc8 Cleanup: GPv3: Return reference from GreasePencil::layer() functions
Since we only assert and never return `nullptr`, it's better to just return a reference.
The access into the span already asserts anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/128025
2024-09-23 13:54:02 +02:00
Pratik Borhade
e494a44024 Fix #128007: Outliner visibility toggles can be edited on linked data
When a linked/overridden collection is child of a local collection,
object/collection level visibility toogles can be edited of library data
if shift clicked on local collection's properties. To fix this, skip further
recursive calls when the property is not editable.

Pull Request: https://projects.blender.org/blender/blender/pulls/128011
2024-09-23 13:06:47 +02:00
Pratik Borhade
c29a2eb451 Fix #127928: Default radius value for gpv3 draw brush
Set default value of `unprojected_radius`

Pull Request: https://projects.blender.org/blender/blender/pulls/128023
2024-09-23 13:05:26 +02:00
Falk David
bb9489070a Cleanup: GPv3: Remove const qualifier in function declaration
The `const` isn't needed for trivial types and shouldn't be used.
2024-09-23 12:16:12 +02:00
Falk David
332f7517da GPv3: Add function to insert a keyframe into multiple layers
This function adds a key into multiple layers. This is more efficient than
inserting a single key multiple times in a loop, because the drawing
array has to be resized one-by-one.
In this function, the resizing happens at once.

Pull Request: https://projects.blender.org/blender/blender/pulls/127930
2024-09-23 12:12:59 +02:00
Clément FOUCAULT
3d74be9c5b Fix #126947: EEVEE: Color drifting & darkening at high sample count
The hardware seems to truncate the mantissa instead
of rounding. Doing the rounding manually fixes the issue.

See PR for in depth analysis.

Pull Request: https://projects.blender.org/blender/blender/pulls/127948
2024-09-23 11:30:59 +02:00
Jeroen Bakker
ddb2179e37 Vulkan: GPU device selection
Allows users to override the auto detection for GPU
selection. Normally the GPU selection is done by looping
over the order Vulkan provides and finding the highest
performing device based on its type (discrete, integrated,
software).

However users might have multiple discrete cards and want
to switch between them. Or developers want to validate other
GPUs without rebooting.

This PR adds the ability to override the auto detection
for the vulkan backend.

![image](/attachments/5d9198a8-af08-4eee-aa73-363edea11cd9)

**Future improvements**:
- This PR does not include a command line option. This can be added
  later for render farms.

Pull Request: https://projects.blender.org/blender/blender/pulls/127860
2024-09-23 11:18:24 +02:00
Campbell Barton
f4c8845b60 Cleanup: remove duplicate check for AMD W6800 GPU
This read like a typo (which missed W6700) however the GPU
wasn't released. Remove the duplicate check and add a note.

Ref !127993
2024-09-23 19:09:14 +10:00
Jeroen Bakker
e7793cbc4d UI: Incorrect usage shader and primitive
Some primitives can only work with certain shaders. In OpenGL this
didn't lead to an error, but Metal and Vulkan could not render at all.
The Vulkan backend is more specific on what it supports so we could
detect incorrect usages and fix them.

This was detected when investigating #126947.

Pull Request: https://projects.blender.org/blender/blender/pulls/128013
2024-09-23 10:31:22 +02:00
Jeroen Bakker
56b7ff256f Vulkan: Fix validation error push constants for compute shaders
Since parallel compilations was introduced, a validation error
was signalling that push constants for compute shaders didn't have
the correct pipeline binding. The root cause was that the pipeline
binding was determined, before the type of shader was known.

This PR fixes this by detemining if a shader is a compute shader up
front. It also removes some code that could lead to issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/128010
2024-09-23 09:44:29 +02:00
Aras Pranckevicius
5a1cf200aa Fix #127542: OBJ material groups are not written unless .mtl file is also written
These two settings are not coupled together, one should be able to
export face material groups without exporting the .mtl file.
2024-09-23 10:16:25 +03:00
Campbell Barton
72b6ffd508 Fix IDPropertyUIManager.as_dict() non-array default for arrays
When a non-array default was set for an array,
the returned default would be empty.
2024-09-23 16:25:13 +10:00
Campbell Barton
57eae31ce9 Fix #127952: Crash on load after id_properties_ui type change
Resolve regression in [0] which keeps UI data when ID property types
change.

[0]: 91466f71f1
2024-09-23 16:18:39 +10:00
Campbell Barton
3e6c816ad4 BLI_math: convert to double before halving for eulO_to_quat
As doubles are used for higher precision, promote to double before
halving the euler for a marginally more precise result.
2024-09-23 12:28:05 +10:00
Campbell Barton
7feccafbb0 Cleanup: various non functional changes
- Use const arguments.
- Quiet unused assignment warnings.
- Use explicit cast to suppress CPPCHECK's truncLongCastReturn warning.
2024-09-23 11:20:14 +10:00
Jacques Lucke
a34b0e17d6 Fix: Geometry Nodes: avoid dangling zone nodes when copying zones
Previously, it was possible to get an invalid zone by copying e.g. the Simulation Input.
Now, whenever copying only one zone node, the other one will automatically be selected
as well. This effectively avoids the dangling zone node.

The same happens already when deleting and grouping nodes.

There are still ways to get dangling zone nodes, especially from Python.
2024-09-23 01:31:59 +02:00
Jacques Lucke
b7bfdfa983 Geometry Nodes: propagate string property subtype to modifier
The only exposed subtype for strings is `file path` currently. Inputs of this
type will show a button to select a path with the file browser.
2024-09-23 01:16:17 +02:00
Jacques Lucke
9239c00eda Geometry Nodes: support showing viewer attribute for grease pencil in spreadsheet 2024-09-22 22:52:28 +02:00
Aras Pranckevicius
c6f5c89669 BLI: faster float<->half array conversions, use in Vulkan
In addition to float<->half functions to convert one number (#127708), add
float_to_half_array and half_to_float_array functions:
- On x64, this uses SSE2 4-wide implementation to do the conversion
  (2x faster half->float, 4x faster float->half compared to scalar),
  - There's also an AVX2 codepath that uses CPU hardware F16C instructions
    (8-wide), to be used when/if blender codebase will start to be built
    for AVX2 (today it is not yet).
- On arm64, this uses NEON VCVT instructions to do the conversion.

Use these functions in Vulkan buffer/texture conversion code. Time taken to
convert float->half texture while viewing EXR file in image space (22M
numbers to convert): 39.7ms -> 10.1ms (would be 6.9ms if building for AVX2)

Pull Request: https://projects.blender.org/blender/blender/pulls/127838
2024-09-22 17:39:54 +02:00
Campbell Barton
2b2a176d8d Cleanup: remove dead code from system path lookup
Commit [0] missed removing this.

[0]: 53dc251fd3
2024-09-22 22:45:11 +10:00
Aras Pranckevicius
958433194e Fix #127932: STL importer was not setting faces as sharp
To match what the previous Python STL importer was doing, and what
the documentation / tooltips say is happening, the imported mesh
faces should be marked as sharp. Do that.
2024-09-22 14:19:38 +03:00
Campbell Barton
b302f37952 Cleanup: remove/comment unused struct members & variables 2024-09-22 18:25:40 +10:00
Campbell Barton
4bd0cc888e Cleanup: various non functional changes
- Reduce variable scope.
- Function style casts.
- Avoid variable shadowing.
- Quiet unused assignment warnings.
- Remove redundant call in GHOST_WindowNULL constructor.
2024-09-22 18:25:40 +10:00
Sean Kim
31e908bce4 Fix #127910: Bake Object Transform does not set an active layer
Missed in bd7c6208b7.

Pull Request: https://projects.blender.org/blender/blender/pulls/127961
2024-09-22 09:17:46 +02:00
Jesse Yurkovich
447cde140d Cleanup: Remove unused BLI_array macro implementation
Remove unused files.

Pull Request: https://projects.blender.org/blender/blender/pulls/127962
2024-09-22 00:53:14 +02:00
Jesse Yurkovich
1dbf75ff52 Cleanup: Remove BLI_array macros in bmesh edgenet
This replaces the older dynamic c array macros with blender::Vector in
bmesh_polygon_edgenet. This is the only remaining use of the old array
machinery and removal of `BLI_array.h / .c` can happen immediately
afterwards.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/119975
2024-09-21 23:59:14 +02:00
Sean Kim
e908a9d39e Cleanup: Rename bmesh detail size raycast function
Pull Request: https://projects.blender.org/blender/blender/pulls/127954
2024-09-21 22:20:00 +02:00
Sean Kim
fc8a163892 Refactor: Sculpt: Remove usage of PBVHVertRef in raycast methods
Part of #118145.

This commit removes the `PBVHVertRef` abstraction and changes the last
remaining usage of it. The `raycast_node` API has been turned into a
static function and the corresponding typed APIs exposed for direct
usage.

Pull Request: https://projects.blender.org/blender/blender/pulls/127933
2024-09-21 20:17:18 +02:00
Campbell Barton
0d8149d4ff Cleanup: various non-functional changes
- Use const pointers.
- Avoid shadowing variables.
- Remove redundant check.
2024-09-21 23:01:59 +10:00