Commit Graph

118394 Commits

Author SHA1 Message Date
Pratik Borhade
de845dbff8 Cleanup: Remove duplicated channel color RNA property
It has been moved to `rna_def_grease_pencil_tree_node` in 3ef2ee7c53

Pull Request: https://projects.blender.org/blender/blender/pulls/136297
2025-03-21 10:22:56 +01:00
Harley Acheson
c13d3e2f7a UI: Color Icons for Red, Green, & Blue
This adds icons for ICON_RGB_RED, ICON_RGB_GREEN, and ICON_RGB_BLUE
that display with those colors. This does not remove the existing
monochrome ICON_COLOR_* icons. This also allows the translation of
the "R", "G", "B" characters shown, for languages that prefer color
words that do not start with these.

Pull Request: https://projects.blender.org/blender/blender/pulls/136154
2025-03-21 01:57:32 +01:00
Campbell Barton
1e6a0e6319 Cleanup: remove references to old names in doc-strings
Also move TODO into the function body as it's not a doc-string.
2025-03-21 00:51:51 +00:00
Campbell Barton
d616c87d03 Cleanup: spelling in comments (make check_spelling_*) 2025-03-21 11:51:50 +11:00
Campbell Barton
0f4056ab65 CMake: add missing headers, sort file lists 2025-03-21 00:19:55 +00:00
Campbell Barton
e1f91c2dba Cleanup: replace int with wmOperatorStatus, consistent naming
- Manually check over all direct calls to operator callbacks
  ensuring the result isn't assigned to an int.
- OPERATOR_RETVAL_CHECK() now fails unless a wmOperatorStatus is used.
- Check the return values of direct calls to callbacks.
- Remove invalid check for the return value of rna_operator_check_cb.
- Use the variable name `retval` as it's most widely used.
- Move the assignment of `retval` out of the `if` statement in
  sculpt/paint operators because it prevents assigning the result
  `const` variable.
2025-03-21 00:13:30 +00:00
John Kiril Swenson
77893a16f6 VSE: Fix typo introduced with recent refactor
Caused by #135560.
2025-03-20 18:45:33 -05:00
Harley Acheson
cc22de7acb UI: Increase Contrast of Area Resize Feedback
When dragging on area edges to resize them, the visual feedback is
brighter on high DPI displays like Retina. This is because the center
line is subpixel when on a regular monitor.  This PR increases the
width of the line and outline, giving a stronger highlight and one
that looks similar on all platforms.

Pull Request: https://projects.blender.org/blender/blender/pulls/136108
2025-03-21 00:32:34 +01:00
Campbell Barton
8a06a0da84 Cleanup: resolve build errors without TBB on Linux
Unfortunately C style casts are needed as the underlying types depend
on the build configuration.
2025-03-20 22:13:33 +00:00
Campbell Barton
2659ec12f5 Cleanup: replace int with wmOperatorStatus
Follow up to adding wmOperatorStatus, these cases were missed as they
didn't cause compiler warnings.
2025-03-21 08:34:21 +11:00
Campbell Barton
10233e95dd Cleanup: use a typed enum for operator & gizmo callbacks
Callbacks: exec invoke & modal now use a typed enum wmOperatorStatus.

This helps avoid mistakes returning incompatible booleans or other
values which don't make sense for operators to return.

It also makes it more obvious functions in the WM API are intended
to be used to calculate return values for operator callbacks.

Operator enums have been moved into DNA_windowmanager_enums.h
so this can be used in other headers without loading other includes
indirectly.

No functional changes expected.

Ref !136227
2025-03-20 21:11:06 +00:00
Harley Acheson
22ad0b9faf UI: Increase Border Edge Drag Width
When resizing areas by dragging at the edges, the hit area is wider
than the visible border. This extra border padding is extended in this
PR by another one pixel on each side. This increases the hit width by
about 30%. This is possible because this adjusts for scrollbars at the
edge of the area.

