Commit Graph

106520 Commits

Author SHA1 Message Date
Jacques Lucke
29e2dcd2c8 Modifiers: remove modifier session_uid in favor of persistent_uid
Since 1497005054, there is a new `ModifierData.persistent_uid` which
has more use cases than the old `session_uid`. This patch removes
`ModifierData.session_uid` and replaces its usages with the new `persistent_uid`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117909
2024-02-06 18:02:32 +01:00
Richard Antalik
a17e3a6fbb Fix: VSE prefetching doesn't work
Caused by error in 3fccfe0bc6. Commit reversed logic for getting scene strips.
2024-02-06 17:32:49 +01:00
Guillermo Venegas
16129d6a48 Cleanup: Deduplicate operator paths properties reading in io importers
Adds a function that deduplicates operator paths properties reading.

-----

There are other places where this function can be useful, but I'm not sure whether to include `BLI_vector.hh` in RNA_access.hh

Pull Request: https://projects.blender.org/blender/blender/pulls/117644
2024-02-06 17:12:25 +01:00
Jacques Lucke
1497005054 Modifiers: add unique modifier identifiers
This adds a new `ModifierData.persistent_uid` integer property with the following properties:
* It's unique within the object.
* Match between the original and evaluated object.
* Stable across Blender sessions.
* Stable across renames and reorderings of modifiers.

Potential use-cases:
* Everywhere where we currently use the name as identifier. For example,
  `ModifierComputeContext` and `ModifierViewerPathElem`.
* Can be used as part of a key in `IDCacheKey` to support caches that stay
  in-tact across undo steps.
* Can be stored in the `SpaceNode` to identify the modifier whose geometry node
  tree is currently pinned (this could use the name currently, but that hasn't been
  implemented yet).

This new identifier has some overlap with `ModifierData.session_uid`, but there
are some differences:
* `session_uid` is unique within the entire Blender session (except for duplicates
  between the original and evaluated data blocks).
* `session_uid` is not stable across Blender sessions.

Especially due to the first difference, it's not immediately obvious that the new
`persistent_uid` can fulfill all use-cases of the existing `session_uid`. Nevertheless,
this seems likely and will be cleaned up separately.

Unfortunately, there is not a single place where modifiers are added to objects currently.
Therefore, there are quite a few places that need to ensure valid identifiers. I tried to catch
all the places, but it's hard to be sure. Therefore, I added an assert in `object_copy_data`
that checks if all identifiers are valid. This way, we should be notified relatively quickly if
issues are caused by invalid identifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/117347
2024-02-06 17:10:40 +01:00
Jacques Lucke
a214db60c6 Cleanup: use ID_IS_LINKED 2024-02-06 17:06:44 +01:00
Damien Picard
5b9c176b68 I18n: extract and disambiguate a few messages
Extract:
- Operators' poll messages, including Python-defined ones.
- Use default translation context for the region toggle pie menu.
- Newly created F-Curve modifiers.
- Newly created video tracker track.
- Grease Pencil UV area status message
- Status messages in the graph slider operators.
- Status message "Text <text.py>" when opening .blend with
  auto-executing Python file.

Disambiguate:
- Track: can mean NLA track, video tracking, a tracking marker, or
  a track constraint.
- Tracking: can mean video tracking, or a track constraint.

Issue reported by Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/117855
2024-02-06 17:06:30 +01:00
Hans Goudey
6b6e57c98c Geometry Nodes: Add local/global toggle to Rotate Rotation node
All the option does internally is reverse the order of the rotations,
but this is the same as old "Rotate Euler" node, and it's a bit more
intuitive this way. Also use the same socket names, "Rotation" and
"Rotate By" which are much more intuitive.

Technically it would be better to not have to duplicate the multi-
function just to switch the order of the arguments. But the
evaluator assumes that the order always matches the socket
order currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/117899
2024-02-06 16:23:26 +01:00
Julian Eisel
3c2366d313 Assets: Add further dedicated derived classes for asset libraries
Continuation of bdfb1f6a04. Adds derived classes for the essentials and
preferences asset libraries, to allow specialized classes with a simple
and common interface. This should help untangling the asset library
service code.
2024-02-06 16:11:32 +01:00
Omar Emara
c4f9484c18 Cleanup: Unused variable warnings 2024-02-06 17:07:51 +02:00
Hans Goudey
36f0ecb978 Fix #117900: Sculpt mode doesn't clear face corner normals
In sculpt mode vertex and face normals are updated explicitly, but
corner normals, which are cached now, aren't updated for performance
reasons. This means that when the mesh is deformed, they need to be
cleared. See b339e3937d for some background on the complexity
of this area.
2024-02-06 09:22:25 -05:00
Jacques Lucke
0baee63b85 Cleanup: correct comment 2024-02-06 14:52:15 +01:00
Clément Foucault
30f2db21d7 EEVEE-Next: Implement viewlayer filters
Implementation is straightforward.
Filter the components at the sync module
level to avoid uncovered cases.

