Page MenuHome

Asset Browser: Add slider UI to pose blending
ClosedPublic

Authored by Angus Stanton (abstanton) on May 19 2022, 12:13 PM.

Details

Summary

Adds Slider UI implemented in ED_util.h to pose blending. This
adds a slider with percentages, and controls for precision
control and incremental control.

Current uncertainty is where to show the slider. ATM, it displays in
the asset browser header when using it from there, or in the
3D view header when using the poses in the animation N-panel.

Demos:

From Asset Library


From Pose Library

Diff Detail

Repository
rB Blender
Branch
T90182-blend-pose-slider (branched from master)
Build Status
Buildable 22161
Build 22161: arc lint + arc unit

Event Timeline

Angus Stanton (abstanton) requested review of this revision.May 19 2022, 12:13 PM
Angus Stanton (abstanton) created this revision.
Angus Stanton (abstanton) retitled this revision from T90182: Asset Browser: Add slider UI to pose blending to Asset Browser: Add slider UI to pose blending.May 19 2022, 12:13 PM
Sybren A. Stüvel (sybren) requested changes to this revision.Jun 20 2022, 3:53 PM

Thanks for the patch! This is something we had in mind for a long time, and never got the change to actually implement :)

The only thing that's not going well yet is that the blending now starts at 50%. This means that there is always a visual "jerk", instead of smoothly blending the asset pose into the current pose. Here you can see what I mean:

For a future patch, it would be sweet if animators could also type in the blend percentage. I think this is also possible with the tSlider approach, so shouldn't be too tricky to get working. That's not necessary for this patch, though, as with the current implementation that's also not possible.

source/blender/editors/armature/pose_lib_2.c
201

The execution order is pretty clear from the source code, as it's just top-to-bottom. Personally I'd only add a "First" if there is a concrete need to explain why this code has to be executed first (sometimes such things can be hard to understand, and then a comment helps).

In this case I'd just remove the "First" though.

482

No need to have this comment here, it's clear what the code does.

This revision now requires changes to proceed.Jun 20 2022, 3:53 PM
  • Merge branch 'master' into T90182-blend-pose-slider
  • Start blend at 0%
  • Remove comments as per diff review
Angus Stanton (abstanton) marked 2 inline comments as done.Jun 22 2022, 2:00 PM
Sybren A. Stüvel (sybren) requested changes to this revision.Jun 23 2022, 2:25 PM
Sybren A. Stüvel (sybren) added inline comments.
source/blender/editors/armature/pose_lib_2.c
340

This will cause a crash when event is NULL, which happens when applying a pose, instead of blending one.

The slider should only be created when blending, and not when applying a pose. Other slider-related code should only run when pbd->slider != NULL.

This revision now requires changes to proceed.Jun 23 2022, 2:25 PM

Fix breaking of apply pose OT

  • Only initialise slider if event==NULL
  • Move blend op text help to modal func
Angus Stanton (abstanton) marked an inline comment as done.Jun 23 2022, 3:35 PM
Angus Stanton (abstanton) added inline comments.
source/blender/editors/armature/pose_lib_2.c
340

I haven't checked for null in the modal or handle event functions since they don't run when using pose apply (unless I'm being silly)

Angus Stanton (abstanton) marked an inline comment as done.Jun 28 2022, 11:17 AM

An alternative approach could be to copy the timeline widget(or something similar) into the preview:


This way, all assets with a time element can be searched or even have in or
in&out points set before being added to the scene.

This way, all assets with a time element can be searched or even have in or
in&out points set before being added to the scene.

Not sure if this makes sense for this use case, since the pose assets don't have a time element. The slider is for interpolating between the current pose and the pose asset, not for playing through an animation asset.

Thanks for the poke, because this should really land :)

This patch is great, not just from a UI perspective but also the removal of all the now-unnecessary code. Much cleaner this way!

This revision is now accepted and ready to land.Sep 26 2022, 4:17 PM