Commit Graph

120055 Commits

Author SHA1 Message Date
Dalai Felinto
51e68fe0ed Cleanup: make format 2024-06-28 11:31:54 +02:00
Nathan Vegdahl
c83727f0bd Anim: add functions for asserting Project Baklava phase-1 invariants
This is implemented as an overloaded function,
`assert_baklava_phase_1_invariants()`, with variants for `Action`, `Layer`, and
`Strip`.

The invariants asserted are those that are specific to phase 1 and which will
later be lifted as more features (such as animation layers, additional strip
types, etc.) are added. The intention is for this to serve as a kind of todo
marker for later phases *and* to help ensure that the phase-1 invariants
currently hold at runtime.

In addition to adding the overloaded function itself, this commit also uses it
in a couple of places in the keyframing code.  Upcoming work on the keyframing
code will be using it more.

This is based on a discussion with @dr.sybren.

Pull Request: https://projects.blender.org/blender/blender/pulls/123830
2024-06-28 11:06:34 +02:00
Damien Picard
92c026c39b I18n: Fix multi-context message extraction regex
The BLT_I18N_MSGID_MULTI_CTXT() macro allows extracting a single
message into up to 16 different contexts. The regex to do that was
slightly wrong because it did not account for the macro potentially
ending with a ",".

The contexts for "New" were also sorted.

Pull Request: https://projects.blender.org/blender/blender/pulls/123793
2024-06-28 10:42:47 +02:00
Nathan Vegdahl
cae1faec12 Refactor: bundle fcurve lookup/creation parameters in a struct
This is a follow up to #123022 to clean up the resultant verbose parameter
passing.  We add a new struct `FCurveDescriptor` that contains the parameters
needed for either looking up or creating an fcurve, and that in turn is passed
down the keyframing call chains where fcurve lookup/creation needs to be done.

Pull Request: https://projects.blender.org/blender/blender/pulls/123486
2024-06-28 09:39:51 +02:00
Sean Kim
549d6fb573 Cleanup: Sculpt: Add assert on span size for helper method
Pull Request: https://projects.blender.org/blender/blender/pulls/123872
2024-06-28 06:25:47 +02:00
Harley Acheson
4ef2381ce3 Cleanup: UI: Remove Unused Icon Texture Drawing Code
About 330 lines of code removed that supported the old
ICON_TYPE_COLOR_TEXTURE icon drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/123868
2024-06-28 05:25:18 +02:00
Campbell Barton
0167dd08fc Merge branch 'blender-v4.2-release' 2024-06-28 12:04:13 +10:00
Campbell Barton
9d10b88f37 Cleanup: remove unnecessary icon scanning on startup
Blender was performing a redundant scan for icons on startup (200 files)
remove this since it adds small but unnecessary overhead.

Part of !123870
2024-06-28 11:53:44 +10:00
Campbell Barton
d77ebc41de Cleanup: remove icon file lists & unused functions
On started Blender was scanning icons for PNG's to display in the theme menu
which hasn't been available since early 2.x days.

Also remove some other unused icon functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/123870
2024-06-28 03:38:25 +02:00
Hans Goudey
1ede471ba2 Cleanup: Remove unnecessary namespaces, pass math types by value
Also remove meaningless const in function declarations.
2024-06-27 17:52:16 -04:00
Sean Kim
868fed96c9 Cleanup: Sculpt: Remove unused sculpt clay brush code
Removal was missed in 0bc7631693.

Pull Request: https://projects.blender.org/blender/blender/pulls/123866
2024-06-27 23:50:58 +02:00
Harley Acheson
4d84940253 UI: File Browser File Type Icons Use Shader Outline
In the File Browser we sometimes show tiny icons at the bottom-left of
items. This PR draws these using the shader's outline mode rather than
overprinting them twice.

Pull Request: https://projects.blender.org/blender/blender/pulls/123865
2024-06-27 23:48:38 +02:00
Lukas Stockner
6967255906 Color management: Support white balance as part of the display transform
This implements a von-Kries-style chromatic adaption using the Bradford matrix.
The adaption is performed in scene linear space in the OCIO GLSL shader, with
the matrix being computed on the host.

