Commit Graph

106561 Commits

Author SHA1 Message Date
Campbell Barton
41b63ebda2 Versioning: add missing version update for renamed key-map
Account for the renamed key-map when loading older saved key-maps &
stored user preferences. [0] missed these changes.

[0]: 661e7e451a
2024-02-09 18:11:12 +11:00
Hans Goudey
2e6223d90f Geometry Nodes: Move instance reference indices to a builtin attribute
This means the array can be shared between geometries when unchanged,
reducing memory usage and increasing performance. It also means that
handling the data can be done more generically using the attribute
system. In the future the transforms can become attributes too.

Two other changes are related here:
- The "almost unique ids" are cached with a shared cache so they
  are shared too.
- The reference indices are baked as an attribute now, making the process
  more generic and potentially easier to optimize in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/117951
2024-02-08 20:55:34 +01:00
Miguel Pozo
bf0ac755e2 Fix: EEVEE: Volumes don't render
OrcoTexCoFactors were wrong.
Regression from
fa3bd17ae8
2024-02-08 19:57:18 +01:00
Miguel Pozo
a8f29e8e36 Disable EEVEE-Next 2024-02-08 17:37:53 +01:00
Sybren A. Stüvel
756ae1eb3e Cleanup: run make format
No functional changes.
2024-02-08 17:16:56 +01:00
Jacques Lucke
2e4a3bae67 Geometry Nodes: use Still mode by default in Bake node
Currently, the geometry nodes modifier always creates a time dependency
if there is a bake animation node, even if there is no bake. Changing this is
not entirely trivial, because it is only known during evaluation if there is baked
data. Making `Still` the default works around that issue in many cases where
the Bake node is in a node group asset that does not depend on time.

Furthermore, it's nice to have the "cheaper" version of the node by default,
which is baking a single frame, instead of baking everything.

Pull Request: https://projects.blender.org/blender/blender/pulls/117999
2024-02-08 17:04:38 +01:00
Sean Kim
fdf37275b6 Fix: Prevent erroneous values for detail_size and detail_percent
This PR applies the UI range for the Dyntopo `detail_size` and `detail_percent` to the actual property range. Previously, 0 and negative values were allowed if manually entered into the field, the former leading to blender hanging upon the next stroke, and the latter leading to potentially odd or unwanted behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/117976
2024-02-08 17:02:55 +01:00
Jacques Lucke
faaa8d4c79 Fix: crash when separating grease pencil in geometry nodes 2024-02-08 16:03:05 +01:00
Sean Kim
4df5bcfea9 Sculpt: Disable sculpt brushes on invisible objects
* Brushes no longer affect invisible objects or objects that are entirely
  contained by hidden collections
* The brush cursor no longer highlights vertices of invisible objects and
  the cursor circle remains view-aligned.

Resolves part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/117746
2024-02-08 15:06:17 +01:00
Philipp Oeser
cdf5265f69 Fix #117971: wrong indices in sculpt undo/restore colors
Caused by 3e81f66998

Looks like we need to store the unique verts indices here, this goes in
line to what similar code in this area does (but havent checked the data
layout of an Undo node here in depth).

Pull Request: https://projects.blender.org/blender/blender/pulls/117986
2024-02-08 14:49:25 +01:00
Philipp Oeser
98bf7a8d7a Fix #116188: hair puff works incorrect with symmetry
Originally caused by 1b19f62917 .

Solution is the same as ff7b8f3412
Only this time it does the same thing `Sphere` falloff (whereas
ff7b8f3412 fixed it for `Projected` falloff)

Pull Request: https://projects.blender.org/blender/blender/pulls/117987
2024-02-08 14:48:45 +01:00
Julian Eisel
83dbbf9aec Fix #117572: Top vertical scrollbar tool not working properly
Remove ugly/fragile special case in `view2d_masks()` that would clamp
the scrollbar-masks by the scrubbing UI. It's now possible to pass
custom scrollbar-masks to `View2D` via `UI_view2d_scrollers_draw()`. So
use this instead, making region code control its own masks, rather than
relying on special case handling in generic `View2D` code.

Also update comment in `scroller_activate_init()` to make the implicit
relationship explicit.

Alternative to, and based on the investigation in !117685.

