Commit Graph

133580 Commits

Author SHA1 Message Date
Campbell Barton
3b9b6ebbfa Merge branch 'blender-v4.1-release' 2024-02-29 22:04:20 +11:00
Bastien Montagne
ab4387d70e GPv3: Fix wrong handling of data names in FCurve RNA paths in conversion code.
Data name should always be escaped in RNA paths, thanks Campbell (@ideasman42)
for the heads up!
2024-02-29 11:53:34 +01:00
Omar Emara
56f8c1c0f6 Compositor: Unify variable size blur between CPU and GPU
This patch unifies the variable size blur between the CPU and GPU
compositor. The difference is due to how weights are computed and used.
The CPU computed a nested array of weights for every possible size, that
is, from size 1 to the base size. Then, it assumed the kernel was
separable and reconstructed a 2D kernel by selecting two 1D weights
array and multiplying them for every pixel of the blur window.

The GPU on the other hand computes a single quadrant of the 2D weights
kernel and sampled it directly in the blur window. We favor the GPU
implementation since it makes no assumptions about the separability of
the weights kernel and since the CPU has no performance advantage even
with the assumption in place.

Pull Request: https://projects.blender.org/blender/blender/pulls/118834
2024-02-29 11:08:49 +01:00
Omar Emara
aa17aca9ec Compositor: Use original variable size in Blur node
Currently, the CPU compositor smoothes its input size in variable size
mode. It is unclear why this is the case, but it seems the logic is that
sharp transitions in the size input are undesirable. Alternatively, this
is similar to the morphological blurring step in the Defocus node. But
it does not use standard weights and it is not morphological in nature
at all.

This patch removes the smoothing step and uses the original size
provided by the user. Looking at resources online, it seems users almost
always expect the size inputs to be used directly, so there is no reason
for force smooth their inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/118757
2024-02-29 10:57:18 +01:00
Pratik Borhade
e67059d504 GPv3: Isolate Layer keymap
Missed in 0228994d6d5492936e8e04bf2368e661e860c37b
Also include this keymap in draw mode, see: #118806

Pull Request: https://projects.blender.org/blender/blender/pulls/118894
2024-02-29 10:49:08 +01:00
Casey Bianco-Davis
c43736c7f4 GPv3: Draw tool side panel
This adds the `brush select`, `mix color` and `color palette` to the side panel. Same as the legacy panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/118762
2024-02-29 10:44:19 +01:00
Christoph Lendenfeld
a96f1208cc Fix #97202: Channels of animation editors disappearing when applying filters
The issue is that when applying filters, the list of channels shrink, but the `View2D` isn't updated accordingly.
When you move the viewport, the channels would jump back into view but not before.

The total height of the channel stack is computed every frame,
and the issue is fixed by calling the `UI_view2d_curRect_clamp_y` after that.

Since this has to be done before `UI_view2d_view_ortho` is called, I had to extract
the height calculations into the caller function.
I thought about making a generic function for all 3 editors but they were too different
to meaningfully do that.

I removed the fix that stopped the channels going off screen when using the cursor to scroll,
since the new logic already does that.

Note: while the report only mentions the Dope Sheet, this fix is applied to
the Graph Editor and NLA editor as well since they had the same issues. This PR fixes them all.

Also fixes #46649

Pull Request: https://projects.blender.org/blender/blender/pulls/118006
2024-02-29 10:33:02 +01:00
Aras Pranckevicius
8703173487 Fix: Compile error when WITH_UNITY_BUILD=OFF 2024-02-29 11:10:21 +02:00
Campbell Barton
4e60a68d21 Merge branch 'blender-v4.1-release' 2024-02-29 18:15:50 +11:00
Campbell Barton
f647e1a5b7 Weight Paint: expose all pose mode selection tools
Pose-mode selection tools (box, lasso & circle select) now support
pose-mode when weight-painting.

Changes to the key-map [0] caused a regression where it was no longer
possible to select multiple bones because Shift-LMB is now used for
painting. The report #114981 proposes to support pose selection tools
in weight paint mode.

Note that in [1] added the tweak tool, this completes the change by
supporting other tools & fixing W-key shortcut access.

Resolves #114981.

[0]: 6de6d7267f3d0eb913ce08675c9d73e27b8785e4
[1]: edcac1f48b92aee693f01a9bb4d23c03870a8f29
2024-02-29 18:12:50 +11:00
Campbell Barton
3a84ecfaff Merge branch 'blender-v4.1-release' 2024-02-29 17:07:38 +11:00
Campbell Barton
94ae1bd407 Fix pose-mode lasso select failing with multiple objects
When detecting pose-bone visibility lasso select used the same
armature for all pose bone checks. This caused the PBONE_VISIBLE
to return invalid results.

