Commit Graph

113180 Commits

Author SHA1 Message Date
Falk David
bdb4233279 GPv3: Rename property name of noise modifier
The `factor` property that controls the noise on the positions
was named `Offset Factor` in RNA but this name is overriden
in the modifier to `Position`.

When this property is e.g. keyed the RNA UI name is used
which can be very confusing.

This renames the RNA UI name to "Position Factor" to avoid
this confusion.
2024-09-19 14:14:50 +02:00
Clément Foucault
c92514f1e7 Fix #124567: No Normals pass when combining two shader to RGB
The unlit packing could write to the (non-existing) 4th
closure bin inside the gbuffer header leading to no
combined pass shader being invoked for these specific
(complex) materials.

Making sure the unlit workaround writes to bin 0 fixes the
issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/127811
2024-09-19 14:11:20 +02:00
Clément Foucault
02cf5f5f0f Fix #127774: Flat Object matrix leads to incorrect culling
Object with degenerate transform matrix can lead to flat
bounds on GPU. This in turn lead to NaN intersection planes
inside `IsectBox`.

Compute (pseudo) size of matrix and bypass culling is any
axis is too small.

The other part of the patch makes sure that there is a
distinction between disabled culling and invalid
bounding boxes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127807
2024-09-19 14:09:57 +02:00
Sean Kim
4291ab855c GPv3: Add Reproject operator
This commit adds the `Reproject Strokes` operator in the
`Grease Pencil` > `Cleanup` menu in edit mode.

All similar operator settings have been ported over from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/127735
2024-09-19 14:06:10 +02:00
Sybren A. Stüvel
38e15412dd Fix #127755: 4.3 regression: Some rigged meshes do not load properly
Revert part of 9530852347 as that did not
take into account that the `max` property may actually be smaller than
the `min` property.

I've also taken the liberty to document this fact in some comments.

The fix for the crash when `min == max` is still in place.
2024-09-19 13:57:30 +02:00
Nathan Vegdahl
91fd95bad4 Cleanup: make strip_keyframe_data_append() doc comment accurate 2024-09-19 13:56:19 +02:00
Jeroen Bakker
214a47f15c Vulkan: Make Unused Attachments Optional
Windows/Intel and Apple drivers do not support dynamic
rendering unused attachments. Due to mistakes we made
this extension partly optional. Eg. the extension was
optional, but its settings were not.

This PR makes the extension fully optional. However
without the extension some drivers might make incorrect
assumptions. This should be solved when it is more clear
why some drivers are still crashing when using dynamic
rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/127839
2024-09-19 13:03:50 +02:00
Pratik Borhade
ba6126dbbd Fix #127604: Skip unlink operator for linked materials
Materials of a linked object can be unlinked from outliner id operation
which should not be possible. Add an extra check to avoid this.

Pull Request: https://projects.blender.org/blender/blender/pulls/127686
2024-09-19 12:54:23 +02:00
Pratik Borhade
912c6d9a3c Fix #127620: Disable smooth operator for linked objects
Shade flat/smooth operators are callable when linked but greyed out if
objects are overridden. Disable these operators in UI for linked objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/127681
2024-09-19 12:53:22 +02:00
Jonas Holzman
b427253a4d Obj-C Refactor: General Code Style cleanups
As part of a more general Objective-C GHOST refactor and in an effort to
modernize the macOS backend for further works, this commit cleans up the
codestyle of Objective-C files. Based off the Blender C/C++ style guide,
in addition to some Objective-C specific style changes.

Changes:
- `const` correctness, use nullptr, initializer list for simple struct
- Reduced variable scope for simple functions, removed unused variables
- Use braces for conditional statements, no else after return
- Annotate inheritted function of GHOST Cocoa classes with override and
  use `= default` to define trivial constructors
- Use #import instead of #include for Objective-C headers
    This is only for correctness. As the Objective-C #import directive
    is really just an #include with an implicit #pragma once.
- Use proper C-style comments instead of #pragma mark
    #pragma mark is an XCode feature to mark code chapters, to follow
    the Blender codestyle, and make the Objective-C code more editor
    agnostic, these were replaced with multi-line C-style comments.

Ref #126772

Pull Request: https://projects.blender.org/blender/blender/pulls/126770
2024-09-19 11:37:52 +02:00
YimingWu
11bf2b9a62 Fix #127539: Prevent multi-object editing in GPv3
Multi-object editing is not supported in GPv3 right now,
do not allow multiple GPv3 objects to go into edit mode
at the same time.