Pull Request: https://projects.blender.org/blender/blender/pulls/117984
2024-02-08 14:25:47 +01:00
Campbell Barton
252ae7029d Fix building FreeStyle with Python 3.12
Add helper functions for creating PyLong sup-types.
In Python 3.12 it's no longer practical to manipulate PyLongObject
values directly. Resolve by creating PyLongObject and copying the
values to a newly created sub-type.
2024-02-08 23:45:21 +11:00
Julian Eisel
8887955def Fix division by 0 in tree view drawing
Would happen when there is no View2D data, like in popups.
2024-02-08 12:07:28 +01:00
Philipp Oeser
228ee8f1c3 Fix #96458: Add channel processing for UsdUVTexture
This adds the processing required to import and export simple material graphs utilizing the UsdUVTexture outputs channels.

If only r, g or b are specified as output, we hook up a `Separate Color` node and connect the appropriate channel from there.
(if a is specified as output, the Alpha output of an image texture node was used already)

On the export side, we traverse from the socket to the image texture node, and if a `Separate Color` on the way, we are using the channel from there to put on the output.

https://openusd.org/release/spec_usdpreviewsurface.html#texture-reader

Pull Request: https://projects.blender.org/blender/blender/pulls/117901
2024-02-08 10:01:41 +01:00
Campbell Barton
f9e976c899 Fix error suppressing double-click events for modal keymap handling 2024-02-08 16:25:01 +11:00
Hans Goudey
cf5304855f Fix #117632: IME input crash after refactor to use std::string
The IME widget drawing code replaces the button's draw string, but it
did this with a C-style const cast which let this go unnoticed in
089c389b5c which changed the string from a C array to a
C++ std::string, where it's UB to just change the length this way.

To fix the crash, just store the string in a temporary array so we
can use the existing unchanged formatting code.

Pull Request: https://projects.blender.org/blender/blender/pulls/117968
2024-02-08 05:52:19 +01:00
Campbell Barton
899f5e2c94 Fix incorrect use of EVENT_* types as a flag
Also use ISKEYMODIFIER macro.
2024-02-08 15:07:40 +11:00
Harley Acheson
b6091f134c Fix #117956: Revert Last Chance Placeholder Default
As #117956 shows, guessing default placeholder text based on the
property UI name can have bad consequence. Best to leave this out and
just set custom placeholder when needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/117962
2024-02-07 21:19:28 +01:00
Brecht Van Lommel
bd8a44e169 Lights: Option to use old point light falloff
Add new "Soft Falloff" option on point and spot light that uses
the old light behavior from Blender versions before 4.0. Blend
files saved with those older versions will use the option.

This option is enabled by default on new lights.

Fix #114241

Co-authored-by: Weizhen Huang <weizhen@blender.org>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/117832
2024-02-07 19:07:11 +01:00
Hans Goudey
5efb35100d Fix #117929: Extract face set operator crash
The problem was calling a "for eval" function on an original mesh
in the main data-base. The parameters are already copied anyway,
so the call was unnecessary. Also reorder some changes to happen
before the geometry is moved to the original mesh.
2024-02-07 10:21:02 -05:00
Jacques Lucke
fc8333089c Fix: duplicate modifier uids with overrides
Keep the `persistent_uid` that is already known to be unique on `ob_dst`
instead of copying the one from `md_src` which may not be unique in
`ob_dst`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117942
2024-02-07 14:21:38 +01:00
Hans Goudey
78963b466b Mesh: Add "Set Sharpness by Angle" operator
This simple  operator set the edge sharpness attribute on edges,
either extending the existing values or replacing them completely.
It's meant to make it more convenient to manually control the
sharpness now that there can be more reason to do that after
auto smooth became a modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/117918
2024-02-07 14:17:16 +01:00
Thomas Dinges
4db1426818 Release cycle: 4.1, Bcon3 2024-02-07 12:49:52 +01:00
Sergey Sharybin
45a73827b0 Fix missing dependency in CMake file
Make sure bf_rna is compiled prior to bf_editor_space_userpref,
so that the RNA_prototypes.h can be included.

Solves possible compilation error when building Blender from
scratch.