Simplify the logic by calling ED_view3d_viewcontext_init_object in the
outer loop.
2024-02-29 17:06:52 +11:00
Campbell Barton
b099108178 Merge branch 'blender-v4.1-release' 2024-02-29 14:02:58 +11:00
Campbell Barton
d5598838a2 Fixes for operator preset cleanup utility
Various fixes to operator preset cleanup:

- Only remove properties that match exactly the properties to exclude
  exactly (taking word boundaries into account).
- When the preset path doesn't exist, don't construct paths relative
  to the working directory.
- Enforce UTF8 encoded text.

Other minor changes:

- Rename "properties" to "properties_exclude" for clarity.
- Use single underscore for private methods.
- Match each line against a single regex instead of constructing a
  string and checking startswith(..) for every property to exclude.
- Use os instead of pathlib, as us used in blender's built in operators
  that handle paths.
- Prefer doc-string over bl_description.
- Double quote strings.
- Use single indentation for lists to reduce right-shift.
2024-02-29 14:00:05 +11:00
Campbell Barton
d39998318f Merge branch 'blender-v4.1-release' 2024-02-29 12:34:14 +11:00
Campbell Barton
08e0b35b31 Fix C-style formatting characters shown in operator reports
Caused by [0] which moved to fmtlib but left in some C-style formatting
characters.

[0]: f04bc75f8ce0dbef36f440ff3f840c54de9fda12
2024-02-29 12:23:17 +11:00
Hans Goudey
860f3ed794 Geometry Nodes: Add volume grid conversion nodes
Adds two nodes as "grid" equivalents to the existing volume nodes:
- **Grid to Mesh**
- **Distribute Points in Grid**

The code for the latter is just duplicated for now. In a later step
old node can be replaced by versioning with two new nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118830
2024-02-29 01:20:27 +01:00
Campbell Barton
550866aca8 Cleanup: remove runtime pointer from workob in what_does_obaction
Any access to this after calling what_does_obaction would reference
invalid stack memory with undefined behavior.
Set to null to ensure this never happens.
2024-02-29 11:13:13 +11:00
Campbell Barton
36e217142f Build: remove svn from Linux build deps script 2024-02-29 10:12:20 +11:00
Habib Gahbiche
262d6fb14f Cleanup: Silence warning 'function overrides a member function but is not marked 'override''
Pull Request: https://projects.blender.org/blender/blender/pulls/118870
2024-02-28 22:37:33 +01:00
Jacques Lucke
fe2a47b5a7 BLI: add chunked list data structure that uses linear allocator
This adds a new special purpose container data structure that can be
used to gather many elements into many (potentially small) lists efficiently.

I originally worked on this data structure because I might want to use it
in #118772. However, also it's useful in the geometry nodes logger already.
I'm measuring a 10-20% speed improvement in my many-math-nodes file
when I enable logging for all sockets (not just the ones that are currently visible).

Pull Request: https://projects.blender.org/blender/blender/pulls/118774
2024-02-28 22:22:21 +01:00
Hans Goudey
bea33a6be9 Geometry Nodes: Add volume grid creation nodes
Add three nodes to the currently experimental volume grid nodes:
- **Mesh to Density Grid**
- **Mesh to SDF Grid**
- **Points to SDF Grid**

These nodes are just wrappers over basic OpenVDB utilities.
The difference from existing volume nodes is that they output
a grid directly instead of a geometry set.

See the design here: https://devtalk.blender.org/t/volumes-in-geometry-nodes-proposal/31917

Pull Request: https://projects.blender.org/blender/blender/pulls/118761
2024-02-28 22:15:10 +01:00
Jesse Yurkovich
6d3b68c9df Cleanup: unused includes in source/blender/io/usd
Reduce dependence on Blender headers as much as possible and move closer
to an include-what-you-use setup.

- Removes unnecessary includes
- Replaces some includes with more appropriate, narrower, substitutes
- Removes unnecessary forward declarations

Pull Request: https://projects.blender.org/blender/blender/pulls/118308
2024-02-28 22:08:04 +01:00
Sean Kim
0e7c9f071a Cleanup: Consolidate dyntopo bmesh detail_size calculation
This PR consolidates the calculation of `BMesh`'s max edge length used for dyntopo across both the sculpt code and the modal operator that displays the resulting grid. It also adds two unit tests for verifying conversions from the `Brush Detailing` and `Relative Detailing` modes to the `Constant Detailing` mode.

Follow up to #118403
2024-02-28 19:42:55 +01:00
Xavier Hallade
b8fdef965d Merge branch 'blender-v4.1-release' 2024-02-28 18:25:21 +01:00
Xavier Hallade
98343c0c17 Build: Upgrade Intel Graphics Compiler to 1.0.15468 on Linux
This corresponds the latest stable LTS release:
https://dgpu-docs.intel.com/releases/LTS_803.29_20240131.html

