Commit Graph

141277 Commits

Author SHA1 Message Date
Campbell Barton
ccfdf79bc3 Tools: support excluding directories for "make format"
As of [0] `intern/itasc/` is excluded from formatting,
however the formatting script was still running clang-format
on files in this directory.

Support ignoring directories to avoid the overhead of running
clang-format which does nothing.

Also add comments & skip creating paths to convert to spaces when
converting tabs to spaces isn't enabled.

[0]: 77617fce77
2024-09-21 19:56:21 +10:00
Campbell Barton
5c784edf96 Cleanup: remove unused headers from bpath.cc 2024-09-21 19:56:20 +10:00
Campbell Barton
890f06ec42 WM: prevent potential freed memory access for the UV unwrapping timer 2024-09-21 17:17:25 +10:00
Campbell Barton
a5453ce992 Cleanup: use bool for unwrap cancel argument 2024-09-21 16:58:19 +10:00
Lukasz Czyz
788bc5158e UV: add support for the SLIM unwrapping algorithm
Integrate an existing implementation of the SLIM unwrapping algorithm
into Blender. More info about SLIM here:
https://igl.ethz.ch/projects/slim/

This commit is based on the integration code written by Aurel Gruber
for Blender 2.7x (unfinished and never merged with the main branch).

This commit is based on Aurel's code, rebased and further improved.

Details:

- Unwrap has been moved into a sub-menu,
  slim unwrapping is exposed as: "Minimum Stretch".
- Live unwrap with SLIM refines the solutions using a timer.
- When using SLIM there are options to:
  - Set the number of iterations.
  - Weight the influence using vertex weights.
- SLIM can be disabled using the `WITH_UV_SLIM` build option.

Co-authored-by: Aurel Gruber <aurel.gruber@infix.ch>

Ref !114545
2024-09-21 16:48:53 +10:00
Campbell Barton
427be373f7 Cleanup: sort cmake file lists 2024-09-21 16:26:43 +10:00
Campbell Barton
f030e6f0b2 Cleanup: spelling in comments 2024-09-21 16:22:52 +10:00
Campbell Barton
0707369bb0 Cleanup: prefer ASCII symbols in code-comments 2024-09-21 16:18:40 +10:00
Sean Kim
c95a89f92b Fix #127828: Clay brush deforms mesh incorrectly
Missed in 0bc7631693

Pull Request: https://projects.blender.org/blender/blender/pulls/127938
2024-09-21 04:40:58 +02:00
Hans Goudey
079a8b395e Geometry Nodes: Optimize realize instances for single component inputs
Previously when there was a single mesh/curve/point cloud/grease pencil
input, the code would still do a deep copy of the entire geometry. Not
only does this waste time and memory usage, it also inhibits the
benefits of the shared cache system, causing normals and other derived
data to be recalculated more than necessary.

This commit makes the realize instance node "free" in those cases.
When the instance has a non-identity transform it only copies and
transforms the positions; the rest of the geometry is untouched.

For the implementation it was simpler to still copy the ID data-block
and rely on implicit sharing to avoid the expense of copying attributes.
That's because we don't have access to the original geometry set
components after all the preprocessing has happened.

Pull Request: https://projects.blender.org/blender/blender/pulls/127867
2024-09-21 04:27:39 +02:00
Hans Goudey
aba9f8a593 Tests: Add geometry nodes test for realize instance single geometry
Test file to ensure #127867 doesn't change behavior.
2024-09-20 22:20:45 -04:00
Campbell Barton
37e3397968 Cleanup: replace magic number with enum (missed last commit) 2024-09-21 11:09:00 +10:00
Campbell Barton
8a683632c7 Cleanup: replace magic number with enum 2024-09-21 10:58:59 +10:00
Campbell Barton
ef098befcb Cleanup: use DEG2RADF macro for clarity 2024-09-21 10:58:20 +10:00
Jesse Yurkovich
460aa3c231 USD: Point Cloud export support
Export Blender Point Clouds as `UsdGeomPoints` primitives.

Summary
- Adds the `USDPointsWriter` class
- Adds tests to ensure that animated positions, velocities, radii, and
  regular attributes are all written correctly (in a sparse format)
