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:
-rw-r--r--blenderkit/ratings.py37
-rw-r--r--blenderkit/resolutions.py4
-rw-r--r--blenderkit/upload.py1
3 files changed, 37 insertions, 5 deletions
diff --git a/blenderkit/ratings.py b/blenderkit/ratings.py
index 66584484..e06b3d49 100644
--- a/blenderkit/ratings.py
+++ b/blenderkit/ratings.py
@@ -293,6 +293,19 @@ def update_ratings_work_hours_ui_1_5(self, context):
# print(float(self.rating_work_hours_ui_1_5))
self.rating_work_hours = float(self.rating_work_hours_ui_1_5)
+def update_ratings_work_hours_ui_1_10(self, context):
+ user_preferences = bpy.context.preferences.addons['blenderkit'].preferences
+ if user_preferences.api_key == '':
+ # ui_panels.draw_not_logged_in(self, message='Please login/signup to rate assets.')
+ # bpy.ops.wm.call_menu(name='OBJECT_MT_blenderkit_login_menu')
+ # return
+ bpy.ops.wm.blenderkit_login('INVOKE_DEFAULT',
+ message='Please login/signup to rate assets. Clicking OK takes you to web login.')
+ # self.rating_work_hours_ui_1_5 = '0'
+ # print('updating 1-5')
+ # print(float(self.rating_work_hours_ui_1_5))
+ self.rating_work_hours = float(self.rating_work_hours_ui_1_10)
+
class FastRateMenu(Operator):
"""Rating of the assets , also directly from the asset bar - without need to download assets"""
@@ -390,6 +403,25 @@ class FastRateMenu(Operator):
options = {'SKIP_SAVE'}
)
+ rating_work_hours_ui_1_10: EnumProperty(name="Work Hours",
+ description="How many hours did this work take?",
+ items=[('0', '0', ''),
+ ('1', '1', ''),
+ ('2', '2', ''),
+ ('3', '3', ''),
+ ('4', '4', ''),
+ ('5', '5', ''),
+ ('6', '6', ''),
+ ('7', '7', ''),
+ ('8', '8', ''),
+ ('9', '9', ''),
+ ('10', '10', '')
+ ],
+ default='0',
+ update=update_ratings_work_hours_ui_1_10,
+ options={'SKIP_SAVE'}
+ )
+
@classmethod
def poll(cls, context):
scene = bpy.context.scene
@@ -426,9 +458,10 @@ class FastRateMenu(Operator):
text=f"\nThat's a lot! please be sure to give such rating only to amazing {self.asset_type}s.\n",
width=500)
+ elif self.asset_type == 'hdr':
+ row = layout.row()
+ row.prop(self, 'rating_work_hours_ui_1_10', expand=True, icon_only=False, emboss=True)
else:
-
-
row = layout.row()
row.prop(self, 'rating_work_hours_ui_1_5', expand=True, icon_only=False, emboss=True)
diff --git a/blenderkit/resolutions.py b/blenderkit/resolutions.py
index f50ff9fe..b2a5e806 100644
--- a/blenderkit/resolutions.py
+++ b/blenderkit/resolutions.py
@@ -261,7 +261,7 @@ def generate_lower_resolutions_hdr(asset_data, fpath):
fn_strip, ext = os.path.splitext(fpath)
ext = '.exr'
if i>0:
- downscale(hdr)
+ image_utils.downscale(hdr)
hdr_resolution_filepath = fn_strip + paths.resolution_suffix[p2res] + ext
@@ -379,7 +379,7 @@ def generate_lower_resolutions(data):
else:
p2res = rkeys[rkeys.index(p2res) - 1]
print('uploading resolution files')
- #upload_resolutions(files, data['asset_data'])
+ upload_resolutions(files, data['asset_data'])
preferences = bpy.context.preferences.addons['blenderkit'].preferences
patch_asset_empty(data['asset_data']['id'], preferences.api_key)
return
diff --git a/blenderkit/upload.py b/blenderkit/upload.py
index b0812efb..284d6359 100644
--- a/blenderkit/upload.py
+++ b/blenderkit/upload.py
@@ -569,7 +569,6 @@ def update_free_full(self, context):
def can_edit_asset(active_index=-1, asset_data=None):
- print(active_index, asset_data)
if active_index < 0 and not asset_data:
return False
profile = bpy.context.window_manager.get('bkit profile')