Commit Graph

102630 Commits

Author SHA1 Message Date
Lukas Tönne
ee14c4aa34 Nodes: Add PanelDeclarationBuilder for panels in builtin nodes
Node groups already have panels, but they modify the node declaration
directly, which is not something we want to do for builtin nodes. For
those the `PanelDeclarationBuilder` should be used.

`PanelDeclarationBuilder` has `add_input`/`add_output` methods just like `NodeDeclarationBuilder`. Adding sockets to a panel increases its size by one. All sockets must be added in order: Adding sockets or panels to the root `NodeDeclarationBuilder` after a panel will complete the panel and adding more sockets to it after that will fail. This is to enforce a stable item order where indices don't change after adding a socket, which is important for things like field dependencies.

Example:
```cpp
static void node_declare(NodeDeclarationBuilder &b)
{
  // Currently this is necessary to enable custom layouts and panels.
  // Will go away eventually when most nodes uses custom layout.
  b.use_custom_socket_order();

  // Create a panel.
  PanelDeclarationBuilder &pb = b.add_panel("My Panel").description("A demo panel").default_closed(true);
  // Add to the panel instead of the root layout.
  pb.add_input<decl::Color>("Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
  pb.add_input<decl::Float>("Weight").unavailable();

  // Continue socket declarations as usual.
  b.add_output<decl::Shader>("BSDF");

  // !!! Warning: continuing the panel after other items is not allowed and will show an error.
  pb.add_output<decl::Float>("Bad Socket");
}
```

Pull Request: https://projects.blender.org/blender/blender/pulls/111695
2023-09-11 13:39:28 +02:00
Richard Antalik
29fcce6a8c Fix build warnings
Introduced in 4d668e6825.
2023-09-11 13:10:14 +02:00
Falk David
b66c0676b4 GPv3: Move dopesheet channels
This will allow to move selected channels to
Top/Bottom/Up/Down in the list.

Co-authored by: Pratik Borhade <pratikborhade302@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/111009
2023-09-11 13:07:48 +02:00
Amelie Fondevilla
3ee7900775 GPv3: Frame All/Selected keyframes
Update the `ACTION_OT_view_all` and `ACTION_OT_view_selected`
operators to take into account grease pencil keyframes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111480
2023-09-11 12:40:04 +02:00
Amelie Fondevilla
6221ff436f GPv3: Jump to Selected/Previous/Next keyframe
Update of the following operators to take into account
grease pencil frames :
* SCREEN_OT_keyframe_jump, which jumps to the average
position of the selected frames, and
* ACTION_OT_frame_jump, which jumps to the previous/next
frame in the active channel.

Pull Request: https://projects.blender.org/blender/blender/pulls/111476
2023-09-11 12:32:01 +02:00
Philipp Oeser
84b4b90e08 Fix #112208: Vertex parenting index wrong with multiple splines
Caused by 346023b457.

Above commit made variables too local (starting index with zero in each
nurb of the curve/surface object, but we need the "overall" index).

Should be good for LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/112222
2023-09-11 12:19:53 +02:00
Amelie Fondevilla
fc5b0ba19a GPv3: Set keyframe type
Update of the animation operator "set keyframe type" to take into account grease pencil keyframes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111472
2023-09-11 11:58:57 +02:00
casey bianco-davis
5870ffa570 GPv3: Frame delete operator
This operator is a combination of the previous delete operator `frame` mode
and the `active_frames_delete_all` operator.

This also add the delete menu and key binds.
2023-09-11 11:37:16 +02:00
Damien Picard
8460aac59d I18n: translate drag and drop messages for sockets
The new node interface items can be dragged and dropped to change
their hierarchy. The messages indicating where an element is dropped
were extracted using N_(), but not actually translated.

This commit enables this translation using TIP_(). It also extracts a
missing message ("Insert into panel").

Pull Request: https://projects.blender.org/blender/blender/pulls/112108
2023-09-11 11:04:36 +02:00
Guillermo Venegas
fca8df9415 Fix #112087: Float curve flickers with aligned points at x axis
Sorting curve points only at x axis generates undefined
behavior if some points are aligned at x axis with qsort.

Pull Request: https://projects.blender.org/blender/blender/pulls/112205
2023-09-11 00:17:14 +02:00
Iliya Katueshenock
3b44fd3655 Fix #112184: Adapt optimized case of Points of Curve node for domain
Fix mistake in 000e722c7d. If domain is not
the curve, then result should be adopted to domain.

Pull Request: https://projects.blender.org/blender/blender/pulls/112185
2023-09-09 19:16:10 +02:00
Richard Antalik
72d3d7f7f4 Fix errors in previous commit
Commit introduced build warning and crash due to not unbinding shader.
2023-09-09 17:22:03 +02:00
Richard Antalik
cba9f47562 Cleanup: VSE timeline drawing code
Deduplicate code, touch up some precondition, and minor improvements.
2023-09-09 17:15:56 +02:00
Richard Antalik
4d668e6825 Cleanup: refactor VSE timeline drawing code
- Use context variables for drawing functions.
- Move conditions to functions drawing specific elements as
  preconditions
- Disentangle calculation of common coordinates.
- Use more descriptive variable names (in context at least)

Individual drawing functions are mostly unchanged, so improvements there
are minimal.

