Commit Graph

117741 Commits

Author SHA1 Message Date
Jesse Yurkovich
ea5ed269ae Merge branch 'blender-v4.4-release' 2025-02-27 16:48:42 -08:00
Jesse Yurkovich
1833d79231 Fix: USD: Don't attempt to export the special custom_normal attribute
Suppress exporting this attribute as there's no conversion to USD that
supports its data type (2d, 16-bit int) and because mesh normals (from
the `corner_normals` API) are already exported. This causes a rather
annoying UI Warning notification that the attribute isn't convertible
during export.

Pull Request: https://projects.blender.org/blender/blender/pulls/135271
2025-02-28 01:47:37 +01:00
Campbell Barton
322abbd311 Fix file-selector operators performing an undo push on failure
Operators are only expected to perform an undo push when finished.
2025-02-28 11:45:11 +11:00
Sean Kim
3a01eb6dfa Cleanup: Reduce usage of BMLogEntry
`undo::get_bmesh_log_entry()` was only used for determining behavior
based on presence of the value, exposing the type is unnecessary. This
commit changes usages of the function to `undo::has_bmesh_log_entry()`
and removes forward declarations.

Pull Request: https://projects.blender.org/blender/blender/pulls/135274
2025-02-27 23:57:50 +01:00
Ray Molenkamp
1f362c570b Cleanup: Formatting 2025-02-27 12:38:41 -07:00
Harley Acheson
3fbb640418 Fix #134621: Only Update Face Orientation Alpha if Using Old Colors
With 4c67c78452 we changed the default theme color for front faces,
used by the Face Orientation overlay, to have zero alpha so that it
could be used in more cases. But versioning updated this for all old
files, which can overwrite users who made deliberate changes to it.
This PR alters the versioning code to only change the color if it
currently exactly matches the old default.

Pull Request: https://projects.blender.org/blender/blender/pulls/135262
2025-02-27 11:29:07 -08:00
Ray Molenkamp
b6dfad1008 MSVC: Fix build error with MSVC 2019
after 582cdc0cf2 msvc2019 has for unknown reasons issues
deciding the right template to use, help it a bit and nudge
it in the right direction.
2025-02-27 12:26:54 -07:00
Harley Acheson
f9df73b875 Fix #134621: Only Update Face Orientation Alpha if Using Old Colors
With 4c67c78452 we changed the default theme color for front faces,
used by the Face Orientation overlay, to have zero alpha so that it
could be used in more cases. But versioning updated this for all old
files, which can overwrite users who made deliberate changes to it.
This PR alters the versioning code to only change the color if it
currently exactly matches the old default.

Pull Request: https://projects.blender.org/blender/blender/pulls/135262
2025-02-27 20:25:47 +01:00
Julian Eisel
3044009271 Assets: Avoid allocating empty preview when unsupported on Mark as Asset
The preview creation for Mark as Asset didn't check if the data-block
supports automatic previews before requesting it, so the preview storage
would be created but no rendering performed. Not a big issue, but for
example the "Remove Preview" operator would be available even though to
the user it looks like the asset doesn't have a preview. This can be
avoided easily.
2025-02-27 19:34:02 +01:00
Miguel Pozo
f930d71a1e GPU: Threadsafe shader creation and acquisition
Move the `StaticShader` class from Workbench to `GPU_shader` and make
compilation thread-safe (Shader usage is still not thread-safe).
Use `StaticShader`s for all shader caches.

Subdivision shaders are still not ported.