Pull Request: https://projects.blender.org/blender/blender/pulls/127796
2024-09-19 11:22:15 +02:00
Lukas Tönne
3a1ab067f2 Fix #127342: Support Curve domain when selecting by vertex group
This requires writing selection attributes to a different domain than
the Point domain.

Note that for assigning/removing from vgroups the `adapt_domain`
function is used implicitly by always looking up attributes from the
Point domain: ".selection" may be stored on Curves and will
automatically be adapted to points. For select-by-vgroup `adapt_domain`
cannot be used because the selection has to be "greedy" (one point
selects the whole curve).

Pull Request: https://projects.blender.org/blender/blender/pulls/127799
2024-09-19 10:59:55 +02:00
Bastien Montagne
5e4c76accc Fix warnings when building Blender with mold linker on linux.
Remove the three problematic entries:
- `aligned_free` is not a 'real' function and does not need to be
  handled here. There is no symetry with the `aligned_malloc` symbol
  here.
- `__end` and `_bss_start` seem to have been mis-typed from the
  beginning (actual symbols seem to be `_end` and `__bss_start`).
  Regardless, neither `gold` nor `mold` seem to take these directives
  from the LD version script into account (result is the same for them
  when removed for the `.map` file), so removing them.

Pull Request: https://projects.blender.org/blender/blender/pulls/127761
2024-09-19 10:52:45 +02:00
Campbell Barton
3a555b60f7 Fix crash making objects single user
Add BKE_view_layer_synced_ensure to the FOREACH_OBJECT_FLAG_BEGIN
macro. This macro was only used by the single-user operator.
2024-09-19 17:22:07 +10:00
Campbell Barton
9e68066a4d Logging: suppress "Info" prints when calling bpy.ops.* in quiet mode 2024-09-19 14:49:05 +10:00
Campbell Barton
67638a72e3 Logging: suppress BKE_bpath summary reports for non-operator callers
Saving for the first time or using save-as printed a summary, e.g.

`Total files 0 | Changed 0 | Failed 0`

When path operations were added it was only accessed from the UI,
where reporting a summary makes sense. Having the summary reported when
path manipulation is done as part of another action isn't useful.
It's also not clear what the summary relates to.

Now the summary is only shown in operator reports.
2024-09-19 14:49:03 +10:00
Campbell Barton
42e94192e5 Logging: suppress render prints in quiet mode 2024-09-19 14:49:02 +10:00
Campbell Barton
b63aa7f713 Cleanup: use bool return value for image write functions 2024-09-19 13:08:14 +10:00
Sean Kim
6a68a924fd Refactor: Sculpt: Remove PBVHVertRef usage in sculpt_expand.cc
Part of #118145

Also removes other now-unused functions & macros.

Pull Request: https://projects.blender.org/blender/blender/pulls/127821
2024-09-19 04:52:01 +02:00
Sean Kim
fa1a3fbcce Refactor: Sculpt: Remove PBVHVertRef usage for PaintCursorContext
Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127823
2024-09-19 04:49:34 +02:00
Harley Acheson
23d0034a1b Fix: Update Window Positions on File Load
When we create a new window at run time, we request that it be placed
at a specific size and location, but afterward we ask the OS for
details about where it was actually made and then update the window's
size and position with the correct information. Unfortunately when we
open a window when loading a blend file we do most of this, but only
update the size from the OS, not the position. There are times a window
will need to be placed somewhere different than we request and so the
window posx and posy will be incorrect until we move or resize it. This
is more likely to happen on Macs, but is possible on any platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/127819
2024-09-19 01:41:58 +02:00
Jonas Holzman
aa5385f648 Fix: Interactive Docking modal operator re-run glitch
Docking can close windows during its operation. If the current window
does not match before and after an operator has run our event handling
code can assume that a new blend file has been loaded and will rerun
the operator. This PR avoid this problem by just not starting if the
event initiating it is of type WINDEACTIVATE. There might be a later
fix that addresses the underlying issue, but this is simple, small, and
harmless.

Pull Request: https://projects.blender.org/blender/blender/pulls/126379
2024-09-19 00:47:37 +02:00
Jesse Yurkovich
6385296e56 Fix #127651: Properly load generated UDIM image tiles in Cycles
Since their introduction, generated UDIM images/tiles would not be
loaded in Cycles. In relative recent history 72ab6faf5d added the
ability to track which tiles were still marked as being "generated" and
unsaved. However, that check was never implemented into the Cycles code.