Pull Request: https://projects.blender.org/blender/blender/pulls/135952
2025-03-20 21:13:34 +01:00
Jesse Yurkovich
7e70e93345 Cleanup: USD: Small header adjustment to usd_asset_utils
Adjustment from recent clang19 build problems. Only use the more
expensive stage.h header in the implementation file where it's needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136159
2025-03-20 18:58:31 +01:00
Julian Eisel
103d535fe4 UI: Use snapping when drag & dropping collections
Part of #134755 / #134766.

Previously dropping collections would use some point under the mouse
cursor, I think projected based on the 3D cursor location. According to
feedback this is pretty useless and unpredictable, snapping to surfaces
under the mouse cursor is preferred.

With this the collection or collection instance will be transformed so
objects are placed relative to the dropping point (plus the collection
instance offset, if any).

This is added for dragging assets mostly, but works for dragging
collections from anywhere (e.g. Outliner).

Pull Request: https://projects.blender.org/blender/blender/pulls/136181
2025-03-20 18:52:42 +01:00
Harley Acheson
dbf3a3979d UI: Increase Height of the Left-Size Corner Action Zones
This PR increase the height (only) of the corner action zones at the
top-left and bottom-left area corners. They get more than twice as tall
so they are twice as easy to hit. Especially nice using a pen.

Pull Request: https://projects.blender.org/blender/blender/pulls/135954
2025-03-20 18:44:51 +01:00
Julian Eisel
6c1c5e8923 Asset browser import settings popover with collection instancing option
Part of #134755 / #134766.

Adds options to the new Import Settings popover (added in 7a6beb65f4)
to toggle collection instancing for dragging in collections. It can be
toggled separately for linking and appending, since it's typical to use
instancing for linking, but not appending (current default, also with
this change).

Previously, toggling collection instancing was only possible via the
Adjust Last Operation panel but this wasn't obvious, many people were
not aware. Adding this option based on feedback by the Blender Studio.

Pull Request: https://projects.blender.org/blender/blender/pulls/135996
2025-03-20 18:44:24 +01:00
Richard Antalik
60de2103c0 Fix: Crash when adding strips above channel 128
Crashes were caused by setting `Strip::machine` above `MAX_CHANNELS`
value.

Instead of clamping this value at multiple places, setter function
`seq::strip_channel_set` was added that implements clamping.

This also allows for better handling of clamping if it was ever needed.

Function `strip_transform_handle_expand_to_fit` still sets machine value
directly and above `MAX_CHANNELS` as a hack. This could be avoided, but
it would require some refactoring.

Pull Request: https://projects.blender.org/blender/blender/pulls/136163
2025-03-20 18:11:08 +01:00
Richard Antalik
a4c86b13ba VSE: Add seq::channel_get_by_index documentation
Usage of this function was quite confusing.

Pull Request: https://projects.blender.org/blender/blender/pulls/136161
2025-03-20 18:10:44 +01:00
Harley Acheson
d61e4d0930 Fix #136206: Clamp Max Row Calculation in Enum Lists
For very large scales with very small windows the enum list calculation
of how many rows might fit can result in zero, causing problems with a
later division. clamping this to a minimum of one fixes this and causes
no harm. This calculation is just a hint on how to behave, whether to
show lists in columns or not, etc. Lists still display fine even when
this variable reaches this minimum.

Pull Request: https://projects.blender.org/blender/blender/pulls/136265
2025-03-20 17:35:25 +01:00
Harley Acheson
b034cdd728 Cleanup: Make format
formatting changes resulting from running Make Format
2025-03-20 08:39:02 -07:00
Jeroen Bakker
a92981e77b Refactor: Vulkan: Move render graph submission into device_submission.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/136257
2025-03-20 15:55:30 +01:00
Pablo Vazquez
58ed0e1568 Fix: UI: Wrong tooltip for Developer Extras
Geometry indices is no longer hidden under Developer Extras, also
remove mention "Edit Source" since nowadays this feature exposes more
features than just that (this tooltip dates back to Blender 2.5 days).

Use `Display` instead of `Show` to be consistent with other tooltips.

Pull Request: https://projects.blender.org/blender/blender/pulls/134584
2025-03-20 15:11:25 +01:00
Julian Eisel
77a0c92283 Fix #113215: Missed asset storage update when node tool is removed
Make sure refreshing an asset library properly clears all storage for
this library, both in the global asset list storage and the storage of
each asset browser.

