Commit Graph

102591 Commits

Author SHA1 Message Date
Iliya Katueshenock
95efb2ea83 Fix #111832: Move the Node Group Icon to a first position in header
Node Group icon have a ID-counter widget and can not be drawn
sequentially with other icons without extra offset. To fix icon
overlapping and add more consistency, icon, specific for such node,
should be first in its header.

Pull Request: https://projects.blender.org/blender/blender/pulls/112142
2023-09-08 14:22:06 +02:00
Christoph Lendenfeld
d3d19e8be9 Animation: Rename "Bake Curve" to "Keys to Samples"
Breaking change since the operator name changes.

Users have been confused about this for a long time.
The term "bake" in the context of animation usually means
to add keys at a given interval without changing the shape of the curve.

The fact that the curve isn't editable after baking was the main issue.

In order to stop the confusion the operator is renamed to "Keys to Samples"
to indicate that there is a conversion happening and that there are no keys afterwards.

The Un-Bake operator has also been changed to "Samples to Keys"

The operator description has been updated to mention that after the conversion
the data is no longer editable.

The "Bake Sound to F-Curves" has been renamed to "Create Samples from Sound"

Pull Request: https://projects.blender.org/blender/blender/pulls/111049
2023-09-08 14:01:47 +02:00
Sybren A. Stüvel
afa8596d21 Anim: add bonecollection.bones RNA collection property
Expose to RNA the bones that are assigned to a collection, as
`bcoll.bones`.

This will return an empty list when in armature edit mode, as only after
exiting edit mode the changes are flushed to the armature.
2023-09-08 13:49:41 +02:00
Christoph Lendenfeld
1a73039499 Animation: Scale Average slider for Graph Editor
This patch has been originally authored by Ares Deveaux #106526

