Implementation of the click-selection operator of keyframes in the dopesheet, along with its alternatives : deselect all when no frames is hit, extend selection with shift, column selection with alt, select all keyframes on current channel with ctrl+alt.
Includes the new following API functions :
* `select_frame_at` : selects a frame in a layer at a specific time (if such frame exists),
* `select_all_frames` : selects all frames of a layer,
* `select_layer_channel` : selects a layer, and sets it as active (if layer is not null, otherwise the active layer is set null),
* `layer_has_frame_selected` : checks if any of the frames in the layer is selected.
Pull Request: https://projects.blender.org/blender/blender/pulls/110492
Previously the panel type name of a modifier (e.g. "MOD_PT_Smooth") was
created by copying from the ModifierTypeInfos name.
This meant that modifiers with the same default name would use
the same identifier for the panels.
Since different object types (e.g. OB_GREASE_PENCIL and OB_MESH)
might want to use the same default modifier name, this PR introduces
an idname field in the ModifierTypeInfo struct. This is then used to
generate the panel type name.
For compatibility reasons, the idname is the same as the name for now.
Note: Because the name was used previously, this means that some
modifiers have spaces in their panel type name.
E.g. "MOD_PT_Volume to Mesh".
Pull Request: https://projects.blender.org/blender/blender/pulls/110468
Currently, while calculating face corner normals, Blender retrieves
custom normal data with write access. When the the custom normals in a
single smooth corner fan don't match, they are reset to the average
value.
This behavior is very old, but it comes from when Blender didn't have a
strong idea of const correctness. Indeed, modifying custom normal data
while calculating normals isn't threadsafe, which is important because
normals are calculated for viewport drawing, for example. And in the
future, properly caching face corner normals (see #93551) will require
the ability to calculate normals on a properly const mesh.
The fix is to still use the average of custom normals in a fan, but
not write that back to the custom data array. In my testing the results
are the same. Setting custom normals still fills the same value for all
corners in a fan.
Pull Request: https://projects.blender.org/blender/blender/pulls/110478
The `on_activate()` function is expected to do undo pushes, call
operators, send notifiers and things like that as needed. Context is
necessary for such things, so seems reasonable to provide it as
argument.
Also needed for #110378.
Much of this was duplicated between grid view and tree view items which
keeping them in sync was becoming a hassle already. Now the logic is
shared via the base class. I find this makes the interfaces easier to
scan through visually as well.
Had to add a virtual iterator function that can be called on an
`AbstractView`.
The `on_activate()` function of an item should only be called when the
item was activated through the view, not through an external data change
(e.g. changing an active item through Python). That is important because
`on_activate()` is expected to do things like sending an undo push. This
is now respected in tree and grid views.
Unused header warning and `modernize-use-override` warnings.
I would like to selectively disable warnings about redundant `virtual` and
`override` keywords, since both together are useful (`override` enables
important compiler warnings that can avoid bugs, `virtual` helps quickly
identifying API functions available for overriding). But this doesn't
seem to be possible, only all of `modernize-use-override` can be
disabled, so simply keep the `virtual` but comment it out.
This is mostly boilerplate code to add a new `GeometryComponent` as well as making sure
the new `GeometryComponent::Type` is handled in all the `switch` statements.
Pull Request: https://projects.blender.org/blender/blender/pulls/110457
Add show_region_channels access for animation editors &
show_region_tools for the spreadsheet.
These could be hidden by resizing the region, there was just not way to
do this from Python.
Exposing these means they can be toggled from WM_MT_region_toggle_pie.
Take into account the filtering flags while filtering grease pencil channels in the grease pencil dopesheet.
This PR also adds two API functions for layers :
* `is_empty` checks if a layer contains no frame, and
* `is_selected` checks if a layer is selected.
Pull Request: https://projects.blender.org/blender/blender/pulls/110484
Some animation operators are not yet implemented for Grease Pencil 3, and trigger asserts. This patch prevents the asserts to be triggered in case of grease pencil channels, so that Grease Pencil 3 can be tested until the operators are properly implemented.
Pull Request: https://projects.blender.org/blender/blender/pulls/110486
Caused by 384c2e1f36
The 'Use Mouse Position' option was always being false which caused
navigation operators to behave as if the cursor was in the middle of
the region.
Implements the rest of #101689, after 5e9ea9243b.
- `vdata` -> `vert_data`
- `edata` -> `edge_data`
- `pdata` -> `face_data`
- `ldata` -> `loop_data`
A deeper rename of `loop` to `corner` will be proposed as a next
step, and renaming `totvert` and `totedge` can be done separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/110432
The current face index can always be retrieved from the "loop_to_face"
map, so passing it around and updating it manually just adds more
state to track.
Utility functions make accessing the next and previous corner of a face
more obvious, and range based for loops make iterating over corners
or vertices in a face simpler too.
Bones with overlapping IK constraints would jump about unpredictably
when at least one of those constraints was either zero-influence or
disabled.
The underlying issue appears to be that depsgraph construction assumes
all IK constraints are enabled (which is necessary for e.g. animating
influence), but the IK solver code excludes disabled and zero-influence
constraints from the solve. This in turn leads to
`BKE_pose_where_is_bone` not getting called when needed in some cases.
This commit addresses the issue by always including all IK targets in
the solve even when disabled or zero-influence, and simply excluding
them from being applied.
See the discussion in #88752 for more details.
This patch was primarily authored by Brecht, but with a minor fix
by me after testing.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/110417
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.
Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.
the only way forward appears to be back.
this reverts :
19422044eda670b53abe0f541db97cbe516e8c813e88a2f44c4e64b772f59547e7a31707fe6c5a57
The problematic commit was 07fe6c5a57
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.
Pull Request: https://projects.blender.org/blender/blender/pulls/110438
No user visible changes expected. Used in the asset shelf branch,
see #104831.
These tooltips only show a label string and appear after a shorter timeout
than the regular tooltips. After the regular tooltip timeout they expand to
the full tooltip. The toolbar and properties editor navigation tabs make use
of this already.
The changes here enable more control over quick label tooltips, making them
usable in more cases, and less ad-hoc. Main changes:
- Refactors internal logic so a single `UI_BUT_HAS_TOOLTIP_LABEL` button flag
can be used to enable quick label tooltips. This decentralizes logic in a
way that's more consistent and extensible.
- Custom callback to return a quick label. This is useful when a label tooltip
should be displayed even when there is no button string set. E.g. in the
asset shelf with "Show Names" disabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/110200
Blender allows animating the active camera selection (i.e. scene.camera)
by binding cameras to markers in the timeline. The dependency graph was
completely ignoring this by not building nodes for these cameras (it is
possible to reference a camera not directly included in the scene), and
not taking this into account in driver relations.
This change ensures that all cameras are included in the dependency
graph, and any drivers referencing scene.camera get dependencies on
all cameras of the timeline, and also time itself to ensure switches
are processed.
Pull Request #110139
The cause of that bug is any dependency on Scene COW, because that is
triggered by selection. Context properties merely are the most reasonable
way for that to happen. Therefore, the special rule should really apply
to any Scene references.
The real motivation is this removes dependency on dvar for when this
code is extracted as a new method in the next commit.
Pull Request #110139
Since markers are used to animate scene.camera, changing their camera
links carries the same consequences as changing scene.camera directly.
This means relations need rebuilding in case a new camera was added.
Pull Request #110139
Dependency building assumes scene.camera is fixed due to #107081.
Thus it is necessary to do a relations update when it does change.
Pull Request #110139
The Adjust Last Operation panel would attempt to use the main region,
even when the operator was initially executed in a different region.
This becomes an issue when the operator relies on context of the region.
For example the pose library gets the active asset from context, which
is only available in the region (e.g. asset shelf) displaying the
assets. In general it seems like redo should restore the region of
invocation.
This uses the region type from the initial operator call context to
lookup a region to restore on redo. While not completely bullet proof
(multiple regions of the same type may be present), this should mitigate
the issue quite a bit.
Required for #104831.
Pull Request: https://projects.blender.org/blender/blender/pulls/108892
Regions that change their size in the layout phase (something that is
supported for a while now) might affect the size of following regions.
For example the asset shelf design forsees that it takes space away from
the tool- and sidebar. When its size changes, tool- and sidebar need to
redraw.
Without this there is a crash in the `asset-shelf` branch:
- Open sidebar
- In the asset shelf Display Settings popover, toggle "Names" twice.
At first the sidebar will be empty, when toggling the second time a
null-dereference will cause a crash. This is because the layout phase of
the sidebar does not run, but after that the region size is updated,
it's tagged for redraw and the draw phase runs (without any layout).
Pull Request: https://projects.blender.org/blender/blender/pulls/110212
- Avoid calling `.finish()` twice, only pass span
- Fix "opcities" typo
- Remove unnecessary "is_empty()" check
- Group creation of "src_data" in one block
- Remove periods after doxygen titles
- Remove unnecessary "curves" argument
- Order mutable argument last
Pull Request: https://projects.blender.org/blender/blender/pulls/110428
Regression in [0] changed the order of execution for the load_post
handler which previously (in 3.5x) ran before driver evaluation.
Calling either load_post/load_post_fail handlers after loading was
changed intentionally to simplify the code-path for calling handlers
however it meant the handler couldn't be used to setup drivers,
so restore the original logic.
[0]: 46be42f6b1