The `ed::asset::list::clear()` function handled clearing of asset
browsers too since recently, however the refresh operator wouldn't use
that when clearing directly from an asset browser. Instead, always clear
all asset library storage/chaches.
2025-03-20 13:07:42 +01:00
Jeroen Bakker
177bbf12df Fix #136239: SubDiv: Read out of bounds
GPU subdivision shaders can read out of bound when evaluating
the last face. This seems to be always been the case, but Metal + Vulkan
has validation to detect these mis-usages.

Binary search was initialized with out of bound values so the last
face could select out of bound index due to rounding.

Pull Request: https://projects.blender.org/blender/blender/pulls/136242
2025-03-20 12:17:58 +01:00
Bastien Montagne
7aced80eec Cleanup: blenkernel: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136134
2025-03-20 11:25:19 +01:00
Omar Emara
8b418a63c4 Cleanup: Use socket type in single input value operation
This patch uses the socket type as opposed to the result type in the
switch case that initialize the values of the single input value
results, since that makes more sense as we are retrieving the values
from the sockets. This also matches the implementation in pixel
operations.
2025-03-20 12:19:43 +02:00
Omar Emara
776810aec9 Cleanup: Remove outdated comments
Float2 and Int2 are no longer internal types, so removes some outdated
comments in the result types enum.
2025-03-20 12:18:35 +02:00
Omar Emara
38446399f4 Cleanup: Use fixed width integer for int results
We use fixed width integers in the variant definition, so retrieve using
fixed width as well.
2025-03-20 12:16:46 +02:00
Omar Emara
1589b1e444 Compositor: Support all single value types in File Output
This patch adds support for all types of single values for the File
Output node, image types are not yet supported. This involves converting
integer types to float since image saving code does not support integer
images.
2025-03-20 11:06:43 +02:00
Omar Emara
ff4237d713 Compositor: Support Int2 and Float2 types in shader operations
This patch adds support for Int2 and Float2 types in shader operations.
They are already supported for multi-function procedures. They are not
used in practice, but implementing them makes adding new types easier
since we don't have to think about types that are supported and those
that aren't. They are both encoded as vec3 due to limited supported for
those types in the GPUMaterial implementation.
2025-03-20 09:52:54 +02:00
Pratik Borhade
4cd7e335a9 Fix #136156: Grease Pencil: Crash calling active layer operator with out-of-bounds index
Exit early from the operator when `layer_index > total layers`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136172
2025-03-20 08:03:36 +01:00
Campbell Barton
90b6235d1c Cleanup: use common suffix's for operator callbacks 2025-03-20 16:05:34 +11:00
Campbell Barton
0dce94c20b Cleanup: clarify ED_undo_operator_repeat return value
This returned a 0/1 using a function signature typically used for
operator exec. Avoid confusion by returning a bool.
2025-03-20 16:00:51 +11:00
Campbell Barton
e4ca31f6dd Fix: incorrect return flags from Image Copy to Clipboard 2025-03-20 15:19:03 +11:00
Campbell Barton
613623e992 Cleanup: use "exec" suffix for operator execute callbacks 2025-03-20 03:56:25 +00:00
Campbell Barton
b5d0b6cf6b Fix: incorrect return flags for marker box select 2025-03-20 03:56:24 +00:00
Sean Kim
cdfb65a5a8 Fix: Potential stack use after free with Plane brush
The `Plane` brush type calculates its own node mask. The
`IndexMaskMemory` for the corresponding `IndexMask` goes out of scope
inside the inner method, resulting in an ASAN crash. To fix this, use
the `IndexMaskMemory` declared in the larger `do_brush_action` scope and
pass it in by reference to ensure its lifetime lasts appropriately.

Pull Request: https://projects.blender.org/blender/blender/pulls/136209
2025-03-20 03:26:49 +01:00
Nicola
51c8986106 Fix #136204: Inversion strength of Plane brush is weaker than expected
Flatten/Fill/Scrape use a different formula for the strength when
inverted, but for Fill and Scrape this is only applied when Invert to
Fill/Scrape is off.