Fixes the render_layer tests.
2024-02-06 14:34:13 +01:00
Jacques Lucke
49f4b643b9 LibOverride: avoid unnecessary GHash lookup
In my test file with many bones (very few of which have an override) this leads
to a 5-10% speedup when saving the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/117803
2024-02-06 13:53:03 +01:00
Jacques Lucke
74971e06f0 Fix #117887: fix asan alloc-dealloc-mismatch
Pull Request: https://projects.blender.org/blender/blender/pulls/117891
2024-02-06 13:49:36 +01:00
Aras Pranckevicius
9958cbf614 Fix: UI: fix off by one error in new image vectorscope code
New code in 567455124d was reading one vertex too many while
drawing the colored vectorscope background
2024-02-06 13:55:11 +02:00
Lukas Tönne
ee9a0f6014 GPv3: Handle vertex groups in the GPv2 conversion operator
Copies vertex group names from the GPv2 object to the new GPv3 GreasePencil data block.
Copies only those names to the drawings that are actually used by any of the strokes.
Updates group indices in `MDeformVert` data to point to local Drawing groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/117860
2024-02-06 12:36:17 +01:00
Campbell Barton
70fa30007f Extensions: tweak wording for updating operators 2024-02-06 22:28:10 +11:00
Campbell Barton
9996d95ab9 Cleanup: spelling in comments 2024-02-06 22:28:10 +11:00
Campbell Barton
6154e511ab Cleanup: quiet missing-declarations & unused variable warnings 2024-02-06 22:28:10 +11:00
Omar Emara
a433adda8e Compositor: Unify Bokeh Blur between CPU and GPU
This patch adjusts the Bokeh Blur node such that it matches between CPU
and GPU. The GPU implementation is followed for the reasons stated
below.

The first difference is a bug in the CPU implementation, where the upper
limit of the blur window is not considered, but the lower limit is.

The second difference is due to an additional weight of 1.0 for blur
size less than 2, which was apparently in place to workaround the
aforementioned bug, since for zero sized blurs, the blur loop will not
run due to the missing upper limit.

The third difference is due to CPU ignoring outside pixels instead of
clamping them to border, which is done until an option is added to the
node to control the boundary condition.

An extra difference existed between Tiled and Full-frame, where the
canvas had different rounding methods, so that was unified.

