diff options
author | Vilem Duha <vilem.duha@gmail.com> | 2021-11-15 12:19:37 +0300 |
---|---|---|
committer | Vilem Duha <vilem.duha@gmail.com> | 2021-11-15 12:19:47 +0300 |
commit | 4d1f6028884eb6e8dfd9632f060943a480fe30b9 (patch) | |
tree | 7d182d5c6607820c41bd7bfae197d54614bbbbcc | |
parent | a0d1647839180388805be150794a812c44e59053 (diff) |
BlenderKit: fix appending of brushes
-rw-r--r-- | blenderkit/asset_bar_op.py | 9 | ||||
-rw-r--r-- | blenderkit/download.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/blenderkit/asset_bar_op.py b/blenderkit/asset_bar_op.py index 710d7151..4ad15285 100644 --- a/blenderkit/asset_bar_op.py +++ b/blenderkit/asset_bar_op.py @@ -108,6 +108,15 @@ def modal_inside(self, context, event): self.update_ui_size(context) self.update_layout(context, event) + # this was here to check if sculpt stroke is running, but obviously that didn't help, + # since the RELEASE event is cought by operator and thus there is no way to detect a stroke has ended... + if bpy.context.mode in ('SCULPT', 'PAINT_TEXTURE'): + if event.type == 'MOUSEMOVE': # ASSUME THAT SCULPT OPERATOR ACTUALLY STEALS THESE EVENTS, + # SO WHEN THERE ARE SOME WE CAN APPEND BRUSH... + bpy.context.window_manager['appendable'] = True + if event.type == 'LEFTMOUSE': + if event.value == 'PRESS': + bpy.context.window_manager['appendable'] = False return {"PASS_THROUGH"} diff --git a/blenderkit/download.py b/blenderkit/download.py index d6feae13..7fda06a2 100644 --- a/blenderkit/download.py +++ b/blenderkit/download.py @@ -302,7 +302,6 @@ def append_asset(asset_data, **kwargs): # downloaders=[], location=None, ''' - file_names = paths.get_download_filepaths(asset_data, kwargs['resolution']) props = None ##### @@ -439,7 +438,6 @@ def append_asset(asset_data, **kwargs): # downloaders=[], location=None, lib['asset_data'] = asset_data elif asset_data['assetType'] == 'brush': - # TODO if already in scene, should avoid reappending. inscene = False for b in bpy.data.brushes: |