- Adds a new `export_points` operator property, mirroring the existing
  `import_points` option

Pull Request: https://projects.blender.org/blender/blender/pulls/126389
2024-09-20 19:57:12 +02:00
Jacques Lucke
4aa99f5647 Fix: add missing virtual destructor 2024-09-20 19:24:37 +02:00
Falk David
d1a6cd92fe GPv3: Fix compiler warning
Introduced by c20399442d.
2024-09-20 18:53:20 +02:00
Julian Eisel
a79f9100a6 Grease Pencil: Bring back eraser and fill tools (now using brush assets)
Followup to a38c96b92c, which implemented the necessary sculpt, paint and
tool-system changes. All this commit has to do is bring back the tool
definitions.

The brush assets project merged all brush based tools into a single, "Brush"
tool. After feedback, we want to bring back some of the previous brush based
tools. For example in grease pencil draw mode, not having an eraser or fill tool
available, and having to go through all the brush assets instead made the
workflow more cumbersome, and features less discoverable (an eraser tool in the
toolbar is quite easy to find, a brush deep down in the asset library may not
be).

Pull Request: https://projects.blender.org/blender/blender/pulls/125449/files
2024-09-20 18:13:19 +02:00
Julian Eisel
a38c96b92c Sculpt/Paint: Bring back support for multiple brush based tools
Design: https://projects.blender.org/blender/blender/issues/126032

The brush assets project merged all brush based tools into a single, "Brush"
tool. After feedback, we want to bring back some of the previous brush based
tools. For example in grease pencil draw mode, not having an eraser or fill tool
available, and having to go through all the brush assets instead made the
workflow more cumbersome, and features less discoverable (an eraser tool in the
toolbar is quite easy to find, a brush deep down in the asset library may not
be).

With this commit we can add back some tools for specific brush types in sculpt &
paint modes. The follow up commit will start with the eraser and fill tools for
grease pencil draw mode, but more tools in other modes are expected to follow.

For every brush type that has a tool in the toolbar, the last used brush is
remembered. This is the biggest part of the changes here.

Brush asset popups will only show the brushes supported by the active tool for
now. The permanent asset shelf region displays all brushes. Activating a brush
that isn't compatible with the current tool will also activate the general
"Brush" tool, but while the brush tool is active we never switch to another one
(e.g. activating an eraser brush will keep the "Brush" tool active). All this
might change after further feedback.

Pull Request: https://projects.blender.org/blender/blender/pulls/125449
2024-09-20 18:09:31 +02:00
Philipp Oeser
2ba13677ad Fix: Sculpt Scale tool adds up scale with non-uniform object scaling
This has already been tried to solve in f71d89bb04 (but apparently
still wrong).

This PR will hopefully address part of the scaling issues (rotation
needs another look, see below)

wrt. to scaling, the is code in place to reorient the size matrix in
`ElementResize` (for `Sculpt`, `Object`, `ObjectTexSpace` & `Pose`) that
multiplies by `td->axismtx` and it can be assumed that this code expects
`td->axismtx` to be normalized (otherwise the scaling adds up). And it
looks like all code coming here actually does this (except sculpt code
from `createTransSculpt`).

So to resolve, normalize `td->axismtx` in `createTransSculpt`.

NOTE: even after this PR, there can still be issues with scaling, namely
with rotated objects and global orientation, or when the pivot is set to 3D
cursor, those need another look.

NOTE: for rotation, I need another look at git history, atm. it seems
puzzling that f71d89bb04 e.g. uses `TransDataExtension::l_smtx` (this
is only ever used for pose related rotation?!)

part of #127398

Pull Request: https://projects.blender.org/blender/blender/pulls/127495
2024-09-20 18:02:31 +02:00
Philipp Oeser
52be15071f UI: dim the hide_select property whenever the bone is hidden
suggestion by @dr.sybren in !127340
2024-09-20 18:00:05 +02:00
Charlie Jolly
b1fc786653 Fix #127897: GPv3 Trim Stroke Ends crash on lines without intersections
Add check to see if curve has intersections before deleting the segments.

