Commit Graph

150077 Commits

Author SHA1 Message Date
Campbell Barton
b5d0b6cf6b Fix: incorrect return flags for marker box select 2025-03-20 03:56:24 +00:00
Campbell Barton
bf87333701 Correct redundant call in bl_run_operators.py
Also correct type in comment.
2025-03-20 13:33:53 +11: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
Campbell Barton
858862657f Tests: improvements to bl_run_operators.py, update suppression list
- The context setup functions now reset the file to factory settings
  before setting up the context - for a predictable context.
- Split operator suppression lists into groups based on the reason
  for being disabled to avoid having to note this in code-comments.
- The suppression list is validated, warning if items aren't used.
- Disable operators which crash in background-mode which don't have
  obvious fixes & aren't useful in background-mode.
2025-03-20 13:16:47 +11: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
33d16796a7 License headers: add header, update files to exclude 2025-03-20 00:39:00 +00: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
Alaska
c771dc3a00 Tests: Add additional camera render tests
This commit edits and adds new tests for missing camera tests bringing
the code coverage for camera projection to basically 100%.

The changes include:
- Adding a test for the central cylindrical camera type
- And editing the other camera tests to include a object with a
`Window` texture coordinate system in view.
  - Modifications to these tests were done in the version of Blender
  closest to when the original test was made. For most tests this was
  Blender 3.1.

Ref: blender/blender-test-data!69
2025-03-19 15:47:35 +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
e4503a991d Refactor: Some tweaks to Cycles geometry sync for upcoming changes
* Use BKE functions directly instead of RNA in some places
* Remove various unused arguments

Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:08:37 +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
Habib Gahbiche
3c984667e8 Tests: Fix hash from latest compositor tests
Commit fdfcbb2ffe was pushed from a remote branch that was not up to date with main. This fixes the issue by pushing the tests to `tests/main` first.

Pull Request: https://projects.blender.org/blender/blender/pulls/136180
2025-03-19 14:07:34 +01:00
Habib Gahbiche
fdfcbb2ffe Tests: Add test cases for new common compositor nodes
Ref PR: https://projects.blender.org/blender/blender/pulls/135300

Pull Request: https://projects.blender.org/blender/blender/pulls/136177
2025-03-19 13:44:38 +01:00
Omar Emara
a55eac6179 Cleanup: Compositor: Remove dead conversion code 2025-03-19 14:11:11 +02:00
Michael Jones
584f19a5af Cycles: Apple Silicon tidy: Remove non-UMA codepaths (v2)
This PR removes a bunch of dead code following #123551 (removal of AMD and Intel GPU support). It is safe to assume that UMA will be available, so a lot of codepaths that dealt with copying between CPU and GPU are now just clutter.

Pull Request: https://projects.blender.org/blender/blender/pulls/136146
2025-03-19 12:53:01 +01:00
Omar Emara
775df8826b Compositor: Add Image Info node
This patch adds a new Image Info node which returns information about
compositor images. The node has three sources:

The node returns the following information:

- Pixel Coordinates: The coordinates of the centers of the pixels in the
  image. Those are essentially the integer coordinates with half pixels
  offsets added.
- Texture Coordinates: Zero centered pixel coordinates normalized along
  the greater dimension. Somewhat analogous to Object coordinates in
  shader nodes.
- Resolution: The resolution of the image.
- Location: The location of the image in the virtual compositing space.
- Rotation: The rotation of the image in the virtual compositing space.
- Scale: The scale of the image in the virtual compositing space.

This node is very useful to allow greater flexibility and procedural
creations. For instance, coordinates can be used to create procedural
effects like vignette using very simple math nodes. And size can be used
to compute size-relative parameters for pixel-parameter nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/135104
2025-03-19 11:38:29 +01:00
Omar Emara
0a80f470f8 Compositor: Add common nodes to compositor
This patch adds common nodes that are used in Geometry Nodes and Shader
Nodes to the compositor. The following new nodes were added:

- Vector Math.
- Vector Rotate.
- Vector Mix.
- Value Mix.
- Clamp.
- Float Curve.
- Blackbody.

The follow nodes were replaced by common counterparts:

- Value.
- Color Ramp.
- Mix Color.
- Map Range.
- Math.
- Combine XYZ.
- Separate XYZ.
- Vector Curves.

Some new features were gained in the process:

- Mix Color can now clamp both factor and result.
- Map Range can map different types and interpolations.
- Vector Curves gained a new Factor input.

Some behaviors were changed:

- Map Range previously forcibly clamped values whose magnitude is larger
  than the arbitrary value of 10000. This is no longer the case.

Some nodes were removed:

- Map Value. This was Map Range without the maximum 10000 limitation
  followed by a Clamp node. Both are now available as nodes.

Some common nodes remain separate:

- Separate/Combine Color. Shader counterpart does not yet support all
  color modes, and does not support alpha.
- RGB Curves. Shader variant does not support Film-Like curves or
  Black/White balancing.

Texture nodes will also be added soon in a separate patch. Nodes that
were replaced are now deprecated but still exist and will later be
removed in v5.0. Backward compatibility code was introduced to convert
from the deprecated nodes to the new nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/135300
2025-03-19 10:54:36 +01:00
Mohamed Gad
95eee272fe Fix #133173: Van Vliet does not converge at some values
Increasing the error tolerance from 1e-8 to 1e-7 guarantees convergence
before reaching oscillatory behavior. Additionally, using double
precision for all variables involved in the operation prevents
truncation errors, ensuring numerical stability.

Introducing a damping factor might fix oscillatory behavior but will
come at the cost of much more iterations, which does not seem worth it
considering that the suggested error tolerance of 1e-7 for the scale
factor translates to, at most, an error tolerance of 1e-3 for the
standard deviation in practice as can be seen by investigating the
derivative of the variance as a function of the scale factor. Such an
error will be almost impossible to notice in the context of blurring.

Pull Request: https://projects.blender.org/blender/blender/pulls/136149
2025-03-19 10:19:26 +01:00
Campbell Barton
44e45e8606 Fix: crash in background mode calling operators using ED_slider_create 2025-03-19 18:39:56 +11:00
Alaska
281b58f19f Tests: Add a render test for a large combined motion blur
This commit adds a test file containing a combined rotation,
translation, and scale transformation on a coloured cube,
with motion blur enabled, all with a low motion blur step count.

This test is being added to make sure various backends interpolate
this combined motion correctly.

Ref: blender/blender#135659
Ref: blender/blender-test-data!75
2025-03-19 06:38:12 +01:00
Campbell Barton
7ecbe51522 Fix: crash in transform.create_orientation on curves without a 3D view 2025-03-19 03:32:34 +00:00
Campbell Barton
484aed26d6 Fix: crash in the weight paint poll function
The poll function didn't account for there being
no active region.
2025-03-19 14:01:28 +11:00
Campbell Barton
38ca9b0b87 Cleanup: improvements ED_markers_find_nearest_marker & it's doc-string
- Remove reference to variable in the function from the doc-string,
- Note that a non-empty marker list always returns a marker.
  Some callers assumed but wasn't the case until recently, see #136059.
- Replace null check in the look with an initial assignment to ensure
  a marker is always returned.
- Rename argument `x` to `frame`.
2025-03-19 01:16:20 +00:00
Campbell Barton
c37455acac Fix: crash in transform.from_gizmo from a missing poll function
In practice it's unlikely users would trigger this crash.
2025-03-19 00:51:15 +00:00
tariqsulley
812aaa957d Fix #136079: Broken source file links in docs pages
Since add-ons are no longer in their own repository,
they don't need to have a separate base URL.

Ref: !136106
2025-03-19 00:38:00 +00:00
Harley Acheson
3f65f700e5 UI: Typographical and Path Wrapping for Tooltips
For tooltips, use typographical line breaking with hard limit for uses
of the regular font, path wrapping with hard limit for uses of the
monospaced font. Small correction to wrapping code so that hard limit
is not taken if there are optional breaking points.

Pull Request: https://projects.blender.org/blender/blender/pulls/136148
2025-03-19 00:44:44 +01:00
Campbell Barton
c690255184 Cleanup: rename "size" to "scale" in transform code
This value is mainly used for scale values, not an absolute "size".
2025-03-19 10:37:45 +11:00
Guillermo Venegas
cb11e23605 Fix #93504: Text moving in status bar
When flexiable spacing clamp the floating point widths to whole pixels
in ui_update_flexible_spacing to remove the random jiggling that can
occur, notable seen on the status bar at the right edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/135899
2025-03-18 23:57:47 +01:00
Sean Kim
96869d03d4 Weight Paint: Allow property changes in the editor to create undo steps
Currently, no change to an RNA property invoked from the UI while inside
Weight Paint mode creates an undo step. This includes both tool
properties (e.g. brush size, tool settings) as well as mesh properties
(symmetry, active vertex group, selection mode).