Graphics compiler upgrades require increasing the mininum required
driver (compute-runtime) version to the corresponding one to guarantee
compatibility, which is XX.XX.27642.38 in this release, so we bump this
requirement accordingly.

Fixes #118713

Pull Request: https://projects.blender.org/blender/blender/pulls/118814
2024-02-28 18:24:30 +01:00
Aras Pranckevicius
f5f7024040 Cleanup: Remove now-unused "tiled" compositor implementation
New ("fullframe") CPU compositor backend is being used now, and all the code
related to "tiled" CPU compositor is just never used anymore. The new backend
is faster, uses less memory, better matches GPU compositor, etc.

TL;DR: 20 thousand lines of code gone.

This commit:
- Removes various bits and pieces related to "tiled" compositor (execution
  groups, one-pixel-at-a-time node processing, read/write buffer operations
  related to node execution groups).
- "GPU" (OpenCL) execution device, that was only used by several nodes of
  the tiled compositor.
  - With that, remove CLEW external library too, since nothing within Blender
    uses OpenCL directly anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/118819
2024-02-28 16:59:16 +01:00
YimingWu
d296c66ab1 GPv3: Show Line Art options in Object > Add menu
The Object > Add > Grease Pencil menu will now show Scene/Collection/Object Line Art
options.

Pull Request: https://projects.blender.org/blender/blender/pulls/118833
2024-02-28 16:20:48 +01:00
Sergey Sharybin
64427b5344 Merge branch 'blender-v4.1-release' 2024-02-28 15:57:10 +01:00
Sergey Sharybin
e3a7d68baf Fix #118034: Cycles: Driven View Layer property not considered in realtime
The issue was caused by Cycles doing dependency tracking on its
side, relying on the fact that view layer needs to be tagged as
modified when its properties change.

This was not the case when custom property on the a view layer is
modified via a driver.

Now the dependency graph will tag IDs which generic properties did
change as ID_RECALC_PARAMETERS, giving it a chance to render engines
to react to it.

Since this is quite generic code which might have unforeseen side
effects the change is not targeted to the current release branch.

Note that this chaneg does not fix the #103140, as the issue there
is use of RNA path to another data-block, without the node tree
registering relation to that data-block.

Also fixes #118117: Compositor does not update image when path is changed via handler

Original Pull Request: https://projects.blender.org/blender/blender/pulls/118134

Pull Request: https://projects.blender.org/blender/blender/pulls/118846
2024-02-28 15:56:31 +01:00
Falk David
5c7e4e15ca Cleanup: Fix typo 2024-02-28 15:23:09 +01:00
Sergey Sharybin
87a98c361c Fix: Crash when parenting mesh to armature with automatic weights
There probably are more cases where crash will happen as it is
rooting into the issue with BKE_object_workob_calc_parent() which
is used in multiple places.

The issue is caused by the access to a runtime field of workob
outside of the BKE_object_workob_calc_parent(): the runtime field
is stack-allocated in the function, and can not be accessed outside
of the function.

The easiest way to reproduce is to use ASAN, and parent mesh to an
armature with automatic weights. Although, on macOS ASAN did not
report issues, so setting workob->runtime to nullptr at the end of
of the BKE_object_workob_calc_parent() was the easiest.

The solution is simple: make the function to return the matrix,
and take care of the working object inside of it, so all tricky
parts are hidden from the API.

The patch is targeting the main branch, as in 4.1 it is not
required to do such change because all uses of the function only
access object_to_world, which is stored in the object in 4.1.

A double-check in the what_does_obaction() might be needed as it
follows the similar pattern, but it does not seem that runtime
field of the workob is accessed in usages of the what_does_obaction().

Pull Request: https://projects.blender.org/blender/blender/pulls/118847
2024-02-28 15:06:02 +01:00
Sean Kim
329926e7d5 Fix: Disable dyntopo detail flood fill for invisible objects
This PR disables the `SCULPT_OT_detail_flood_fill` operator on invisible objects.

Addresses part of #112371
2024-02-28 14:45:41 +01:00
Sean Kim
89d073dafa Fix: Disable project line gesture on invisible objects
This PR disables the `SCULPT_OT_project_line_gesture` operator on invisible objects.

Addresses part of #112371
2024-02-28 14:44:50 +01:00
Sean Kim
aa75f841bf Fix: Disable set_persistent_base for invisible objects
This PR disables the `SCULPT_OT_set_persistent_base` operator for invisible objects.

