Page MenuHome

Added 'Update Pose' feature to Pose Library
Needs RevisionPublic

Authored by Kevin C. Burke (blastframe) on Jun 7 2022, 3:00 AM.

Details

Summary

1. Description of the problem that is addressed in the patch.
The current method for updating a Pose is not obvious to users, especially beginners, as the "Assign Action" method does not imply Pose Asset editing unless the user is well-versed in the Action data-block workings of Blender animation. It is also not available in the 3D View's Animation Panel nor the context-menu which makes such a valuable feature difficult to access and undiscoverable. The title can be confusing as in the Asset Browser it is called a Pose, but in the operator it is called an Action. To edit a Pose/Action, it is assumed that the user already knows to create keyframes for all edited bones in the Action which is not clear to those unfamiliar to Actions. Further, the overwriting-a-Pose feature is available in several other 3D applications' pose libraries and arguably expected in the primary user interface by an animator with experience in those applications.

2. Description of the proposed solution, and a motivation as to why this is the best solution.
The Update Pose feature surfaces a Pose overwriting operator to the primary user interfaces in the Context Menu and Asset Library respectively. Its name includes Pose so the operation has more obvious expectations to the user. It is also a faster, more intuitive solution as it does not require the user to key all edited bones: the operator has an option for reselecting the original pose’s bones before automatically keying them on creation.

3. List of alternative solutions, and a motivation as to why these are undesirable.
Another solution could be renaming ‘Assign Action’ to ‘Edit Pose’ and adding it to the Pose Library’s main UI & Context Menu, but the issue of more steps to complete a common task, assumed understanding of Actions, and likelihood of omitting a bone/bones from the original pose via re-selection remains.

4. Limitations of the proposed solution.
The proposed solution does not edit the existing Pose data, but overwrites it. This overwrites the thumbnail image preview (sometimes undesired when using a custom Pose preview image).

5. Mock-up of the proposed user interface and a description of how users are going to interact with the new feature.
Users can edit a pose by Applying the pose, adjusting the bones, then choosing ‘Update Pose’ from the Context Menu or ‘Update’ from the Pose Library Panels in the Asset Browser.

Context Menu:

Asset Browser Pose Library Panels:

Screencast demonstrating ease-of-use:

Diff Detail

Event Timeline

Kevin C. Burke (blastframe) requested review of this revision.Jun 7 2022, 3:00 AM
Kevin C. Burke (blastframe) created this revision.

Blender team sould implement this change ASAP. The steam update has just shipped and without this function I'm sure plenty of people's workflow has been made more difficult. Mine sure has.

Btw, I have no idea how I can "accept" this revision if I'm just a regular user. I see no explanation as to what that means, but if it helps then great.

This revision is now accepted and ready to land.Jun 8 2022, 5:18 PM

Blender team sould implement this change ASAP. The steam update has just shipped and without this function I'm sure plenty of people's workflow has been made more difficult. Mine sure has.

Btw, I have no idea how I can "accept" this revision if I'm just a regular user. I see no explanation as to what that means, but if it helps then great.

It doesn't help, and you shouldn't.

This revision now requires review to proceed.Jun 8 2022, 10:47 PM

Users are currently unable to update their existing poses in the Asset Browser's Pose Library.

This is incorrect. The right-hand sidebar of the asset browser (N panel) has a button "Assign Action", which assigns the action to the current character and allows all animation editing tools Blender has available.

Options include reselecting the pose asset's pose bones to ensure no bones are omitted as well as the ability to activate the updated pose.

How are these options shown to the user? Is this chosen before or after the menu item is used?

It would help to have some screenshots of the feature, so that it's easier to see how things fit together. Some info about the limitations of the approach would also help; check Ingredients of a Patch for more info. During the last meeting it was mentioned that this approach also re-renders the asset preview icon, and that this is not desired -- such information should be in the patch description.

On the technical level: A lot of the POSELIB_OT_pose_asset_update_pose class is just a copy of POSELIB_OT_create_pose_asset with some minor alterations. That's not a good design, and should be resolved. If code should be shared, there are many ways to do this, for example by placing the common code into a superclass. However, care should be taken here to not do this just for the sake of doing it. After all, what's the use in setting the active asset, when "Update Pose" always works on the currently active asset? And what would be the use in preventing data loss, when the datablock is already marked as asset, and thus won't be removed anyway?

pose_library/operators.py
327–328

In general, flip the condition, return early. Also, it's not nice to users to silently cancel the execution. If execution is impossible, this should be checked for in the poll() function, and then the poll message can be set to explain why.

However, I have doubts that this change is necessary at this point in the code -- this is the PoseAssetUser mix-in class, which is used by various other operators. I thoroughly disagree that all those operators should just silently do nothing when asset is None.

If you need such checks, add them to POSELIB_OT_pose_asset_update_pose's execute() function instead, as a check before calling super().execute(…).

pose_library/pose_creation.py
94–109

This is just a copy-paste of the above function, with one line altered. That's not a nice way to design the code. Better to split up the original function into a part that has the common code, and an extra argument for the function to return dst_action. Also see functools.partial for a way to pass arguments to that function.

Sybren A. Stüvel (sybren) requested changes to this revision.Jun 14 2022, 3:11 PM
This revision now requires changes to proceed.Jun 14 2022, 3:11 PM
Kevin C. Burke (blastframe) edited the summary of this revision. (Show Details)
Kevin C. Burke (blastframe) edited the summary of this revision. (Show Details)
Kevin C. Burke (blastframe) marked 2 inline comments as done.

This update addresses issues raised by @Sybren A. Stüvel (sybren), including the removal of a conditional checking if an asset is None in the PoseAssetUser class and a more efficient usage of the PoseActionCreator class' create method.

Sybren A. Stüvel (sybren) requested changes to this revision.Jul 5 2022, 12:29 PM

Asset Browser Pose Library Panels:

I don't think it's a good idea to have the same operation in two regions of the same editor, even with a different name. The right-hand panel is intended for editing the data, whereas the left-hand panel is intended for using the data. As such, I think the button should only be in the right-hand panel. I'm also not sure why the button would be enabled in one place, but disabled in the other.

As for the preview image, it would indeed be good if the original preview image was maintained. This might be as simple as replacing pose_action.asset_generate_preview() with pose_action.preview.image_pixels = previous_action.preview.image_pixels. Not sure though, maybe @Julian Eisel (Severin) has some insight here?

pose_library/operators.py
386

PoseAssetUser doesn't check whether the pose asset can actually be edited. This will allow the operator to be called even when the pose asset is not in the current file, in which case it cannot be updated. Or, maybe it will work, but then it updates an in-memory copy of the pose, and won't save the changes back to the pose library.

392

This should get a description of what it means. Does this somehow restore the previously-existing selection of bones? Or does it select all the bones that are used in the pose asset? What happens if this is disabled?

396

Don't compare to True unless you want to distinguish between True and other true-ish values.

This revision now requires changes to proceed.Jul 5 2022, 12:29 PM

As for the preview image, it would indeed be good if the original preview image was maintained. This might be as simple as replacing pose_action.asset_generate_preview() with pose_action.preview.image_pixels = previous_action.preview.image_pixels. Not sure though, maybe @Julian Eisel (Severin) has some insight here?

Just briefly checking (so I might be missing things)... It seems that rather than actually updating the pose action, it creates a new one? What happens to parameters modified in the old pose, or custom properties set in the pose or the asset meta-data? AFAICS they would just get lost and everything gets reset to the default state. If the old pose action is kept and properly updated instead, the preview generation can just be skipped to keep the old one.