No intended functional changes.
2023-09-09 15:54:33 +02:00
Jacques Lucke
dd515ebc1d Geometry Nodes: add Skip input to Simulation Output node
This adds a new Skip input to the Simulation Output node (design task: #112082).
It is a convenience feature that makes it easy to conditionally forward the
output of the Simulation Input node to the Simulation Output node, without the
need for potentially multiple Switch nodes. When Skip is enabled, the other inputs
of the Simulation Output node are not evaluated, i.e. the nodes in the simulation
zone are ignored.

The implementation adds this new functionality directly to the `LazyFunction`
of the Simulation Output node. It has new inputs that are linked directly
to the Simulation Input node, so that the simulation state can be forwarded.

Pull Request: https://projects.blender.org/blender/blender/pulls/112140
2023-09-09 09:53:01 +02:00
Miguel Pozo
967d49dba4 Cleanup: Formatting
Fix formatting after e5f6c57f8c
2023-09-08 21:35:13 +02:00
Miguel Pozo
e5f6c57f8c EEVEE-Next: Merge UBOs
Merge all the small UBOs used by the engine to save binding slots.
Each module is still responsible for filling its own data (by storing a
reference to it at construction) and this data is still private for other
modules.
The engine instance pushes the data to the GPU at the end of
`end_sync`, so only the modules that modify their data outside of the
sync functions need to manually call `Instance::push_uniform_data()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/112046
2023-09-08 21:03:37 +02:00
Miguel Pozo
1faa522880 Fix: EEVEE-Next: Motion blur on image renders
overscan_changed is always true the first frame.
2023-09-08 20:29:29 +02:00
Harley Acheson
930dadd600 Fix #111831: Proper Highlighting of Inactive Buttons
Deal separately with menu states of Disabled and Inactive buttons,
since we want different hover highlighting for inactive.

Pull Request: https://projects.blender.org/blender/blender/pulls/112159
2023-09-08 19:42:47 +02:00
Julian Eisel
87aa34d801 UI: Let asset shelf header resizing affect the entire asset shelf
Users expect to be able to scale the uppermost edge of the asset shelf,
which actually belongs to the asset shelf header region only. So it
would only work to hide/unhide this. They expect this because they seem
like one region, but they are actually implemented as two (to have
separate layout and scrolling mostly).

This adds a region flag so that scaling a region can actually affect the
previous one instead. Something similar is already used for split
regions.

Part of #107881.
2023-09-08 17:51:58 +02:00
Leon Schittek
cc1c38f74d UI: Fix inconsistent menu background padding
Remove slight (2 pixels) extra padding at bottom of menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/111826
2023-09-08 17:43:33 +02:00
Harley Acheson
e7f1647785 Fix #112081: Incorrect Toolbar Context Highlighting
More specific targeting of Tool item alternates list.

Pull Request: https://projects.blender.org/blender/blender/pulls/112153
2023-09-08 17:38:13 +02:00
Julian Eisel
3589533908 Thumbnails: Always use cached thumbnails for offline files
bd9f94e917 made it so the file browser doesn't bring files online for
the purpuse of creating their thumbnail, because that can take a while.
Instead it uses a previously cached thumbnail if available. This should
be the behavior for all cases thumbnails are requested, it's not only
the file browser that does this.

In fact it makes sense to move this into the normal function to "manage"
thumbnails (that is, load and if necessary (re)create cached
thumbnails) since there are no currently known use-cases for
different behavior.

Also, seems like the previous solution didn't work when loading ID
previews from offline .blend files. For that we need to use the path to
the .blend file to check the offline status, not the full path to the ID.

Found while working on #109234 (Use UI preview system for async loading of
file/asset previews).

Pull Request: https://projects.blender.org/blender/blender/pulls/112101
2023-09-08 16:41:44 +02:00
Hans Goudey
98e33adac2 Mesh: Further optimize topology map creation
We need a separate array that we can change in during the parallel
group construction. That array tells where in each group the index
is added. Building this array is expensive, since construcing a new
`Array` fills its elements serially. There are two possible solutions:

1. Use a copy of the offsets to increment result indices directly
2. Rely on OS-optimized `calloc` instead of `malloc` and a copy/fill

Both depend on using `fetch_and_add` instead of `add_and_fetch`.

The vertex to corner and edge to corner map creation is optimized
by this commit, though the benefits will be useful elsewhere in the
future.

|          | Before  | 1. offsets copy | 2. calloc       |
| -------- | ------- | --------------- | --------------- |
| Grid 1m  | 3.1 ms  | 1.9 ms (1.63x)  | 1.8 ms (1.72x)  |
| Grid 16m | 51.8 ms | 33.3 ms (1.55x) | 32.7 ms (1.58x) |

This commit implements the calloc solution, since it's slightly faster
and simpler. In the future, `Array` could do this optimization itself
when it detects that its fill value is just zero bytes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112065
2023-09-08 16:18:38 +02:00
Hans Goudey
be68db8ff9 Geometry Nodes: Show node group in modifier UI after duplication
When duplicating the node group from the geometry node editor, show the
data-block selector in the modifier interface. Otherwise it's not clear
that the modifier is using a local data-block, not the original asset.
2023-09-08 10:03:16 -04:00
Hans Goudey
80b1d098a7 UI: Add a separator before modifier context menu geometry nodes items 2023-09-08 10:03:16 -04:00
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