Commit Graph

111305 Commits

Author SHA1 Message Date
Hans Goudey
879eca663a Fix #124419: Smooth brush broken for larger meshes
Simple mistake in 68d6bf56e5.
2024-07-09 17:19:00 -04:00
Hans Goudey
248910be1f Fix: Build error on Windows after recent fix
`PreviewImage` is a non-trivial type on MSVC and can't
be allocated with `MEM_cnew`.
2024-07-09 16:16:56 -04:00
Hans Goudey
1d5bf4ca56 Refactor: Sculpt: Change parts of snake hook brush to new structure
- Access positions from a thread-local array
- Replace use of the proxy system with immediately applied translations
- Access data from stroke cache directly
2024-07-09 15:26:30 -04:00
Hans Goudey
426ffa6000 Refactor: Sculpt: Specialize snake hook brush per PBVH type
Part of #118145.
2024-07-09 15:26:30 -04:00
Jesse Yurkovich
3c65b154eb Merge branch 'blender-v4.2-release' 2024-07-09 12:07:15 -07:00
Pablo Delgado Krämer
7cc0e48882 Fix #124016: Translate Image Texture node color spaces to MaterialX
This addresses #124016. The report provides a scene to test the changes.

Currently, the Blender and MaterialX color spaces are not fully aligned,
but the linear/srgb heuristic should cover most cases however.

Pull Request: https://projects.blender.org/blender/blender/pulls/124315
2024-07-09 21:06:08 +02:00
Hans Goudey
5665243bef Cleanup: Use C++ types for snake hook brush 2024-07-09 14:10:05 -04:00
Hans Goudey
3009d4f28c Cleanup: Sculpt: Move snake hook brush to separate file 2024-07-09 13:31:45 -04:00
Julian Eisel
46c0d3e644 Fix: Broken active highlighting of assets in the asset shelf
Suspecting a mismatch when asset weak references stored using Unix style
paths with ones generated at runtime with Windows sytle paths.

Pull Request: https://projects.blender.org/blender/blender/pulls/124415
2024-07-09 19:07:18 +02:00
Jacques Lucke
57f1d959d4 Cleanup: use StringRefNull instead of std::string for instance reference name 2024-07-09 18:56:09 +02:00
Jacques Lucke
39d509f91f Fix: incorrect preview image shallow copy 2024-07-09 18:53:50 +02:00
Jacques Lucke
d0c6bce884 Fix: new/free mismatch
Also see 06be295946.
2024-07-09 18:31:13 +02:00
Jacques Lucke
a57d1ae35e Cleanup: fix compilation
For some reason, `MTex` is trivial on some platforms and not on others.
2024-07-09 18:20:11 +02:00
Sybren A. Stüvel
c26dc45bd9 Merge remote-tracking branch 'origin/blender-v4.2-release' 2024-07-09 18:11:21 +02:00
Pratik Borhade
63cb33139f Fix #124288: Channels overlap the Dope Sheet search
Channels are drawn after/on top of the search box. To fix this, move
`ED_time_scrub_channel_search_draw` below the channel drawing function.

Pull Request: https://projects.blender.org/blender/blender/pulls/124331
2024-07-09 17:57:07 +02:00
Jacques Lucke
dc8e9678e1 Geometry Nodes: allow naming geometry sets
This adds a new `name` member to the `GeometrySet` class. This name can be set
with the new `Set Geometry Name` node. Currently, the name is only used in the
spreadsheet when displaying instances.

The main purpose of this name is to help debugging in instance trees. However, in the
future it may also be used when exporting instance trees or when creating separate
objects from them.

Note, the name is not expected to be unique, it is fully in user control.

Naming geometries is necessary to make the spreadsheet more useful for instances,
because currently the user has no information for which geometry is used by each instance.

We also want to use this name to improve the integration with grease pencil where
sometimes layers become instances with the same name.

Pull Request: https://projects.blender.org/blender/blender/pulls/114910
2024-07-09 17:03:54 +02:00
Aras Pranckevicius
6f0620161d Fix #123949: OBJ importer should not set face sharpness when vertex normals are present
Having both custom vertex normals and the "is the face sharp?"
attribute on a mesh leads to some non-intuitive behaviours. Instead,
make the behaviour more aligned with OBJ format description wording,
which says "When vertex normals are present, they supersede
smoothing groups" (https://paulbourke.net/dataformats/obj/).

Pull Request: https://projects.blender.org/blender/blender/pulls/124366
2024-07-09 16:59:17 +02:00
Clément Foucault
e0474c4bd3 Merge branch 'blender-v4.2-release' 2024-07-09 16:47:16 +02:00
Clément Foucault
983e4a7543 Fix: EEVEE: Shadow mode versioning node affecting Cycles
Even if Cycles is not the active render engine, this
versioning code could affect Cycles if a material was
used with Cylces in another file (using linking).

Fix this by spliting the output node into another one
that only affects EEVEE.
2024-07-09 16:46:06 +02:00
Jacques Lucke
056ac7f407 Fix: new/free mismatch in a few cases
Also see 06be295946.
These aren't all cases, but a few that I found by addding a static
assert in `MEM_new` so that it fails for trivially constructible types.
2024-07-09 16:22:04 +02:00
Omar Emara
cad488e820 Merge branch 'blender-v4.2-release' 2024-07-09 17:12:39 +03:00
Omar Emara
0251db1447 Fix #124335: Viewport compositor crash upon scene change
The viewport compositor crashes when the scene is changed in some
situations. That's because the viewport compositor tries to use node
tree data that was freed in the last depsgraph update, while it should
have invalidate those references based on the same depsgraph update.

