Commit Graph

116519 Commits

Author SHA1 Message Date
Pratik Borhade
a9b863be43 Fix #58333: Box select missing status bar key for deselect
Allow mouse release events to be included on status bar.

Pull Request: https://projects.blender.org/blender/blender/pulls/133182
2025-01-20 03:54:56 +01:00
Harley Acheson
5a452884fc UI: Improve Status Bar Display for GP Lines
When adding Grease Pencil lines, circles, curves, etc this PR updates
how the status bar shows options. No big changes just substituting
icons for text.

Pull Request: https://projects.blender.org/blender/blender/pulls/133279
2025-01-20 02:35:01 +01:00
Campbell Barton
d42b425ea9 Fix #131062: Active tool does not sync in Texture Painting workspace
Resolve an error where the brushes from the image/3D viewport
where shared but the tool was not. Causing the brush not to match
the appropriate tool when both an image & 3D viewport were displayed.

Resolve the issue by adding support for a "pending" tool,
a tool ID which is to be used.

This accounts for cases where it's not known if the requested tool
exists and uses the same code paths for initializing tools as is done
for initializing on file load for e.g.

Ref !133085
2025-01-20 11:21:33 +11:00
Campbell Barton
90b03d2344 Cleanup: spelling in comments 2025-01-20 11:19:23 +11:00
Richard Antalik
5394cb7514 Fix: VSE retiming key python API not defined on all strip types
API was defined only for movie strips. Define is also for Scene, image
and sound strips.

This required minor refactoring of how RNA collection type is defined.

Pull Request: https://projects.blender.org/blender/blender/pulls/133103
2025-01-19 21:21:36 +01:00
Richard Antalik
30f3eaa2a5 Fix #133167: Scene snapping settings confilict with VSE
Enabling `use_snap_rotate` in 3D viewport caused rotation in sequencer
to apply snapping. Rotation snapping was using mixed snapping functions,
which aren't implemented in sequencer.

Ignore affect rotation/scale tool setting property and force increment
snapping to be used with these transform modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133272
2025-01-19 20:56:56 +01:00
Brecht Van Lommel
4f72b8b3ff Math: Protect against using inplace min/max on pointers and references
As happened before, see #132918.

Pull Request: https://projects.blender.org/blender/blender/pulls/133261
2025-01-19 12:31:16 +01:00
Brecht Van Lommel
627114ee54 UI: Viewport Render Animation operator using jobs system
Instead of the old time cursor, this will now show a progress bar in the
OS taskbar or dock, as well as the main window status bar. Along with the
job name and cancel button.

Pull Request: https://projects.blender.org/blender/blender/pulls/133174
2025-01-19 07:30:50 +01:00
Harley Acheson
8953cc5045 UI: Improved Initial Message for Mesh Bisect
When first starting the Mesh Bisect operator, the Status Bar shows
"LMB: Click and drag to draw cut line". This PR just changes that to
show the message with an icon instead. And adds "Cancel".

Pull Request: https://projects.blender.org/blender/blender/pulls/133244
2025-01-19 00:49:52 +01:00
Pratik Borhade
5726a998a0 Fix #133151: Display "Depth" in status bar for inset operator keymap
Depth property of inset operator had wrong text displayed in status
bar. Should be "Depth" instead of "Tweak". Was changed in error in
commit 42a8947eb1.

Pull Request: https://projects.blender.org/blender/blender/pulls/133230
2025-01-18 19:35:44 +01:00
Sietse Brouwer
0db41a88b5 Fix: Grease Pencil: Uninitialized attribute values when drawing strokes
When drawing strokes in Grease Pencil, some (custom) attribute values
stayed uninitialized. This was due to a tiny bug in the Draw operator
initializing only some attribute values of newly drawn stroke points
to their default value and not all of them.
This PR fixes that.

Pull Request: https://projects.blender.org/blender/blender/pulls/133216
2025-01-18 09:02:00 +01:00
Sean Kim
6100023527 Cleanup: Remove unused sculpt_automask variables and functions
Pull Request: https://projects.blender.org/blender/blender/pulls/133223
2025-01-18 04:04:12 +01:00
Sean Kim
baffd174c8 Paint: Allow executing 3D paint operators without location
In Sculpt, Vertex Paint, and Weight Paint, the operator used while
painting (`SCULPT_OT_brush_stroke`, `PAINT_OT_vertex_paint`, and
`PAINT_OT_weight_paint`) can currently be executed in python as they
define `exec` methods. However, each of them has a implicit dependency
on the `OperatorStrokeElement` struct containing a `location`
corresponding to the object space location of the stroke daub.

This limits the usefulness of the operator in non-interactive
situations, as determining the actual location of a stroke on a 3D
object requires access to the Paint BVH to perform a raycast and project
the mouse from 2D region space into object space.