With this PR, these two additional scenarios should now work:
- Properly load pixels if all tiles are generated
- Properly load pixels if a UDIM image has been loaded from a file and
  new generated tiles have been added but not saved yet etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/127673
2024-09-19 00:40:30 +02:00
Sean Kim
3ca97f8c5c Fix #127671: Multiplane scrape causes parts of mesh to disappear
Root cause was introduced in 347ec1acd7, the `IndexMask` was not being
iterated over correctly

Pull Request: https://projects.blender.org/blender/blender/pulls/127816
2024-09-18 23:36:58 +02:00
Sean Kim
00aedc065b Fix: Mask from Cavity did not call .finish after applying mask
Pull Request: https://projects.blender.org/blender/blender/pulls/127815
2024-09-18 23:13:07 +02:00
Hans Goudey
e3fc40dfc3 Cleanup: Sculpt: Remove unused PBVHVertRef functions 2024-09-18 16:59:49 -04:00
Hans Goudey
dcb3391e10 Refactor: Sculpt: Specialize expand face set and boundary access
Part of #118145.
2024-09-18 16:54:43 -04:00
Hans Goudey
9562056f50 Cleanup: Sculpt: Remove unused PBVHVertRef functions 2024-09-18 15:24:39 -04:00
Julian Eisel
622affe853 Fix #126521: Redo popup doesn't refresh layout on changes
98c92b9033 disabled refreshing for the redo popup, since that requires
passing an operator pointer to the UI to holding on to it while the popup is
visible. Usually operators are short lived and shouldn't be held by the UI, to
avoid dangling pointer accesses. In this case it's fine though, because the
operator will be kept alive in the window manager.

Partially reverts 98c92b9033, and adds a comment to note this special case.

Fixes: #126521, #127561

Pull Request: https://projects.blender.org/blender/blender/pulls/127795
2024-09-18 20:50:53 +02:00
Julian Eisel
42b390fe3d Fix #127510: Crash when registering panel as instanced
Generally the instanced option shouldn't be necessary, and it's not used as
intended in the report. However, crashes should be avoided.
2024-09-18 19:17:33 +02:00
Hans Goudey
721ece9efb Cleanup: Sculpt: Move automasking functions to proper header 2024-09-18 11:11:13 -04:00
Jacques Lucke
4a45ae7393 Nodes: rename "unavailable" to "available" in node declaration
This simplifies future use of this method by avoiding double negations.
2024-09-18 16:08:05 +02:00
Hans Goudey
711313a054 Fix: Sculpt: Mask gesture crash with multires 2024-09-18 08:59:16 -04:00
Hans Goudey
f52819c044 Cleanup: Sculpt: Simplify grids indexing in two places 2024-09-18 08:47:32 -04:00
Habib Gahbiche
50f2857b1a Fix #127793: Crash on startup on macOS 15
std::sort() requires a strict weak ordering, i.e. `x < x` must be false. Therefore `id_order_compare(ID *a, ID *b)` must return false for `a.name == b.name`
Pull Request: https://projects.blender.org/blender/blender/pulls/127794
2024-09-18 14:46:02 +02:00
Hans Goudey
77d69f4347 Cleanup: Remove unused sculpt PBVHVertRef functions
Part of #118145.
2024-09-18 08:42:02 -04:00
Hans Goudey
7f26485f68 Refactor: Sculpt: Specialize face set access in mask init
Part of #118145.
2024-09-18 08:37:44 -04:00
Hans Goudey
45b5ea7d1e Refactor: Sculpt: Specialize expand cache active vertex position
Part of #118145.
2024-09-18 08:33:29 -04:00
Pratik Borhade
ac66069eff Fix #127582: Crash when clicking onto particle settings button
This is due to memory allocation mismatch. `MEM_dupallocN` is used on
cpp style `ButsTextureUser` pointer. Now fixed by using `MEM_new`. Also
pass `uiButArgNFree/Copy` callback fn arguments to avoid the use of
default arguments which are C style.

Pull Request: https://projects.blender.org/blender/blender/pulls/127690
2024-09-18 13:32:06 +02:00
Aras Pranckevicius
92544d6d76 BLI: add float<->half conversion functions with correct math, use in Vulkan
Blender codebase had two ways to convert half (FP16) to float (FP32):

- BLI_math_bits.h half_to_float. Out of 64k possible half values, it converts
  4096 of them incorrectly. Mostly denormals and NaNs, which is perhaps not too
  relevant. But more importantly, it converts half zero to float 0.000030517578
  which does not sound ideal.
- Functions in Vulkan vk_data_conversion.hh. This one converts 2046 possible
  half values incorrectly.