Pull Request: https://projects.blender.org/blender/blender/pulls/127918
2024-09-20 17:59:11 +02:00
Jacques Lucke
3506dc42c3 Fix: add missing include 2024-09-20 17:53:16 +02:00
Philipp Oeser
b58f61a91a Fix: inconsistent bone selection after hiding or changing selectability
In blender, hidden items should not be selected.
Also, making an item unselectable should deselect it.

- in armature editmode (unlike posemode), hiding a bone through RNA
(unlike though the Outliner) would not deselect the bone
- in armature editmode (unlike posemode), hiding a bone through RNA
would not update the Outliner
- in armature posemode (unlike editmode), making a bone unselectable did
not deselect it (at least it did not update properly)

To resolve, add deselection to the RNA update functions and add needed
depsgraph tagging
Also add Bone selectability checkbox to Properties Editor (could be
split in a separate commit) -- came up in #127180.

Pull Request: https://projects.blender.org/blender/blender/pulls/127340
2024-09-20 17:42:41 +02:00
Falk David
c20399442d Fix #127906: Issues with reproject operator
There were some issues with the operator:
* The `keep_original` option could easily crash blender.
* The surface projection did not work correctly.

This commits fixes those issues. The `keep_original` was
missing a tag for the topology that changes in the
drawing. The surface projection needed to cache the
viewport depths. This is done once and then used
to initialize the `DrawingPlacement`.
2024-09-20 16:53:41 +02:00
Jacques Lucke
c0179a1b78 Nodes: show panel description when hovering over panel headers
We already have the `description` property on panels but are currently not
displaying it when hovering over a panel header. With this patch, the
descriptions will be shown in group nodes as well as the geometry nodes
modifier.

I had to do two lower level changes for layout panels because it didn't work
with tooltips properly.
* Tooltips make the label in the panel header interactive, but clicking to
  open/close the panel should still work.
* The tooltip should disappear when clicking on the header. This is consistent
  with tooltips in other places.

Pull Request: https://projects.blender.org/blender/blender/pulls/127852
2024-09-20 16:24:09 +02:00
Jacques Lucke
3ccfa65245 Geometry Nodes: support packing bakes into .blend files
Previously, it was only possible to bake to disk with geometry nodes. This patch
adds support for storing the baked data directly in the .blend file.

By default, new bakes are stored in the .blend file now. Whether a new bake
should be packed or stored on disk can be configured in two places: in the
properties of the bake node and in the bake panel of the modifier. These
settings don't affect existing bakes, only the next bake.

To unpack or pack an individual bake, there is a new operator button next to the
bake button. The icon and the label below indicate where the bake is currently
stored. The label now also contains the size of the bake.

To unpack or pack all bakes, the `File > External Data > Pack Resources / Unpack
Resources` operators can be used. The unpack operator also has a new title that
mentions the number if individual files separate from the number of bakes. This
works better than just listing a number of files because a bake can consist of
many files.

Pull Request: https://projects.blender.org/blender/blender/pulls/124230
2024-09-20 16:18:12 +02:00
Falk David
645aa27965 Cleanup: Format 2024-09-20 15:48:45 +02:00
Miguel Pozo
88c84e6a37 Fix #124514: Wrong "slight defocus" DoF
The radius was not used for the sampling offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/127880
2024-09-20 15:22:23 +02:00
Christoph Lendenfeld
34a18c7608 Anim: Merge Animation operator
This adds the "Merge Animation" (`ANIM_OT_merge_animation`) operator to the 3D viewport.
It merges the animation of all selected objects into the animation of the active object.

On a technical level this moves the `ChannelBag` of the source action into a new slot
on the target action. The Slot name is copied but might differ due to name clashes.
Due to this, the operator is named "Merge Animation" and not "Merge Actions" since
it might not merge the complete actions but only the slots actually used by the selection
in the 3D viewport

This operator will find all related IDs to the selection, i.e. object data, shape keys etc. and merge those as well.
That means this operator can also be used to JUST merge the actions of the active object and its data.

### Caveats
Because there may be more than 1 slot user this might reassign an object that isn't actually selected.
The other option is that when there is more than 1 slot user, the `ChannelBag` is copied instead of moved.
That means moving objects that share a slot one by one would result in a loss of slot sharing and
data duplication. I think it's better to respect the artist decision of "these things use the same animation"
in this case. (open to opinions though)

