[Bf-extensions-cvs] [2f9b3836] master: BlenderKit: switch to new validation system, wher mark for validation isn't needed. Further protect for unavailable quotas from the server.

Vilem Duha noreply at git.blender.org
Tue May 28 20:42:29 CEST 2019


Commit: 2f9b3836cc8d437ad5a86a528a76dc64bd1b6033
Author: Vilem Duha
Date:   Tue May 28 15:53:44 2019 +0200
Branches: master
https://developer.blender.org/rBA2f9b3836cc8d437ad5a86a528a76dc64bd1b6033

BlenderKit: switch to new validation system, wher mark for validation isn't needed.
Further protect for unavailable quotas from the server.

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

M	blenderkit/__init__.py
M	blenderkit/search.py
M	blenderkit/ui_panels.py
M	blenderkit/upload.py

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

diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py
index 07062b03..67c76eba 100644
--- a/blenderkit/__init__.py
+++ b/blenderkit/__init__.py
@@ -19,7 +19,7 @@
 bl_info = {
     "name": "BlenderKit Asset Library",
     "author": "Vilem Duha",
-    "version": (1, 0, 23),
+    "version": (1, 0, 24),
     "blender": (2, 80, 0),
     "location": "View3D > Properties > BlenderKit",
     "description": "Online BlenderKit library (materials, models, brushes and more)",
diff --git a/blenderkit/search.py b/blenderkit/search.py
index e95cbee1..81c137f0 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -580,7 +580,7 @@ def write_profile(adata):
         user['sumPrivateAssetFilesSize'] /= (1024 * 1024)
     if user.get('remainingPrivateQuota') is not None:
         user['remainingPrivateQuota'] /= (1024 * 1024)
-        
+
     bpy.context.window_manager['bkit profile'] = adata
 
 
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py
index 552516a4..a0ba9713 100644
--- a/blenderkit/ui_panels.py
+++ b/blenderkit/ui_panels.py
@@ -43,7 +43,7 @@ def label_multiline(layout, text='', icon='NONE', width=-1):
         threshold = int(width / 5.5)
     else:
         threshold = 35
-    maxlines = 3
+    maxlines = 6
     li = 0
     for l in lines:
         while len(l) > threshold:
@@ -128,7 +128,7 @@ def draw_upload_common(layout, props, asset_type, context):
             row = layout.row()
 
             row.prop(props, 'asset_base_id', icon='FILE_TICK')
-        layout.operator("object.blenderkit_mark_for_validation", icon='EXPORT')
+        # layout.operator("object.blenderkit_mark_for_validation", icon='EXPORT')
 
     layout.prop(props, 'category')
     if asset_type == 'MODEL' and props.subcategory != '':  # by now block this for other asset types.
@@ -420,7 +420,9 @@ class VIEW3D_PT_blenderkit_profile(Panel):
                 layout.label(text='Email: %s' % (me['email']))
                 if me.get('sumAssetFilesSize') is not None:  # TODO remove this when production server has these too.
                     layout.label(text='Public assets: %i Mb' % (me['sumAssetFilesSize']))
+                if me.get('sumPrivateAssetFilesSize') is not None:
                     layout.label(text='Private assets: %i Mb' % (me['sumPrivateAssetFilesSize']))
+                if me.get('remainingPrivateQuota') is not None:
                     layout.label(text='Remaining private storage: %i Mb' % (me['remainingPrivateQuota']))
             layout.operator("wm.url_open", text="See my uploads",
                             icon='URL').url = paths.BLENDERKIT_USER_ASSETS
diff --git a/blenderkit/upload.py b/blenderkit/upload.py
index 30e707d9..e3eaae48 100644
--- a/blenderkit/upload.py
+++ b/blenderkit/upload.py
@@ -26,8 +26,9 @@ if "bpy" in locals():
     imp.reload(bg_blender)
     imp.reload(autothumb)
     imp.reload(version_checker)
+    imp.reload(ui_panels)
 else:
-    from blenderkit import asset_inspector, paths, utils, bg_blender, autothumb, version_checker, search
+    from blenderkit import asset_inspector, paths, utils, bg_blender, autothumb, version_checker, search,ui_panels
 
 import tempfile, os, subprocess, json, re
 
@@ -549,6 +550,7 @@ def start_upload(self, context, asset_type, as_new, metadata_only):
     if props.report != '':
         self.report({'ERROR_INVALID_INPUT'}, props.report)
         return {'CANCELLED'}
+
     if as_new:
         props.asset_base_id = ''
         props.id = ''
@@ -723,13 +725,26 @@ class ModelUploadOperator(Operator):
         return result
 
     def draw(self, context):
+        props = utils.get_upload_props()
         layout = self.layout
-        layout.label(text="Really upload as new? ")
-        layout.label(text="Do this only when you create a new asset from an old one.")
-        layout.label(text="For updates of thumbnail or model use reupload.")
 
-    def invoke(self, context, event):
         if self.as_new:
+            layout.label(text="Really upload as new? ")
+            layout.label(text="Do this only when you create a new asset from an old one.")
+            layout.label(text="For updates of thumbnail or model use reupload.")
+
+        if props.is_private == 'PUBLIC':
+            ui_panels.label_multiline(layout, text='Since this version (1.0.24), '
+                                                   'PUBLIC ASSETS ARE VALIDATED AUTOMATICALLY '
+                                                   ' after upload. '
+                                                   'Click Ok to proceed.')
+
+
+
+    def invoke(self, context, event):
+        props = utils.get_upload_props()
+
+        if self.as_new or props.is_private == 'PUBLIC':
             return context.window_manager.invoke_props_dialog(self)
         else:
             return self.execute(context)



More information about the Bf-extensions-cvs mailing list