Page MenuHome

Assets: Preview rendering for Action datablocks
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Feb 26 2021, 11:34 AM.

Details

Summary

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.

Diff Detail

Repository
rB Blender

Event Timeline

Sybren A. Stüvel (sybren) requested review of this revision.Feb 26 2021, 11:34 AM
Sybren A. Stüvel (sybren) created this revision.

Looks good code wise.

This revision is now accepted and ready to land.Feb 26 2021, 11:44 AM
  • Add NULL-check to use_solid_render_mode expression
  • Don't crash Blender when there is no scene camera
  • Mention Action name in error message

Now it also looks good code-wise to me :)