Assets: Preview rendering for Action datablocks

Render previews for Action datablocks by rendering the scene camera with
the Workbench (solid) engine. The //look// can be configured by setting
the scene's render engine to Workbench and editing the scene's shading
properties.

It is assumed that the pose has already been applied and that the scene
camera is capturing the pose. In other words, the render function just
renders from the scene camera without evaluating/applying the Action
stored in `preview->id`. The ID is only used to determine its type and
to store the resulting preview.

Not all code paths that lead to the `action_preview_render()` function
actually provide a depsgraph. The "Refresh Asset Preview" button
(`ED_OT_lib_id_generate_preview`) does, but `WM_OT_previews_ensure` does
not.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10543
This commit is contained in:
2021-02-26 12:44:08 +01:00
parent e1a541c689
commit 17534e28ff
3 changed files with 90 additions and 11 deletions

View File

@@ -92,6 +92,7 @@ void ED_preview_shader_job(const struct bContext *C,
int sizey,
int method);
void ED_preview_icon_render(struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct ID *id,
unsigned int *rect,