Design task: #126937

Pull Request: https://projects.blender.org/blender/blender/pulls/127414
2024-09-20 15:08:16 +02:00
Lukas Tönne
057a6c3efd Fix: GPv3: Clone tool crashes due to index range regression
The `IndexRange::total_size` function was changed in ba28469e45.
This broke the grease pencil clipboard paste function, because it
already subtracts the starting index, leading now to invalid index
ranges. Removing the duplicate fixes this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/127907
2024-09-20 14:55:51 +02:00
Sybren A. Stüvel
26379c2b01 Anim: Update Action Slot selectors in the UI
Now that #127751 has landed, `layout.template_slot(...)` calls can pass a
text to use as label. This produces a nicer layout than possible before.

Pull Request: https://projects.blender.org/blender/blender/pulls/127905
2024-09-20 14:33:24 +02:00
Bastien Montagne
b2e50d5886 Revert "Cleanup: add missing struct qualifier"
`struct` keyword for members and parameters is not necessary in C++
headers, as long as the struct has been declared previously.

This reverts commit 09e459589f.
2024-09-20 13:42:13 +02:00
Bastien Montagne
3e03576b09 Add more control over ID renaming behavior.
This commit adds low-level logic in BKE to support three behaviors in
case of name conflict when renaming an ID:
1. Always tweak new name of the renamed ID (never modify the other ID
  name).
2. Always set requested name in renamed ID, modifying as needed the
  other ID name.
3. Only modify the other ID name if it shares the same root name with the
  current renamed ID's name.

It also adds quite some changes to IDTemplate, Outliner code, and
RNA-defined UILayout code, and the lower-level UI button API, to allow
for the new behavior defined in the design (i.e. option three from above list).

When renaming from the UI either 'fails' (falls back to adjusted name) or forces
renaming another ID, an INFO report is displayed.

This commit also fixes several issues in existing code, especially
regarding undo handling in rename operations (which could lead to saving
the wrong name in undo step, and/or over-generating undo steps).

API wise, the bahavior when directly assigning a name to the `ID.name`
property remains unchanged (option one from the list above). But a new
API call `ID.rename` has been added, which offers all three behaviors.

Unittests were added to cover the new implemented behaviors (both at
BKE level, and the RNA/Py API).

This commit implements #119139 design.

Pull Request: https://projects.blender.org/blender/blender/pulls/126996
2024-09-20 13:36:50 +02:00
Nathan Vegdahl
b200d1f975 Anim: remove strip data as well when an action strip is removed
This is a follow up to #126559. In that PR, strip data is never deleted even
when the strip that uses it is. Thus, the strip data array just keeps growing as
more strips are added, and never shrinks.

This PR implements that deletion. The approach is simple: remove the strip data
from the array using a swap-remove that swaps in the last item in the data
array, and then loop over the strips in the action to update any that were
referencing that swapped-in item. Additionally, before removal we check to make
sure the data item isn't still being used by any strips, and if it is then we
don't remove it.

Pull Request: https://projects.blender.org/blender/blender/pulls/127837
2024-09-20 13:07:15 +02:00
Julian Eisel
439d4dfc3c Fix: UI: Small layout glitch with search template and decorators
Button layout wouldn't be entirely correct with split layout was
enabled, but decorators disabled (`uiLayout.use_property_split = True`,
`uiLayout.use_property_decorate = False`).

See https://projects.blender.org/blender/blender/pulls/127751#issuecomment-1298468.
2024-09-20 13:06:21 +02:00
Aras Pranckevicius
e0ce6ce28a Tests: enable VSE blend modes tests
The actual files for them and reference results were added several
years ago, but the tests themselves were never enabled

Pull Request: https://projects.blender.org/blender/blender/pulls/127898
2024-09-20 12:56:57 +02:00
Julian Eisel
7d97f99dfc Refactor: UI: Avoid confusing layout property split return value
The function would return two very different layouts in different code
paths, making it not clear to the caller what to expect. For one code
path the return value was rather useless, and in fact unused, so I was
able to just remove this. Also clarified behavior and return values in
the function API comment.
2024-09-20 12:33:56 +02:00
Julian Eisel
a3a5793a28 UI: Allow label for search template (respecting property split layout)
Since 5bcb0c9935, `uiLayout.template_ID()` already supports passing a label, in
which case the `uiLayout.use_property_split` would be respected. This makes the
template fit nicely with the surrounding layout, where buttons might have a
label split on the left, and a decorator button on the right.