Addresses part of #112371
2024-02-28 14:41:47 +01:00
Bastien Montagne
de5451b112 Cleanup: Move BKE_anim_data header to be fully C++. 2024-02-28 11:51:03 +01:00
Sergey Sharybin
44810e137f Merge branch 'blender-v4.1-release' 2024-02-28 11:37:09 +01:00
Sergey Sharybin
9060b0dfb7 Cleanup: Correction to type annotation and smaller fixes/optimizations
This commit contains changes done to these scripts in the main branch.
2024-02-28 11:36:44 +01:00
Sergey Sharybin
066f7d9eea Revert "Cleanup: Address mypy errors and warnings"
The similar cleanup with a lot of other changes were committed
to the main branch. Is easier to revert this change, copy the
scripts from main, and merge things back.

This reverts commit 4bc1ba3c2d579b2bd4746eac71c0de948985fa45.
2024-02-28 11:36:44 +01:00
Jacques Lucke
4a4916db45 Fix #118237: don't allow changing NodeSocket.type directly on built-in nodes
Changing socket types like this is not generally supported. Usually one should
modify a property that is stored on the node instead. For custom node trees,
one should generally remove one socket and replace it with the new one.

Existing addons might use this functionality on custom node trees where it's
okayish. This patch forbids changing socket types directly on built-in nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118794
2024-02-28 11:35:32 +01:00
Falk David
a492a8f695 Fix #118837: Time offset modifier not working as expected
The time offset modifier was working differently than in GPv2. This is because in the new implementation, the time offset modifier actually modifies the keyframe mappings. And thus the order of the modifiers, and where the time offset modifier is placed in the stack, matters.

The problem is that this can lead to unexpected results like seeing unmodified drawings.
Technically, the issue here is that other modifiers only modify the current frame as supposed to all drawings in the timeline.
This is done as an optimization, but doesn't work when drawings can be shifted around on the timeline using the time offset modifier.

The fix changes the way the modifiers are executed. Because the time offset modifier can only modify **when** the drawings
are show, and not the drawing data themselves, we execute all the time offset modifiers first (in the order they appear in the stack) and then execute all the other modifiers after.

This means that the user can no longer run into the issue of "moving" drawings away from the current frame where they can't be seen.
It also makes time offset modifier behave the same as they did in GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118842
2024-02-28 11:30:43 +01:00
Sergey Sharybin
4bc1ba3c2d Cleanup: Address mypy errors and warnings
Pull Request: https://projects.blender.org/blender/blender/pulls/118844
2024-02-28 11:25:44 +01:00
Campbell Barton
6c78f79740 Cleanup: pass matrices by reference instead of value 2024-02-28 17:16:18 +11:00
Campbell Barton
12386e6809 Fix PLY import error caused by recent cleanup
Regression caused by [0]. Passing "Span" by value caused io_ply test to
fail. References were used so changes would be applied to arguments
passed in.

Revert these changes for "ply_import.cc".

[0]: d338261c55dadc0ef15fcf4afc032d324aee7b5e
2024-02-28 17:01:30 +11:00
Campbell Barton
4701879f52 Merge branch 'blender-v4.1-release' 2024-02-28 16:09:47 +11:00
Campbell Barton
7f8fcddba5 Merge branch 'blender-v4.1-release' 2024-02-28 16:09:42 +11:00
Campbell Barton
503de16353 Fix #117583: Inaccessible title bar buttons on GNOME/Wayland
New windows on GNOME with LIBDECOR windowing would sometimes have an
unusable title-bar with the whole title-bar acting as the edge-resize.

Would happen predictably when opening large windows which the window
manager would resize to fit the display.

The cause of this was Blender receiving a window configure event
without a window size for new windows. This configure event
would be ignored, causing the title bar not to work properly.

This is a regression from [0] which removed logic to calculate the
window size from the arguments passed to GHOST for window creation.
This wasn't correct either as the it could temporarily set the
window size before the requested size configuration was received.

Resolve the problem by queuing configuration requests,
handling them then the requested window size is known.

[0]: 1455315111ae769d101413fe600662484ff46d62
2024-02-28 16:07:10 +11:00
Campbell Barton
cec6d57107 Fix memory leak with Wayland & LIBDECOR
The configuration was cleared before freeing.
2024-02-28 16:05:05 +11:00
Hans Goudey
d338261c55 Cleanup: Pass Span by value
Also pass Span instead of `const Array &`
and use parantheses for BLI includes.
2024-02-27 23:09:54 -05:00
Hans Goudey
5c5089d651 Fix: Small changes to USD and Alembic curves import
Make both importers work the same way: first building an array
of the new offsets, then comparing the offsets to check if the
topology changed. Previously the USD importer incorrectly
compared curve offsets to USD point counts.

Also:
- Don't unnecessarily set the resolution to the incorrect default.
  The default for the curves system is 12. But it's unnecessary to
  fill the attribute to the default value anyway.
- Use some helper methods to iterate over all curves.
- Use float literal instead of integer.
- Use cast and `copy_from` for positions copy
- Pass Span by value

Pull Request: https://projects.blender.org/blender/blender/pulls/118829
2024-02-28 05:05:53 +01:00