(Part of #134690)

Pull Request: https://projects.blender.org/blender/blender/pulls/134812
2025-02-27 19:20:33 +01:00
Hans Goudey
582cdc0cf2 Cleanup: Use Array for FieldInferencingInterface
There is no need for amortized growth for the field interface.
Array seems slightly better than Vector because it's smaller and
doesn't give the impression that the size might change.

Pull Request: https://projects.blender.org/blender/blender/pulls/135257
2025-02-27 17:32:51 +01:00
Jacques Lucke
b05fb3801e Merge branch 'blender-v4.4-release' 2025-02-27 17:16:47 +01:00
Jacques Lucke
66ba309f6e Fix #135031: data-race in Remove Attribute node 2025-02-27 17:16:17 +01:00
Jeroen Bakker
11325aaff0 Cleanup: Fix typo in subdiv_eval.cc
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/135254
2025-02-27 16:47:06 +01:00
Hans Goudey
0c04952a76 Cleanup: Specify backing type for node enums
Otherwise it defaults to int. This change can make a few structs
slightly smaller. Also use a signed integer type for the compositor
enum; that's the convention for non-flag enums.
2025-02-27 10:14:29 -05:00
Hans Goudey
a701e01e5d Cleanup: Use auto after static_cast to avoid repetition 2025-02-27 09:58:03 -05:00
Hans Goudey
4b0cb31d3f Cleanup: Remove "e" prefix for field status enum name 2025-02-27 09:58:03 -05:00
Hans Goudey
aa6eb93015 Cleanup: Typo in comment, argument name consistency 2025-02-27 09:58:03 -05:00
Aras Pranckevicius
02869cc6c8 Color management: Dithering consistency/perf improvements
Float->byte rendered image dithering uses triangle noise algorithm. Keep
the algorithm the same, just make some improvements and fix some issues:

1) The hash function for noise was using "trig" hash from "On generating
random numbers" (Rey 1998), but that is not a great quality hash, plus it
can produce very different results between CPUs/GPUs. Replace it with
"iqint3" (recommended by "Hash Functions for GPU Rendering", JCGT 2020),
which is same performance on GPU, faster on CPU, and much better quality.
This is the same hash as Cycles already uses elsewhere. Also it is purely
integer based, so exactly the same results on all platforms.

2) For the above point, replace `dither_random_value` to take integer
pixel coordinates and adjust calling code accordingly. Some previous
callers were (accidentally?) passing integer coordinates already. Other
places actually get a tiny bit simpler, since they now no longer need an
extra multiplication.

3) The CPU dithering path was wrongly introducing bias, i.e. making the
image lighter. The CPU path also needs dither noise to be in [-1..+1]
range (not [-0.5..+1.5]!) just like GPU path does, since the later
float->byte conversion already does rounding.

4) The CPU dithering path was using thread-slice-local Y coordinate,
meaning the dithering pattern was repeating vertically. The more CPU cores
you use, the worse the repetition.

5) Change the way that uniform noise is converted to triangle noise.
Previous implementation was based on one shadertoy from 2015, change it
to another shadertoy from 2020. The new one fixes issues with the old way,
and it just works on the CPU too, so now both CPU and GPU code paths are
exactly the same.

6) Cleanup: remove DitherContext, just a single float is enough

Performance and image comparisons in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/135224
2025-02-27 15:52:45 +01:00
Hans Goudey
3ee75006c3 Cleanup: Use utility function to clear ListBase 2025-02-27 09:43:14 -05:00
Jeroen Bakker
22aad0fde7 SubDiv: Use shader create info for patch evaluation shader
This PR migrates the subdiv_patch_evaluation_comp.glsl to use
shader create info.

The part of OSD that is used is included as a typedef source (osd_patch_basis.glsl).

Pull Request: https://projects.blender.org/blender/blender/pulls/134917
2025-02-27 15:42:08 +01:00
Clément Foucault
583e2b7240 DRW: Move GPU context lock out of the DST variable.
This doesnt remove the locking but isolate the `GPUContext`
lock to oustide the `DrawManager` class.

This has no functional change.

Pull Request: https://projects.blender.org/blender/blender/pulls/135189
2025-02-27 15:39:05 +01:00
Sebastian Parborg
1fc2daf3e2 Merge branch 'blender-v4.4-release' 2025-02-27 15:16:37 +01:00
Omar Emara
fdeda50b5c Cleanup: Nodes: Use common prefix instead of sh_fn
Nodes that are shared between Geometry and Shader nodes use the prefix
sh_fn for their base type and poll functions. The compositor will also
share those nodes very soon, so we generalize the name to use the prefix
"common".
2025-02-27 14:51:24 +02:00
Omar Emara
2833c0f283 Fix: Compositor asserts for unsupported unavailable sockets
The compositor asserts if an unsupported unavailable socket exists. This
assert should not exist, because the GPU material compiler will itself
gracefully handle such sockets when their type is GPU_NONE, which is
already the case. So remove the assert and add a note about the
behavior.
2025-02-27 14:34:23 +02:00
Pratik Borhade
9d12ac29ea Fix: Grease Pencil: Add channel_color RNA prop to layer groups
Property wasn't added to earlier because it was part of tree-node.
But it was moved to tree-node just in main, see: 3ef2ee7c53
Failing right now in 4.4.