The source of this issue is in the depsgraph itself. In particular, when
the depsgraph evaluation happens in two passes, the ID recalculate flags
are backed up for every pass then restored at the end of all passes,
however, this doesn't happen for the ID Type Update table. So whenever
evaluations happen in two passes, changes will not be propagated to
engines that require those information, like the viewport compositor
engine in that particular case.

To fix this, we backup and restore the ID Type Update table in a similar
manner to the ID recalculate flags.

Fixes #107235, #124335, #116142.

Pull Request: https://projects.blender.org/blender/blender/pulls/124409
2024-07-09 16:10:58 +02:00
Falk David
55162916ca Fix: GPv3: Draw Tool: Prevent trim_end_points from removing entire stroke
The `trim_end_points` in the draw tool was only supposed to be able to remove
end points of the stroke.
Make sure to clamp the value so that at least one point remains in the curve.
2024-07-09 16:08:04 +02:00
Sybren A. Stüvel
1b09466e13 Refactor: Anim, move some Slot methods next to their siblings
Move some methods on `Slot` in the source file so that they sit next to
their siblings. Some unrelated functions squeezed in between them.

No functional changes.
2024-07-09 15:57:48 +02:00
Jacques Lucke
edd40007ab Fix: new/free mismatch
Also see 06be295946.
2024-07-09 15:39:09 +02:00
Bastien Montagne
57e9abb564 Cleanup: Remove left-over call to BKE_blendfile_write_partial_end.
BPY `library.write` has been moved to new PartialWriteContext code a few
weeks ago, removing this call to `BKE_blendfile_write_partial_end` was
somehow missed then.
2024-07-09 15:27:12 +02:00
Bastien Montagne
17af2bb83c Cleanup: BKE Workspace: Remove unused BKE_blendfile_workspace_config_write. 2024-07-09 15:23:44 +02:00
Falk David
6a69b1789e Fix: GPv3: Crash caused by invalid curve plane normal
In some cases, the plane normal would not be normalized
correctly. This fixes the normalization and ensures the normal
has a length of 1.
2024-07-09 15:11:39 +02:00
Clément Foucault
acf7eab3b5 Merge branch 'blender-v4.2-release'
# Conflicts:
#	tests/data
2024-07-09 14:52:34 +02:00
Clément Foucault
7fe7b2eed0 Fix: EEVEE: Hardware discrepancy with math wrap function
The math render tests were not passing on the AMD hardware.
This was due to some compiler behavior not returning 1
on the `floor((a - c) / (b - c))` calculation even if
`a` and `b` were equal.
2024-07-09 14:13:32 +02:00
Lukas Tönne
2eaf85aa54 Fix #124393: GPv3: invalid frame when inserting in the draw tool
The draw tool tries to insert a duplicate frame when using additive
drawing, but the start frame it tries to duplicate can be null.
Check the return value of `start_frame_at` before using it, and insert
an empty frame if no start frame exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/124396
2024-07-09 13:49:35 +02:00
Julian Eisel
280a8afa76 Fix "Reset to Default" using wrong value for asset shelf preview size
Use RNA callback to get the actual default value (which asset shelf
types may define using `AssetShelf.bl_default_preview_size`.
2024-07-09 13:37:57 +02:00
Jeroen Bakker
71de545697 Fix #124377: EEVEE Incorrect HDRI Previews location
When render border is active the default framebuffer view is changed
and results to rendering the HDRI previews inside the render border
and not in the bottom right corner of the 3d viewport.

This PR fixes it by resetting the viewport when drawing the HDRI
previews.

Also tried to pass the DRW default view during submission, but that
didn't fixed the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/124402
2024-07-09 13:32:54 +02:00
Jeroen Bakker
34380f5c37 Fix #124377: EEVEE Incorrect HDRI Previews location
When render border is active the default framebuffer view is changed
and results to rendering the HDRI previews inside the render border
and not in the bottom right corner of the 3d viewport.

This PR fixes it by resetting the viewport when drawing the HDRI
previews.

Also tried to pass the DRW default view during submission, but that
didn't fixed the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/124402
2024-07-09 13:30:09 +02:00
Julian Eisel
3f0aabbec6 Fix new/free mismatch with asset shelf duplication 2024-07-09 13:05:41 +02:00
Sybren A. Stüvel
1276680874 Anim: Action editor, show slot user count if not equal to 1
In the Action editor, show the number of users for each slot.

- 1 user (the expected case): not shown
- multiple users: number is shown between parentheses, f.e. `(3)`
- none: shown as `(unassigned)` as I think that's clearer than `(0)`.

This PR doesn't technically depend on !122500, but having that landed
first will make testing this one quite a bit easier.

Pull Request: https://projects.blender.org/blender/blender/pulls/124337
2024-07-09 12:56:33 +02:00
Campbell Barton
48dbda62a5 Merge branch 'blender-v4.2-release' 2024-07-09 19:49:44 +10:00
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
Campbell Barton
1cfc83d5f6 UI: add cancel_default option to WindowManager.invoke_props_dialog
Make it possible that the cancel option is default for operator
popups.
2024-07-09 19:26:25 +10: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