This change brings the same to `uiLayout.template_search()`, plus makes it
respect `uiLayout.use_property_decorate`

Pull Request: https://projects.blender.org/blender/blender/pulls/127751
2024-09-20 12:24:36 +02:00
dereck
24dfc75c4b Spreadsheet: add tooltips to float and int values to see the complete value
Sometimes it is inconvenient to see some large numbers in the spreadsheet
because they are cut off.

This commit adds tool tips to the spreadsheet when hovering the mouse
over a normal float or int value.

Pull Request: https://projects.blender.org/blender/blender/pulls/127588
2024-09-20 12:23:34 +02:00
Campbell Barton
09e459589f Cleanup: add missing struct qualifier 2024-09-20 19:52:01 +10:00
Campbell Barton
77617fce77 Revert "Cleanup: make format."
This reverts commit 06b8ddca8f.

Add ".clang-format" which prevents these files from being formatted.

Commit [0] missed adding this file.

[0]: f43da6fc4c
2024-09-20 19:46:56 +10:00
Bastien Montagne
06b8ddca8f Cleanup: make format. 2024-09-20 11:33:23 +02:00
Bastien Montagne
60013228e1 Fix #126205: Do not rebuild collection caches on any ID deletion.
Deleting ID would systematically call `BKE_main_collection_sync_remap`,
which would invalidate all collection caches. This should only be needed
when deleting a Scene, Collection or Object ID.

Pull Request: https://projects.blender.org/blender/blender/pulls/127866
2024-09-20 11:14:22 +02:00
Sean Kim
bd7c6208b7 GPv3: Add Bake Grease Pencil Animation operator
This commit ports over the legacy Grease Pencil "Bake Object Transform
to Grease Pencil" (`GPENCIL_OT_bake_grease_pencil_animation`) to GPv3.

It is accessed in the same location as the old operator, via the menu
path Object > Animation > Bake Object Transform to Grease Pencil

Pull Request: https://projects.blender.org/blender/blender/pulls/126581
2024-09-20 10:53:31 +02:00
Aras Pranckevicius
cb6d0dca40 Tests: bump to updated VSE blend modes render tests 2024-09-20 11:46:12 +03:00
Sergey Sharybin
4f5b6b114d Cycles: Bump OptiX version to 7.4
This commit switches buildbot to use OptiX 7.4 to gain performance
and memory optimizations for B-Spline curves.

Ref #125899

Pull Request: https://projects.blender.org/blender/blender/pulls/127861
2024-09-20 10:37:21 +02:00
Sybren A. Stüvel
b51d60a226 Anim: add iterator over Action Slot uses, with references
Add an iterator `foreach_action_slot_use_with_references(ID, callback)`
that provides references to the found `bAction` pointer and slot handle.
That way the callback can assign another Action or slot when it sees
fit, without having to know exactly what the source of this info is
(could be a direct assignment, but also an NLA strip or Action
Constraint).

Ref: #127844
Pull Request: https://projects.blender.org/blender/blender/pulls/127871
2024-09-20 10:30:15 +02:00
Alaska
8ae944026e Cleanup: Avoid double printing the word 'size' in Cycles debug
Avoid printing the word `size` twice when printing information about
the scheduled tile size to terminal when Blender is launched with
with `--debug-cycles --verbose 3` or higher.

Pull Request: https://projects.blender.org/blender/blender/pulls/127885
2024-09-20 10:10:57 +02:00
Philipp Oeser
44a845d650 Fix #127833: Action linked after particle settings duplication
Similar to how we do for new world, material, ..., no reason to not
duplicate Actions (no way otherwise to assign a different Action from
UI).

Fix similar to a75ac18638

Pull Request: https://projects.blender.org/blender/blender/pulls/127850
2024-09-20 09:37:12 +02:00