Pull Request: https://projects.blender.org/blender/blender/pulls/135225
2025-02-27 13:32:35 +01:00
Jacques Lucke
3af79b1d3b Merge branch 'blender-v4.4-release' 2025-02-27 12:48:57 +01:00
Jacques Lucke
09fd1d48e2 Fix #135164: crash when deleting nodes from node tree after appending
The issue was that changing session ids for a data-block were not handled gracefully enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/135230
2025-02-27 12:47:01 +01:00
Jacques Lucke
9df6e9214e Fix #135152: crash because of missing gizmo update after closed editor
The visibility of Geometry Nodes gizmos sometimes depends on the
selected nodes in a node editor. Therefore, when the editor is closed,
the set of available gizmos has to be refreshed.
2025-02-27 12:44:57 +01:00
Lukas Tönne
dfc7140655 Merge branch 'blender-v4.4-release' 2025-02-27 12:32:37 +01:00
Lukas Tönne
b34c116398 Fix: Geometry Nodes menu socket can leak memory
The enum items propagation mechanism for Menu sockets makes a local copy of item
pointers to propagate between node group inputs and interface definitions.
In case these items are not used (e.g. because they are already shared with the
socket) the local copy must still be released to avoid leaking the memory.

This only happens with more than 4 enum items, because of the internal default
buffer for `Vector`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135226
2025-02-27 12:31:31 +01:00
Jacques Lucke
b632b5c974 Nodes: UI: always draw panels as collapsible in tree view
This changes the drawing in the tree interface panel so that panels always show
the icon to collapse it, even if it is empty. This makes it more obvious when an
item is a panel and not just a socket.

Right now, this is not strictly necessary, because sockets can also be
identified by their socket icon. However, that changes with #133936 where a
panel can also have a (boolean) socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/135207
2025-02-27 12:12:05 +01:00
Anthony Roberts
a08da0c897 Merge branch 'blender-v4.4-release' 2025-02-27 10:03:17 +00:00
Pratik Borhade
255dec2c51 Fix #135136: UI: Shader node template panels can't collapsed on drag
Multiple panels of material in properties tab were not
collapsed/expanded when click-dragged over them. This is because wrong
button type for interface-panel. To support multi-drag, button has to be
of type toggle, see: `ui_do_but_ANY_drag_toggle()->
ui_drag_toggle_but_is_supported`

Pull Request: https://projects.blender.org/blender/blender/pulls/135154
2025-02-27 11:02:35 +01:00
Omar Emara
20897f5f20 Cleanup: Warning about integers of different signs
The SAT shaders in the compositor contain comparisons of different
signed integers, use uint to fix this.
2025-02-27 11:19:24 +02:00
Jeroen Bakker
fcc5681624 SubDiv: Use shader create info for custom data
This PR migrates the custom_data_interp_comp.glsl to use
shader create info.

During development tests have been conducted to use specialization constants,
but due to limitations inside Metal we didn't use them.

Number of ShaderCreateInfos have been reduced by using macros. Variadic macros
have not been used as they don't support CPP compilation.

Pull Request: https://projects.blender.org/blender/blender/pulls/134932
2025-02-27 09:50:36 +01:00
Jeroen Bakker
e2793ab3da Fix: SubDiv: CPP Shader compilation
Some shaders were missing and didn't
compile using CPP compilation

Pull Request: https://projects.blender.org/blender/blender/pulls/135090
2025-02-27 08:54:34 +01:00
Jeroen Bakker
667c8a914f Revert "Cleanup: GPU: Reduce compilation warnings"
This reverts commit 3ca5f6f62e.

There were some performance regressions detected.