The parameters specify the white point of the input, which is to be mapped to
the white point of the scene linear space. The main parameter is temperature,
specified in Kelvin, which defines the blackbody spectrum that is used as the
input white point. Additionally, a tint parameter can be used to shift the
white point away from pure blackbody spectra (e.g. to match a D illuminant).

The defaults are set to match D65 so there is no immediate color shift when
enabling the option. Tint = 10 is needed since the D-series illuminants aren't
perfect blackbody emitters.

As an alternative to manually specifying the values, there's also a color
picker. When a color is selected, temperature and tint are set such that this
color ends up being balanced to white.
This only works if the color is close enough to a blackbody emitter -
specifically, for tint values within +-150. Beyond this, there can be ambiguity
in the representation.
Currently, in this case, the input is just ignored and temperature/tint aren't
changed. Ideally, we'd eventually give UI feedback for this.

Presets are supported, and all the CIE standard illuminants are included.

One part that I'm not quite happy with is that the tint parameter starts to
give weird results at moderate values when the temperature is low.
The reason for this can be seen here:
https://commons.wikimedia.org/wiki/File:Planckian-locus.png
Tint is moving along the isotherm lines (with the plot corresponding to +-150),
but below 4000K some of that range is outside of the gamut. Not much can
be done there, other than possibly clipping those values...

Adding support for this to the compositor should be quite easy and is planned
as a next step.

Pull Request: https://projects.blender.org/blender/blender/pulls/123278
2024-06-27 23:27:58 +02:00
Harley Acheson
9ae237d0b4 UI: Allow Discretionary Use of Icon Outline
Icons can have contrasting outlines, but currently this can only happen
for some icons and when the theme setting "Icon Border" is greater than
zero. This change shows them in the same situations but also allows
them to be shown when needed. For special situations like having an
icon overlay on an icon, or for the icons in the corners of File
Browser preview items, etc.  In a nutshell this allows UI_icon_draw_ex
to honor its outline argument, rather than ignoring it unless the theme
setting was also set.

Pull Request: https://projects.blender.org/blender/blender/pulls/123863
2024-06-27 23:00:53 +02:00
Falk David
8f64329c79 Refactor: Use newer attribute API in create_liquid_geometry
The `create_liquid_geometry` still used the older attributes
API to write the velocities.
This replaces the use of `BKE_attribute_new` with
the newer attribute API.
No functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123854
2024-06-27 20:39:30 +02:00
Sergey Sharybin
d16eac9cee Merge branch 'blender-v4.2-release' 2024-06-27 19:57:51 +02:00
Hans Goudey
e1ca54c52a Fix #123768: Sculpt: Crash on undo with multires 2024-06-27 13:54:01 -04:00
Falk David
a0f0a4dd49 Cleanup: Remove BKE_attribute_allow_procedural_access
This function was already replaced by `bke::allow_procedural_attribute_access`.
Removes the rest of the usages.

Pull Request: https://projects.blender.org/blender/blender/pulls/123852
2024-06-27 19:20:04 +02:00
Miguel Pozo
baf07c22bd Revert "Fix #123794: Crash when UDIMs have gray and color tiles"
This reverts commit 095e78bd28.
2024-06-27 19:15:55 +02:00
Miguel Pozo
095e78bd28 Fix #123794: Crash when UDIMs have gray and color tiles 2024-06-27 19:14:48 +02:00
Michael Kowalski
b2f8f5a491 Fix: USD import: domelight Y-up orientation
Added necessary rotation to convert from Y-up to Z-up when
importing USD dome lights as world materials.

Pull Request: https://projects.blender.org/blender/blender/pulls/123797
2024-06-27 19:06:49 +02:00
Sergey Sharybin
e75dfaf17b Merge branch 'blender-v4.2-release' 2024-06-27 18:40:48 +02:00
Sergey Sharybin
32588169d3 Fix: Initialization of paint mode fails in certain files
It is possible that the file does not have Grease Pencil paint
yet, leading to a crash in the BKE_paint_init().

The simple fix is to swap the order of acquiring the paint
pointer and the code which ensures that this paint exists.
2024-06-27 18:40:04 +02:00
Campbell Barton
a8fae77f10 Cleanup: remove unused icon utilities and make convenience target
Remove utilities to assist in creation of the now removed `*.dat` icons.