Pull Request: https://projects.blender.org/blender/blender/pulls/117937
2024-02-07 11:39:45 +01:00
Damien Picard
019eb5a35e I18n: use IFACE_ to translate status bar info & viewport statistics
Although the information displayed in the status bar is strictly
speaking reports, it makes sense to translate them using the Interface
setting instead of Reports, as the tool names and stats terms are
also translated in other UI places (toolbar, menus).

This change includes status bars statistics and keymaps, and viewport
statistics.

The change is quite extensive as it is all or nothing. Translating
keymaps using Interface means some status messages will include them
indirectly, and thus cannot use Reports without having a weird mix of
original and translated words. In turn, having only some messages
translated would be even more confusing.
The result is that all messages related to input are now translated with
Interface, which I think also makes sense.

Discussed as a followup to !116804.

-----

cc. @gtitaev

Pull Request: https://projects.blender.org/blender/blender/pulls/117234
2024-02-07 11:17:50 +01:00
Philipp Oeser
b56192b3bb Fix: Simplify "Volume Resolution" not updating for non volume objects
This came up in #117747.

Unless an object was of OB_VOLUME type, the setting was not updating the
viewport accordingly since the introduction in 365bf103d1. So if for
example a mesh has a "Mesh to Volume" node, the update did not take
place.

If we use context, we can check the evaluated GeometrySet on any object
type with a geometry nodes modifier though and if it has a volume, we
can also tag for update.

Pull Request: https://projects.blender.org/blender/blender/pulls/117848
2024-02-07 10:32:06 +01:00
Bastien Montagne
7ca62fa54e Refactor: Turn main USD public header into full Cpp one.
Rename `usd.h` to `usd.hh`, and put its declarations in the
`blender::io::usd` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/117897
2024-02-07 09:42:23 +01:00
Bastien Montagne
9363293472 Refactor: USD: Rename usd.hh to usd_private.hh
This header is for 'internal' USD code only (also needed by the hydra
code), and uses references to the USD library itself, so its previous
name was a bit too generic.

First step to move the main public Blender USD API header (`usd.h`) to cpp.
2024-02-07 09:42:20 +01:00
Pratik Borhade
af27c1feed Fix #113365: Backdrop lines don't match height in nla
Adjust ymax of action in frame range so that height will match with the
channel's height. Use same ymax as in `acf_nlaaction_backdrop`.
Also fixed `ycenter` value.

Pull Request: https://projects.blender.org/blender/blender/pulls/113490
2024-02-07 08:12:13 +01:00
Hans Goudey
c743213c3b Cleanup: Add missing forward declaration 2024-02-06 21:32:26 -05:00
Guillermo Venegas
c00c3c9eac UI: Import dialog popup feedback
For import operators dialog popups shows the name
of the file that is being imported as title, in case of
multiple file import shows the count.

Pull Request: https://projects.blender.org/blender/blender/pulls/117917
2024-02-07 01:00:15 +01:00
Christoph Lendenfeld
446b92d2ce Anim: Graph Editor - automatically lock key translation to a single axis
When moving keys in the Graph Editor animators
usually only want to move them on one axis.
While this is possible in a few ways (G+X, or G + Middle Mouse Button click),
we could default the behavior to always lock on an axis.
This was suggested by Dreamworks animators during the
Animation & Rigging module meeting.
https://devtalk.blender.org/t/2024-01-26-animation-rigging-module-meeting/33081#patch-review-decision-time-5

This PR adds an option with which the movement is
always locked to a single axis by default.
The option can be found in the Graph Editor under "View->Auto-Lock Axis".

The movement will then be restricted to the axis along
which you've moved the cursor the most.
You can still manually override the lock behavior by pressing `X` or `Y`.

I am piggybacking off the auto locking feature you get when pressing the middle mouse button.
When the new feature is enabled I call that at the start of the transformation.
Except when:
* only handles are selected
* the tweak mode has been started on a handle

This is to not snap handles, which is a behavior that has
been requested by the artists.

Pull Request: https://projects.blender.org/blender/blender/pulls/117669
2024-02-06 23:31:09 +01:00
Christoph Lendenfeld
79f84775f2 Anim: Motion Paths in camera space
Animators (especially for film and TV) often need
to track the movement of things in screenspace.
At the end of the day, the pixel motion is what counts.
But motion paths were always in world space,
which made it hard to use when the camera
is also animated (during action scenes e.g.)