The equivalent logic for the Plane brush is to lower the inversion
strength only when the inversion mode is set to Invert Displacement.

Fill and Scrape don't need an explicit check in `brush_strength`
because `flip` is set to `1.0` in `brush_flip` when
`BRUSH_INVERT_TO_SCRAPE_FILL` is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/136211
2025-03-20 03:03:27 +01:00
Campbell Barton
4c88c929c6 Fix: invalid return value from sequencer "Add Speed Transition" operator 2025-03-20 12:59:42 +11:00
Campbell Barton
b385b667f7 Cleanup: keep DNA rename list sorted 2025-03-20 00:38:53 +00:00
Campbell Barton
126cfbeb82 Refactor: rename bPoseChannel::size to scale
Match the name of the RNA as well as Object::scale, also rename
associated flags.

Ref !136151
2025-03-19 22:12:47 +00:00
Sean Kim
d9a6cdb8c8 Tests: Add calc_vert_neighbors_interior unit test
Adds basic testcase for a cube with no boundary verts and no hidden
faces.

Pull Request: https://projects.blender.org/blender/blender/pulls/136150
2025-03-19 21:49:24 +01:00
Omar Emara
2bc47e1e93 Cleanup: Compositor: Remove unused function 2025-03-19 16:01:45 +02:00
Omar Emara
b5392187ba Compositor: Support conversion to and from int2 and float2
This patch adds support for converting to and from float2 and int2
result types for GPU devices, this is already supported on CPU.
2025-03-19 15:51:57 +02:00
Brecht Van Lommel
9e1d8e349d Cycles: Adaptive subdivision no longer doubles up with Blender levels
Use the mesh wrapper mechanism from GPU subdivision to get the base mesh.
This can significantly reduce memory usage and render setup time if the
level was not manually set to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:10:20 +01:00
Brecht Van Lommel
53b84851c5 Refactor: Always use subdivision mesh wrapper, even without GPU subdiv
This makes it possible for Cycles adaptive subdivision to always get the
base mesh, and will enable the same for other external renderers as well.

Metal and Vulkan now support GPU subdivision, so by default the wrapper
will be used most of the time. However this can be disabled in the
preferencesas well. For those cases, the subdiv wrapper is still created
but cached immediately as part of modifier evaluation. This way it can
take advantage of multithreaded depsgraph evaluation, which is not
guaranteed for other cases.

The draw code access the object data through a wrapper that will return
either the base mesh or subdivided mesh depending if GPU subdivision is
enabled or not. Previously Object.data would have the appropriate mesh
already, but now that Cycles may do adaptive subdivision while GPU
subdivision is disabled this is no longer possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:08:37 +01:00
Brecht Van Lommel
7cc74e4078 Refactor: Access object data through accessor function in draw module
To prepare for customizing this for Meshes. Do it for everything so
copy-pasting code is more likely to do the right thing.

Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:08:37 +01:00
Brecht Van Lommel
321ec72c74 Refactor: Speed up and fix some issues in mesh wrapper
* Fix mesh_copy_data setting the subd wrapper type without copying the
  associated tessellated mesh. It's unclear if this currently causes any
  issues, but with future changes it would crash.
* Use double checked lock to avoid mutex locks on every call to
  BKE_mesh_wrapper_ensure_mdata and BKE_mesh_wrapper_ensure_subdivision.
* Set wrapper type to subd also if subdivision was skipped due to bad
  topology or level set to zero. Previous it would do mutex locking and
  TBB task isolation on every function call.
* Add assert when BKE_mesh_wrapper_ensure_mdata changes the wrapper type
  from subd to mdata. This doesn't really make any sense, it just loses
  the subdivision detail. If any code relies on this we need to understand
  why and maybe change it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:08:37 +01:00
Brecht Van Lommel
9526fe9993 Refactor: Add BKE_mesh_new_from_object argument to ignore subdivision
Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:08:37 +01:00
Omar Emara
a55eac6179 Cleanup: Compositor: Remove dead conversion code 2025-03-19 14:11:11 +02:00