Fixes: #135215, #134941
2025-02-27 08:23:26 +01:00
Campbell Barton
0fa74fc4af Merge branch 'blender-v4.4-release' 2025-02-27 15:54:48 +11:00
Jason C. Wenger
80a38bb1e4 Fix #120770: poor un-subdivide performance with disconnected geometry
- Refactor tagging logic into a function to remove duplicate code

  The two phases of tagging were identical logic just with the variables
  and tag values swapped. This change ensures the two loops use matching
  behavior.

- Adjust iteration to prevent restarting from the beginning of the mesh
  after each island.

- Simplify and speed iteration tests.

  testing to ensure v->e is non-null is redundant - verts with no edges
  would never have passed `bm_vert_dissolve_fan_test` in the first
  place, so can't be tagged as `VERT_INDEX_INIT`.
  Re-testing `bm_vert_dissolve_fan_test(v)` is redundant - it was
  checked above, and during tagging, the topology does not change.
  Topology only changes later, after tagging is complete.
  Therefore it's guaranteed to return the same result as the first time.

- Simplify loop logic, rename vars for clarity

  offset and nth were constants, and depth was what causes alternation.
  However none of that math is necessary - it can simply be done with
  call order.

  'seek_a' and 'seek_b' were renamed to what they actually are - lists
  of verts that are tagged for collapse and ignore, respectively.

  Further, by checking if any verts were tagged during the first
  iteration pass, the second iteration pass can be avoided entirely if
  it will perform no work.

Ref: !135212
2025-02-27 15:53:12 +11:00
Campbell Barton
51113085de Cleanup: remove disabled BMWalker logic for un-subdivide
This isn't going to be enabled and made the in-lined tagging more
difficult to follow.
2025-02-27 15:53:12 +11:00
Harley Acheson
b8a81c90d1 Merge branch 'blender-v4.4-release' 2025-02-26 20:18:18 -08:00
Harley Acheson
89e78e7065 Fix: MacOS Status Status Bar Swap Areas Spacing
For MacOS, when hovering your mouse over the area corner "action zones"
the Status Bar shows a "Swap Areas" item that has unnecessary spacing
between the Control modifier key icon and left mouse button icon. This
is because I forget different icons were shown for Mac. This PR just
uses the proper calculated spacing that knows better.

Pull Request: https://projects.blender.org/blender/blender/pulls/135208
2025-02-27 05:13:09 +01:00
Sean Kim
3fca920e72 Merge branch 'blender-v4.4-release' 2025-02-26 17:17:15 -08:00
Sean Kim
a106480b92 Fix #135130: Mask from Cavity does not work via operator
Introduced with 6b0fa709fa.

Pull Request: https://projects.blender.org/blender/blender/pulls/135139
2025-02-27 02:16:29 +01:00
Sean Kim
79df0351d4 Spreadsheet: Expose .sculpt and .hide attributes behind debug option
This commit adds five commonly used internal Sculpt Mode attributes
to the Spreadsheet editor when `--debug-value 4001` is passed in to
assist with development and debugging of issues.

The whitelisted attributes are:
* `.sculpt_mask`
* `.sculpt_face_set`
* `.hide_vert`
* `.hide_poly`
* `.hide_edge`

And are displayed after the other existing debug columns.

Pull Request: https://projects.blender.org/blender/blender/pulls/135201
2025-02-27 02:15:36 +01:00
Jesse Yurkovich
d6cdaff0c0 Cleanup: USD: remove now unneeded PXR_VERSION guards
These were primarily put in place during the library update period of
4.2 to ease the in-between time when not all platforms had updated
libraries. Also, now that we've begun depending on later version of USD
and MaterialX, there's little reason to pretend that using versions
prior to 24.03 is still supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/135202
2025-02-27 00:15:41 +01:00
John Kiril Swenson
debf747265 Fix linting error on buildbot 2025-02-26 15:34:20 -06:00
John Kiril Swenson
b79344e3a0 UI: Ensure invisible scrollbar tracks are opaque and shrink scrollbars with handles
This patch registers scrollbars with handles so that they shrink just
like their non-handle counterparts.

To avoid user errors related to clicking into the handle track instead
of the underlying view, if the final alpha of the track is invisible (0)
then it will range up to 0.25 instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/135023
2025-02-26 21:57:36 +01:00
Harley Acheson
4a56715e60 Merge branch 'blender-v4.4-release' 2025-02-26 12:26:33 -08:00