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
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
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.
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
- 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.
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
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
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.
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
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
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.
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
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
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
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
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.
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
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'.
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
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