Commit Graph

26196 Commits

Author SHA1 Message Date
JonasDichelle 8812be59a4 Compositor: Make Hue Correct node wrap
Compositor: Make Hue Correct node wrap

This patch makes the Hue Correct node as well as the Hue Correct VSE
modifiers to wrap, such that no discontinuities occur for the red hue.
Since it now wraps, the default curve preset now exempts the last point
of the curve.

A new CUMA_USE_WRAPPING flag was added to specify wrapping for curve
maps. The implementation works by adding two virtual points before and
after the terminal points in the curve map, such that their handles
match, and would then produce a continues curve.

This is a breaking change, since existing curves were also adjusted
using versioning. However, the change will not be significant, since in
most realistic cases, the terminal points will be close to each other,
and even with wrapping, the connection will be very sharp, almost
matching the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/117114
2024-03-21 15:35:02 +01:00
Omar Emara 2906ea9785 BLI: Add nearest interpolation with clamped boundary
This patch adds clamped boundaries variants of the nearest interpolation
functions in the BLI module. The naming convention used by the bilinear
functions were followed.

Needed by #119414.

Pull Request: https://projects.blender.org/blender/blender/pulls/119732
2024-03-21 13:22:10 +01:00
Philipp Oeser 475865ddb7 Merge branch 'blender-v4.1-release' 2024-03-21 11:13:23 +01:00
Campbell Barton f64f3e8524 Extensions: recursively remove custom-directories on repo removal
Even though there is a dialog users must accept when removing a
repository & directory being removed is shown, it's possible users
assume this only removes files which are part of the repository after
pointing the custom-directory to their home directory or similar.

Removing repositories which point to a custom-directory now only
remove packages and server meta-data to prevent accidents.

Resolves #119481.
2024-03-21 11:43:00 +11:00
Campbell Barton 57dd9c21d3 Cleanup: spelling in comments 2024-03-21 10:02:53 +11:00
Campbell Barton 116264c310 Cleanup: use full scentences for code-comments & minor corrections 2024-03-21 09:49:19 +11:00
Hans Goudey ddcfc46ee6 Fix #119544: Cage modifier deformation ignored in next modifier
When the edit mesh modifier stack first deforms the original edit mesh,
it creates deformed positions in a separate array. That array is copied
to the mesh's vertex positions if a subsequent modifier requires an
actual mesh rather than a mesh wrapper.

However, if that last deform modifier is the last "on cage" modifier
and the next modifier requires a real Mesh, we hit a code path that
didn't copy the temporary position array, since it was contained in the
separate `EditMeshData` struct that must be handled manually.

This was a regression in 91b27ab637. In the future I hope to
make this simpler by expanding the use of implicit sharing and making
the conversion from original BMesh to a Mesh more lazy / const correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/119718
2024-03-20 23:16:02 +01:00
Miguel Pozo 81ceff8e73 Fix: Missing subversion update
Missing from #119436
2024-03-20 18:39:46 +01:00
YimingWu 3689dfca4f GPv3: Build Modifer migration
Reimplemented build modifier using the new `CurvesGeometry` logic.

Pull Request: https://projects.blender.org/blender/blender/pulls/118739
2024-03-20 13:28:28 +01:00
Jacques Lucke 7447666c85 Merge branch 'blender-v4.1-release' 2024-03-20 11:48:42 +01:00
Jacques Lucke 067daec270 Nodes: don't use combined input/output sockets in node tree interface
Those shouldn't really exist at all currently, since we forbid them in 354915cf3c.
Unfortunately, not all cases were removed, and many node trees with such sockets
have been created during the development of 4.1 due to the auto-smooth changes.

I'm not entirely sure if it's still possible to properly remove them now. The commit
above mentions that we might lose links due to changed identifiers. Maybe we're
better off just supporting these inlined sockets while also allowing the "align with
previous socket" functionality.

Either way, not creating more of such node trees for now is reasonable, since we
explicitly disabled that functionality for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/119654
2024-03-20 11:26:07 +01:00
Campbell Barton ee64778cac Cleanup: code-comments for struct ID's and use backtick quotes
- Prefix comments before members is used practically everywhere,
  remove C99 syntax from inside comments.
- Replace double quotes with backticks for code styling.
2024-03-20 14:43:35 +11:00
Clément Foucault 23dce15f67 EEVEE-Next: Horizon Scan: Use Spherical harmonics
This uses Spherical Harmonics to store the indirect lighting and
distant lighting visibility.

We can then reuse this information for each closure which divide
the cost of it by 2 or 3 in many cases, doing the scanning once.

The storage cost is higher than previous method, so we split the
resolution scaling to be independant of raytracing.

The spatial filtering has been split to its own pass for performance
reason. Upsampling now only uses 4 bilinearly interpolated samples
(instead of 9) using bilateral weights to avoid bleeding.

This also add a missing dot product (which soften the lighting
around corners) and fixes the blocky artifacts seen at lower
resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118924
2024-03-19 19:16:21 +01:00
Falk David 0177c55880 Fix: Curves: Missing check in `get_mutable_attribute`
Same as fd92647f34.
Without this check, the function would try to create a new
attribute even if `num` was 0.
2024-03-19 17:09:41 +01:00
Jacques Lucke 3ad4ea81d1 Nodes: rename multi_input_socket_index to multi_input_sort_id
For historical reasons, the `multi_input_socket_index` was actually reversed
(large index comes first). This patch renames it to `multi_input_sort_id` and
adds a comment. This new name makes it less confusing that the id is reversed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119652
2024-03-19 13:42:09 +01:00
Sybren A. Stüvel 7ec5dab1df Merge remote-tracking branch 'origin/blender-v4.1-release' 2024-03-19 11:18:31 +01:00
Falk David 3334fff801 Fix compiler error on windows
It seems that the compiler on windows struggled to
correctly assign the namespace of the `LocalMemArena`
destructor because the struct was defined locally
in a lambda.

This moves the struct definition out of the lambda.
2024-03-19 11:09:57 +01:00
Sybren A. Stüvel c0c7e34bab Fix #119615: Anim, Crash with NLA tweak mode and linked Armatures
Fix a crash when inserting a key with tweak mode enabled, but where
`AnimData::actstrip` was NULL.

The root cause of this is that two pointers in the `AnimData` struct
(`act_track` and `actstrip`) are expected to be set when NLA tweak mode
is enabled, BUT these are not exposed to RNA and thus invisible to the
library overrides system. As such, they are NULL when loading from disk,
while the `ADT_NLA_EDIT_ON` flag still indicates they are to be used.