Pull Request: https://projects.blender.org/blender/blender/pulls/117847
2024-02-06 12:25:34 +01:00
JonasDichelle
567455124d UI: Image Editor Vectorscope Improvement
Update the look of image editor Vectorscope widget (design #116973):
- Colored and Luma options for the point cloud,
- The circles are no longer very low poly,
- Overall grid/background colors are tuned.
- Primary color locations have text labels.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116974
2024-02-06 12:22:48 +01:00
Omar Emara
291735971c Compositor: Port GPU Inpaint node to CPU
This patch ports the newly redesigned GPU Inpaint node to the CPU. The
code is mostly identical to the GPU code with the necessary adjustments
to make it work with CPU.

See #114849 for more information.

Pull Request: https://projects.blender.org/blender/blender/pulls/117716
2024-02-06 12:18:50 +01:00
Matias Mendiola
d589251905 GPv3: Separate operator
This PR adds the "Separate" operator from GPv2.

Changes:
In GPv2 there were three modes: Selected Point, Selected Strokes and Active Layer. For better consistency with meshes Separate Operator, there are now three modes:

- Selected (point or strokes is determined by mode selection)
- By Layers (not only the active one)
- By Materials (new)

Also Multiframe selection is now supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/116715
2024-02-06 12:06:48 +01:00
Omar Emara
0bd831b087 Fix #117859: Viewport compositor crash for empty camera region
The viewport compositor crashes when in camera view, passepartout is
opaque, and camera region is empty, that is, out of view. That's because
operations didn't handle zero sized compositing regions.

This patch fixes that by allocating invalid results for relevant
operations when the compositing region is invalid.
2024-02-06 13:01:59 +02:00
Bastien Montagne
dbfd54d7c8 Fix (studio-reported) RNA allowing to rename linked IDs.
There is no reason to allow this currently, and the underlying code is
not designed to support it right now.

Kept liboverrides IDs names editable though through RNA API, think this can
be valuable for advanced processing or debugging.
2024-02-06 12:00:34 +01:00
Bastien Montagne
9a1651533d Cleanup: Make io/usd/hydra and render/hydra headers fully Cpp ones.
This code was actually already full Cpp, so it's essentially a massive
filenames cleanup.
2024-02-06 12:00:34 +01:00
Bastien Montagne
21e2dfc6b4 Cleanup: Make io/usd/intern headers fully Cpp ones.
This code was actually already full Cpp, so it's essentially a massive
filenames cleanup.
2024-02-06 12:00:34 +01:00
Clément Foucault
c2ef2daa2c Fix: DRW: Out of bound index in PassSortable
This was caused by hair subpass growing the subpass
vector but not adding anything to the sorting_values_
vector. This means the indices that was return by
`sub_passes_.append_and_get_index` were dereferencing
the `sorting_values_` vector out of bounds on this line:
`float a_val = sorting_values_[a.index];`
2024-02-06 11:15:23 +01:00
Pratik Borhade
289d7fa7d2 Fix #117851: Crash switching to Camera with Background image
Caused by abf4c4d9ef
Wrong memory address passed to `BKE_image_release_ibuf`

Pull Request: https://projects.blender.org/blender/blender/pulls/117884
2024-02-06 10:15:00 +01:00
Sergey Sharybin
7abc1bc7d4 Fix #117760: Regression: Ctrl+Z causes Losing Audio Sound
Cused by 29aaa2922d

This change is more of a work-around, since there should be no such
tagging required. This change brings the behavior closer to what it
was before the offending commit, and solve an immediate user-level
regression.

Pull Request: https://projects.blender.org/blender/blender/pulls/117834
2024-02-06 09:06:46 +01:00
Campbell Barton
f282c6a3ad Extensions: add handlers for synchronizing & downloading updates
The actual implementation is currently in the add-on.
2024-02-06 18:51:01 +11:00
Campbell Barton
7161af74be Extensions: de-duplicate and improve doc-strings 2024-02-06 16:26:36 +11:00
Campbell Barton
2ccada61cb Cleanup: improve naming consistency, use doxy sections for splash screen 2024-02-06 14:44:03 +11:00
Campbell Barton
2bbb460c10 UI: expose the custom directory as a path property
Support changing the directory from the new repository dialog since it
no longer crashes.
2024-02-06 14:43:31 +11:00
Campbell Barton
f1a440abb6 Fix crash browsing file/directory properties within popups
Caused by [0] which closed all popups when adding a file selector event.

This was done so pressing "Open..." from the splash closes the splash
however it caused BUTTONS_OT_file_browse & BUTTONS_OT_directory_browse
to crash when changing the path of an RNA property within a popup.

Move the logic to close popups into the splash screen itself.
Since some actions such as opening a URL's should keep the splash open,
resolve by closing the splash when a file selector is opened.

[0]: b49abbec5f
2024-02-06 14:34:41 +11:00
Campbell Barton
c527056f0c Fix #117783: Allow Multiple Negatives in Numerical Inputs with Units
Support multiple unary operators before a number where only a single
negative value worked in the past.

Ref !117827.
2024-02-06 09:28:30 +11:00
Hans Goudey
72d324bd81 Fix #117865: "Create Face Sets" operator crashes for multires
The same implementation is used for meshes and multires grids,
since face sets are always stored per base mesh fast. We just need
to account for that in one place to avoid the crash.
2024-02-05 15:29:42 -05:00
Jesse Yurkovich
4797773604 Fix #117816: Import USD DistantLight as Blender Sun light
The UsdLuxDistantLight schema was being checked under the wrong
conditional.

Pull Request: https://projects.blender.org/blender/blender/pulls/117820
2024-02-05 21:03:18 +01:00
Hans Goudey
df8c85d3f9 Cleanup: UI Remove more unnecessary a1 and a2 parameters
Similar to 5155feeeb8. These had values without any meeting,
almost completely just 0 or -1 (which meant "find good values if possible"
anyway).
2024-02-05 14:38:11 -05:00
Alexander Gavrilov
3cf1c795ff Fix assertion when creating an override of a enum custom property.
Introduced in 92cf9dd2f2
2024-02-05 21:11:38 +02:00
Aras Pranckevicius
e1f8775807 VSE: default to new "Auto" image filter for strips
Part of "improve filtering situation" (#116980), now strip scaling filter defaults to "Auto" which has logic like:

- No scale, no rotation, integer positions: Nearest (fastest)
- Scaling up by more than 2x: Cubic Mitchell, so you get nicer blending between pixels than with bilinear,
- Scaling down by more than 2x: Box, so that many pixels are averaged properly without too much aliasing,
- Otherwise: Bilinear

Existing strips that use Bilinear (which is default) get switched to Auto when loading older files.

All of this has an advantage that unless you have some special needs for your look, you can leave it at default and it will look decently good at either large up-scaling or large down-scaling, but not waste performance if you don't use any scaling at all. Previously none of the choices were good in "all cases": box (née subsampled3x3) only looks good when scaling down, cubic only looks good when scaling up, default bilinear leaves performance on the table when you don't use any scale/rotation, etc.

On something like Gold movie current edit, most of the strips effectively use Nearest now, except some that are translated into non-integer pixel positions; those stay effectively Bilinear.

Pull Request: https://projects.blender.org/blender/blender/pulls/117853
2024-02-05 20:09:29 +01:00
Hans Goudey
e6188d0976 Camera: Make alpha a factor property
Removes the need to manually specify the slider state when defining the UI.
2024-02-05 12:26:00 -05:00
Hans Goudey
cfc68a1247 Fix #117813: Precision ignored for some slider buttons 2024-02-05 12:26:00 -05:00
Hans Goudey
945dc7c863 Cleanup: Use references and const in interface_layout.cc 2024-02-05 12:26:00 -05:00
Julian Eisel
bdfb1f6a04 Assets: Use inheritance for asset library class
Initial changes to make the asset library class polymorphic, plus using
that to cleanup some basic loading logic. I'm confident that this will
help us improve the asset library management code quite a bit, currently
it's quite confusing. Plus it will be extendable this way in future, so
new kinds of asset libraries (e.g. Blender project asset libraries or
arbitrary online asset libraries) can be added much easier.
2024-02-05 18:25:18 +01:00
Clément Foucault
b351638008 Fix: EEVEE-Next: Broken Normal and AO pass for emissive materials
The deferred combine pass was not rendered for these pixels
since they would not output any BSDF.

The check in pipeline sync have to be removed in order to
support emission only passes.
2024-02-05 18:15:09 +01:00
Hans Goudey
f63a776a40 Cleanup: Use this keyword to access class methods in UI views 2024-02-05 11:42:16 -05:00
Jacques Lucke
db4fd7060f BLI: support content based slicing in IndexMask
This allows slicing an `IndexMask` so that it only contains certain indices.

Pull Request: https://projects.blender.org/blender/blender/pulls/117857
2024-02-05 17:19:27 +01:00
Damien Picard
fa77e9142d UI: fix and improve a few messages
- "can not" -> "cannot" in many places (ambiguous, also see
  Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
  everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.

Some issues reported by Joan Pujolar and Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/117856
2024-02-05 17:08:17 +01:00
Sergey Sharybin
4f0ec384ce Fix incorrect update tag handling in inactive depsgraphs
The dependency graph builder takes the original data-block's recalc
flags to tag IDs after the dependency graph has been built, while
the evaluation of the graph only re-sets tho recalc flag to 0 only
for active dependency graph. This could have caused an inconsistency
of the handled tags: for example, if a headless render modifies some
object's properties and then renders the scene multiple times without
re-creating dependency graph (using Eevee or having Persistent Data,
and rendering multiple view layers, for example).

This change makes it so the recalc flags from the original ID are
only considered by active dependency graph, of when an ID is first
evaluated within a non-active dependency graph. This is a bit of a
conservative change to avoid possible breakage. In theory it should
be possible to never consider original recalc flags for render, and,
eventually, also ignore it for the active graphs. This needs to be
with more care and, so follow safer approach for now.

In practice this change fixes an issue with missing particle hair
when rendering second view layer of rlayer_flags_01.blend with Eevee.

Pull Request: https://projects.blender.org/blender/blender/pulls/117854
2024-02-05 16:59:14 +01:00