owned this note
owned this note
Published
Linked with GitHub
---
tags: Assets, Pose Library, Asset Browser, Animation
---
# Pose Library Plan of Attack
This is a **draft** document. The intention is to expand this document to describe the work & design for the [Asset Browser & Pose Library project](https://developer.blender.org/project/profile/126/), then move the contents of this file into tasks on developer.blender.org.
## Pose Creation
### Panel in Dopesheet Editor
This panel is used for **creating a new Pose in the current blend file**.
It is intentionally basic in its functionality.
- It copies the Action data
- of the currently selected pose bones
- as defined by keys on the current frame
- to the first frame of a new Action that is marked as Asset.
Panel content:
- "Create Pose Asset" button
The actions it will perform:
- Create the Action datablock,
- copy animation data into it as defined above,
- mark it as Asset.
This button (or the entire panel) should be disabled when the current Action is already marked as Asset.
**Dispute**: location of this panel; could be moved into the viewport as well. More directly available, but less clear which channels go into the Pose. It is likely that there are two viewports: one for the camera & preview rendering, and one for animating.
### Refresh Asset Browser After Pose Creation
After creating the pose per the "Create Pose Asset" button described above:
- Send notifiers so that the Asset Browser refreshes,
- scroll the just-created Asset into view, and
- select the Asset so that it can be further edited by the user.
**Dispute:** Blender shouldn't automatically change the UI for you. It could be possible to do the above upon dragging something from the Action editor into the Asset Browser. This drag & drop could perform the same actions as the "Create Pose Asset" button, and then scroll the dropped asset into view.
### Provide Info Before Creating Pose
Add properties to the above operator, and show a popup with them to provide Asset metadata before creating the Asset:
- Pose Name
- Tags
These will then also be used by the redo panel, making it possible to press F9 and edit the just-created Asset.
**Dispute:** This is hard to implement well beyond just providing the pose name. It may be better to have some fields that are always in view, which can be used to provide name & tags for new poses. This could then be extended by showing an "Update Pose" button when a pose with that name already exists.
### Preview Support
Make it possible to attach a preview image to Pose assets, i.e. to Action datablocks.
- Extend the `bAction` struct with a `preview` pointer,
- extend `BKE_previewimg_id_get_p()` in `icons.cc` to handle the pointer, and
- test & implement what else is necessary to make it possible to manually select a preview image in the Asset Browser.
### Automatic Preview Rendering
Render a preview with the current scene camera. This makes it possible to set specific render options for preview generation.
- Find the Scene's Camera,
- render a frame at a suitable resolution,
- crop it square, and
- assign it as the selected Action's preview image.
These actions should be performed when the "Refresh Preview" button is pressed in the Asset Browser sidebar.
**Dispute**: Using the scene camera is nice when there is a separate pose library blend file, which can be set up specifically for rendering thumbnails. Taking a screenshot of the viewport will work in simpler cases as well.
### Automatic Preview Attachment
When creating the pose per the "Create Pose Asset" button:
- render a preview as described above, and
- assign it to the just-created pose datablock, before refreshing the Asset Browser.
### Copy Pose from Shot File to Pose Library
Goal: make it easy to convert a pose in a shot/animation file into a Pose in the Pose Library.
Create an operator "Copy Pose as Asset", similar to "Create Pose Asset", which:
- creates an Action asset datablock in exactly the same way,
- saves that datablock in a temporary blend file, and places some information about this blend file on the clipboard (or even the blend file itself),
- removes the datablock from the current blend file's main database (if storage there was necessary to begin with).
Note that this operator should not set an "undo" step, and ideally wouldn't even mark the currently open file as dirty.
Create an operator "Paste Asset" in the Asset Browser, which:
- loads the above-saved temporary blend file,
- appends any datablocks in it to the current blend file's main database,
- refreshes the Asset Browser, and
- deselects all assets, then selects the just-loaded Assets. This selection change is consistent with the behaviour of other importers.
## Pose Updates
### Update Pose in Current File
This workflow should be made possible:
- Open the blend file that contains the Pose to update,
- select the Pose in the Asset Browser,
- apply the pose to the rig,
- update and key the rig,
- press an "Update Pose" button to update the Pose datablock, and
- save the blend file.
This means adding an "Update Pose" button in the Asset Browser's right-hand panel, as that's the only place that has a concept of "currently selected Pose asset". Clicking the button:
- removes all existing keyframes from the Action, and
- copies new keyframes into the action, the same way the "Create Pose" button would.
This means "Update Pose" **only** updates the pose itself, and leaves all Asset metadata as-is.
### Update Pose in Current File by Copying from Shot File
This matches the *Copy Pose from Shot File to Pose Library* flow described above, except it updates an existing Asset rather than creating a new one.
Create an operator "Paste To Asset", which:
- is only enabled when an existing Asset is selected, that resides in the current blend file,
- loads the temporary blend file that was saved when "Copy as Asset" was clicked,
- performs the same routine as described in "Update Pose in Current File", except that the current bone selection is ignored and all keys from the Action are copied.
### Open Asset-containing Blend File
Right-clicking on an Asset in the Asset Browser should present a context menu with an operator "Open Containing Blend File". The operator should:
- Start a new Blender process,
- open the blend file that contains the selected asset.
### Select Asset When Opening Blend File
When using "Open Containing Blend File" as described above, it would be nice if the Asset Browser automatically selects the Asset of interest.
**This is a debatable feature**, because:
- Blender currently never auto-selects things for the user.
- There is no guarantee the opened blend file has a single Asset Browser editor visible, so in theory this feature could be useless (no Asset Browser) or require guesswork (multiple Asset Browsers).
## Filtering with Category-Enriched Tags
### Show Tags
Add a Tags panel to the left-hand sidebar of the Asset Browser.
It should show all tags of all visible assets.
**Dispute**: could become unwieldy.
### Filter by Tags
Tags should be selectable, allowing multi-selection. If any tags are selected, only those Assets that have ALL selected tags should be shown.
The panel should show all tags of those assets that would be visible if tag filtering wouldn't exist.
**Dispute**: Could become unwieldy. Alternative is to have explicit "Add Filter" button after tag selection. This would apply the filtering based on the selected tags, then reduce the shown tags to only those on the still-shown Assets.
### Group Tags by Category
- Tags in the form `category:subtag` should be grouped together.
- This group should have a header indicating the category.
- The tags should use only the subtag as a label.
### Filtering by Category-Enriched Tags
This filtering system should support queries like "Hand-poses only, suitable for Rex and Victoria", or "Poses for Rex only, but both Face and Hand poses".
Update the filtering such that:
- All selected subtags of the same category form an "OR" clause, and
- all such clauses are "AND"-ed together with eachother and with regular tags.
## Other interesting stuff
### Future idea: create tags from bonegroups
### Pose Editor as special mode of Dopesheet Editor