To allow users to define a stroke in region space coordinates, this
commit adds a new parameter to the associated operators,
`reproject_stroke` which indicates whether or not the current `location`
data should be discarded and replaced with newly calculated positions.

Ref: #132960

Pull Request: https://projects.blender.org/blender/blender/pulls/132974
2025-01-18 02:17:47 +01:00
Miguel Pozo
0a72db9f94 Fix #133198: Overlay-Next: Texture Paint workspace crash
Regression from 1406b9e656
Ensure it matches the Overlay Legacy behavior.
2025-01-17 22:59:39 +01:00
Harley Acheson
e8bc7ec68b Fix #83589: Remove Tooltips on Gizmo Mouse Down
Currently tooltips on gizmo parts can pop up while holding your mouse
down, unlike other UI elements. And they don't disappear until a few
pixels into a drag. This PR solves both by removing tooltips on mouse
down on a gizmo part.

Pull Request: https://projects.blender.org/blender/blender/pulls/132576
2025-01-17 22:44:21 +01:00
Bastien Montagne
64bdc245b2 Fix warning in some compilers.
Compilers do not seem to agree on valid printf format for `int64_t`,
recent clang 19 on linux requires `%ld`, while older compilers like the
buildbot ones of clang 15 on OSX ask for `%lld`.

So instead, cast the value to `int32_t`. Other solution may have been to
use `PRId64`, but this is fairly bad for readability.
2025-01-17 21:07:11 +01:00
Philipp Oeser
434f94b254 Fix #133211: Grease pencil Smooth modifier ignores influence vertexgroup
To resolve, multiply the modifier `Factor` by influence vertex groups
weights (if a vertexgroup is used).

Pull Request: https://projects.blender.org/blender/blender/pulls/133213
2025-01-17 18:00:43 +01:00
Philipp Oeser
0fd3f3c216 Fix #133207: Grease Pencil Opacity modifier "Use Weight As Factor" wrong
Two things not behaving as in GPv2:
- points outside the influence vertexgroup were getting zero opacity (as
opposed to 1.0 in GPv2)
- Opacity Factor was multiplied in (even though it shouldnt and is
rightfully greyed out)

I assume the a misunderstanding in c02f3c94d9.

Pull Request: https://projects.blender.org/blender/blender/pulls/133208
2025-01-17 17:56:49 +01:00
Christoph Lendenfeld
3f76352149 Refactor: extract utility functions from brush asset code
No functional changes intended.

Some functionality from the brush asset system will be reused by the pose library.
To avoid duplicating code, the relevant functions are extracted to a common place.

All functions are moved as is, except for `visit_library_catalogs_catalog_for_search`.
For that I changed the `bUserAssetLibrary` argument to a `AssetLibraryReference`.
That is because in the follow up PR I am using this function with non user libraries as well.

This is a refactor PR extracted from #132747.
To get a full picture of the use case see that PR.

Part of #131840

Pull Request: https://projects.blender.org/blender/blender/pulls/132857
2025-01-17 17:11:03 +01:00
Julian Eisel
8117e1981a Cleanup: Fix invalid doxygen format in RNA path comment
Some doxygen outputs would become invalid with this, e.g. XML output
would be `index to use when
<emphasis><computeroutput>index_dim</emphasis> &gt; 0</computeroutput>`,
so the closing tags were placed in invalid order.
2025-01-17 16:58:50 +01:00
Miguel Pozo
20332e89a9 Selection: Improve Display as Bounds/Wires selection behavior
Make the selection behavior more visually consistent in Render mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/133007
2025-01-17 16:30:32 +01:00
Christoph Lendenfeld
d9536fe878 Cleanup: anim_motion_paths.cc
No functional changes.

This patch just changes the comments to start with a capital letter
and end with a dot.

Pull Request: https://projects.blender.org/blender/blender/pulls/133209
2025-01-17 16:27:28 +01:00
Bastien Montagne
14e788e42e BKE: PartialWriteContext: Add concept of library duplicates.
Check done by PartiaWriteContext writing code to ensure there is no
library ID written which filepath is the same as the destination
blendfile path of the context, was flacky in case there would be
multiple library IDs with that same path.

While this is not expected situation currently, it will likely change in
the future, so handle that properly, and generate a CLOG warning.
2025-01-17 15:22:54 +01:00
Bastien Montagne
063267f459 Fix #132900: Blender error after editing and saving a brush asset.
The handling of library for IDs added to a PartiaWriteContext in 'make
local' mode (i.e. to make them local in the written blendfile) was
flacky, leading to invalid removal of the ID name from the library ID
namemap in G_MAIN.

