This makes the code reusable in a few more places,
particularly by tests for a new boolean implementation
also defined in the geometry module.
It also makes the way some primitives are reused among
different nodes a bit clearer.
Pull Request: https://projects.blender.org/blender/blender/pulls/112255
This callback is actually never excuted when e.g. defining operators
buttons through the layout API.
A design task has also been created to keep track of this issue: #112253
The `VIEWLAYER_PT_eevee_next_layer_passes_data` class name was
re-used by mistake for Workbench Next in ba982119cd,
and the actual EEVEE Next class was then removed in 678dc456e3.
This adds back the UI as it was, and the missing passes (Vector and
Position) it referenced.
Pull Request: https://projects.blender.org/blender/blender/pulls/112162
In image renders, after the first motion blur step,
non deformed geometry was being marked as deformed,
since all their geometry lengths are 0.
This caused velocity_local_pos_get to read wrong/unitialized values.
Fix#100718: NLA Hold Forward Inconsistency
Action Track with 'extrapolation=Hold Forward' behaves the same as 'Hold'.
For the Action Track, we now properly treat extrapolation Hold_Forward just like the rest of the NLA system.
Co-author Wayde Moss @wbmoss_dev
Pull Request: https://projects.blender.org/blender/blender/pulls/109182
Now that specific menus can be searched directly (see 7f9d51853c),
there is no need to maintain separate search functionality for adding
nodes. This PR removes the add node search. In a way this brings us
closer to the `NodeItem` situation before, but the setup is more
flexible since the menus are more standard and easier to customize.
In the few ways we customized the node search items before, this gives
us the same results as before. Overall the searching is less flexible,
but I think that is just a tradeoff we have to accept for the simplicity
of searching menus. In the future menus could be made more dynamic,
with each builtin node's menu path stored on the node type, similar to
assets. That might be a nice compromise. In the meantime this code
is just dead weight.
Pull Request: https://projects.blender.org/blender/blender/pulls/112056
The issue was that Armatures have their own edit-mode undo system, but it
didn't account for bone collections yet.
The solution implemented here is to also copy the list of BoneCollections
in each edit-mode undo step, just like EditBones themselves already are.
Additionally, the undo EditBones now have their bone collection membership
remapped to point at those undo copies, so that the entire undo step is
self-contained.
When restoring from an undo step, we simply do the reverse: copy all of
the EditBones and BoneCollections back to the actual armature, and remap
the EditBone collection membership appropriately.
This patch also includes a temporary workaround for a final issue, where
BoneCollection membership information could be lost when undoing pops you
out of edit mode. The correct solution for this is a bit involved, and
will be part of a future PR. But the workaround ensures that things
aren't broken in the mean time.
Pull Request: https://projects.blender.org/blender/blender/pulls/111965
Update of the `ACTION_OT_mirror` to take into account grease pencil
frames. Implemented modes are mirror over current frame, zero
frame, and selected marker.
Pull Request: https://projects.blender.org/blender/blender/pulls/111511
Pull request #109518 (commit cf5666345d) added logic to rename the
active UV map to "st". However, this behavior is currently breaking
UV Map node export to USD Preview Surface materials.
Specifically, UV Map nodes that reference the original active map name
do not get updated to use the new name "st", and the exported USD shader
references an invalid texture coordinate primvar.
This commit removes this logic for now. We should support such
renaming in the future, but the behavior should be extended to update
the relevant UV Map nodes with the new name. Also, we should consider
adding a USD export option to enable this feature.
Pull Request: https://projects.blender.org/blender/blender/pulls/112234
OBJECT_OT_object_join does not seem to use any screen/window during its
execution. Removing the relevant poll code so it makes it easier to run
this operator in the background.
Pull Request: https://projects.blender.org/blender/blender/pulls/112244
Regression from c51467cd4c.
Above commit made the IS_ALLSELECT_EVENT more strict and now excluded
mousewheel events.
Refining IS_ALLSELECT_EVENT even further (to respect mousewheel there)
is unfortunately not easily possible since mouswheel events are excluded
from `win->eventstate` (could only be retrieved from `win->event_queue`
but that is not reliable either since it might have events that are not
handled yet).
Possible solutions:
___
Adding mouswheel events to `win->eventstate`
- seemed to risky (could not forsee all possible consequences this would
have, e.g. double-click behavior)
___
Moving shortcuts for button array copy/paste from ALT to SHIFT
- downside: breaking user habits
- upside: additionally holding ALT could open the door for pasting on
all selected items
-- downside: without further work to make paste to multiple work better,
it would bring back #108096
___
So propose to do what was first suggested in #108270 as a third
solution:
Instead of refining IS_ALLSELECT_EVENT, bring it back to the state
before c51467cd4c (So `Ctrl + Alt + V` would still pass this test), but
specifically "filter out `Ctrl + Alt + V` right after in ui_apply_but().
Pull Request: https://projects.blender.org/blender/blender/pulls/112095
Shader draw parameter support is needed for Workbench-next. (Almost) All
devices that we support also supports shader draw parameters. This PR
doesn't include a workaround for devices that don't have support.
For end-users this PR will allow workbench-next to render the object on
the correct location. Before this patch they were always drawn on the origin.
The catch is that OpenGL uses gl_InstanceID which always starts counting at 0.
Vulkan has gl_InstanceIndex which holds the correct instance number. By
subtracting the gl_InstanceIndex from gl_BaseInstance will get the correct
gl_InstanceID.
This patch also activates some device extensions to perform in shader printf
statements inside a shader. Documentation for this will be added to the dev
docs how to use them.
Pull Request: https://projects.blender.org/blender/blender/pulls/111461
In the animation transform code, `T_AUTOMERGE` was used
to indicate that the duplicated keys need to be merged.
In perparation of #111051, this no longer makes much sense because
in grease pencil we cannot have two keys in the same channel at the same
frame.
This PR replaces the `T_AUTOMERGE` flag in the animation code to
`T_DUPLICATED_KEYS` to indicate that the transform is being called
with duplicated keyframes.
Pull Request: https://projects.blender.org/blender/blender/pulls/111268
Node buttons/options are conventionally drawn between outputs and
inputs. With custom node layouts this is not so clear any more since
inputs and outputs can be mixed.
This patch simply draws buttons right before the first input, or at the
bottom if a node does not have input sockets. This ensures a layout
compatible with standard node drawing and does not require extra work.
Eventually an explicit declaration method could place buttons explicitly
but for now this yields a useful default behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/112228
This is a special case in the node group operator which exposes all the
sockets when only one node is selected. This was still creating sockets
in inputs..outputs order, unlike the general case with multiple nodes.
Followup fix for #112073
Pull Request: https://projects.blender.org/blender/blender/pulls/112226
Use the same method for passing assets to an operator as the newer node
group operator menus. This supports quick favorites and shortcuts for
specific assets.
Also fix a crash when a dynamic submenu is added to quick favorites.
That still doesn't work though-- the menu ends up being empty.
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.