Commit b917c64d authored by Vilem Duha's avatar Vilem Duha
Browse files

BlenderKit: Reflect change in scoring algorithm

fix minor bug when creator fills 0 as texture size in material.
parent 32baafe4
...@@ -1836,8 +1836,8 @@ class AssetPopupCard(bpy.types.Operator, ratings_utils.RatingsProperties): ...@@ -1836,8 +1836,8 @@ class AssetPopupCard(bpy.types.Operator, ratings_utils.RatingsProperties):
row.emboss = 'NONE' row.emboss = 'NONE'
op = row.operator('wm.blenderkit_tooltip', text=str(s), icon_value=pcoll['trophy'].icon_id) 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' \ op.tooltip = 'Asset score calculated from user ratings. \n\n' \
'Score = quality × complexity × 10*\n\n *Happiness multiplier' 'Score = average quality × median complexity × 10*\n\n *Happiness multiplier'
row.label(text=' ') row.label(text=' ')
tooltip_extension = f'.\n\nRatings results are shown for assets with more than {show_rating_threshold} ratings' 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): ...@@ -1847,7 +1847,7 @@ class AssetPopupCard(bpy.types.Operator, ratings_utils.RatingsProperties):
row.label(text=' ') row.label(text=' ')
op = row.operator('wm.blenderkit_tooltip', text=str(c), icon_value=pcoll['dumbbell'].icon_id) 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 ''}" f"{tooltip_extension if rcount <= show_rating_threshold else ''}"
if rcount <= show_rating_prompt_threshold: if rcount <= show_rating_prompt_threshold:
...@@ -2029,9 +2029,9 @@ class SetCategoryOperator(bpy.types.Operator): ...@@ -2029,9 +2029,9 @@ class SetCategoryOperator(bpy.types.Operator):
class ClosePopupButton(bpy.types.Operator): class ClosePopupButton(bpy.types.Operator):
"""Visit subcategory""" """Close popup window"""
bl_idname = "view3d.close_popup_button" bl_idname = "view3d.close_popup_button"
bl_label = "BlenderKit close popup" bl_label = "Close popup"
bl_options = {'REGISTER', 'INTERNAL'} bl_options = {'REGISTER', 'INTERNAL'}
@classmethod @classmethod
......
...@@ -692,7 +692,12 @@ def automap(target_object=None, target_slot=None, tex_size=1, bg_exception=False ...@@ -692,7 +692,12 @@ def automap(target_object=None, target_slot=None, tex_size=1, bg_exception=False
bpy.ops.object.material_slot_select() bpy.ops.object.material_slot_select()
scale = (scale.x + scale.y + scale.z) / 3.0 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: if not just_scale:
bpy.ops.uv.cube_project( bpy.ops.uv.cube_project(
cube_size=scale * 2.0 / (tex_size), cube_size=scale * 2.0 / (tex_size),
correct_aspect=False) # it's * 2.0 because blender can't tell size of a unit cube :) correct_aspect=False) # it's * 2.0 because blender can't tell size of a unit cube :)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment