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:
authorVilem Duha <vilem.duha@gmail.com>2021-09-09 20:22:24 +0300
committerVilem Duha <vilem.duha@gmail.com>2021-09-10 12:52:53 +0300
commitb917c64d9b1a007a96d476e37dcf60c733ffc689 (patch)
tree47a08892dd09600c3408ece7e2a2a7cab0e34bc2
parent32baafe44dc56edd1baf6e5a16b4439ded8238f2 (diff)
BlenderKit: Reflect change in scoring algorithm
fix minor bug when creator fills 0 as texture size in material.
-rw-r--r--blenderkit/ui_panels.py10
-rw-r--r--blenderkit/utils.py5
2 files changed, 10 insertions, 5 deletions
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py
index e2b8d700..25fa5927 100644
--- a/blenderkit/ui_panels.py
+++ b/blenderkit/ui_panels.py
@@ -1836,8 +1836,8 @@ class AssetPopupCard(bpy.types.Operator, ratings_utils.RatingsProperties):
row.emboss = 'NONE'
op = row.operator('wm.blenderkit_tooltip', text=str(s), icon_value=pcoll['trophy'].icon_id)
- op.tooltip = 'Asset score calculated from averaged user ratings. \n\n' \
- 'Score = quality × complexity × 10*\n\n *Happiness multiplier'
+ op.tooltip = 'Asset score calculated from user ratings. \n\n' \
+ 'Score = average quality × median complexity × 10*\n\n *Happiness multiplier'
row.label(text=' ')
tooltip_extension = f'.\n\nRatings results are shown for assets with more than {show_rating_threshold} ratings'
@@ -1847,7 +1847,7 @@ class AssetPopupCard(bpy.types.Operator, ratings_utils.RatingsProperties):
row.label(text=' ')
op = row.operator('wm.blenderkit_tooltip', text=str(c), icon_value=pcoll['dumbbell'].icon_id)
- op.tooltip = f"Complexity, average from {rc['workingHours']} ratings" \
+ op.tooltip = f"Complexity, median from {rc['workingHours']} ratings" \
f"{tooltip_extension if rcount <= show_rating_threshold else ''}"
if rcount <= show_rating_prompt_threshold:
@@ -2029,9 +2029,9 @@ class SetCategoryOperator(bpy.types.Operator):
class ClosePopupButton(bpy.types.Operator):
- """Visit subcategory"""
+ """Close popup window"""
bl_idname = "view3d.close_popup_button"
- bl_label = "BlenderKit close popup"
+ bl_label = "Close popup"
bl_options = {'REGISTER', 'INTERNAL'}
@classmethod
diff --git a/blenderkit/utils.py b/blenderkit/utils.py
index 096688be..42e3d331 100644
--- a/blenderkit/utils.py
+++ b/blenderkit/utils.py
@@ -692,7 +692,12 @@ def automap(target_object=None, target_slot=None, tex_size=1, bg_exception=False
bpy.ops.object.material_slot_select()
scale = (scale.x + scale.y + scale.z) / 3.0
+
+ if tex_size == 0:# prevent division by zero, it's possible to have 0 in tex size by unskilled uploaders
+ tex_size = 1
+
if not just_scale:
+
bpy.ops.uv.cube_project(
cube_size=scale * 2.0 / (tex_size),
correct_aspect=False) # it's * 2.0 because blender can't tell size of a unit cube :)