Now simply esure there is a local copy of the library too when adding an
ID to the context, even if it will be made local there.
2025-01-17 15:22:54 +01:00
Jeroen Bakker
390ca01685 Cleanup: Vulkan: Remove resource ownership
Images used to be tracked with ownership in order to reset swap chain
images to its original layout. This isn't used anymore as we always mark
them in VK_IMAGE_LAYOUT_UNDEFINED to make the first pipeline barrier a
nop.

This change reduces unneeded complexity and safe a few CPU cycles.

Pull Request: https://projects.blender.org/blender/blender/pulls/133197
2025-01-17 14:46:22 +01:00
Jacques Lucke
43b41984ae Fix: use MEM_delete instead of MEM_free
This was missing in 1151d82df3.
2025-01-17 14:13:14 +01:00
Philipp Oeser
782a4c9d85 Fix #133194: Grease Pencil Vertex Weight Angle influence vertexgroup has no effect
The weights were just not used at all.

Stumbled over this checking on #133055

Pull Request: https://projects.blender.org/blender/blender/pulls/133195
2025-01-17 13:39:26 +01:00
Jacques Lucke
e3d83806fd Fix: use delete instead of free 2025-01-17 12:52:06 +01:00
Jaime Torres
947330e529 Fix #129849: Remove redundant 'GreasePencil' references in PaintMode
As established in issue #129849 , there are references to older versions of Grease Pencil that aren't needed.
This PR is meant to remove such references or, in places where otherwise `GreasePencil` is referenced
but `GPencil` is not, it changes the reference as for it to reference the v3 implementations in PaintMode.
It also removes `GreasePencil` from the list of options when declaring `PaintMode`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131065
2025-01-17 12:30:47 +01:00
Jacques Lucke
58c923c0bd Fix #133177: incorrect handling of shared layers in mesh validation 2025-01-17 12:22:41 +01:00
Jacques Lucke
aec72c0a9a Fix #97685: very inaccurate mean computation in Attribute Statistic node
Numerical instability mainly comes from adding values together which have very
different magnitude. There are algorithms to keep the error small like "Kahan
Summation", however those are also slower because of additional code in the hot
loop. This patch implements a simpler approach that is slightly less accurate,
but still seems to solve the cases that people commonly run into while being
simpler and faster. The approach is to simply compute a couple partial sums
first, and to add those up in the end. The individual partial sums can also be
computed in parallel. Care has to be taken to maintain determinism with floating
point values.

If accuracy is still not enough for some use cases, we can revisit this later
and e.g. use doubles or a better summation algorithm.

Pull Request: https://projects.blender.org/blender/blender/pulls/132759
2025-01-17 12:20:42 +01:00
Jacques Lucke
987003d456 Nodes: replace some node checks with accessor method calls
This uses the following accessor methods in more places in more places:
`is_group()`, `is_group_input()`, `is_group_output()`, `is_muted()`,
`is_frame()` and `is_reroute()`.

This results in simpler code and reduces the use of `bNode.type_legacy`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132899
2025-01-17 12:17:49 +01:00
Jacques Lucke
7408d0d8b1 Nodes: improve getting owner id during tree update
Using the `BKE_id_owner_get` during the node tree update can avoid having to
iterate over lots of data-blocks in common cases. Previously, the code had to
iterate over all potential owners of node group to find the correct one.

Pull Request: https://projects.blender.org/blender/blender/pulls/132903
2025-01-17 12:17:17 +01:00
Jacques Lucke
1151d82df3 Cleanup: move BlendFileData to C++
This simplifies potentially adding more data to the struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/133050
2025-01-17 12:16:04 +01:00
Pablo Vazquez
9081674e8c Fix: UI: Use title case for items in status bar
Missed these in the recent pull request review.
2025-01-17 12:10:46 +01:00
Jeroen Bakker
2f18e4fe29 Vulkan: Add debug group for swapchain
Improves debugging swapchains when using renderdoc.

Pull Request: https://projects.blender.org/blender/blender/pulls/133190
2025-01-17 11:40:11 +01:00
Jeroen Bakker
56f14a0083 Vulkan: Add support for GPU_DATA_UBYTE to F16 data conversion
This data conversion is needed to download a HDR framebuffer for
color-picking and saving screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/133187
2025-01-17 10:58:28 +01:00
Bastien Montagne
318bc5af77 BKE: ID namemap: always report warning when checking integrity of the namemap.
Using `CLOG_INFO` and then reporting critical error is not very coherent,
nor practical, since INFO messages are not even displayed by default in
the console.
2025-01-17 10:48:33 +01:00
Jeroen Bakker
80ec04b4ef Cleanup: Vulkan: Use full surface format
GHOST_ContextVK used to pass only the surface texture format to
the GPU backend, it didn't pass the color space. This PR also includes
the color space.