Function to convert float (FP32) to half (FP16) was in Vulkan
vk_data_conversion.hh, and it got a bunch of possible inputs wrong. I guess it
did not do proper "round to nearest even" that CPU/GPU hardware does.

This PR:

- Adds BLI_math_half.hh with float_to_half and half_to_float functions.
    - Documentation and test coverage.
    - When compiling on ARM NEON, use hardware VCVT instructions.
- Removes the incorrect half_to_float from BLI_math_bits.h and replaces single
  usage of it in View3D color picking to use the new function.
- Changes Vulkan FP32<->FP16 conversion code to use the new functions, to fix
  correctness issues (makes eevee_next_bsdf_vulkan test pass). This makes it
  faster too.

Pull Request: https://projects.blender.org/blender/blender/pulls/127708
2024-09-18 13:15:00 +02:00
dupoxy
5fe32f351a Fix #127731: Sculpt crash on Extract Face Set usage
This is due to function mismatch. Use CPP style `MEM_delete` to fix
the crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/127732
2024-09-18 13:01:01 +02:00
Pratik Borhade
eb44c39824 Fix #127616: Copy to selected adds modifier to linked object
Add extra check to prevent copying modifier on selected linked objects

Pull Request: https://projects.blender.org/blender/blender/pulls/127797
2024-09-18 12:47:52 +02:00
Sebastian Parborg
928ab6dc0f Fix: Compile error when building without WITH_EXPERIMENTAL_FEATURES 2024-09-18 12:47:28 +02:00
Clément Foucault
318eab5584 Fix: #126455: Missing refraction with only emissive material
When the opaque layer was populated with only emissive
material, no raytracing was used for it and no feedback
buffer was needed. Thus, the refraction layer had nothing
to raytrace against.

This fixes it by forcing the use of feedback buffer in this
corner case.

Pull Request: https://projects.blender.org/blender/blender/pulls/127771
2024-09-18 12:29:02 +02:00
Sean Kim
b5d418a83f Refactor: Sculpt: Specialize pose face set IK chain creation
Part of #118145.

Doing so removes the last usages of some dependent code as well, namely
the `SCULPT_VERTEX_NEIGHBORS_ITER` macro and the `PBVHVertRef` version
of the `flood_fill` algorithms. The now dead & unused code, as well as
their related helper functions, structs, and defines have been removed.

Additionally, a helper `vert_face_set_get` method for multires has been
added to be consistent with the other provided APIs

Pull Request: https://projects.blender.org/blender/blender/pulls/127781
2024-09-18 05:33:15 +02:00
Jacques Lucke
9db50bed04 Fix: Geometry Nodes: use better hash for InstanceReference
Before, sometimes instance references that would compare equal could
have different hashes.
2024-09-17 23:01:45 +02:00
Pratik Borhade
2ba69519a8 Fix #127678: Auto-Save Preferences does not work for few anim properties
`U.runtime.is_dirty` is not tagged dirty when some animation preferences
are changed. To fix this, pass `rna_userdef_update` updated function
which will tag preference dirty with the help of `USERDEF_TAG_DIRTY`
macro.

Pull Request: https://projects.blender.org/blender/blender/pulls/127754
2024-09-17 20:31:13 +02:00
Lukas Tönne
6b63fa8f85 GPv3: Interpolate Sequence operator
This is a variation of the modal "Interpolate" operator, where a series
of keyframes is generated according in stead of a single keyframe.
The behavior should be the same as the GPv2 operator.

Much of the code is shared between the "Interpolate" and "Interpolate
Sequence" operators now (utility functions section at the top).

Pull Request: https://projects.blender.org/blender/blender/pulls/127709
2024-09-17 20:20:18 +02:00
Hans Goudey
d15681a459 Sculpt: Extract deformation position data and logic to a class
In an effort to improve code documentation, reduce the number of
commonly needed arguments, and avoid repeating work for each
BVH node, combine position data and shape key data arrays to a
temporary struct used during brush deformation.

I'm generally wary of adding such object-oriented abstractions to
the code, but I think this one will hold up, and I find things easier to
understand after the change. It reduces overhead too, since the
evaluated position attribute and shape key data aren't retrieved
potentially thousands of times.

Pull Request: https://projects.blender.org/blender/blender/pulls/127725
2024-09-17 19:55:25 +02:00
Hans Goudey
b2ce5393ad Cleanup: Sculpt: Remove unused automasking function
See 1e22f364f8
2024-09-17 13:37:00 -04:00