Commit Graph

150077 Commits

Author SHA1 Message Date
Bastien Montagne
8ad740ae95 API Docs: Add some more precisions about calling __init__ for Blender-derined classes.
Hopefully will avoid confusion like in #134600.
2025-02-17 10:49:04 +01:00
Falk David
1a071ef755 Fix #134490: Grease Pencil: Clone brush in sculpt mode not working
The main issue was that the code was using
`foreach_editable_drawing_with_automask` which shouldn't have been
the case since there is no "masking" to be done when pasting strokes.

Additionally the code was computing the view position of every
pasted point and then computing the offset to move the points to the
mouse position.

Instead, we compute the center of the 3d bounds of the pasted strokes
and then project only the center to the view. From there we can offset
all the points to move them under the mouse cursor.

It's a bit weird to do this projection of the center to the view and
I believe we mainly do it to reuse the `DeltaProjectionFunc`.
There are cases where the projection of the center to the view will fail
which can lead to unexpected behavior on the user end. For now we
just leave the pasted strokes where they were copied from, which
isn't ideal. But this can be improved later.

Pull Request: https://projects.blender.org/blender/blender/pulls/134589
2025-02-17 10:38:02 +01:00
Jeroen Bakker
f89a075015 Merge branch 'blender-v4.4-release' 2025-02-17 08:58:44 +01:00
Jeroen Bakker
0faba244a5 Fix: Vulkan: Async readback of storage buffers
The vulkan backend was implemented with async in mind, however the one place
where Blender uses for async was implemented blocking. This PR splits the
readback into flushing the command and waiting for readback.

**Performance**

Improvement of animation playback performance of shader balls.blend is around 10%.
Shader balls.blend frame: 1-100, 10 x animation playback

| Branch               | Total time | Average time |
| -------------------- | ---------- | ------------ |
| blender-v4.4-release | 26851 ms   | 2685 ms      |
| This PR              | 23675 ms   | 2367 ms      |

Pull Request: https://projects.blender.org/blender/blender/pulls/134227
2025-02-17 08:58:06 +01:00
Dalai Felinto
645242dcc4 Fix: Point cloud keymap not working
Pull Request: https://projects.blender.org/blender/blender/pulls/134638
2025-02-17 08:44:05 +01:00
Hans Goudey
cd04584412 Point Cloud: Implement transform operator
This ends up being very simple because point cloud has
no connectivity information and each element is just one
position.

Also implement the 3D transform gizmo.

The geometry deformation system isn't implemented in this
commit. That can be tacked later.
2025-02-16 23:36:04 -05:00
Hans Goudey
62b568d393 Point Cloud: Implement box, circle, lasso select tools
Signficantly simplified versions of the similar curves code.
These require #134623 to function.
2025-02-16 22:48:35 -05:00
Hans Goudey
75be98a4dc Point Cloud: Implement "Set Attribute" operator
Similar to the mesh and curves operators of the same name.
2025-02-16 21:28:53 -05:00
Hans Goudey
aff784aa14 Point Cloud: Implement "Affect only Origins" object transform option
Basically the same code as the curves support in this area.
2025-02-16 20:48:46 -05:00
Hans Goudey
c1c67c918e Refactor: Various C++ cleanups to object data transform
Make `XFormObjectData` a real virtual struct instead of using
C style over-allocation. Use C++ arrays and math types.
2025-02-16 20:31:09 -05:00
Hans Goudey
a369397301 Sculpt: Reduce overhead for multires index buffer creation
Avoid calling `GPU_indexbuf_add_line_verts` and the triangle
version of that function. It's faster to avoid function calls and
just write to the data arrays directly. I did some very rough tests
and observed about a 10% improvement in runtime for the
entire index buffer creation process.
2025-02-16 18:51:14 -05:00
Jonas Holzman
3c4a4282ea Merge branch 'blender-v4.4-release' 2025-02-16 23:41:30 +01:00
kgalik
c3d92f32dc NDOF: Rework input handling on macOS
This patch modifies the logic behind handling NDOF device events on
macOS so that it can benefit from the `Blender` profile available in
3DConnexion driver v10.8.7 and later.

A new device command was introduced: `kConnexionCmdAppEvent`, which is
sent by the driver upong getting an apprioriate NDOF device button
input. This allow the driver to consumes all NDOF device input and then
send appropriate app events based on its configuration instead of
forwarding raw data to the application directly.

