Commit Graph

111267 Commits

Author SHA1 Message Date
Jacques Lucke
165b60fd3e Fix #124398: new/free mismatch
Also see 06be295946.
2024-07-09 11:43:54 +02:00
Julian Eisel
00ff0e275a Fix potential null-pointer dereference when displaying asset tags 2024-07-09 11:38:46 +02:00
Nathan Vegdahl
8b44d6fb0d Fix: inserting keys in Action editor for non-active ID doesn't work
After #122672 landed, slots other than the the slot for the currently active
ID became accessible from the Action Editor.  However, the code for inserting
keys directly in the Action Editor assumed that the ID being keyed was
always the active one.  This made inserting keys on slots other than the slot
for the active ID fail because the RNA paths wouldn't resolve for that ID.
Additionally, even if they did resolve (e.g. if the ID type was the same), the
keying code would use the wrong ID anyway, which would result in unexpected
behavior regardless.

This commit fixes this by looking up an ID that actually uses the given slot,
and using that ID to perform the keying.

Note that there are various corner cases that have to be handled, such as when
there is more than one user of a slot (and none of them are the active ID),
which makes the choice ambiguous, or when there are no users of a slot.  We
handle these corner cases by simply keying the fcurves directly, rather than
going through the normal keyframing code paths.  This means that in those corner
cases the value of the property in the scene is ignored, and the fcurve is
simply keyed with whatever value the fcurve evaluates to on that frame.  We may
revisit this in the future if this fallback behavior turns out to not feel good
to users in practice, but for now it seems like a reasonable solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/124227
2024-07-09 11:25:45 +02:00
Nathan Vegdahl
45c489396f Refactor: move RNAPath == operator implementation to a free function
This is to follow C++ core guidelines.  Based on this discussion:
https://projects.blender.org/blender/blender/pulls/123998#issuecomment-1229591

Pull Request: https://projects.blender.org/blender/blender/pulls/124394
2024-07-09 11:24:12 +02:00
Julian Eisel
d4ae97fc3d Fix new/free mismatch for context copying
Would crash when displaying the Current File asset library in the asset
browser.
2024-07-09 10:58:39 +02:00
Falk David
6bbffc6b69 Revert "Fix #124082: GPv3: New frames created in sculpt mode are empty"
This reverts commit 924aa88877.
Introduced a high priority issue: #124344
2024-07-09 10:35:11 +02:00
Casey Bianco-Davis
52a6da315b Fix: GPv3: Draw tool outline invalid geometry with View drawing plane.
When outline was used with the drawing plane set to `View` all of the
points positions would be uninitialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/124260
2024-07-09 10:15:34 +02:00
Christoph Lendenfeld
d859b2d45d Merge branch 'blender-v4.2-release' 2024-07-09 09:31:00 +02:00
Pratik Borhade
5d8e29f84e Fix #124372: Crash in curve custom falloff UI
Caused by 9f90594db7
`func_argN_copy_fn` is assigned when `UI_but/block_funcN_set` is used.
In case of `ui_but_new`, it is uninitialized. Use block's callback
for but if `block/but->func_argN` exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/124388
2024-07-09 09:26:50 +02:00
Christoph Lendenfeld
0e8f36e63d Fix #106946: NLA sync length stops keys from being inserted
The option on NLA strips "Sync Length" (in the Action Clip dropdown of the N panel)
stops keys from being inserted if it is disabled.
This is due to the evaluation mode of the strip, which is set
to "Hold" internally but ONLY IF "Sync Length" is enabled.
Removing that condition allows to key in tweak mode regardless of that setting.

## History
This has been put in place by 89ee260ef2
Judging by the commit description, this was put in place to allow keyframing
in tweak mode. However, no explanation is given why this is only allowed
with "Sync Length" enabled. Potentially because there was no special
handling of tweak strips for keying evaluation, which has been put in
place later. (09709a7e64)

