[Bf-extensions-cvs] [4d1f6028] blender-v3.0-release: BlenderKit: fix appending of brushes

Vilem Duha noreply at git.blender.org
Mon Nov 15 10:23:59 CET 2021


Commit: 4d1f6028884eb6e8dfd9632f060943a480fe30b9
Author: Vilem Duha
Date:   Mon Nov 15 10:19:37 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rBA4d1f6028884eb6e8dfd9632f060943a480fe30b9

BlenderKit: fix appending of brushes

===================================================================

M	blenderkit/asset_bar_op.py
M	blenderkit/download.py

===================================================================

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:



More information about the Bf-extensions-cvs mailing list