Scale the selected key segments to their average
Unlike just scaling using the transform tools, this scales to the average of each individual F-Curve segment.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111744
2023-09-08 13:07:30 +02:00
Richard Antalik
e39cc78313 Cleanup: Split VSE timeline and preview drawing code 2023-09-08 12:54:44 +02:00
Sybren A. Stüvel
59c592f1de Anim: remove RNA access to bone groups
Bone groups have been replaced with bone collections (#108941), but for
versioning purposes are still in DNA. This commit removes the RNA
access.
2023-09-08 12:12:39 +02:00
Sybren A. Stüvel
f78ed7b900 Anim: rename Armature show_group_colors to show_bone_colors
There are no more bone groups, and the colors have been moved to the
bones themselves (042c5347f4). Now the
armature property that controls whether they're shown or not also refers
to 'bone colors' instead of 'group colors'.
2023-09-08 12:12:39 +02:00
Christoph Lendenfeld
a41da206cd Fix: Animation Editor snapping not working when using rotate or scale
This was introduced with #109015

The issue manifested in two ways.
* snapping did not work with rotate and scale
* the scale and rotate value would increment in steps instead of fluidly

This was caused because the snapping code would force the
mode to `SCE_SNAP_TO_INCREMENT` if the snapping
wasn't enabled for the given transform mode.

This snapping mode is not supported in the Animation Editors though,
causing the snapping `switch` to fall back to `default` which is to do no snapping.
My assumption is that this mode also causes the increments in the transform.

It would be good to support that in the future,
but for now this is just a fix to get the 3.6 behavior back.

Pull Request: https://projects.blender.org/blender/blender/pulls/112088
2023-09-08 11:34:17 +02:00
Christoph Lendenfeld
3a1b8e009b Animation: Graph Editor optimize handle drawing
The drawing code of the keyframe handles had the same issue
as the curve drawing itself, namely that it drew everything even things out of view.

This patch uses the same logic introduced in #110301 to get the
bounding indices of the curve in the viewport and only draw those.

This does NOT improve the performance when fully zoomed out on large data.

Test setup: 6000f of dense key data on 62bones
I ran my test on a zoom level that had the Graph Editor display about 500 frames.
The numbers are per curve and ONLY the handle drawing functions.

| Before | After |
| - | - |
| ~300μs | ~53μs |

Pull Request: https://projects.blender.org/blender/blender/pulls/112126
2023-09-08 11:31:43 +02:00
Campbell Barton
9e41eccc6e Cleanup: spelling in comments 2023-09-08 17:12:29 +10:00
Campbell Barton
4fc5d287ac Cleanup: doxygen parameters, blank comment lines 2023-09-08 16:53:30 +10:00
Campbell Barton
5ab2f61d44 Cleanup: remove use of 'auto' 2023-09-08 16:53:27 +10:00
Campbell Barton
0ff8ed788d Fix own error in a8124a2cb4 2023-09-08 16:50:51 +10:00
Campbell Barton
45305a5ad1 Keymap: remove internal vert_without_handles option
This was needed while testing #96544, now all curve picking selects
bezier knots without handles - the option can be removed.

This is a functional change for the 2.7x keymap, however selecting
bezier points with handles isn't a useful difference to keep.
2023-09-08 16:40:59 +10:00
Campbell Barton
773fb27d96 Curve Pen Tool: only select the knot when picking vertices
Follow the convention now used for 3D curve selection.
2023-09-08 16:40:58 +10:00
Campbell Barton
fb6b798f6d Curve Pen Tool: set the selection for extruded bezier vertices
Extruded bezier copied the selection from the previous point
which didn't always make sense - the handle pointing in the opposite
direction from the extrusion could be selected for example.

Now a single handle is always selected.
2023-09-08 16:40:57 +10:00
Campbell Barton
93ca6b6d0d Cleanup: rename CurvePenData::acted to changed
Follow convention used elsewhere.
2023-09-08 15:50:43 +10:00
Campbell Barton
34e4916d51 Fix setting curve handles free/aligned/toggle ignoring selected knots
Missed from [0] where handles should be considered selected when the
knot is selected.

[0]: 78b6ed19f3
2023-09-08 15:42:59 +10:00
Campbell Barton
ec89e966d0 BKE_deform: assert on invalid arguments to BKE_defvert_remove_group 2023-09-08 14:56:07 +10:00
Campbell Barton
3bc9971f26 Cleanup: assert the index created in rule_follow_leader is valid
Assert that the partial is part of the particle system before
creating an index. This is a hint to developers that the cast
is safe and using a pointer offset isn't going to cause problems.

Issue raised by !111193.

Co-authored-by: Loren Osborn <linux_dr>
2023-09-08 13:57:53 +10:00
Campbell Barton
a8124a2cb4 Fix potential error casting a pointer offset to int on 64bit systems
When using a pointer offset that may be out-of-bounds the integer
must not truncate the offset.

Issue raised by !111193.

Co-authored-by: Loren Osborn <linux_dr>
2023-09-08 13:46:01 +10:00
Campbell Barton
e5a1e6bcf1 Cleanup: use early returns in deform.cc functions 2023-09-08 13:42:47 +10:00
Harley Acheson
8d71e55d40 UI: Simplified Hover on Tool Items
Tool highlighting that targets RGN_TYPE_TOOLS only, moves
the highlighting to ui_block_func_POPUP

Pull Request: https://projects.blender.org/blender/blender/pulls/112113
2023-09-08 02:27:39 +02:00
Pablo Vazquez
24fe81e602 UI: Do not repeat icon in modifier options menu
"Apply as Shape Key" and "Save as Shape Key" shared the same icon, it
is good practice to not use the same icon for two consecutive items
in the same group in a menu.

Also add a separator to split Shape Key-related items from the rest.
2023-09-08 00:52:29 +02:00
Colin Basnett
5a679ccc28 Fix: Incorrect NodeTreeInterface move functions argument descriptions
Seems to have been a typo in the descriptions.

Pull Request: https://projects.blender.org/blender/blender/pulls/112109
2023-09-08 00:29:17 +02:00
Hans Goudey
88a7860251 Cleanup: Avoid assuming guarded allocator in corrective smooth modifier
Don't call `MEM_dupallocN` on unknown data. We don't know that this
pointer references a heap allocation, especially not an allocation made
by Blender's allocator. Even if that's the case currently, we don't want
to rely on that in the future as attribute data management gets more
flexible with implicit sharing.

Using `Array` is a simpler way to copy memory, though it does require
a bunch of boilerplate changes in the rest of the modifier.
2023-09-07 18:07:17 -04:00
Hans Goudey
a8bbddc10b Fix #111811: Corrective smooth modifier crash with zero vertices
In the charge splash screen demo file for Blender 3.4, the corrective
smooth modifier is called with a zero vertex mesh, which means it ends
up trying to free a null pointer is creates locally. Checking for null
resolves the crash. A future fix will remove the assumption that
`rest_coords` are allocated with the guarded allocator and can be
used as an argument to `MEM_dupallocN`.
2023-09-07 15:56:53 -04:00
Harley Acheson
9903c4419e Fix #112077: Crash Highlighting Popover menu
Added check for null active region

Pull Request: https://projects.blender.org/blender/blender/pulls/112099
2023-09-07 19:52:41 +02:00
Lukas Tönne
21953e47dc Fix #112073: Add all group outputs first, followed by all inputs
This keeps initial node groups using conventional outputs..inputs
layout.

Pull Request: https://projects.blender.org/blender/blender/pulls/112076
2023-09-07 15:08:52 +02:00
Lukas Tönne
0691ac622f Fix #111969: Remove gaps between panels and fill in the background
Panels are supposed to fill in the background.

Pull Request: https://projects.blender.org/blender/blender/pulls/112078
2023-09-07 15:07:06 +02:00
Lukas Tönne
fc321739f0 Fix #111963: Followup fix to ensure sockets inside panels have unique identifiers
#111972 made sure copied sockets have unique identifiers, but it didn't
cover the case of copying a panel and its children.

- Added an optional `uid_gen` argument to item copy functions which
  generates new unique identifiers for copied items. If not specified
  the items will retain the original identifiers (e.g. when copying an
  entire node tree).
- Removed the `copy_items` panel function from the API. Only used
  internally and requires a uid generator now.

Pull Request: https://projects.blender.org/blender/blender/pulls/112074
2023-09-07 15:06:38 +02:00
Hans Goudey
0783debda8 Geometry Nodes: Hide node group selector for asset modifiers
When adding modifiers from assets in the new modifier menu, switching
the node group the modifier uses afterwards will not be common. The goal
is to replace the builtin modifier directly. In that case it's easier to
just add a new modifier. The "Empty Modifier" item makes it easy to
choose an arbitrary node group anyway.

Combined with hiding the two sub-panels when they are unnecessary,
many node-modifiers will look just as clean as their builtin counterparts.

The option to show the data-block selector is added to the menu
in the node header so it's still accessible though.

Pull Request: https://projects.blender.org/blender/blender/pulls/111995
2023-09-07 14:47:40 +02:00
Hans Goudey
9f998c3e3a Cleanup: Change mesh face triangle count macro to C++ inline function 2023-09-07 08:36:43 -04:00
Christoph Lendenfeld
8134849b12 Fix: Graph Editor extrapolation line drawing issue
Introduced with #110788
Because of the logic introduced there, the first key might not be drawn,
resulting in a wrong extrapolation line.

This fixes it by always adding the first point

Pull Request: https://projects.blender.org/blender/blender/pulls/112072
2023-09-07 10:31:03 +02:00
Lukas Tönne
8f21353b5d Fix #111788: Label width needs to use UI scale to match node width
For the label width the offset from the node width needs to be scaled by
`UI_SCALE_FAC`.

Pull Request: https://projects.blender.org/blender/blender/pulls/112047
2023-09-07 09:21:33 +02:00
Campbell Barton
6a1ba2aca1 Cleanup: remove unused defines, reduce variable scope 2023-09-07 16:22:58 +10:00
Campbell Barton
3f9a15bc30 Fix #112052: Theme access asserts on startup
Resolve an issue where drawing the status-bar's report info could
assert on startup. This was probably caused by accessing theme colors
before drawing.

The reporter traced this back to [0] however I couldn't reproduce the
problem. Remove theme access from INFO_OT_reports_display_update as the
color has not been used since [1].

[0]: 6de294a191
[1]: 694bc4d040
2023-09-07 15:54:55 +10:00
Campbell Barton
3059c3ee26 UI: display a short pulse when displaying reports in the status bar
This functionality was lost in [0].

[0]: 694bc4d040
2023-09-07 15:54:54 +10:00
Campbell Barton
3b0ced2e31 BLI_math: add add_v3_uchar_clamped (previously color_add_v3_i)
Move color_add_v3_i to a public function,
useful for making minor color adjustments.
2023-09-07 15:54:53 +10:00
Campbell Barton
2ed423c23b Cleanup: remove unnecessary UI_GetThemeColorType4ubv call
Store theme colors in variables for reuse.
2023-09-07 15:54:51 +10:00
Hans Goudey
c4cec77b91 Fix: Debug build error after previous commit
Remove debug asserts that don't serve a clear purpose besides testing
something that's clear from the called code, and require accessing mesh
data just for asserts.
2023-09-06 22:57:59 -04:00
Richard Antalik
49a0502f35 Fix mistake in previous commit
In 1fb692e896 values were clamped, but not used.
2023-09-07 04:34:04 +02:00
Hans Goudey
9db02c8617 Cleanup: Change OffsetsIndices::data() to return Span instead of pointer
Accessing the span should be possible. `Span` already allows pointer
access itself.
2023-09-06 22:27:39 -04:00
Richard Antalik
1fb692e896 Fix crash when moving retimed sound strip
Crash happened, when strip start frame has negative value.
Sound properties can not be animated in negative frames.
2023-09-07 03:57:33 +02:00
Hans Goudey
2cc3a63216 Cleanup: Remove mesh validation assert in mesh code
These asserts are helpful for development, but are too expensive and
strict to live permanently in debug builds.

Resolves #112035
2023-09-06 15:37:35 -04:00
Harley Acheson
d99af958d7 UI: Show Selected Tool Item
Show Toolbar items with selected highlight and hover highlight.

Pull Request: https://projects.blender.org/blender/blender/pulls/111939
2023-09-06 19:07:28 +02:00
Julian Eisel
1b2e29e692 Cleanup: Clarify path variable name in thumbnail create function
"filepath" was misleading since this path could also point into a .blend
file. Further, the convention was to use "filepath" for such files, and
"file_path" for when only an actual file path was expected. This is
highly confusing and non-obvious. Plus a (newer?) function broke with
the convention.

Just be explicit about the type of path, even if a bit verbose. It's
good to always have the reminder that this may be more than just a file
path when passing it around.
2023-09-06 18:46:29 +02:00
Harley Acheson
63e210895b UI: Proper Selection Highlight for Confirms
Operator Confirms get blue highlights since we use those like dialogs.

Pull Request: https://projects.blender.org/blender/blender/pulls/111949
2023-09-06 18:24:48 +02:00
Bastien Montagne
eadc54bb5d Fix (unreported) crash when deleting ObData while keeping their ShapeKeys.
Batch deletion of IDs could lead to deleting ObData ones while keeping
the related ShapeKeys.

Orphaned shape keys are not allowed anymore in Blender, they are checked
against in both file write and read code.

This would lead to assert (and crash) e.g. in the liboverride code.

This commit forcefully add shapekeys of deleted meshes, curves etc.,
when calling e.g. `BKE_id_multi_tagged_delete`.

Note that deleting the shapekey when deleting the obdata ID was already
implemented in single ID deletion (`BKE_id_delete` & co), in the
underlying private `id_free`. But this is skipped in `no main` case.
which is used by the batch deletion code for performance optimizations.
2023-09-06 18:21:15 +02:00
Bastien Montagne
fc02d5ee11 Fix (unreported) crash in versioning code of the new Bone Collections.
Code would access invalid (null) `pchan->bone` pointers, presumably due
to the (linked) armature data being heavily modified compared to the
local Object's poses? At least that's the idea of what caused this
invalid state of pose data.

Unfortunately the issue was detected in a very complex case.
Essentially, opening an older snapshot (r3034) of a Pets production anim
file with assets from current repository r3055), which have been heavily
cleaned-up.
This triggers massive amount of missing linked data from the older anim
file, and extremely heavy resyncing process of liboverrides.

In any case, calling `BKE_pose_ensure` before accessing object's pose
data should never be a bad thing. ;)
2023-09-06 18:21:15 +02:00