2025-12-01
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
bl_info = {
|
||||
"name": "BlenderKit Online Asset Library",
|
||||
"author": "Vilem Duha, Petr Dlouhy, A. Gajdosik",
|
||||
"version": (3, 16, 1, 250612), # X.Y.Z.yymmdd
|
||||
"version": (3, 18, 0, 251121), # X.Y.Z.yymmdd
|
||||
"blender": (3, 0, 0),
|
||||
"location": "View3D > Properties > BlenderKit",
|
||||
"description": "Boost your workflow with drag&drop assets from the community driven library.",
|
||||
@@ -28,7 +28,7 @@ bl_info = {
|
||||
"tracker_url": "https://github.com/BlenderKit/blenderkit/issues",
|
||||
"category": "3D View",
|
||||
}
|
||||
VERSION = (3, 16, 1, 250612)
|
||||
VERSION = (3, 18, 0, 251121)
|
||||
|
||||
import logging
|
||||
import random
|
||||
@@ -297,6 +297,11 @@ def asset_type_callback(self, context):
|
||||
6,
|
||||
),
|
||||
]
|
||||
|
||||
# Only add addon option for Blender 4.2+
|
||||
|
||||
if bpy.app.version >= (4, 2, 0):
|
||||
items.append(("ADDON", "Add-ons", "Find add-ons", "PLUGIN", 7))
|
||||
else:
|
||||
items = [
|
||||
("MODEL", "Model", "Upload a model", "OBJECT_DATAMODE", 0),
|
||||
@@ -314,6 +319,11 @@ def asset_type_callback(self, context):
|
||||
),
|
||||
]
|
||||
|
||||
# Only add addon option for Blender 4.2+
|
||||
|
||||
if bpy.app.version >= (4, 2, 0):
|
||||
items.append(("ADDON", "Add-on", "Upload an addon", "PLUGIN", 7))
|
||||
|
||||
return items
|
||||
|
||||
|
||||
@@ -380,6 +390,61 @@ class BlenderKitUIProps(PropertyGroup):
|
||||
max=10,
|
||||
update=search.search_update_delayed,
|
||||
)
|
||||
search_order_by: EnumProperty(
|
||||
name="Order",
|
||||
description="Search result order",
|
||||
items=(
|
||||
(
|
||||
"default",
|
||||
"Default",
|
||||
"By default, the sorting algorithm changes dynamically based on search filters.",
|
||||
),
|
||||
("-created", "Newest", "Sort results from newest to oldest."),
|
||||
("created", "Oldest", "Sort results from oldest to newest."),
|
||||
(
|
||||
"-bookmarks",
|
||||
"▼ Bookmarks",
|
||||
"Sort results from most bookmarked to least.",
|
||||
),
|
||||
(
|
||||
"bookmarks",
|
||||
"▲ Bookmarks",
|
||||
"Sort results from least bookmarked to most.",
|
||||
),
|
||||
(
|
||||
"-score",
|
||||
"▼ Score",
|
||||
"Sort results from highest asset score to the lowest.",
|
||||
),
|
||||
(
|
||||
"score",
|
||||
"▲ Score",
|
||||
"Sort results from lowest asset score to the highest.",
|
||||
),
|
||||
(
|
||||
"-working_hours",
|
||||
"▼ Complexity",
|
||||
"Sort results from most complex to the least.",
|
||||
),
|
||||
(
|
||||
"working_hours",
|
||||
"▲ Complexity",
|
||||
"Sort results from least complex to the most.",
|
||||
),
|
||||
(
|
||||
"-quality",
|
||||
"▼ Quality",
|
||||
"Sort results from highest quality rating to the lowest.",
|
||||
),
|
||||
(
|
||||
"quality",
|
||||
"▲ Quality",
|
||||
"Sort results from lowest quality rating to the highest.",
|
||||
),
|
||||
),
|
||||
default="default",
|
||||
update=search.search_update,
|
||||
)
|
||||
search_license: EnumProperty(
|
||||
name="License",
|
||||
items=(
|
||||
@@ -408,7 +473,7 @@ class BlenderKitUIProps(PropertyGroup):
|
||||
)
|
||||
search_blender_version_max: StringProperty(
|
||||
name="Maximum version (excluding, lower than)",
|
||||
default="4.99",
|
||||
default="5.99",
|
||||
description="Limit the assets by maximum version of Blender in which they were created, exluding the specified version and all newer versions from the search results. "
|
||||
+ "Only assets created in LOWER THAN (< max) maximum version will be shown. Use semantic versioning format: X.Y.Z.\n\n"
|
||||
+ "E.g.: exclude all Blender 4 assets by specifying 4, 4.0, or 4.0.0. Assets created in 3.6 and lower will be shown",
|
||||
@@ -1109,6 +1174,19 @@ class BlenderKitGeoToolSearchProps(PropertyGroup, BlenderKitCommonSearchProps):
|
||||
pass
|
||||
|
||||
|
||||
class BlenderKitAddonSearchProps(PropertyGroup, BlenderKitCommonSearchProps):
|
||||
search_installed: BoolProperty(
|
||||
name="Installed Only",
|
||||
description="Show only addons that are already installed in Blender",
|
||||
default=False,
|
||||
update=lambda self, context: (
|
||||
search.refresh_search()
|
||||
if context.window_manager.blenderkitUI.asset_type == "ADDON"
|
||||
else None
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class BlenderKitHDRUploadProps(PropertyGroup, BlenderKitCommonUploadProps):
|
||||
texture_resolution_max: IntProperty(
|
||||
name="Texture Resolution Max",
|
||||
@@ -1927,7 +2005,11 @@ class BlenderKitAddonPreferences(AddonPreferences):
|
||||
|
||||
api_key: StringProperty(
|
||||
name="BlenderKit API Key",
|
||||
description="Your blenderkit API Key. Get it from your page on the website",
|
||||
description=(
|
||||
"Your unique API key authenticates downloads and requests inside the add-on. "
|
||||
"No manual setup is required, the API Key is auto-filled at login and cleared at logout. "
|
||||
"However, you can also paste the key from your profile settings on the BlenderKit website."
|
||||
),
|
||||
default="",
|
||||
subtype="PASSWORD",
|
||||
update=utils.api_key_property_updated,
|
||||
@@ -1980,6 +2062,13 @@ class BlenderKitAddonPreferences(AddonPreferences):
|
||||
update=utils.save_prefs,
|
||||
)
|
||||
|
||||
sidebar_panels: BoolProperty(
|
||||
name="Hide sidebar panels",
|
||||
description="Hide BlenderKit sidebar panels (search, upload, and selected model functionality). This prevents upload and it's also the only place for import settings. Reenable this to access these features.",
|
||||
default=False,
|
||||
update=utils.save_prefs,
|
||||
)
|
||||
|
||||
header_menu_fold: BoolProperty(
|
||||
name="Header menu fold", default=False, update=ui_panels.update_header_menu_fold
|
||||
)
|
||||
@@ -2209,15 +2298,21 @@ In this case you should also set path to your system CA bundle containing proxy'
|
||||
update=utils.save_prefs,
|
||||
)
|
||||
|
||||
max_assetbar_rows: IntProperty(
|
||||
name="Max Assetbar Rows",
|
||||
description="max rows of assetbar in the 3D view",
|
||||
default=1,
|
||||
min=1,
|
||||
maximized_assetbar_rows: IntProperty(
|
||||
name="Maximized Assetbar Rows",
|
||||
description="Maximum rows of assetbar in the 3D view when expanded",
|
||||
default=4,
|
||||
min=2,
|
||||
max=20,
|
||||
update=utils.save_prefs,
|
||||
)
|
||||
|
||||
assetbar_expanded: BoolProperty(
|
||||
name="Assetbar Expanded",
|
||||
description="Whether the assetbar is currently expanded to show maximum rows",
|
||||
default=False,
|
||||
)
|
||||
|
||||
thumb_size: IntProperty(
|
||||
name="Assetbar Thumbnail Size",
|
||||
default=96,
|
||||
@@ -2329,6 +2424,12 @@ In this case you should also set path to your system CA bundle containing proxy'
|
||||
update=search.search_update,
|
||||
) # In future we can subsets like sexualized, pornography or violence subset. And allow users choose what is part of NSFW.
|
||||
|
||||
temp_enabled_addons: StringProperty(
|
||||
name="Temporarily Enabled Addons",
|
||||
description="JSON string of temporarily enabled addon package IDs that should be disabled on next session",
|
||||
default="[]",
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
if self.api_key.strip() == "":
|
||||
@@ -2362,9 +2463,10 @@ In this case you should also set path to your system CA bundle containing proxy'
|
||||
gui_settings.label(text="GUI settings")
|
||||
gui_settings.prop(self, "show_on_start")
|
||||
gui_settings.prop(self, "thumb_size")
|
||||
gui_settings.prop(self, "max_assetbar_rows")
|
||||
gui_settings.prop(self, "maximized_assetbar_rows")
|
||||
gui_settings.prop(self, "search_field_width")
|
||||
gui_settings.prop(self, "search_in_header")
|
||||
gui_settings.prop(self, "sidebar_panels")
|
||||
gui_settings.prop(self, "show_VIEW3D_MT_blenderkit_model_properties")
|
||||
gui_settings.prop(self, "tips_on_start")
|
||||
gui_settings.prop(self, "announcements_on_start")
|
||||
@@ -2434,6 +2536,7 @@ classes = (
|
||||
BlenderKitBrushUploadProps,
|
||||
BlenderKitGeoToolSearchProps,
|
||||
BlenderKitNodeGroulUploadProps,
|
||||
BlenderKitAddonSearchProps,
|
||||
)
|
||||
|
||||
|
||||
@@ -2500,6 +2603,9 @@ def register():
|
||||
bpy.types.NodeTree.blenderkit = PointerProperty( # for uploads, not now...
|
||||
type=BlenderKitNodeGroulUploadProps
|
||||
)
|
||||
bpy.types.WindowManager.blenderkit_addon = PointerProperty(
|
||||
type=BlenderKitAddonSearchProps
|
||||
)
|
||||
if bpy.app.factory_startup is False:
|
||||
user_preferences = bpy.context.preferences.addons[__package__].preferences
|
||||
global_vars.PREFS = utils.get_preferences_as_dict()
|
||||
|
||||
Reference in New Issue
Block a user