This PR introduces the feature of projecting a motion path into the screen space of the active scene camera.

Limitations
This makes the motion path only useful when looking through the active scene camera.
Switching the scene camera using markers is not yet supported.

Technical Implementation
This is achieved by baking the motion path points into the
camera space on creation. For every point calculated,
the camera is evaluated through the depsgraph and
the resulting world matrix is used.
Then I pass in the current frame's world matrix of the
camera into the shader to make sure the points follow it.
As can be seen in the video, it looks quite odd when
viewed at another angle but this is expected.
I mentioned that in the tooltip, so it shouldn't be an issue

Pull Request: https://projects.blender.org/blender/blender/pulls/117593
2024-02-06 23:14:17 +01:00
Ray Molenkamp
95a863a7e7 CMake/MSVC: deploy cuda support for oidn if available 2024-02-06 13:51:58 -07:00
Brecht Van Lommel
e38f360ddb Cleanup: Unused enum value that should not have been in recent commit
Ref #117673
2024-02-06 20:51:06 +01:00
Jesse Yurkovich
434bb0c93f Fix #108754: remove overactive color management assert
The assert attempted to guard against file formats declaring themselves
as "requiring a float buffer" but outputing to a "byte buffer". However,
DPX seems to permit this and the code seems to support it correctly.

The assert was originally added in 2022 by 5baa3ecda6. Subsequently the
test which exposed the problem was added in 2023 by 7699c7407d. But the
issue at hand has existed since DPX was added; it's the only format with
this combination of capabilities.

Pull Request: https://projects.blender.org/blender/blender/pulls/117914
2024-02-06 20:50:44 +01:00
Guillermo Venegas
0d7282e69b Fix: Presets overriding drag-n-drop data
Currently, internal I/O operators can be invoked with drag-n-drop path
data, and when this happens a quick popup menu is shown to customize
import settings.

If these operators support operator presets, using a preset can
override path data given by drag-n-drop, and that can be unwanted
behavior.

While this can be fixed by setting path properties to SKIP_SAVE, doing
this would make these properties also to stop using ghost values. These
ghost values are used by the file select window to open operator last
import directory, and using this flag makes the file select windows
always open the home directory.

To fix that, add an explicit flag PROP_SKIP_PRESET that skips properties
writing to presets. Also clarify that PROP_HIDDEN and PROP_SKIP_SAVE
also avoid writing to presets.

Added a operator that can clean operator's specific property presets.
Importing presets from previous versions runs an automatic cleanup.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/117673
2024-02-06 20:02:27 +01:00
Hans Goudey
42561c2a1c Fix #117903: Copy as driver crash
The copy as driver function assumed that the path was allocated.
Generally we should avoid using `MEM_dupallocN` for reasons
like this.
2024-02-06 13:11:16 -05:00
Jacques Lucke
e1ee422d12 Nodes: improve handling of deprecated nodes
In 4.1 we deprecate the `Rotate Euler` node in favor of the `Rotate Rotation`
node which uses the new rotation socket type. The node is not removed
(for now) because that would come with compatibility issues. More generally,
we'll likely run into the situation where nodes are deprecated more often in the
future, without actually removing them to keep compatibility. This patch improves
how such nodes are handled in the UI.

The patch does three things:
* Adds a new `Utilities > Deprecated` entry in the add node menu in geometry nodes.
* Moves search items which are deprecated to the bottom in the search results
  (currently, this only works in English, can be fixed in bcon3).
* Adds a new `bNodeType->deprecation_notice` that will result in a deprecation
  warning when the node is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/117905
2024-02-06 19:08:01 +01:00
Jacques Lucke
0ecb20df47 Geometry Nodes: improve socket naming in Sample nodes
This makes the socket names in the sample nodes a bit more aligned.
Specifically, the following names are changed:
* Geometry Proximity: `Target > Geometry`, `Source Position > Sample Position`
* Sample UV Surface: `Source UV Map > UV Map`

Pull Request: https://projects.blender.org/blender/blender/pulls/117908
2024-02-06 18:25:03 +01:00
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