When using 3DConnexion driver versions prior to v10.8.7, the behavior
is unchanged. This approach allows for supporting all of the SpaceMouse
Enterprise buttons, long presses included (solving issue #119206 on macOS)

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/126694
2025-02-16 23:39:24 +01:00
Campbell Barton
c97a2e86a9 Merge branch 'blender-v4.4-release' 2025-02-16 21:00:42 +11:00
Campbell Barton
665b4dfbad Fix IDProperty comparison warning in debug mode
The warning to check if two numbers are nearly equal when comparing
floats didn't take negative numbers into account, causing -1.0 & 0.0
for e.g. to be considered not equal but close.
This also resolves a divide by zero.
2025-02-16 20:56:07 +11:00
Campbell Barton
f43e7b2b09 Fix error in grease_pencil.relative_layer_mask_add poll
Resolve exception during menu search by checking the object type is
grease pencil.
2025-02-16 20:49:52 +11:00
Campbell Barton
5087246f39 Cleanup: strip trailing space, sort file lists 2025-02-16 20:42:16 +11:00
Campbell Barton
4c5424d9fc Merge branch 'blender-v4.4-release' 2025-02-16 19:45:34 +11:00
Campbell Barton
a80bd2744d Fix incorrect null checks in animadata::find_related_ids 2025-02-16 19:39:44 +11:00
Pratik Borhade
f209902866 Merge branch 'blender-v4.4-release' 2025-02-16 13:30:32 +05:30
Pratik Borhade
9dddef9581 Fix #134316: Color being sampled from hidden faces in texture paint
If face that has been hit is hidden, skip sampling from the face,
instead use current pixel color.

Pull Request: https://projects.blender.org/blender/blender/pulls/134321
2025-02-16 08:58:52 +01:00
Campbell Barton
69e63d190d Cleanup: use "at_most" RNA array access functions for simplicity 2025-02-16 18:39:35 +11:00
Campbell Barton
a8feffdc18 RNA: add array get/set functions that limit the number of elements
Add the corresponding int/boolean functions for
RNA_property_float_{get/set}_array_at_most functions.
2025-02-16 18:39:33 +11:00
Campbell Barton
3b11f5dc44 Cleanup: use a const argv in main() for WIN32 matching other systems
Avoid casting `argv` to a `const char **` when passed to functions.
2025-02-16 18:39:31 +11:00
Campbell Barton
efd46c86a9 Cleanup: pass arguments by const reference instead of value 2025-02-16 18:39:30 +11:00
Campbell Barton
9b0df7c60a Merge branch 'blender-v4.4-release' 2025-02-16 18:32:17 +11:00
Campbell Barton
c80980d10b Fix #125376: Standalone bpy module can crash on exit 2025-02-16 18:27:02 +11:00
Campbell Barton
d02f957296 Merge branch 'blender-v4.4-release' 2025-02-16 17:17:56 +11:00
Campbell Barton
78ccea432f UI: correct array size check for colors
Allow arrays to be larger than 4.

Related to #134537.
2025-02-16 17:14:12 +11:00
Campbell Barton
96179be206 Cleanup: cmake indentation 2025-02-16 17:14:12 +11:00
Alaska
67e34dc74c Merge branch 'blender-v4.4-release' 2025-02-16 18:03:08 +13:00
Alaska
74808ac2c3 Tests: Enable OptiX OSL generated volumetric texture coordinate tests
In a recent commit (1), a bug was fixed where the generated texture
coordinates on volumes in Cycles with OptiX OSL was incorrect.

Due to this fix, OptiX OSL now passes render tests in scenes that use
that feature, so this commit enables those tests on that platform.

(1) 0177537c9a

Pull Request: https://projects.blender.org/blender/blender/pulls/134629
2025-02-16 06:02:04 +01:00
илья _
a0b9071413 Cleanup: Sculpt: Avoid unnecessary copy
Unlike to view containers like span, or implicitly shared containers like virtual array, this is simple container which is unique owner the memory. So its copy here also lead to N/8-bytes copy.

Pull Request: https://projects.blender.org/blender/blender/pulls/134617
2025-02-16 03:26:53 +01:00
Ray Molenkamp
49af320b7f Deps: Shaderc Fix msvc runtime + switch to ninja
the static crt was selected, which isn't a problem as crt
object aren't passed between the host and the shared lib
still it's be nice to use the same runtime between both.
`SHADERC_ENABLE_SHARED_CRT` is a msvc specific option and
doesn't affect other platforms.

also switch build system from msbuild to ninja on windows.
this brings down the shaderc build time from 185 to 47 seconds
for the release libs, and 224 to 53 for the debug libs
total savings: 5 minutes!
2025-02-15 12:52:59 -07:00
Lukas Stockner
a6a183ab4d Merge branch 'blender-v4.4-release' 2025-02-15 19:56:23 +01:00
Lukas Stockner
0177537c9a Fix #129279: Cycles: Matrix-typed attributes not working in OptiX OSL
The issue here is that the individual components of TypeDesc are 8-bit each,
but the code was applying a 4-bit mask. It just so happens that the only
case where this matters is TypeDesc::MATRIX44, since its value is 16.
2025-02-15 19:31:07 +01:00
Dalai Felinto
1e87818808 Point Cloud: Select All/None/Invert
Select All operator and boiler plate for future point cloud operators.

The selection code is basically copied/inspired by the curves selection
code. A lot of it could probably be moved to shared attribute selection
functions.

Note, while this patch is working well, there are some caveats
to test it:

* Shortcuts are being defined (you can see them in the Preferences). Yet
  they are not working for whatever reason.

* There is no way to visualize the selection. I've been testing it by
  using a Nodes tool that changes the material based on selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/134450
2025-02-15 12:36:39 +01:00
Richard Antalik
564feceffd Cleanup: Use float instead of double for VSE retiming step
After calculating precision error, it turns out, that float type is
capable of working with up to 100h of 60fps footage without problems.

Pull Request: https://projects.blender.org/blender/blender/pulls/134477
2025-02-15 09:53:58 +01:00
Sean Kim
03a2d675a7 Fix #134591: Node tool crashes when modifying mesh topology
Caused by 0b891a68b1

In certain cases, we need to perform a whole-geometry update to the
underlying mesh data. The prior commit cleared the paint BVH but did not
tag the depsgraph for geometry updates, causing incorrect data to be
used while rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/134597
2025-02-15 02:27:35 +01:00
Alaska
870f92c6f9 Merge branch 'blender-v4.4-release' 2025-02-15 13:25:13 +13:00
Alaska
bcec81c4be Fix: Overflow when using light falloff node on distant lights
In Cycles lights can be given a light falloff node to control their
light falloff.

This worked by multiplying the light's strength by different
combinations of the ray length, which would be FLT_MAX for
distant lights. This resulting in almost every configuration of the
light falloff node overflowing when used on distant lights, which is
undesirable.

This commit fixes this issue by ignoring most of the functions of the
light falloff node when used on a distant light.

And in the process fixes a small discrepancy between SVM and OSL when
using the light falloff node on distant lights.

Pull Request: https://projects.blender.org/blender/blender/pulls/134539
2025-02-15 01:23:12 +01:00
Harley Acheson
beaaa428e9 UI: Tightened Status Bar Spacing
Slight adjustments to the spacing of items on the Status Bar. Mainly
to reduce the distance between adjoining icons. Small decrease in space
between icon and text. Slight decrease in text size inside the event
icons. Proportionally wider gap between items.

Pull Request: https://projects.blender.org/blender/blender/pulls/134534
2025-02-15 00:57:49 +01:00
Sean Kim
2266faa962 Merge branch 'blender-v4.4-release' 2025-02-14 15:09:50 -08:00
Sean Kim
3f6bf5ae05 Cleanup: Minor changes for recently added bl_object.py
* Adds SPDX license header
* Resets scene in more standard way

Pull Request: https://projects.blender.org/blender/blender/pulls/134543
2025-02-15 00:09:10 +01:00
Hans Goudey
3a542c9396 Merge branch 'blender-v4.4-release' 2025-02-14 15:44:59 -05:00
Hans Goudey
77ed7bfca5 Fix: Incorrect selection field type in Set Selection node
The selection can be float or boolean for these geometry types.
At the very least this caused asserts in debug builds.
2025-02-14 15:43:19 -05:00
Hans Goudey
76794727d6 Fix: Spreadsheet point cloud selection filter with no attribute wrong
This shouldn't really affect the release since original point cloud data is hidden
but it might and the fix is trivial anyway: everything is selected when there's no
attribute, just like curves.
2025-02-14 15:42:23 -05:00
Hans Goudey
568c791e22 Cleanup: Use StringRef for uiBut tooltips
And replace nullptr arguments for tooltips in UI button
creation functions with std::nullopt. Though the distinction
between "no tooltip" and "empty tooltip" doesn't seem to exist,
it seems safer to keep the distinction since it existed with null before.
2025-02-14 15:12:48 -05:00
Hans Goudey
4727dfd627 Cleanup: Remove unnecessary const qualifiers in function declarations 2025-02-14 14:32:57 -05:00
Hans Goudey
2e22be10f8 Cleanup: Missing custom data implicit sharing info in edit mesh undo
The missing sharing info shouldn't cause crashes currently, but since this
is the one place that CustomData is built "manually" it's better to do the
standard thing and create it.
2025-02-14 13:45:44 -05:00