Support for drawing flipped preview icons.
Add icon_flip argument to Layout.template_asset_view.
This is a proof of concept patch to support flipping preview images in the UI.
The patch is in response to a request to flip icons for accessing pose libraries which have the option to flip poses.
To avoid storing copies of flipped images, they can be drawn flipped.
To test flipping in the file-selector, this script sets the value:
for area in bpy.context.screen.areas:
if area.type == 'FILE_BROWSER':
area.spaces[0].params.preview_flip = {'X'}Open Topics
- We could use a struct for storing preview preview transformation to avoid having to add more arguments in the future.
- If the intention is only to use this for preview icons, the internal variable name could be changed from icon_flip to preview_icon_flip.
- Currently some icon types (vector icons for example), don't flip but could be supported.
- We could handle this at a different level (flip the preview data after loading for example).