This behavior was initially introduced to avoid creating extra undo
steps when painting or sculpting and changing tool settings, however,
it applied to all property changes performed while in any paint mode,
including changes to mesh datablock properties.

To fix this behavior, this commit simply removes Weight Paint from the
list of modes that have their own (legacy) undo system. This means it's
now covered by the regular memfile / global undo system.

This builds on !134548 and !134836.

Ref: #134220, #69760, and many others

Pull Request: https://projects.blender.org/blender/blender/pulls/135758
2025-03-18 22:05:54 +01:00
Sean Kim
d6f88c757e Cleanup: Remove unnecessary const in mesh_brush_common.hh
Pull Request: https://projects.blender.org/blender/blender/pulls/136113
2025-03-18 22:01:17 +01:00
Sean Kim
054f8719ce Fix #136105: Unable to sample un-merged color in Texture Paint
Introduced with 9dddef9581

Code incorrectly checked for if the face was hidden instead of checking
if the face was not hidden when picking the face.

Pull Request: https://projects.blender.org/blender/blender/pulls/136107
2025-03-18 21:55:22 +01:00
Brecht Van Lommel
ab3204e251 Revert "Cycles: Apple Silicon tidy: Remove non-UMA codepaths"
This reverts commit 1a93dfe4fc.

This is hitting asserts in the tests, revert until it's fixed.

Ref #136117
2025-03-18 20:37:23 +01:00
Brecht Van Lommel
bb878234a7 Fix #136137: Crash with subdivision modifier and search
After recent changes. Use uiLayoutPanel like other modifiers.
2025-03-18 20:17:06 +01:00
Clément Foucault
17eadcabc8 Fix: EEVEE: Broken lightprobe baking with hair particle system
Would result in a crash after 2892b494bd
2025-03-18 19:27:54 +01:00
Aras Pranckevicius
944c7733e3 Tests: emit more animation data in I/O test template output
Previously only "legacy style" (no action layers, slots etc.)
were emitted for import tests

Pull Request: https://projects.blender.org/blender/blender/pulls/136133
2025-03-18 19:13:09 +01:00
Michael Jones
1a93dfe4fc Cycles: Apple Silicon tidy: Remove non-UMA codepaths
This PR removes a bunch of dead code following #123551 (removal of AMD and Intel GPU support). It is safe to assume that UMA will be available, so a lot of codepaths that dealt with copying between CPU and GPU are now just clutter.

Pull Request: https://projects.blender.org/blender/blender/pulls/136117
2025-03-18 19:09:25 +01:00
Bastien Montagne
7bf17d83ab Cleanup: blenfont & blentranslation: 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/136126
2025-03-18 18:25:50 +01:00
Harley Acheson
4894c888ee BLF: Configurable Line Breaking Behavior
The PR allows specifying the method of line breaking. Current functions
gain an optional argument that defaults to "Minimal" which breaks as it
does now, only on space and line feed. "Typographical" breaks on
different types of spaces, backslashes, underscore, forward slash if
not following a number, dashes if not following a space, Chinese,
Japanese, and Korean Ideograms, and Tibetan intersyllabic marks. "Path"
breaks on space, underscore, and per-platform path separators. There is
also a "HardLimit" flag that forces breaking at character boundary at
the wrapping limit.

Pull Request: https://projects.blender.org/blender/blender/pulls/135203
2025-03-18 18:02:36 +01:00
Julian Eisel
7a6beb65f4 Asset Browser: Add import settings popover, move import method into it
Part of #134755 / #134766.

Replaces the current import method menu in the middle of the Asset
Browser header with a "Import Settings" popover. The import method is
located there now, because it doesn't need to be as prominent as it used
to be, especially with #104686.

Plan is to add further settings to this popover, e.g. see #135996 or
 #134943.
2025-03-18 17:49:44 +01:00
Clément Foucault
2892b494bd Cleanup: DRW: Remove some global access to DRWContext
Rel #136090
2025-03-18 17:48:54 +01:00
Clément Foucault
8c7cb9d3c7 Cleanup: DRW: Flatten global access to DRWContext
Rel #136090
2025-03-18 17:28:00 +01:00
Harley Acheson
745509a0ab Fix #136119: Remove Warning Message With Save As
Regular "Save As" does not set "incremental" property, either true or
false, which results in a warning message. This PR just handles the
reading of this optional property properly by checking existence first.

Pull Request: https://projects.blender.org/blender/blender/pulls/136127
2025-03-18 17:23:35 +01:00