Commit Graph

102604 Commits

Author SHA1 Message Date
Hans Goudey
75c57e924f UI: Rename Geometry Nodes "Show Node Group Selector" property
Skip "Selector" in the name. The fact that this influences the UI is
implied by "Show." That makes the "Selector" word redundant.
2023-09-08 10:03:16 -04:00
Sybren A. Stüvel
0ea79698ac Anim: Add bone.collections.clear() RNA function
Add the RNA function `bone.collections.clear()` to remove a bone from all
its collections.
2023-09-08 15:53:35 +02:00
Sybren A. Stüvel
9d65214d5b Anim: add notifier ND_BONE_COLLECTION for bone collection changes
Send nodifier `NC_OBJECT | ND_BONE_COLLECTION` on bone collection changes.
2023-09-08 15:53:35 +02:00
Pablo Vazquez
754f2f9c80 UI: Use asset icon for "Mark Asset" in menus
Use the asset icon for the "Mark Asset" operator in menus.

Using icons is not only good for accessibility, but also to create
a connection with the Asset Browser and the icon shown in the
data-block template once marked as asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/112111
2023-09-08 15:39:59 +02:00
Campbell Barton
4de525e757 Fix assertion unwrapping UV's on a mesh without UV's 2023-09-08 23:15:50 +10:00
Campbell Barton
52c4051d13 Cleanup: use doxy sections 2023-09-08 23:09:51 +10:00
Campbell Barton
2133ee141e WM: don't update key-maps when toggling "show_expanded"
Toggling show_expanded set the WM_KEYMAP_UPDATE_RECONFIGURE flag.
Disable this as it's only a display option in the UI.
2023-09-08 23:09:51 +10:00
Campbell Barton
d897fd34cb UV: restore internal solver state variable
Removed in [0] however I think it helps track the state,
so restore the state and assertions.

[0]: 8ace65e3c6
2023-09-08 23:09:51 +10:00
georgiy.m.markelov@gmail.com
cc2198254f Fix #111988: Hydra render crash if object doesn't have material
Appeared after f5472dcebc.

Pull Request: https://projects.blender.org/blender/blender/pulls/112128
2023-09-08 14:58:47 +02:00
Campbell Barton
468198a6df License header: add SPDX header 2023-09-08 22:33:32 +10:00
Campbell Barton
a4aa5adf44 Fix #110729: Unwrap angle based fails with seams
Regression [0] which merged index assignment into an earlier loop.
This caused the indices to be overwritten by p_chart_abf_solve
causing unwrap to fail.

[0]: 8ace65e3c6
2023-09-08 22:30:14 +10:00
Hans Goudey
006104645a Cleanup: Remove unnecessary struct keyword in C++ code 2023-09-08 08:27:28 -04:00
Hans Goudey
dcd0512eb1 Cleanup: Move sequencer_intern.hh to C++
See #103343
2023-09-08 08:27:28 -04:00
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