Rather than adding a NULL pointer check (and having to add that in many
more places), I used this two-pronged approach:

- Extend the 'NLA tweakmode' override apply code, to set the `act_track`
  and `actstrip` pointers when they are incorrectly NULL. This is done
  by lookup of the track and strip by name.
- Add versioning code to exit out of tweak mode whenever the
  `ADT_NLA_EDIT_ON` flag is set, but those two pointers are still NULL.

The last step was necessary with the example file attached to the bug
report, as that was saved with a buggy blender version. New saves work
just fine.

Pull Request: https://projects.blender.org/blender/blender/pulls/119632
2024-03-19 10:45:32 +01:00
Falk David 53b9d77109 Fix build error
This error was introuced by 5e2955d3cd.
Instead of trying to use the function name
with `__func__` use a string literal.
2024-03-19 10:11:44 +01:00
Falk David 5e2955d3cd GPv3: Multithread fill triangulation
This became a bottleneck in one of the test files during playback.

A grease pencil object was using an array modifier which tags the triangle
caches to be invalidated. Then it re computed the fills on every frame, which
was slow (when single threaded).

With this patch, the playback went from ~43fps to 60+fps.

Pull Request: https://projects.blender.org/blender/blender/pulls/119531
2024-03-19 09:52:15 +01:00
Campbell Barton a535524fe1 Fix #119500: Installing an Extension via dragging has no feedback
Call the install operators directly instead of using bpy.app.handlers.
Now reports from installing are in the status bar.
2024-03-19 18:12:10 +11:00
Hans Goudey bb4271459f Fix: Build error from missing include in legacy mesh conversion
The include was removed by a cleanup in main, not in 4.1.
2024-03-18 18:35:32 -04:00
Hans Goudey 5001a1a4a7 Merge branch 'blender-v4.1-release' 2024-03-18 16:44:47 -04:00
Hans Goudey 51cdf665ab Fix #119520: Auto smooth modifier added unnecessarily with bevel
If the bevel "Harden Normals" option is on, custom normals will be
generated. In that case, the automatic sharp edge tagging based on the
angle shouldn't run. This PR extends the earlier fix to #116395 to
handle this case and also extends the check to not just check the last
modifier, which doesn't work in this test file which has a collision
modifier at the end. That makes sense anyway, since what we really care
about is whether the evaluated mesh has custom normals or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/119638
2024-03-18 21:43:22 +01:00
Hans Goudey 5bfe6ad8f8 Fix: Various issues with auto smooth versioning
This PR fixes several issues with the versioning that replaces the old
auto smooth flag with a modifier.

One issue is that the flag wasn't cleared in the initial versioning
code. That means some objects have the replacement modifier but their
meshes still have the flag set. The fix for that is to make the
versioning idempotent by trying to find an existing node group before
adding a new one. The versioning is now re-run on all objects to clear
the flags. Flags on all meshes are cleared too, even unused meshes.
That could cause loss of the auto-smooth when the mesh is linked from
a different blend-file, but that situation should be very rare.

Another issue was that the versioning wasn't run when linking objects.
That was simple to solve by adding the versioning where the proxy
versioning already existed for that case.

Finally, arguably the largest issue was that the the newly added node
groups were always added as local data-blocks. When linking, having
library data-blocks point to local data-blocks not in that library is
quite bad and breaks assumptions around Blender. This is solved by
having an auto smooth node group per library.

Resolves #119516, #119455, #119447

Pull Request: https://projects.blender.org/blender/blender/pulls/119539
2024-03-18 20:15:36 +01:00
Brecht Van Lommel 7a395e2e7f Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was f57e4c5b98.

After this one more fix was committed, this one is preserved as well:
67bd678887.
2024-03-18 15:04:12 +01:00
Philipp Oeser 5ba581bd0a Fix #119523: Missing driver bone target doesn't mark driver as invalid
If a bone was specified (but now missing), the driver would fallback to
using the object as a target (which can lead to unintended behavior).

So now check if a bone is specified, if it is missing, mark the driver
invalid. If no bone is specified at all, then use the armature object as
the target.

NOTE: `DTAR_FLAG_INVALID` is not granular enough to distinguish the
object and bone targets, so both will be marked in red in the UI (there
is already comments about it in code). If necessary, we could introduce
an additional DTAR_FLAG_BONE_INVALID and use that in a couple of places.

Pull Request: https://projects.blender.org/blender/blender/pulls/119533
2024-03-18 12:48:43 +01:00
Brecht Van Lommel 971e82b93a Merge branch 'blender-v4.1-release' 2024-03-15 21:13:19 +01:00
Hans Goudey ba430d1d22 Revert "Fix #119455: Auto smooth versioning on append applies to existing IDs"
This reverts commit c6497dd9f7.

This wasn't working the way I expected, it seems the LIB_TAG_NEW isn't
set here. Better to address the fundamental issues anyway. Sorry for
the noise.
2024-03-15 15:25:13 -04:00
Hans Goudey e2e26d3872 Merge branch 'blender-v4.1-release' 2024-03-15 13:58:12 -04:00
Hans Goudey c6497dd9f7 Fix #119455: Auto smooth versioning on append applies to existing IDs
When appending objects from an older file, versioning needs to run to add
an auto smooth modifier if necessary. However, this was running for all
objects rather than just the newly appended objects. It's quite wrong to
modify existing objects here, so add an explicit check for that. This could
improve performance as well, but skipping checks for objects when
the work is unnecessary.

The crash will hopefully be resolved by other improvements to the auto
smooth versioning (making it properly idempotent and running it again
should fix the problem with the hidden legacy flags still set). But I still think
this PR is worth committing, to be very explicit about only modifying new
objects in versioning code.

Pull Request: https://projects.blender.org/blender/blender/pulls/119467
2024-03-15 18:47:39 +01:00
Hans Goudey a869bae1dc Merge branch 'blender-v4.1-release' 2024-03-15 11:50:04 -04:00
Hans Goudey 1111903416 Fix #119446: Incorrect auto smooth versioning for subsurf modifier
Previously I misunderstood the subsurf modifier's handling of custom
normals. The "use custom normals" check in 4.0 checked if there were
custom normals and whether the auto smooth flag was checked. I wrongly
changed that to check the mesh normals domain instead of whether there
was custom normals. In 4.1, auto smooth isn't required to use custom
normals, but that should be the only change here.

In this PR, that change is done for CPU and GPU subdivision, and for
the versioning which adds a modifier. The versioning now only puts the
new modifier before the subsurf modifier if it would have used the
custom normals interpolation in 4.0.

The last change causes two test failures which I also misunderstood
before. The previous results were arguably incorrect, because the
Cycles experimental adaptive subdivision ignored the auto smooth
angle, which was 5 degrees. It should have been 180 degrees.
I will modify those test files to remove auto smooth from the meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119485
2024-03-15 11:32:50 -04:00
Falk David 3cc933d024 GPv3: Conversion: Convert some object-data flags
This adds conversion for the following flags:
- `GREASE_PENCIL_ANIM_CHANNEL_EXPANDED`
- `GREASE_PENCIL_AUTOLOCK_LAYERS`
- `GREASE_PENCIL_STROKE_ORDER_3D`

Note: The last two are not expose through the UI yet.
2024-03-14 17:26:14 +01:00
Falk David 6a320524b9 Fix: GPv3: Function `use_masks` returns wrong value
This fixes an issue where the `use_masks` functions on layers
and groups returned the wrong value.
The issue was that the root group doesn't have this flag set
which then propagates to all the layers and groups.
To fix this we invert the `GP_LAYER_TREE_NODE_USE_MASKS` flag (now called `GP_LAYER_TREE_NODE_HIDE_MASKS`).

The API still uses the `use_masks` function.
2024-03-14 15:25:23 +01:00
Falk David a5229ed125 GPv3: Add layer masks operators and UI
Layer masks were partly already there. This PR completes the implementation and expose them through the UI.

This also adds three operators to:
- add a layer mask
- remove a layer mask
- reorder layer masks

Note: These are not used by the renderer yet. Will be done in a following PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/119433
2024-03-14 14:07:37 +01:00
Falk David a07a558ac5 GPv3: Add view layer name property
This adds the `viewlayername` property to grease pencil v3 layers.
It's exposed as `viewlayer_render` in python.

Note: this is not used in the renderer yet. Will be used in a following PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/119422
2024-03-14 10:15:07 +01:00
Hans Goudey b5082f6640 Refactor: Simplify BLI_serialize.hh for asset indexer
- Remove the unnecessary `ContainerValue` from the class hierarchy
- Construct `StringValue` with a `std::string` by value to avoid copies
- Remove some indirection by using type names directly instead of aliases
- Use utility methods to lookup/append specific data types for arrays/dicts
- Simplify conversion from unique_ptr to shared_ptr
- Avoid use of `new` and `delete`
- Avoid creating maps of all elements in vector for a single lookup
2024-03-13 14:52:57 -04:00
Thomas Dinges 51a3c03072 Release: Bump to 4.1 RC.
Splash screen by Lynxsdesign
2024-03-13 15:52:53 +01:00
Jacques Lucke 43dbb98625 Merge branch 'blender-v4.1-release' 2024-03-13 13:29:28 +01:00
Jacques Lucke 297157e1c7 Fix #119241: setting edge selection does not work correctly
This was likely a typo in bd4c310a19.

Pull Request: https://projects.blender.org/blender/blender/pulls/119413
2024-03-13 13:25:23 +01:00
Campbell Barton 924561680e WM: suppress prints when G.quiet is set 2024-03-13 15:33:02 +11:00
Hans Goudey 77b6f5d7e3 Merge branch 'blender-v4.1-release' 2024-03-12 17:34:52 -04:00
Hans Goudey 885b116c75 Fix: Socket names in auto smooth versioning node group
The current naming for node groups is "Socket" rather than "Input".
Also remove translation which is unnecessary since these are just identifiers.
2024-03-12 17:33:47 -04:00
Hans Goudey 6cbdb9c242 Merge branch 'blender-v4.1-release' 2024-03-12 17:12:00 -04:00
Hans Goudey 9141a8cb25 Fix #119398: Weighted normal modifier "Keep Sharp" option missing versioning
The Weighted Normal modifier has a "Keep Sharp" option that used to
recalculate the sharp edge tags based on the mesh's smoothing angle.
To keep the same behavior, an auto smooth versioning modifier has to
be added before that modifier when the option is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/119400
2024-03-12 22:08:19 +01:00
Hans Goudey 51c738da1b Cleanup: Mesh: Use updated "corner" name for variables 2024-03-12 14:55:58 -04:00
Hans Goudey 9cafccf004 Cleanup: Sculpt: Unify face PBVH node face index access
Remove one function from the API.
2024-03-12 14:55:58 -04:00
Hans Goudey 20fbaa455e Merge branch 'blender-v4.1-release' 2024-03-12 12:13:40 -04:00
Hans Goudey 3c3f1e6d62 Fix #117603: Auto smooth replacement versioning skipped for link/append
Unfortunately the only versioning code that can "properly" add data-
blocks is not run when linking or appending (`do_versions_after_setup`
has details). The versioning has to be done manually for this case.
Fortunately that is simple since the versioning function already just
operators on a main database.
2024-03-12 12:09:30 -04:00
Hans Goudey daa1739953 Merge branch 'blender-v4.1-release' 2024-03-12 10:54:14 -04:00
Hans Goudey 91466f71f1 Fix #91256, #112646: IDProperty UI data lost when changing type
With some data-type conversions we can do a best-effort conversion of
UI data like default values and min and max to the new data type.
This can help to make Python scripts simpler and to avoid bugs like
#105965.

Pull Request: https://projects.blender.org/blender/blender/pulls/106161
2024-03-12 15:49:20 +01:00
Falk David ee9510cdc3 Merge branch 'blender-v4.1-release' 2024-03-12 14:48:44 +01:00
Falk David 998514af7b Fix #115313: GPencil brush direction is not kept
The core of the issue was that `sculpt_flag` was used by three different enums (`eGP_Sculpt_Flag`, `eGP_Sculpt_Mode_Flag`, and `eBrushFlags`). This resulted in the flag getting overriden because `ENUM_OPERATORS` expected the maximum value of `eGP_Sculpt_Flag` to be `(1 << 3)` which it wasn't.

