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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilém Duha <vilda.novak@gmail.com>2021-05-11 18:47:11 +0300
committerVilém Duha <vilda.novak@gmail.com>2021-05-11 18:47:11 +0300
commit2d689e6b48c43c3bb652da04e8f574ad0241e62a (patch)
tree412c0086490a787f1e028897b104f135c7cadac8
parentbc704993268d31d053a9db0937722d9c949a78ca (diff)
BlenderKit: Fix replace active model button
Dowload operator invoke had no return in some cases
-rw-r--r--blenderkit/autothumb.py2
-rw-r--r--blenderkit/download.py15
-rw-r--r--blenderkit/search.py12
3 files changed, 27 insertions, 2 deletions
diff --git a/blenderkit/autothumb.py b/blenderkit/autothumb.py
index 9be9039e..b7f2a8d0 100644
--- a/blenderkit/autothumb.py
+++ b/blenderkit/autothumb.py
@@ -426,8 +426,6 @@ class ReGenerateThumbnailOperator(bpy.types.Operator):
json_args=args_dict,
wait=False)
return {'FINISHED'}
- start_thumbnailer(self, context)
- return {'FINISHED'}
def invoke(self, context, event):
wm = context.window_manager
diff --git a/blenderkit/download.py b/blenderkit/download.py
index eca35c41..7cffff44 100644
--- a/blenderkit/download.py
+++ b/blenderkit/download.py
@@ -1278,6 +1278,9 @@ class BlenderkitDownloadOperator(bpy.types.Operator):
description="",
default="")
+ # close_window: BoolProperty(name='Close window',
+ # description='Try to close the window below mouse before download',
+ # default=False)
# @classmethod
# def poll(cls, context):
# return bpy.context.window_manager.BlenderKitModelThumbnails is not ''
@@ -1376,6 +1379,9 @@ class BlenderkitDownloadOperator(bpy.types.Operator):
layout.prop(self, 'resolution', expand=True, icon_only=False)
def invoke(self, context, event):
+ # if self.close_window:
+ # context.window.cursor_warp(event.mouse_x-1000, event.mouse_y - 1000);
+
print(self.asset_base_id)
wm = context.window_manager
# only make a pop up in case of switching resolutions
@@ -1393,6 +1399,15 @@ class BlenderkitDownloadOperator(bpy.types.Operator):
self.resolution = 'ORIGINAL'
return wm.invoke_props_dialog(self)
+ # if self.close_window:
+ # time.sleep(0.1)
+ # context.area.tag_redraw()
+ # time.sleep(0.1)
+ #
+ # context.window.cursor_warp(event.mouse_x, event.mouse_y);
+
+ return self.execute(context)
+
def register_download():
bpy.utils.register_class(BlenderkitDownloadOperator)
diff --git a/blenderkit/search.py b/blenderkit/search.py
index 7c02be5a..cd89d3bd 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -1406,6 +1406,11 @@ class SearchOperator(Operator):
options={'SKIP_SAVE'}
)
+ # close_window: BoolProperty(name='Close window',
+ # description='Try to close the window below mouse before download',
+ # default=False)
+
+
tooltip: bpy.props.StringProperty(default='Runs search and displays the asset bar at the same time')
@classmethod
@@ -1429,6 +1434,13 @@ class SearchOperator(Operator):
return {'FINISHED'}
+ # def invoke(self, context, event):
+ # if self.close_window:
+ # context.window.cursor_warp(event.mouse_x, event.mouse_y - 100);
+ # context.area.tag_redraw()
+ #
+ # context.window.cursor_warp(event.mouse_x, event.mouse_y);
+ # return self. execute(context)
class UrlOperator(Operator):
""""""