Pull Request: https://projects.blender.org/blender/blender/pulls/123902
2024-07-09 09:16:50 +02:00
Julian Eisel
2781725734 Fix #124363: Asset shelf catalog selector closes when uncollapsing catalogs 2024-07-09 09:04:47 +02:00
Campbell Barton
a52e3e18de Merge branch 'blender-v4.2-release' 2024-07-09 15:42:57 +10:00
Campbell Barton
8bbe1fe6ef CMake: remove logic to exclude removed add-ons directories
Using a REGEX on an absolute path may not work reliably without
escaping the path. Remove the exclusion as these paths are no longer
part of Blender's sources.

If some developers happen to have these directories it's harmless as
they won't be used.
2024-07-09 15:32:08 +10:00
Fermin
ad58c9eaca XR: Add passthrough support for Meta Quest devices
Uses the OpenXR extension XR_FB_PASSTHROUGH_EXTENSION_NAME,
compatible mainly with the Meta Quest family of devices.

Currently, passthrough support over OpenXR is disabled by default
in the Quest Link app, and must be manually enabled in its settings
to use this feature.

The performance of the passthrough render varies with the quality
of the connection between the headset and the PC. For better results,
connecting the headset directly through USB to the PC, or at least
connecting the PC to the local network over ethernet, is recommended.

