Commit Graph

106544 Commits

Author SHA1 Message Date
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
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