Commit Graph

150077 Commits

Author SHA1 Message Date
Hans Goudey
525293a95d Fix: MEM_new/MEM_freeN mismatch in file browser code
Caused by cd84d3f3da
2024-07-03 15:13:48 -04:00
Hans Goudey
cbb60190b4 Cleanup: Sculpt: Use const for gesture data, rename variables 2024-07-03 14:52:15 -04:00
Hans Goudey
a7c7e58a4c Sculpt: Data oriented factors calculation for paint brushes
Part of #118145.

Store intermediate data (factors and distances) in thread local storage
for the paint and smear color brushes. The rest of the brushes aren't
refactored to the new "standard", but most of the code we want to
remove in the short term isn't used anymore.
2024-07-03 14:52:15 -04:00
Hans Goudey
0b44d3d163 Cleanup: Sculpt: Use const SculptSession arguments 2024-07-03 14:52:15 -04:00
Hans Goudey
f8fc28bea9 Refactor: Sculpt: Add API function for accessing original color data 2024-07-03 14:52:15 -04:00
Hans Goudey
6fce121596 Cleanup: Sculpt: Simplify vertex position access in color smear brush 2024-07-03 14:52:15 -04:00
Sean Kim
b2ec10184c Sculpt: Initial data oriented refactor for draw face sets brush
Part of #118145.

Performance after this change results in an 156% speedup. This is
measured on the function `stroke_update_step` on a mesh with 24k verts
across 20k instances of the function being timed. In absolute values,
this represents a 0.09ms speedup, from 0.16ms to 0.25ms.

For BMesh, the brush now takes mask values into consideration by
averaging all of the vert mask values for a face.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/123811
2024-07-03 20:46:36 +02:00
Harley Acheson
38681f3a63 UI: Large Blender Logo Alignment Fixes
Slight changes to the sizing and placement of the Blender logo within
its icon bounds. Perfect alignment to grid for top of the horizontal
bar, bottom, and right edges. Could allow use down to about 32x32.

Pull Request: https://projects.blender.org/blender/blender/pulls/124120
2024-07-03 20:13:30 +02:00
Harley Acheson
c468319497 UI: Use Large Blender Logo for Blend File in File Browser
For times when we show the blender logo inside a larger document image,
use the version meant for larger sizes. The complexity is almost
identical, but we use it larger here so use the nicer one.

Pull Request: https://projects.blender.org/blender/blender/pulls/124117
2024-07-03 19:16:40 +02:00
Harley Acheson
c6411e61ae Fix: Handle Missing Font in ID List Previews
Handle missing font in the hover tooltip preview in the Data-block ID
selector. Add error handing both in IMB_font_preview itself and in the
current caller (to show message).

Pull Request: https://projects.blender.org/blender/blender/pulls/124111
2024-07-03 18:24:28 +02:00
Hans Goudey
5b50bb19e7 Cleanup: Sculpt: Use C++ math types for color paint brushes 2024-07-03 12:13:52 -04:00
Hans Goudey
ad0e327dd0 Sculpt: Data oriented refactor for color smooth brush
Part of #118145.
2024-07-03 12:13:52 -04:00
Hans Goudey
ea202f83bf Cleanup: Use const SculptSession arguments 2024-07-03 12:13:52 -04:00
Harley Acheson
1992296828 Fix #124068: Update Text Style Weights With Change of UI Font
Only when the user changes the UI font to one that does not have a
variable weight axis, update the text style weights to match the font's
design weight. So if changing to an old-school font that has a fixed
weight, for example bold, also update UI Text Style weights to match
so everything looks as designed and expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/124074
2024-07-03 18:02:20 +02:00
Bastien Montagne
06be295946 Add detection of mismatches usages of MEM_new/MEM_freeN.
This commit will error (and abort if enabled) when trying to call
`MEM_freeN` (and related `MEM_dupallocN`, `MEM_reallocN` and
`MEM_recallocN` functions) with a pointer created the C++ way (i.e.
through `MEM_new`, or the guardedalloc-overloaded `new` operator).

To do so, it adds internal use only implementations for `malloc_alligned`
and `free`, which take an extra parameter indicating whether they are
dealing with data created/deleted the 'C++ way' (using `new`/`delete`
and similar).

The cpp-created data are flagged with the new
`MEMHEAD_FLAG_FROM_CPP_NEW`, either in the lower two-bytes len value for
lockfree allocator, or as a new flag member of the guarded allocator
header data.

The public `MEM_new`/`MEM_delete` template functions, and the
guardedalloc-overloaded versions of `new`/`delete` operators are updated
accordingly.

These changes have been successfully tested both with and without
`WITH_CXX_GUARDEDALLOC`.

NOTE: A lot of mismatches have already been fixed in `main` before merging
this change. There are likely some less easy to trigger ones still in our
codebase though.