Pull Request: https://projects.blender.org/blender/blender/pulls/123837
2024-06-27 18:28:32 +02:00
Hans Goudey
9584f8fb55 Cleanup: Sculpt: Fix misleading naming of grids index buffer functions 2024-06-27 11:28:50 -04:00
Hans Goudey
dc70f454b7 Cleanup: Sculpt: Extract vertex buffer filling into separate functions
This makes future diffs in this area smaller since filling each node's
data won't change, but the surrounding infrastructure is likely to.
2024-06-27 11:28:49 -04:00
Hans Goudey
1453136ad0 Cleanup: Sculpt: Simplify drawing visible face counting 2024-06-27 11:28:49 -04:00
Christoph Lendenfeld
98939c29d4 Merge branch 'blender-v4.2-release' 2024-06-27 17:00:03 +02:00
Christoph Lendenfeld
f3b393a74a Fix #123738: Keyframe drawing issue while duplicating keys
The issue was introduced with f06fd85d97 where the building of the keylist used was
restricted to the visible range of the dope sheet.
The optimization uses `BKE_fcurve_bezt_binarysearch_index` which can only work when
the FCurve is sorted. During transformations in the dope sheet this is not the case as the
sorting only happens when the transformation is applied.
The fix is to do a range check in the for loop instead of a binary search.
Testing the range comes with a performance impact though.

| Before optimization | broken with f06fd85d97 | this PR |
| - | - | - |
| 90ms | 6ms | 20ms |

An alternative solution would be to sort FCurves during transformations of the Dope Sheet.
This is done in the Graph Editor and with the recent speedups introduced there this could be
a viable option. However this is out of scope for this fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/123824
2024-06-27 16:50:44 +02:00
Jeroen Bakker
e72e538fdd Vulkan: Fix sequential read hazard
When a buffer resource was read, and after that read from another
shader stage it would not generate the appropriate pipeline barrier.

This is fixed by keeping the last write action around and check
if the shader stage was already included in the previous barriers.

Pull Request: https://projects.blender.org/blender/blender/pulls/123845
2024-06-27 15:53:14 +02:00
Hans Goudey
15ef372567 Merge branch 'blender-v4.2-release' 2024-06-27 09:31:14 -04:00
Hans Goudey
8945b7e49a Fix #123809: Sculpt visibility invert missing PBVH node update
Caused by 1a37017244
2024-06-27 09:29:45 -04:00
Christoph Lendenfeld
ef8f14f3d6 Fix #90923: Bone Stick active color
The `Stick` drawing mode for armatures was overriding the colors,
meaning it ignored bone colors specified by the user and also didn't use
the correct color for selected vs active.

Pull Request: https://projects.blender.org/blender/blender/pulls/123544
2024-06-27 15:23:43 +02:00
Bastien Montagne
adfe688046 Fix another batch of mismatches MEM_new/MEM_freeN cases in UI/Assets code. 2024-06-27 15:01:37 +02:00
Hans Goudey
643334b727 Sculpt: Resolve over-allocation of multires draw vertex buffers
The "verts per grid" calculation was wrong for the non-flat/indexed
vertex buffer layout used for smooth shading. For example, for a
multires subdivision level of 8, each PBVH node's vertex buffers
were 3 times larger than they needed to be.

Pull Request: https://projects.blender.org/blender/blender/pulls/123808
2024-06-27 14:58:58 +02:00
Hans Goudey
83a15be109 Sculpt: Improve multires drawing performance by simplifying logic
Combined with previous logic, this roughly doubles the performance of
sculpt-mode multires draw vertex buffer extraction in my simple test.
That measurement is for when we initially enter sculpt mode when the
VBO creation is single threaded. Otherwise in my testing the copying
was bound by memory bandwidth and the improvement was smaller.
2024-06-27 14:58:56 +02:00
Hans Goudey
7cf9854938 Sculpt: Avoid vertex buffer access overhead for multires drawing 2024-06-27 14:58:56 +02:00
Hans Goudey
b013eed967 Sculpt: Remove double function call indirection in multires drawing
The nested function pointers were very confusing and bad for performance.
2024-06-27 14:58:56 +02:00
Jeroen Bakker
3009c98d5f Vulkan: Fix read-after-write hazard in draw manager visibility
Draw Manager visibility compute shader triggered a read-after-write
hazard. This root cause was that the incorrect access was read from
the shader interface. It was set to none, skipping the needed pipeline
barrier.