Thanks a lot to [KISKA](https://kiska.com/)
for their support in the development of this feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/124204
2024-07-09 06:10:17 +02:00
Campbell Barton
514e1643e9 Merge branch 'blender-v4.2-release' 2024-07-09 13:47:15 +10:00
Campbell Barton
bf68ce401d Merge branch 'blender-v4.2-release' 2024-07-09 13:47:12 +10:00
Campbell Barton
5e4b07cb06 Merge branch 'blender-v4.2-release' 2024-07-09 13:47:04 +10:00
Campbell Barton
da9cfbdae9 Docs: add doc-string to mathutils.Vector swizzle attributes
Also refactor definitions into a macro as they were exceeding the
line-length and wrapping.

Ref: !124275

Co-authored-by: Nathan Burnham <nathan@nathanburnham.uk>
2024-07-09 13:45:07 +10:00
nutti
5523662414 Docs: add default parameters to Context.temp_override
Ref: !124348
2024-07-09 13:44:09 +10:00
Richard Antalik
1f42c9eb54 Fix: Crash when clicking on unrealized retiming key
When keys are realized, strip handle positions are used to ensure, that
left and right key exists. If strip content is offset to the right,
this caused crash. This happened, because `SEQ_retiming_add_key()`
clamped timeline frame to strip content only on right side.

Clamp timeline frame to strip content on both sides.

Pull Request: https://projects.blender.org/blender/blender/pulls/124207
2024-07-09 01:30:40 +02:00
Hans Goudey
bbcc720c13 Fix: Property search crash after recent allocator change
The button's callback function argument "free function" needs to be
copied along with the resource itself. We used to just call MEM_freeN
in this case, now we call the dedicated deallocation function which
supports non-trivial types.

Caused by 9f90594db7.
2024-07-08 19:09:25 -04:00
Hans Goudey
61db25b78e Fix: Linker error in lite build with OBJ import node 2024-07-08 19:05:36 -04:00
Hans Goudey
e474eef5d1 Cleanup: Formatting 2024-07-08 18:17:19 -04:00
Hans Goudey
28d3f7f638 Cleanup: Sculpt: Remove unused PBVH variables 2024-07-08 17:56:41 -04:00
Hans Goudey
4817ff1d72 Refactor: Sculpt: Remove PBVH CCGKey storage
Part of #118145.
2024-07-08 17:56:31 -04:00
Hans Goudey
977e961067 Fix: OBJ import node build error in lite build
Similar to 3a31fcebcf
2024-07-08 17:05:06 -04:00
Hans Goudey
68d6bf56e5 Sculpt: Refactor position and mask smoothing for BMesh and multires
Similar to:
- c93767a8b4
- 851505752f

Those commits didn't apply to the smoothing brushes. Now all refactored
brushes use the new code structure. This commit includes utilities for averaging
neighboring mask and position values which will be used by the mask and mesh
filters in future commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/124371
2024-07-08 23:04:06 +02:00
Sean Kim
c070986e23 Cleanup: Sculpt: Extract common translation function
Pull Request: https://projects.blender.org/blender/blender/pulls/124368
2024-07-08 22:09:49 +02:00
Hans Goudey
8762290658 Fix: Windows build error after recent cleanup
Just switch back to the C allocator API here, I don't know how we're
supposed to allocate DNA types with `DNA_DEFINE_CXX_METHODS`.
2024-07-08 15:48:31 -04:00
Sean Kim
67dc0245e4 Merge branch 'blender-v4.2-release' 2024-07-08 12:38:10 -07:00
Sean Kim
d527e3a6bd Fix #122947: Curve stroke on duplicate object doesn't update normals
When a mesh is shared between multiple objects, sculpting with a brush
with the Curve stroke type doesnt update normal values for the affected
nodes when using PBVH drawing. This is because when reevaluating the
depsgraph for the objects, the shared PBVH is destroyed and the nodes
are recalculated, losing the existing node flag updates.

This only occurs for the Curve stroke type because all of its stroke
steps are performed within a single call to the overall operator when
the user presses enter, unlike other brush strokes which apply on each
mouse movement.

To fix this, we simply force update the normals before destroying the
PBVH at the end of the stroke step.

Pull Request: https://projects.blender.org/blender/blender/pulls/124268
2024-07-08 21:36:28 +02:00
Harley Acheson
f95436de08 Merge branch 'blender-v4.2-release' 2024-07-08 12:36:28 -07:00
Harley Acheson
9a26bfcd5f Fix: Shade Smooth Removal Notification When Needed
Only send `NC_OBJECT | ND_DRAW` notification if the smooth by angle
modifier has been removed, not on all changes. This is a slight
adjustment to #124330.

Pull Request: https://projects.blender.org/blender/blender/pulls/124362
2024-07-08 21:35:26 +02:00
Hans Goudey
792efafa2c Cleanup: Miscellaneous changes to OBJ/import nodes
- Sort add menu alphabetically
- Use forward declaration for GeometrySet again
- Use `this->` to access class methods
- Use `MEM_cnew`
- Fix typo
- Pass Span by value
- Pass MutableSpan instead of Vector &
- Remove unnecessary whitespace
- Use `BLI_SCOPED_DEFER` for freeing non-RAII objects
- Use `is_empty()` instead of `size() == 0`
- Use `GeometrySet::from_mesh` ability to handle null argument
2024-07-08 15:12:42 -04:00
Jacques Lucke
c876731844 Fix: new/free mismatch for cloth brush 2024-07-08 20:39:00 +02:00
Devashish Lal
4b884f737c Geometry Nodes: OBJ Import Node
Add a node similar to the STL import node (d1455c4138) that
imports OBJ files, including both meshes and curves. The output consists
of a geometry instance for each mesh/curve in the file.

There are a few improvements to address in the future: Currently the node
has no inputs besides the file path. Options may be exposed in the future.
Materials are also not imported yet, because creating material data-blocks
during evaluation may not be trivial.

This is part of a GSoC project:
https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482

Pull Request: https://projects.blender.org/blender/blender/pulls/123967
2024-07-08 20:20:38 +02:00
Harley Acheson
aa90a9179a Merge branch 'blender-v4.2-release' 2024-07-08 09:43:12 -07:00
Pratik Borhade
e8f0dabc7e Fix #124302: Crash when clicking arrow button in outliner
This is due to missing rebuild of outliner tree. Auto smooth operator
is cleared with shade flat execution but outliner is unaware of this and
the modifier tree element remains intact. This add a notifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/124330
2024-07-08 18:42:06 +02:00
Sergey Sharybin
584834e5a8 Fix #124342: Color sampling clamped to 1 for specific tool
SHift-X sets the color value directly, bypassing clamping done
on the RNA level. The color picker uses RNA setter to assign
colors, which enforces limits.

This change makes it so the 0..1 is an UI range, but allows to
manually type in values above that. This is similar to colors
in the node trees, but a bit more conservative by using UI range
explicitly.

Thanks Omar for identifying the root cause of where the clamping
is coming from!

Pull Request: https://projects.blender.org/blender/blender/pulls/124355
2024-07-08 18:21:50 +02:00
Jacques Lucke
eeb1e14531 GPv3: simplify adding multiple layers with empty drawings
This is often required when generating grease pencil procedurally, e.g. in #124279.
2024-07-08 18:09:36 +02:00
Jacques Lucke
346110a415 GPv3: add method to set local layer transform
Used by e.g. #124279.
2024-07-08 18:09:36 +02:00
Jesse Yurkovich
5bb5cfd97a Merge branch 'blender-v4.2-release' 2024-07-08 09:07:07 -07:00
Jesse Yurkovich
7d6835f043 Fix #124075: Read Alembic point cloud velocity data
This regressed during the change to use GeometrySets in ea256346a8.

Pull Request: https://projects.blender.org/blender/blender/pulls/124077
2024-07-08 17:56:43 +02:00
Jesse Yurkovich
f9b2edbf01 Fix #124009: Clamp material index when uploading mesh through Hydra
Prevent crash from a mesh created around the time of Blender 4.0 with
bad (negative) material indices on some faces.

The Poly Haven folks were poked to fix the actual asset as well but it's
simple enough for us to clamp in this code path, especially since we
were already doing it for the upper bound.

Pull Request: https://projects.blender.org/blender/blender/pulls/124026
2024-07-08 17:55:50 +02:00
Julian Eisel
f4525c9901 Sculpt/Paint: Rename "Sculpt Tool" etc to "Brush Type" in the UI
Renames "Sculpt Tool", "Vertex Paint Tool", ... to "Brush Type" in all cases.

The name "tool" is overloaded, plus, there actually is a "Brush Tool" now. As a
follow up to the assets project merge we can rename this in C++, added this
to #116337 and opened #124201. At least rename it in the UI for a start.

Pull request: https://projects.blender.org/blender/blender/pulls/124203
2024-07-08 17:50:25 +02:00
Julian Eisel
2ffe132313 Assets: Make brush assets non-experimental
With the previous commit brush assets are now well supported, and can be
enabled by default (not disabled anymore by the "Extended Asset Browser"
experimental feature). In fact this commit only enables displaying them
in the asset browser and using normal asset operators on brushes.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:25 +02:00
Julian Eisel
7b0ea0f1b4 Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.

With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
  handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
  removed here. That means they draw as blank now, and the icon files can be
  removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
  the Essentials asset library. Icons/previews are handled as standard asset
  previews.
- Grease pencil eraser options are replaced by a general default eraser brush
  that can be set by the user.

More changes are planned still, see task list issue below.

Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar

Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/

Tasks:
https://projects.blender.org/blender/blender/issues/116337

Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:25 +02:00
Julian Eisel
721dbfccfd UI: Turn asset shelf popup into a popover, add operator to call from shortcut
Turns the asset shelf into a popover which reduces some of the special
handling. An operator `WM_OT_call_asset_shelf_popover()` (similar to
`WM_OT_call_panel()`) is added to be able to call the popover from shortcuts.
Exactly this was an important aspect for the brush assets project, to allow
quick searching for brushes from the popup.

A custom shortcut can be added to asset shelf popovers using "Assign Shortcut"
in the context menu of buttons invoking it.

The popover is spawned with the mouse hovering the first asset and the search
button active using "semi modal" handling. That means while the popover is
open, any text input is captured by the search button, while the rest of the
popover stays interactive. So for example navigating through asset catalogs is
possible, a single click activates an asset and closes the popover.

Reviewed as part of the asset shelf project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Julian Eisel
adb8157ebb UI: Uncollapse first levels of catalogs by default in asset shelf
When opening the popup to select the asset catalogs to show as tabs in the
asset shelf, it's annoying that they would collapse back to the root level
every time. This would mean users have to manually uncollapse a bunch of
catalogs every time they call the popup. Since this is a popup, we don't need
to be too careful about saving space. And in practice these catalog trees are
usually rather small anyway. So simply uncollapse the first few levels of
catalogs.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Julian Eisel
e108517bd6 Fix asset shelf context menu acting on active, not clicked asset
Make sure the view item the context menu is spawned from is always activated.
The brush assets context menu relies on that (it accesses the active brush from
paint settings, and the brush needs to be imported to apply operations like
"Edit Metadata").

Had to refactor how closing the popup on activation works. It's now a general
view feature and enabled by default. Can be disabled using
`ui::AbstractView::set_popup_keep_open()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/124043

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00