The `sculpt_flag` was exposed through python as `"direction"`.
In the UI this meant that it was effectively used as `brush.direction`. This fix replaces `brush.gpencil_settings.direction` with `brush.direction`.
It also makes sure `sculpt_flag` is only ever used with values from `eGP_Sculpt_Flag`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119373
2024-03-12 14:22:52 +01:00
Falk David 6a016ce255 Cleanup: Remove unnecessary check
fd92647f added an early return so now this check is no longer needed.
2024-03-12 11:25:48 +01:00
Falk David fd92647f34 Fix: GPv3: Add missing check in `get_mutable_attribute`
The function didn't return early in case the domain was empty.
The fix makes sure we return an empty `MutableSpan` in this case
(add doesn't try to create a new custom data layer).
2024-03-12 11:16:59 +01:00
Lukas Tönne 054ef616ce Fix #117997: Crash trying to copy vertex group attributes as spans
Grease Pencil provides custom vertex group attributes as VArrays that
are a view on the `MDeformVert` buffer. These attributes are not spans,
which the curve conversion code was expecting. Non-span VArrays must be
materialized first.

Pull Request: https://projects.blender.org/blender/blender/pulls/119212
2024-03-11 20:52:14 +01:00
Hans Goudey 68ac54bbcc Fix #119250: Python: World matrix for newly created objects is not identity
Initialize these like other fields in the object runtime struct.
2024-03-11 15:34:10 -04:00
Jacques Lucke b4e3a00cd3 Merge branch 'blender-v4.1-release' 2024-03-11 19:35:26 +01:00
Jacques Lucke c5443ec80d Fix #90999: crash when converting volume grid with high indices to dense volumes
There seems to be an integer overflow in OpenVDB code. For now just avoid rendering
the volume when the indices are very large, which is an extreme case anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/119279
2024-03-11 19:34:57 +01:00
Jacques Lucke b33ec06283 Merge branch 'blender-v4.1-release' 2024-03-11 19:18:07 +01:00
Iliya Katushenock bca31c3846 Fix: handle cyclic links when detecting dangling reroutes
Fix of error from 95810eec8f

Pull Request: https://projects.blender.org/blender/blender/pulls/119335
2024-03-11 19:17:27 +01:00
Howard Trickey 70fa3becad Refactor: Move mesh_boolean_convert from blenkernel to geometry.
Header file is renamed to GEO_mesh_boolean_convert.cc and
files that included it are updated to use that path.
This is in preparation for bigger changes to the internal
boolean API, which make more sense as a "geometry" API
than a kernel API.

Pull Request: https://projects.blender.org/blender/blender/pulls/119336
2024-03-11 18:17:57 +01:00
Sybren A. Stüvel c7e4365d7a Merge remote-tracking branch 'origin/blender-v4.1-release' 2024-03-11 17:16:32 +01:00
Hans Goudey f6f767b879 Cleanup: Rename "me_eval" to "mesh_eval"
Similar to 854cdd1180
2024-03-11 11:21:18 -04:00
Jacques Lucke 4d0936c7d7 Fix #119316: instancing lamps does not work
The issue was that calling `ensure_geometry_instances` converts all instances to a
geometry, even the ones that can't be converted. The comment already says that
non-geometry instances should stay intact, but that didn't work correctly yet:
```
  /**
   * If references have a collection or object type, convert them into geometry instances
   * recursively. After that, the geometry sets can be edited. There may still be instances of
   * other types of they can't be converted to geometry sets.
   */
```

Pull Request: https://projects.blender.org/blender/blender/pulls/119324
2024-03-11 15:58:40 +01:00
Jacques Lucke ad9d93ef13 Merge branch 'blender-v4.1-release' 2024-03-11 15:40:43 +01:00
Iliya Katueshenock 95810eec8f Fix #106235: use first non-dangling link of multi-input socket for internal link
Pull Request: https://projects.blender.org/blender/blender/pulls/119280
2024-03-11 15:39:02 +01:00
Lukas Tönne f04bf1694f Fix #118509: Make sure to use valid indices in frame maps
Moving a set of keyframes could cause crashes by setting invalid
`drawing_index` in `GreasePencilFrame` data.

The transform operator for grease pencil keyframes can add and remove
keyframes by overwriting existing frames. The `move_duplicate_frames`
function in particular has to keep track of drawing user counts to
ensure that the drawings referenced by the frames are still alive at the
end.

This was broken when moving multiple keyframes at once, such that later
keyframes would overwrite the target positions for earlier frames (for
example moving frames [1,2,3] to [2,3,4]). The `move_duplicate_frames`
was first removing the source frame and then adding it back at the
destination. In case the source frame was already the destination of an
earlier keyframe, this will cause incorrect user count because the frame
being removed is not the same as the one being added back.

To avoid this problem, remove all the source keyframes first before any
other modification of the destination layer. That way we can be sure the
frames at the source index is actually the expected frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/119207
2024-03-11 12:50:19 +01:00
Casey Bianco-Davis 5b33a7bc62 Fix: Vertex group data lost after draw tool or delete operator.
Fixes vertex group data loss after the `Draw Tool`, `Delete`, `Dissolve` operators.

Note: This is not a exhaustive list and there are other operators that will still loss vertex group data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119034
2024-03-11 03:01:57 +01:00
Campbell Barton e33f5e36ac Cleanup: spacing around C-style comment blocks 2024-03-09 23:40:57 +11:00
Kyler Kelly 060174cf14 Transform: customizable rotation snap increment values
Add two snapping increment options: a regular value
(activated with Ctrl) and a precise value (activated with Ctrl+Shift).
These values are separate for 2D and 3D views.

Ref !118760
2024-03-09 16:57:12 +11:00
Hans Goudey 733f02407d Merge branch 'blender-v4.1-release' 2024-03-08 20:56:27 -05:00
Hans Goudey 7b25699333 Fix #119232: Crash on Generate Data Layers in DataTransfer modifier
"r_map" is null for the generate layers operator (rather than the modifier
evaluation). It should disable the creation of the "CD_NORMAL" layer too,
like the crease, bevel weight, sharp edge, and uv seam attributes above.
2024-03-08 20:55:43 -05:00
Hans Goudey 04a9790035 Merge branch 'blender-v4.1-release' 2024-03-08 16:35:33 -05:00
Hans Goudey c4bf2d43e7 Fix #116395: Auto smooth versioning modifier added unnecessarily
As mentioned in new code comments, the auto smooth behavior in 4.0 was
to skip sharp angle tagging when the evaluated mesh had custom normals.
There was already a check for custom normals on the original mesh (we
can't access the evaluated mesh from versioning code). But that didn't
handle cases where custom normals were created by modifiers (the normal
edit and weighted normal modifiers). Now skip adding the new modifier
when those modifiers come last in the stack. Alternatively we could
check if they existed in the stack at all, but that seems a bit more
risky.
2024-03-08 16:09:05 -05:00
Hans Goudey fbaf6219eb Cleanup: Return catmull rom basis weights by value 2024-03-08 11:51:10 -05:00
Pratik Borhade 7e3abdf503 Merge branch 'blender-v4.1-release' 2024-03-08 16:56:20 +05:30
Pratik Borhade 021565d867 Fix #119142: Skip linking collection inside another linked collection
When linking a collection from library, it can be linked inside another
linked/overrided collection if it is selected in outliner. This can be
prevented by linking with editable parent collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/119144
2024-03-08 12:23:19 +01:00
Campbell Barton f3e0e39df5 Cleanup: use const pointers where camera data isn't modified 2024-03-08 17:15:08 +11:00
Campbell Barton 8cbb57ee0a CLI: suppress noisy prints when running commands
Messages such as "Blender quit" get in the way of custom commands,
add G.quiet to suppress noisy "info" prints.
2024-03-08 13:27:29 +11:00
Campbell Barton 20b5908af8 Docs: reference G & U from Global & UserDef doc-strings
Include some context for how these structs are used as it's not so
clear where values are set/initialized.
2024-03-08 13:26:07 +11:00
Campbell Barton 8dd049d569 Cleanup: clarify argument names for passing a file buffer
Prefer the term size over length for size in bytes.
2024-03-08 12:57:34 +11:00
Campbell Barton 6f6a6ace39 Cleanup: redundant forward declarations of structs 2024-03-08 11:31:11 +11:00
Campbell Barton 9372e0dfe0 CLI: support defining custom commands via C++ & Python API
Add support for add-ons to define commands using the new argument
`-c` or `--command`.

Commands behave as follows:

- Passing in a command enables background mode without the need to pass
  in `--background`.
- All arguments following the command are passed to the command
  (without the need to use the `--` argument).
- Add-ons can define their own commands via
  `bpy.utils.register_cli_command` (see examples in API docs).
- Passing in `--command help` lists all available commands.

Ref !119115
2024-03-08 11:10:13 +11:00
Hans Goudey 744f3b2823 Cleanup: Grammar in comments: Fix uses of "own"
"Own" (the adjective) cannot be used on its own. It should be combined
with something like "its own", "our own",  "her own", or "the object's own".
It also isn't used separately to mean something like "separate".

Also, "its own" is correct instead of "it's own" which is a misues of the verb.
2024-03-07 16:23:35 -05:00
Bastien Montagne d99fffc460 GPv3: Legacy Conversion: Animation: Optimize fcurves handling.
Did not realize it, but original commit was re-generating some 'static'
strings (at modifier level) for each and every processed FCurves!

Now create these base RNA paths only once per modifier, outside of the
lambda callback.
2024-03-07 17:39:40 +01:00
Sybren A. Stüvel 90ef46baa1 Anim: DNA for `Animation` data-block
Introduce new DNA for the `Animation` data-block and its sub-data.

This includes the blenkernel code for reading & writing to blend files,
and for memory management (freeing, duplicating). Minimal C++ wrappers
are included, with just the functionality needed for blenkernel to do
its job.

The Outliner code is extended so that it knows about the new data-type,
nothing more.

For more info, see issue #113594.

Pull Request: https://projects.blender.org/blender/blender/pulls/119077
2024-03-07 16:41:25 +01:00
Philipp Oeser 77168d960a Merge branch 'blender-v4.1-release' 2024-03-07 15:46:04 +01:00
Philipp Oeser 5d1d447c2b Fix #114552: Copy material to selected crash on object lacking slot
Caused by 9c1da81a4c.

This happened in the case where objects shared the same data and slots
are assigned to object and receiving object did not have a material slot
yet.

Then, `ob->matbits` may be NULL, now just check for this, too.

Pull Request: https://projects.blender.org/blender/blender/pulls/119161
2024-03-07 15:43:47 +01:00
Hans Goudey c8efea42e1 Cleanup: Remove unnecessary braces for container default constructors
These containers (Set, Vector, Map, Span), etc. have default constructors,
making the braces unnecessary for default initialization. Better to depend
on that consistently rather than having braces in some places and not others.
2024-03-07 09:30:23 -05:00
Hans Goudey c25a635587 Core: Avoid double map lookup in ID remapping
Theoretically this could improve performance when remapping
many IDs, but the goal is more to have consistent best practices
in the use of `Map`.
2024-03-07 09:30:22 -05:00
Hans Goudey 72758f3296 Cleanup: Use FunctionRef for IDRemapper callback
This avoids the need for a separate argument struct in a few cases
and generally makes the remapping friendlier to use with lambdas.
2024-03-07 09:30:22 -05:00
Hans Goudey 2f0fa33eec Cleanup: Remove unnecessary void keyword in C++ function declarations 2024-03-07 09:30:22 -05:00
Hans Goudey d22a8b0a16 Cleanup: Remove unnecessary namespace specification 2024-03-07 09:30:22 -05:00
Hans Goudey 8c16d06858 Cleanup: Use reinterpret_cast instead of C-style cast 2024-03-07 09:30:22 -05:00
Campbell Barton 2d3a1aa238 Cleanup: spelling in comments 2024-03-07 13:29:18 +11:00
Campbell Barton 9796805bb8 Cleanup: sort CMake source files 2024-03-07 13:29:09 +11:00
Bastien Montagne ea73438e8a LibOverride: Use new `BKE_id_copy_in_lib` to create ID in libraries.
This replaces the somewhat hackish and usafe code used previously.

Also fixes a potential bug, where the newly created `local_id` was
dereferenced before checking for it to be non-null.

Pull Request: https://projects.blender.org/blender/blender/pulls/108328
2024-03-06 17:05:13 +01:00
Bastien Montagne a681f5d896 Core: Add proper support to add or copy IDs into libraries.
Seems to work OK in basic cases, but needs more work when copying
outside of Main at least.

Note: There is no behavioral changes expected from this commit.

Note that there are at least two known usecases for this change:
* Liboverrides, as with recursive resync and proxies conversion it
  often ends up creating 'virtual' linked data that does not actually
  exists in the library blend files.
* Complex versionning code (`do_versions_after_setup`) when it needs
  to create new IDs (currently handling linked data that way is just not
  supported!).

Implements #107847.
2024-03-06 17:05:10 +01:00
Brecht Van Lommel b3d55b37bc Merge branch 'blender-v4.1-release' 2024-03-06 16:52:54 +01:00
Hans Goudey 0106514669 Fix #107232: Creating builtin attributes in edit mode can cause crash
For example, creating the "position" attribute with the wrong name or type
could crash Blender when exiting edit mode. This is because some data isn't
stored as attributes in Blender, and the attribute API doesn't work very well
with BMesh.

Two parts to the solution:
- Remove builtin attributes with incorrect domains or names when
  converting from BMesh to Mesh.
- Add error messages when creating builtin attributes in edit mode. It's still
  possible to create name-convention attributes, because Blender should be
  able to handle different types and domains for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/119110
2024-03-06 16:16:43 +01:00
Falk David bab3e5c442 Fix: GPv3: Frames map not saved
The copy constructor of the Layer class didn't do a copy
of the frames storage (DNA) and only a copy of the frames map (runtime).
This is fine, but we need to make sure to tag the frames storage,
because it is out of sync otherwise.
During edit mode undo, the layers were copied (but the frames storage not tagged) which meant that after undoing and then saving the file,
the frames would be gone after reloading.

The fix makes sure we tag the frames storage, so that it is properly synced.
2024-03-06 13:56:27 +01:00
Lukas Tönne f51e93bec7 GPv3: Shrinkwrap modifier
Port of shrinkwrap modifier from GPv2.

Adds a new API function in `BKE_shrinkwrap.hh` for the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119118
2024-03-06 12:05:00 +01:00
Falk David a11335d19a Cleanup: Move BKE_fcurve.h to C++
No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119094
2024-03-05 18:39:08 +01:00
Hans Goudey 94770b74be Merge branch 'blender-v4.1-release' 2024-03-05 11:32:47 -05:00
Hans Goudey 7b94e61f09 Fix #119047: Avoid copying captured attribute to itself
The "capture field on geometry" utility is used in many places to store
the result of field evaluation as an attribute. There is a special case
for when an attribute already exists with the same name, data type, and
domain. But when exactly the same attribute was stored, it would assert
because it ended up copying an array to itself. Arguments for those copy
functions aren't supposed to alias each other.

As a fix, clarify the logic a bit to return earlier in this case.
Also remove a redundant case handling the same thing later on
in the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119063
2024-03-05 17:32:09 +01:00
Hans Goudey 5993c517bd Cleanup: Use C++ Array, Span, int2 for lasso coords 2024-03-05 11:29:04 -05:00
Hans Goudey f2ab2ad8da Cleanup: Correct comments about custom data masks 2024-03-05 09:46:36 -05:00
Omar Emara d6b1d00a0f Cleanup: Use enums instead of numbers for Glare node 2024-03-05 11:51:52 +02:00
Campbell Barton ed5fb3eaba Cleanup: various non-functional C++ changes 2024-03-05 11:32:42 +11:00
Campbell Barton e011c1ab9b Cleanup: spelling in comments 2024-03-05 11:25:35 +11:00
Campbell Barton 76867ad4c2 Cleanup: redundant "void" in function declarations for C++ 2024-03-05 11:25:35 +11:00
Hans Goudey 6479dc50fa Refactor: Mesh: Use C++ threading API for tessellation
This allows deleting a bunch of duplicate code, since there doesn't
need to be a special single-threaded case anymore. It also just
reduces the necessary boilerplate.

Also change naming a bit and use signed integers instead of unsigned.

I didn't notice any performance difference.

Pull Request: https://projects.blender.org/blender/blender/pulls/119069
2024-03-05 01:03:45 +01:00
Sybren A. Stüvel a1b10f85cd Refactor: Anim, split up FCurve-reading/writing code
Split `BKE_fcurve_blend_write(writer, listbase)` into two functions:
- `BKE_fcurve_blend_write_data(writer, fcurve)` for the data of a single
  F-Curve, and
- `BKE_fcurve_blend_write_listbase(writer, listbase)` for writing a list
  of F-Curves.

And the same for `BKE_fcurve_blend_read_data()`.

This is necessary for the upcoming Animation data-block, which will
store F-Curves as arrays instead of `ListBase`s.

No functional changes.
2024-03-04 17:50:14 +01:00
Lukas Tönne d6aadd6692 GPv3: Outline modifier
Port of GPv2 outline modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/118911
2024-03-04 16:54:07 +01:00
YimingWu b3e46b65b9 GPv3: Fix: Memory corruption after modifier conversion
The switch branches are not laid out in correct order and without
`break`s between some of them, leading to wrong conversion results.

Pull Request: https://projects.blender.org/blender/blender/pulls/119052
2024-03-04 13:34:21 +01:00
Campbell Barton 1b514659ca Cleanup: minor changes to temp directory API
- Pass null instead of an empty string to BKE_tempdir_init
  because the string isn't meant to be used.
- Never pass null to BLI_temp_directory_path_copy_if_valid
  (the caller must check).
- Additional comments for which checks are performed & why
  from discussion about #95411.
2024-03-04 11:42:02 +11:00
Jesse Yurkovich b0daa792d3 Merge branch 'blender-v4.1-release' 2024-03-03 13:53:47 -08:00
Guillermo Venegas 8f68dfe0c2 Fix #119000: File handler extension check should be case insensitive
Allows case insensitive extension match.

Pull Request: https://projects.blender.org/blender/blender/pulls/119018
2024-03-03 22:50:51 +01:00
Jacques Lucke 1756ccf809 Merge branch 'blender-v4.1-release' 2024-03-02 23:57:15 +01:00
Jacques Lucke 65083472ec Fix: issue in previous commit
Many tests started failing after 173c41c1c0
due to memory leaks.
2024-03-02 23:56:37 +01:00
Jacques Lucke 434759d333 Merge branch 'blender-v4.1-release' 2024-03-02 21:40:47 +01:00
Jacques Lucke 173c41c1c0 Fix #114946: Mesh.clear_geometry should not clear required built-in attributes
Pull Request: https://projects.blender.org/blender/blender/pulls/119012
2024-03-02 21:40:03 +01:00
Jacques Lucke b16e4bee1f Merge branch 'blender-v4.1-release' 2024-03-02 20:20:26 +01:00
Jacques Lucke cc891aa699 Fix #115583: multiple sharing info for same data after reading file
It's possible that multiple custom data layers share the same underlying data.
This data is only written once (per data-block) currently. However, when reading
the data again, two separate `ImplicitSharingInfo` were constructed which
referenced the same underlying memory. The fix is to reuse previously created
`ImplicitSharingInfo` that manage the same data.

Pull Request: https://projects.blender.org/blender/blender/pulls/118991
2024-03-02 20:10:34 +01:00
Bastien Montagne 015ae2b3a6 Merge branch 'blender-v4.1-release' 2024-03-02 16:29:05 +01:00
Bastien Montagne da101d8cdb Fix #118300: Broken liboverride data can crash Blender on load.
Second issue reported in the comment was caused by some shapekeys
flagged as embedded liboverride data, when their owner ID (Mesh e.g.)
is not a liboverride at all.

The `BKE_lib_override_library_validate` called on file read was only
covering real liboverride IDs, which where then supposed to take care of
their own embedded data. But since the owner ID is already a full
non-override ID, its embedded data ended up never being properly
sanitized.

Most likely more corruption data from quite old files and/or deprecated
experimental features.
2024-03-02 16:17:41 +01:00
Christoph Lendenfeld 69943f65c7 Refactor: replace BLI_BITMAP with blender::BitVector in keyframing.cc
No functional changes.

This PR replaces the uses of the C-style `BLI_BITMAP`
with `blender::BitVector` in `keyframing.cc`.

Note that in `BKE_animsys_nla_remap_keyframe_values` I had to
add code that maps from one to the other because I don't feel
comfortable ripping out the `BLI_BITMAP` from
`NlaEvalChannelSnapshot->remap_domain`

Pull Request: https://projects.blender.org/blender/blender/pulls/118957
2024-03-01 15:41:53 +01:00
Lukas Tönne 68c12fe0ec GPv3: Envelope Modifier
Ports the Envelope modifier from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118272
2024-03-01 10:42:41 +01:00
Raul Fernandez c9bddce79b Cleanup: Grammar in comment
Comment's wording improvement

Pull Request: https://projects.blender.org/blender/blender/pulls/118913
2024-02-29 18:52:29 +01:00
Jacques Lucke 0e8e219d71 Undo: support implicit-sharing in memfile undo step
This adds implicit sharing support for the `MemFile` undo-step. This decreases memory
usage and increases performance.

Implicit sharing allows the undo system to take (shared) ownership of some data.
Previously, the data would always be serialized and compared to the previous undo-step.
So this turns an O(n) operation into O(1) (in terms of memory usage and time).

Read/write code that wants to make use of this has to use the new `BLO_read_shared`
and `BLO_write_shared` functions respectively. Those either make use of implicit-sharing
internally or do the "full" read/write based on a passed-in function. It seems possible to
use the same API in the future to store shared data to .blend files.

Improvements:
* Much faster undo step creation in many cases by avoiding the majority data copies
  and equality checks. This fixes #98574. I found undo step creation and undo step
  decoding to be 2-5 times faster in some demo files from the blender website and in
  some production files from the Heist project.
* Reduced memory usage when there is large data in `bmain`. For example, when
  loading the same highly subdivided mesh that I used in #106228 the memory usage
  is 1.03 GB now (compared to 1.62 GB in `main` currently). The main remaining copy
  of the data now is done by rendering code.
* Some significant performance improvements were also measured for the new grease
  pencil type (#105540).

There is one main downside of using implicit-sharing as implemented here: `MemFile`
undo steps can't be written as .blend files anymore. This has a few consequences:
* Auto-save becomes slower (up to 3x), because it can't just save the previous undo step
  anymore and does a normal save instead. This has been discussed in more detail here:
  https://devtalk.blender.org/t/remove-support-for-saving-memfile-undo-steps-as-blend-files-proposal/33544
  It would be nice to work towards asynchronous auto-save to alleviate this problem.
  Some previous work has been done to reduce the impact of this change in 41b10424c7
  and f0f304e240. This has been committed separately in efb511a76d.
* Writing `quit.blend` has to do a normal file save now. So it's a bit slower too, but it's
  less of a problem in practice.
* The `USE_WRITE_CRASH_BLEND` functionality does not work anymore. It doesn't seem
  to be used by anyone (removed in e90f5d03c4)

There are also benefits to not writing `MemFile` from undo steps to disk. It allows us to
more safely do undo-specific optimizations without risking corrupted .blend files. This
is especially useful when we want to preserve forward compatibility in some cases.
This requires converting data before writing the .blend files, but this conversion is not
necessary for undo steps. Trying to implement this kind of optimization in the past has
often lead to bugs (e.g. 43b37fbc93).

Another new problem is that it is harder to know the size of each undo step. Currently, a
heuristic is used to approximate the memory usage, but better solutions could be found
if necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/106903
2024-02-29 17:14:58 +01:00
YimingWu 3dc483982c GPv2: LineArt: Conversion code
Adds conversion code for the lineart modifier for Grease Pencil 3.

Pull Request: https://projects.blender.org/blender/blender/pulls/118791
2024-02-29 16:02:44 +01:00
Miguel Pozo 4083f8004d EEVEE-Next: Add Shadows PCF
Add percentage closer filtering to shadowmap sampling and a
`shadow_filter_radius` property to lights to control it.

Notes:
* This adds PCF to `eevee_shadow_tracing_lib`, but not to
  `eevee_shadow_lib`, which is used by volumes (not required) and
  thickness.
* PCF is computed based on the LOD0 size. This assumes that higher
  LODs are only used when the shadowmap resolution is actually good
  enough to match the render resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118220
2024-02-29 15:47:16 +01:00
Jacques Lucke fac64c3378 Cleanup: extract function to read custom data layer data 2024-02-29 14:15:04 +01:00
Jacques Lucke 43b5bd02d4 Cleanup: extract function to write custom data layer data 2024-02-29 14:07:16 +01:00
Aras Pranckevicius 79707c2ae8 Extern: update Audaspace to latest version
No behavior changes, but no need to have a local modification
that sets JOS resampler quality to Medium

This basically contains two PRs that got accepted upstream:
- https://github.com/audaspace/audaspace/pull/19
- https://github.com/audaspace/audaspace/pull/20

Pull Request: https://projects.blender.org/blender/blender/pulls/118896
2024-02-29 12:08:00 +01:00
Campbell Barton da2ac8ee92 Merge branch 'blender-v4.1-release' 2024-02-29 22:04:23 +11:00
Campbell Barton c19cdc343f Fix assert with temporary directories beginning with "//"
- Skip leading forward slashes when setting the temp directory.
- Add a utility function to set the temporary directory
  which is used for the user preferences & environment variables.

This issue was raised by #95411 where "//" resolves to "/",
then asserts when passed to Blender's file-system functions.
However the crash referenced in this report looks to be caused
by Collada failing to write to the temporary directory which
can be handled separately.

Ref !118872
2024-02-29 22:01:44 +11:00
Bastien Montagne ab4387d70e GPv3: Fix wrong handling of data names in FCurve RNA paths in conversion code.
Data name should always be escaped in RNA paths, thanks Campbell (@ideasman42)
for the heads up!
2024-02-29 11:53:34 +01:00
Hans Goudey 860f3ed794 Geometry Nodes: Add volume grid conversion nodes
Adds two nodes as "grid" equivalents to the existing volume nodes:
- **Grid to Mesh**
- **Distribute Points in Grid**

The code for the latter is just duplicated for now. In a later step
old node can be replaced by versioning with two new nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118830
2024-02-29 01:20:27 +01:00
Campbell Barton 550866aca8 Cleanup: remove runtime pointer from workob in what_does_obaction
Any access to this after calling what_does_obaction would reference
invalid stack memory with undefined behavior.
Set to null to ensure this never happens.
2024-02-29 11:13:13 +11:00
Hans Goudey bea33a6be9 Geometry Nodes: Add volume grid creation nodes
Add three nodes to the currently experimental volume grid nodes:
- **Mesh to Density Grid**
- **Mesh to SDF Grid**
- **Points to SDF Grid**

These nodes are just wrappers over basic OpenVDB utilities.
The difference from existing volume nodes is that they output
a grid directly instead of a geometry set.

See the design here: https://devtalk.blender.org/t/volumes-in-geometry-nodes-proposal/31917

Pull Request: https://projects.blender.org/blender/blender/pulls/118761
2024-02-28 22:15:10 +01:00
Sergey Sharybin 87a98c361c Fix: Crash when parenting mesh to armature with automatic weights
There probably are more cases where crash will happen as it is
rooting into the issue with BKE_object_workob_calc_parent() which
is used in multiple places.

The issue is caused by the access to a runtime field of workob
outside of the BKE_object_workob_calc_parent(): the runtime field
is stack-allocated in the function, and can not be accessed outside
of the function.

The easiest way to reproduce is to use ASAN, and parent mesh to an
armature with automatic weights. Although, on macOS ASAN did not
report issues, so setting workob->runtime to nullptr at the end of
of the BKE_object_workob_calc_parent() was the easiest.

The solution is simple: make the function to return the matrix,
and take care of the working object inside of it, so all tricky
parts are hidden from the API.

The patch is targeting the main branch, as in 4.1 it is not
required to do such change because all uses of the function only
access object_to_world, which is stored in the object in 4.1.

A double-check in the what_does_obaction() might be needed as it
follows the similar pattern, but it does not seem that runtime
field of the workob is accessed in usages of the what_does_obaction().

Pull Request: https://projects.blender.org/blender/blender/pulls/118847
2024-02-28 15:06:02 +01:00
Bastien Montagne de5451b112 Cleanup: Move `BKE_anim_data` header to be fully C++. 2024-02-28 11:51:03 +01:00
Falk David a492a8f695 Fix #118837: Time offset modifier not working as expected
The time offset modifier was working differently than in GPv2. This is because in the new implementation, the time offset modifier actually modifies the keyframe mappings. And thus the order of the modifiers, and where the time offset modifier is placed in the stack, matters.

The problem is that this can lead to unexpected results like seeing unmodified drawings.
Technically, the issue here is that other modifiers only modify the current frame as supposed to all drawings in the timeline.
This is done as an optimization, but doesn't work when drawings can be shifted around on the timeline using the time offset modifier.

The fix changes the way the modifiers are executed. Because the time offset modifier can only modify **when** the drawings
are show, and not the drawing data themselves, we execute all the time offset modifiers first (in the order they appear in the stack) and then execute all the other modifiers after.

This means that the user can no longer run into the issue of "moving" drawings away from the current frame where they can't be seen.
It also makes time offset modifier behave the same as they did in GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118842
2024-02-28 11:30:43 +01:00
Hans Goudey d338261c55 Cleanup: Pass Span by value
Also pass Span instead of `const Array &`
and use parantheses for BLI includes.
2024-02-27 23:09:54 -05:00
Kévin Dietrich ea256346a8 Alembic/USD: Use GeometrySets to import data
This rewrites the Alembic and USD data importers to work with and
output GeometrySets instead of Meshes.

The main motivation for this change is to be able to import properly
point clouds, which are currently imported as Meshes, and curves
data, which suffer from a lot of issues due to limitations of
legacy curves structures (fixed by the new curves data-block) and are
also converted to Meshes. Further, for Curves, it will allow importing
arbitrary attributes.

This patch was primarily meant for Alembic, but changes to USD import
were necessary as they share the same modifier.

For Alembic:
There should be no behavioral changes for Meshes
Curves are imported as the new Curves object type
Points are imported as PointClouds

For USD:
There should be no behavioral changes for Meshes
Curves are imported as the new Curves object type
Note that the current USD importer does not support loading PointClouds,
so this patch does not add support for it.

For both Alembic and USD, knots arrays are not read anymore, as the new
Curves object does not expose the ability to set them. Improvements can
be made in the future if and when example assets are provided.

This fixes at least the following:
#58704: Animated Alembic curves don't update on render
#112308: Curves have offset animations (alembic / USD)
#118261: wrong motion blur from usd in cycles and reverting to the first
frame when disabeling motion blur

Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115623
2024-02-28 03:02:38 +01:00
Campbell Barton a9803765dc Cleanup: remove colon after "return" doxy command 2024-02-28 12:13:17 +11:00
Iliya Katueshenock 6872963e4f Fix #118748: Geometry Nodes: Skip any processing of string attributes
String attributes are not handled correctly (or at all) by geometry nodes
currently because their storage is very inefficient and will likely have to
change in the future anyway. Elsewhere processing string attributes was
explicitly disabled. That was missing in these cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/118802
2024-02-27 23:33:04 +01:00