Pull Request: https://projects.blender.org/blender/blender/pulls/123839
2024-06-27 14:55:15 +02:00
Richard Antalik
fb2e712991 VSE: Clarify wording for Replace Selection property 2024-06-27 14:53:57 +02:00
Falk David
84e5de3327 Fix: GPv3: Crash in grease_pencil_object_cache_populate
This was due to wrong indexing into `num_triangles_per_stroke` and
`num_vertices_per_stroke`. We were using the the index of the stroke
in the drawing instead of the index into the `visible_strokes` mask.
2024-06-27 13:54:05 +02:00
Omar Emara
6f06e2258f Image: Clarify color depth tooltip for EXR images
Clarify the tooltip for the half float color depth property for EXR
images to indicate that it doesn't affected data passes and that they
will still be saved as full float.
2024-06-27 14:29:44 +03:00
Jeroen Bakker
e9cba0e588 Fix #123670: EEVEE: Add support for new grease pencil type
EEVEE didn't support the new grease pencil object type. Which would
not output the depth texture when overlays where turned off.

Pull Request: https://projects.blender.org/blender/blender/pulls/123816
2024-06-27 13:24:37 +02:00
Bastien Montagne
6aa6aee2d5 Reapply "Fix (unreported) Assets: MEM_new/MEM_freeN mismatch usages."
This reverts commit cb76781be7, and fixes
the issues from original da05bff96c commit (missing initialization
of a pointer in copy constructor in some cases, and forgot to handle
one allocated string in the move constructor).

Many thanks to @julianeisel for finding the actual issues here.
2024-06-27 12:20:49 +02:00
Bastien Montagne
cb76781be7 Revert "Fix (unreported) Assets: MEM_new/MEM_freeN mismatch usages."
This commit causes crashes when opening a second blendfile (attempt to
free already freed data).

This reverts commit da05bff96c.
2024-06-27 11:05:48 +02:00
Bastien Montagne
da05bff96c Fix (unreported) Assets: MEM_new/MEM_freeN mismatch usages.
This one was a bit more involved than the previous ones, since the
mismatch was intentional here, and happened on a non-trivial type.

It was done because the new object (managed by the `unique_ptr`) steals
the internal data of the original object. Calling `MEM_delete` (and
therefore the destructor of the `AssetMetaData` object) would then lead
to access-after-free and double-freeing errors.

This is addressed by adding two new 'copy' and 'move' constructors to this type.

The copy one ensures that deep-copy of internal data happens as expected, and
allows to simplify greatly the code in `BKE_asset_metadata_copy`, which
becomes a mere wrapper around it.

The move one allows `make_unique` to properly steal (and clear) the internal
data of the source object, which can then safely be deleted.

Pull Request: https://projects.blender.org/blender/blender/pulls/123693
2024-06-27 09:44:22 +02:00
Sean Kim
99c75beabf Cleanup: Silence unused variable warning
Pull Request: https://projects.blender.org/blender/blender/pulls/123806
2024-06-27 04:43:19 +02:00
Sean Kim
11d0a9db1b Fix: Build error from missing change in recent commit
Pull Request: https://projects.blender.org/blender/blender/pulls/123805
2024-06-27 04:36:09 +02:00
Sean Kim
1a392104c3 Cleanup: Sculpt: Add BLI_NOINLINE to mask.cc helper methods
Pull Request: https://projects.blender.org/blender/blender/pulls/123804
2024-06-27 04:18:21 +02:00
Sean Kim
0bc7631693 Sculpt: Initial data-oriented refactor for clay brush
Part of #118145.

Performance after this change results in an 119% speedup. This is
measured on the fucntion `stroke_update_step` on a mesh with 24k verts
across 5k instances of the function being timed. In absolute values,
this represents a 0.06ms speedup, from 0.38ms to 0.32ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/123751
2024-06-27 04:07:10 +02:00