Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-01-26 17:05:31 +0300
committerJacques Lucke <jacques@blender.org>2022-01-26 17:10:49 +0300
commit12b26d21b001359cb0bd48ed073aee8f314b3455 (patch)
tree614ce1c83ce8f61852fa8f7c120277aaa407921c /release
parent6738ecb64e8b6d0c1f5a79f1e63f468b4138de19 (diff)
Assets: allow creating preview image by rendering active object
For node groups there is no good default preview generation. Nevertheless, t would be useful to generate a preview image for a node group by rendering an object in some cases. This commit adds a new operator that allows updating the preview image for the active asset by rendering the active object. Note, the operator can also be used for other asset types, not just node groups. The operator can be found in a menu right below the refresh-preview button. Currently it is the only operator in that menu. In the future, more operators to create previews may be added. Differential Revision: https://developer.blender.org/D13747
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_filebrowser.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 731a220848e..50005a8f7f0 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -761,6 +761,15 @@ class ASSETBROWSER_PT_metadata_preview(asset_utils.AssetMetaDataPanel, Panel):
col.operator("ed.lib_id_load_custom_preview", icon='FILEBROWSER', text="")
col.separator()
col.operator("ed.lib_id_generate_preview", icon='FILE_REFRESH', text="")
+ col.menu("ASSETBROWSER_MT_metadata_preview_menu", icon='DOWNARROW_HLT', text="")
+
+
+class ASSETBROWSER_MT_metadata_preview_menu(bpy.types.Menu):
+ bl_label = "Preview"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("ed.lib_id_generate_preview_from_object", text="Render Active Object")
class ASSETBROWSER_PT_metadata_tags(asset_utils.AssetMetaDataPanel, Panel):
@@ -840,6 +849,7 @@ classes = (
ASSETBROWSER_MT_view,
ASSETBROWSER_MT_select,
ASSETBROWSER_MT_edit,
+ ASSETBROWSER_MT_metadata_preview_menu,
ASSETBROWSER_PT_metadata,
ASSETBROWSER_PT_metadata_preview,
ASSETBROWSER_PT_metadata_tags,