Pull Request: https://projects.blender.org/blender/blender/pulls/123740
2024-07-03 17:23:03 +02:00
Bastien Montagne
a1e2cc2b6e Cleanup: Unused variables in non-assert release builds. 2024-07-03 16:33:03 +02:00
Clément Foucault
71159872a4 Fix: EEVEE: VDB renders as bounding box when using Volume Scatter
Use the same approach as Cycles and only render the volume
objects if the shader is using any attribute.

Fix #124061
2024-07-03 16:27:08 +02:00
Bastien Montagne
4afb48acad Cleanup: Move internal guardedalloc headers to C++.
Pull Request: https://projects.blender.org/blender/blender/pulls/124106
2024-07-03 16:04:18 +02:00
Lukas Stockner
e2d77fbc1c Cleanup: Remove outdated asserts
61fb25cb94 removed the factors argument.
2024-07-03 16:01:38 +02:00
Sergey Sharybin
35788ca3c9 Merge branch 'blender-v4.2-release' 2024-07-03 16:01:21 +02:00
Alaska
659e19607d Cycles: Cleanup calls to _cycles.available_devices
Refactor the call to `_cycles.available_devices` into it's own function
and update `self.device` at the same time to avoid mis-matches between
`_cycles.available_devices` and `self.device`.

Pull Request: https://projects.blender.org/blender/blender/pulls/124079
2024-07-03 16:00:42 +02:00
Alaska
090fed06a9 Cycles: Fix automatic OptiX denoiser section criteria
Only select OptiX as the automatic denoiser if an OptiX
device is selected in preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/124032
2024-07-03 16:00:02 +02:00
Hans Goudey
78e9621bcd Sculpt: Refactor sampling for multi-plane scrape brush
Part of #118145.
2024-07-03 09:59:25 -04:00
Hans Goudey
734e9fa4b8 Fix: MEM_new/MEM_freeN mismatch in edit mesh undo
For non-trivial custom data types, the undo system did a shallow copy of the
base array which implicitly transferred ownership of the data to the undo
system. Combined with implicit sharing, this was hacky at best, and quite
wrong at worst, since it freed the implicit sharing info incorrectly.

To fix this, free the mesh custom data with the standard function for that
and add the non-trivial layers to the undo state using implicit sharing to
avoid another copy.

Alternative to #123894 and #123884.

Pull Request: https://projects.blender.org/blender/blender/pulls/123991
2024-07-03 15:32:05 +02:00
Hans Goudey
7f4de339f8 Cleanup: Correct misleading variable name in previous commit 2024-07-03 09:21:22 -04:00
Hans Goudey
61fb25cb94 Sculpt: Separate distance filtering from calculation
Remove the filtering of factors from the brush distance calculation
function to simplify its responsibilities and to allow passing a custom
radius from the outside. Factor filtering is now done in a separate
function. Also rename the distance calculation functions.
2024-07-03 09:18:39 -04:00
Bastien Montagne
a882d289fe Cleanup: Unused vars in non-assert release builds. 2024-07-03 15:14:18 +02:00
Clément Foucault
e10dcc01bd Fix: EEVEE: Avoid loosing SSS small radius energy
This was caused by the effective radius of some
components were below the first sample radius.
This meant that the accumulation resulted in zero
weight for these components.

This patch introduce a minimum radius that can
be represented depending on the sample closest
to the center pixel. This makes sure that we
have at least one sample that will have
non-zero weight.

Fix #124031
2024-07-03 15:09:19 +02:00
Aras Pranckevicius
28d00f16d9 Merge branch 'blender-v4.2-release' 2024-07-03 16:01:55 +03:00
Aras Pranckevicius
44510662e9 Fix #123541: VSE thumbnails in some cases are drawn outside of the strip
Code was using seq->start + seq->len to figure out where the "right
side of content" is, seemingly since forever (i.e. since 997b5fe4
added strip thumbnails). But that is incorrect starting with 3.3,
where seq->len is "number of frames / samples in source media",
but that does not necessarily match number of frames in the timeline.
For movies this happens when media framerate does not match
sequencer framerate.

Use SEQ_time_content_end_frame_get instead to calculate where the
content ends.

Pull Request: https://projects.blender.org/blender/blender/pulls/124081
2024-07-03 14:59:07 +02:00
Sergey Sharybin
bd75344b2b Merge branch 'blender-v4.2-release' 2024-07-03 14:47:23 +02:00
Sergey Sharybin
9460dfd4f3 Fix #124086: blake2 hasher is unavailable on macOS
The issue is caused by an external dependency to
/opt/homebrew/opt/libb2/lib/libb2.1.dylib

This change adds a test to catch the same issue in the future,
and moves the arm64 libraries to a newer hash with fixed Python.

Pull Request: https://projects.blender.org/blender/blender/pulls/124096
2024-07-03 14:46:33 +02:00
Clément Foucault
4d2fcc5716 Fix: EEVEE: Avoid assert from empty volume object material
Also avoid drawing them at all if the material has no
volume shader.
2024-07-03 14:40:54 +02:00
Pratik Borhade
439c318098 Fix #98440: Confirm On Release in Radial Control doesn't work with RMB
Cancelling operator with RMB is hardcoded but some wants RMB to invoke
the operation as well. In such case, don't use RMB to cancel operator
and reset the radius, i.e. when both `rc->init_event` and `event->type` is RMB

