diff options
author | Vilém Duha <vilda.novak@gmail.com> | 2019-08-20 11:51:09 +0300 |
---|---|---|
committer | Vilém Duha <vilda.novak@gmail.com> | 2019-08-20 11:51:09 +0300 |
commit | f0d3bf133debc16b4730fda9a54a366cfa2e29b0 (patch) | |
tree | 89e4f3b7e82bd5a3280f4025d01d9c232d91d3b4 /blenderkit/autothumb.py | |
parent | 05ed8f54271de2c6e4a91fdda14c9ac3f95431ab (diff) |
BlenderKit: fix T66833
don't attempt to render thumbnail if file wasn't saved (it would fail on the end.)
Diffstat (limited to 'blenderkit/autothumb.py')
-rw-r--r-- | blenderkit/autothumb.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/blenderkit/autothumb.py b/blenderkit/autothumb.py index 2e5eb710..f9e7c85f 100644 --- a/blenderkit/autothumb.py +++ b/blenderkit/autothumb.py @@ -256,6 +256,7 @@ class GenerateThumbnailOperator(bpy.types.Operator): """Generate Cycles thumbnail for model assets""" bl_idname = "object.blenderkit_generate_thumbnail" bl_label = "BlenderKit Thumbnail Generator" + bl_options = {'REGISTER', 'INTERNAL'} @classmethod def poll(cls, context): @@ -281,6 +282,16 @@ class GenerateThumbnailOperator(bpy.types.Operator): def invoke(self, context, event): wm = context.window_manager + if bpy.data.filepath == '': + title = "Can't render thumbnail" + message = "please save your file first" + + def draw_message(self, context): + self.layout.label(text = message) + + bpy.context.window_manager.popup_menu(draw_message, title=title, icon='INFO') + return {'FINISHED'} + return wm.invoke_props_dialog(self) @@ -288,6 +299,7 @@ class GenerateMaterialThumbnailOperator(bpy.types.Operator): """Tooltip""" bl_idname = "object.blenderkit_material_thumbnail" bl_label = "BlenderKit Material Thumbnail Generator" + bl_options = {'REGISTER', 'INTERNAL'} @classmethod def poll(cls, context): |