Pull Request: https://projects.blender.org/blender/blender/pulls/133185
2025-01-17 10:28:22 +01:00
Pratik Borhade
25286dd2cd Fix #132112: Grease Pencil: Draw overlays for active object
`object_is_paint_mode()` returns true for objects that are not in active
interaction mode. This results in drawing of overlays for each Grease
Pencil object. Now fixed with adjusted condition.

Pull Request: https://projects.blender.org/blender/blender/pulls/132159
2025-01-17 10:16:39 +01:00
Brecht Van Lommel
a6b293daac Python Module: Bundle VFX library python bindings
When calling bpy.utils.expose_bundled_modules(), these modules are
added to sys.path.

This provides a solution/workaround to two problems:
* Using bpy together with packages like usd-core is problematic. Besides
  crashing due to C++ symbol conflicts, it's just impossible to import
  different versions of the same module, or to have distinct environment
  variables for both. (#127132)
* Blender add-ons using these VFX modules do not currently work with
  the bpy module.

This adds about 15MB to the bpy package.

Pull Request: https://projects.blender.org/blender/blender/pulls/133082
2025-01-17 10:13:31 +01:00
Brecht Van Lommel
ae6b47f346 MaterialX: Support linking color directly to surface shader
Matching Cycles and EEVEE.

Also changes some Color4 to Color3, since shader nodes don't use this alpha.

Pull Request: https://projects.blender.org/blender/blender/pulls/132907
2025-01-17 10:09:18 +01:00
Omar Emara
bea39233ea Cleanup: Share interpolation enum between all nodes
Share a single enum list and DNA type between all compositor nodes that
use interpolation.
2025-01-17 10:41:14 +02:00
Campbell Barton
8d97330482 Cleanup: clarify naming for BMesh tangent calculation functions
The newly added "tangent_pair" calculation functions meant the names
didn't read well in some cases, use this style of naming for clarity:

- BM_face_calc_tangent_from_*
- BM_face_calc_tangent_pair_from_*
2025-01-17 15:28:32 +11:00
Campbell Barton
c7104f5392 Fix #96535: Incorrect extrude direction with two faces of a cube
It was possible two quads at right-angles to each other would accumulate
a "tangent" that was co-linear with the it's normal.

Resolve this by calculating two tangents for each face, then using the
accumulated tangent that's least co-linear with the accumulated normal.
2025-01-17 15:17:06 +11:00
Campbell Barton
27cb542393 Refactor: minor changes to transform normal calculation
Normalize the calculated values in createSpaceNormalTangent in
preparation for additional error checks that require the values
to be normalized earlier on.

- createSpaceNormalTangent now normalizes the resulting normal & plane.
- createSpaceNormalTangent_or_fallback has been added that initializes
  the matrix even if the tangent or normal aren't usable
  (this was previously being done inline).
- createSpaceNormalTangent now returns false if the final tangent
  is zero length (this was previously unlikely but possible).
- Remove redundant vector normalize calls.
- Use "r_" prefixed return arguments, order them last.
2025-01-17 15:17:06 +11:00
Jesse Yurkovich
1ceaaeeff7 USD: Write extents out for Curves and more consistently for other types
Cleanup and enhance our export of the USD `extent` attribute.

This does the following:
- The existing `author_extents` function now uses recently added common
  code to write out the extents attribute
- A new `author_extents` overload allows the use of Blender's native
  bounds for the types that support it. We now use this rather than
  asking USD to recompute it for us.
- Meshes will now have their extents correctly written during animations
- Curves will now have their extents written as they were not doing so
  prior to this PR
- Hair, Lights, Points, and Volumes make use of the `author_extents`
  functions now

Since Curves need their extents tested, this PR also moves the test from
C++ to Python. Python tests allow for faster iteration, are more
straightforward to write, and allow usage of the USD validator.

Pull Request: https://projects.blender.org/blender/blender/pulls/132531
2025-01-17 03:28:13 +01:00
Jesse Yurkovich
cdc7526aed Fix: Use correct set_attribute overload for USD writing
Own mistake in 49ae7ffc9c found through inspection shortly after commit.

Add a static_assert to prevent the hard to notice problem in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/133169
2025-01-17 03:27:49 +01:00
Campbell Barton
dd32c10b5d Refactor: minor changes to get_path_environment_multiple
- Support a null "subfolder_name" argument
  in keeping with the rest of BLI_appdir functions.
- Use "test_path" utility to de-duplicate path joinging & checks,
  this also means the paths will be logged.
- De-duplicate loop body for the last item.
2025-01-17 12:29:16 +11:00
Campbell Barton
a586b537af Cleanup: various non-functional changes in C++ 2025-01-17 11:54:43 +11:00