Pull Request: https://projects.blender.org/blender/blender/pulls/123053
2024-07-03 14:24:02 +02:00
Alaska
1e6161759e Fix #124073: Incorrect material shadow mode versioning
Only apply EEVEE-Next material shadow versioning to materials with
surfaces. Otherwise this will break the rendering of some materials
(E.g. Volumetrics) by making the surface opaque to the camera.

Pull Request: https://projects.blender.org/blender/blender/pulls/124076
2024-07-03 14:23:40 +02:00
Nikita Sirgienko
74c09b2e63 Cycles: oneAPI: Fix undefined behavior when embree fails initializing
Embree device pointer can end up being nullptr even when Embree on GPU is
expected to be used.  Previous implementation overlooked this possibility,
leading to a completely silent fallback to the non-Hardware ray-tracing path,
this commit fixes it.  We've noticed this as now Embree relies on a driver
component: https://github.com/intel/level-zero-raytracing-support that can
potentially be missing from a system.

Pull Request: https://projects.blender.org/blender/blender/pulls/124085
2024-07-03 14:13:01 +02:00
Xavier Hallade
4477641467 Cycles: oneAPI: Fix driver version check for future Intel GPU drivers
SYCL runtime currently relies on an internal driver behavior that will
break the driver version string returned by SYCL if it changes:
https://github.com/oneapi-src/unified-runtime/issues/1777
This will be fixed at SYCL runtime level but until we use a new enough
one, we need to add additional verifications to avoid blocking execution
on a driver that will change this internal behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/124084
2024-07-03 14:12:16 +02:00
Xavier Hallade
275b6ee008 Merge branch 'blender-v4.2-release' 2024-07-03 14:03:37 +02:00
Philipp Oeser
cbbeeccd08 Fix #124027: EEVEE light influence UI disappears when light is pinned
As desribed in #90039, we dont have a context object when pinning data,
this was accessed though leading to python errors.

The object was only used for the active state of certain layouts, do to
resolve the errors (and disappearing UI), check if we actually get an
object from context. That means the correct active state of certain
layouts is lost (it could either be always ON or always OFF, PR is using
the former -- since the default visibility is ON, so that would be more
common).

Pull Request: https://projects.blender.org/blender/blender/pulls/124091
2024-07-03 13:43:39 +02:00
Pratik Borhade
e2c038218a Fix #124045: Console error when using node gesture operation
Caused by 9d4d1aea98. Not every operator
that uses lasso gesture has `smooth_stroke/radius` properties defined,
they are sculpt tool specific. When using `node link cut` tool, console
is flooded with the "property not found error".

Pull Request: https://projects.blender.org/blender/blender/pulls/124040
2024-07-03 13:21:46 +02:00
Omar Emara
eba1a49fa7 Merge branch 'blender-v4.2-release' 2024-07-03 13:31:36 +03:00
Omar Emara
81e4fa29b8 Compositor: Allow Glare node size below 6
This patch allows the size of the Glare node to be below 6. This is not
really a fix, but it is targeting the release branch because of concerns
about this limitation which din't exist for old EEVEE bloom.

Pull Request: https://projects.blender.org/blender/blender/pulls/124092
2024-07-03 12:30:42 +02:00
Omar Emara
46270f03d8 Merge branch 'blender-v4.2-release' 2024-07-03 12:29:48 +03:00
Omar Emara
30643fcf9b Fix: Bloom glare crashes when image is too small
The Bloom mode of the Glare node crashes if the input image is too
small. This is because bloom is computed using a down-sampling followed
by an up-sampling chain, and if the user supplied size is not maximum,
the computed chain length might be zero or negative, which is not
handled gracefully. To fix this, we just sanitize the chain length.

Pull Request: https://projects.blender.org/blender/blender/pulls/124089
2024-07-03 11:27:26 +02:00
Bastien Montagne
ff4fcb5169 Cleanup: Unused variables in release, non-assert builds. 2024-07-03 10:55:06 +02:00
Campbell Barton
b615091256 Merge branch 'blender-v4.2-release' 2024-07-03 16:57:15 +10:00
Campbell Barton
463c05b341 Extensions: fix missing redraw after setting tags, report adding a repo
- Report when a repository is added since it's not so clear from the
  popup that a new repository has been added.
- Fix for missing redraw after selecting all/none tags.
- Also access the tags property once instead of getting it for each
  button.
2024-07-03 16:56:01 +10:00
Campbell Barton
9da4f557f1 Merge branch 'blender-v4.2-release' 2024-07-03 16:05:49 +10:00
Campbell Barton
e2b24904c9 Extensions: add buttons to select tags
This is for convenience since manually selecting all/none is tedious.
2024-07-03 15:55:20 +10:00
Jesse Yurkovich
ca9db38014 Hydra: Update Storm reference images for both Hydra and USD variations 2024-07-02 17:45:00 -07:00