Merge branch 'blender-v2.81-release'
This commit is contained in:
commit
8478a2e674
|
@ -91,6 +91,17 @@ def scene_load(context):
|
|||
preferences = bpy.context.preferences.addons['blenderkit'].preferences
|
||||
preferences.login_attempt = False
|
||||
|
||||
def check_timers_timer():
|
||||
''' checks if all timers are registered regularly. Prevents possible bugs from stopping the addon.'''
|
||||
if not bpy.app.timers.is_registered(search.timer_update):
|
||||
bpy.app.timers.register(search.timer_update)
|
||||
if not bpy.app.timers.is_registered(download.timer_update):
|
||||
bpy.app.timers.register(download.timer_update)
|
||||
if not (bpy.app.timers.is_registered(tasks_queue.queue_worker)):
|
||||
bpy.app.timers.register(tasks_queue.queue_worker)
|
||||
if not bpy.app.timers.is_registered(bg_blender.bg_update):
|
||||
bpy.app.timers.register(bg_blender.bg_update)
|
||||
return 5.0
|
||||
|
||||
licenses = (
|
||||
('royalty_free', 'Royalty Free', 'royalty free commercial license'),
|
||||
|
@ -399,7 +410,19 @@ def update_tags(self, context):
|
|||
if props.tags != ns:
|
||||
props.tags = ns
|
||||
|
||||
def update_free(self, context):
|
||||
if self.is_free == False:
|
||||
self.is_free = True
|
||||
title = "All BlenderKit materials are free"
|
||||
message = "Any material uploaded to BlenderKit is free." \
|
||||
" However, it can still earn money for the author," \
|
||||
" based on our fair share system. " \
|
||||
"Part of subscription is sent to artists based on usage by paying users."
|
||||
|
||||
def draw_message(self, context):
|
||||
ui_panels.label_multiline(self.layout, text=message, icon='NONE', width=-1)
|
||||
|
||||
bpy.context.window_manager.popup_menu(draw_message, title=title, icon='INFO')
|
||||
|
||||
class BlenderKitCommonUploadProps(object):
|
||||
id: StringProperty(
|
||||
|
@ -598,6 +621,10 @@ class BlenderKitMaterialUploadProps(PropertyGroup, BlenderKitCommonUploadProps):
|
|||
description="shaders used in asset, autofilled",
|
||||
default="",
|
||||
)
|
||||
is_free: BoolProperty(name="Free for Everyone",
|
||||
description="You consent you want to release this asset as free for everyone",
|
||||
default=True, update=update_free
|
||||
)
|
||||
|
||||
uv: BoolProperty(name="Needs UV", description="needs an UV set", default=False)
|
||||
# printable_3d : BoolProperty( name = "3d printable", description = "can be 3d printed", default = False)
|
||||
|
@ -1481,10 +1508,15 @@ def register():
|
|||
bkit_oauth.register()
|
||||
tasks_queue.register()
|
||||
|
||||
bpy.app.timers.register(check_timers_timer)
|
||||
|
||||
bpy.app.handlers.load_post.append(scene_load)
|
||||
|
||||
|
||||
def unregister():
|
||||
|
||||
bpy.app.timers.unregister(check_timers_timer)
|
||||
|
||||
ui.unregister_ui()
|
||||
search.unregister_search()
|
||||
asset_inspector.unregister_asset_inspector()
|
||||
|
|
|
@ -237,5 +237,6 @@ def register():
|
|||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(KillBgProcess)
|
||||
bpy.app.timers.unregister(bg_update)
|
||||
if bpy.app.timers.is_registered(bg_update):
|
||||
bpy.app.timers.unregister(bg_update)
|
||||
|
||||
|
|
|
@ -928,4 +928,5 @@ def unregister_download():
|
|||
bpy.utils.unregister_class(BlenderkitKillDownloadOperator)
|
||||
bpy.app.handlers.load_post.remove(scene_load)
|
||||
bpy.app.handlers.save_pre.remove(scene_save)
|
||||
bpy.app.timers.unregister(timer_update)
|
||||
if bpy.app.timers.is_registered(timer_update):
|
||||
bpy.app.timers.unregister(timer_update)
|
||||
|
|
|
@ -50,6 +50,7 @@ def get_bkit_url():
|
|||
url = BLENDERKIT_MAIN
|
||||
return url
|
||||
|
||||
|
||||
def find_in_local(text=''):
|
||||
fs = []
|
||||
for p, d, f in os.walk('.'):
|
||||
|
@ -58,9 +59,11 @@ def find_in_local(text=''):
|
|||
fs.append(file)
|
||||
return fs
|
||||
|
||||
|
||||
def get_api_url():
|
||||
return get_bkit_url() + BLENDERKIT_API
|
||||
|
||||
|
||||
def get_oauth_landing_url():
|
||||
return get_bkit_url() + BLENDERKIT_OAUTH_LANDING_URL
|
||||
|
||||
|
@ -86,7 +89,7 @@ def get_temp_dir(subdir=None):
|
|||
if not os.path.exists(tempdir):
|
||||
os.makedirs(tempdir)
|
||||
if subdir is not None:
|
||||
tempdir = tempdir + os.sep + subdir
|
||||
tempdir = os.path.join(tempdir, subdir)
|
||||
if not os.path.exists(tempdir):
|
||||
os.makedirs(tempdir)
|
||||
return tempdir
|
||||
|
@ -108,7 +111,7 @@ def get_download_dirs(asset_type):
|
|||
|
||||
subdirs = ['brushes', 'textures', 'models', 'scenes', 'materials']
|
||||
for subd in subdirs:
|
||||
subdir = ddir + os.sep + subd
|
||||
subdir = os.path.join(ddir, subd)
|
||||
if not os.path.exists(subdir):
|
||||
os.makedirs(subdir)
|
||||
if subdmapping[asset_type] == subd:
|
||||
|
@ -123,7 +126,7 @@ def get_download_dirs(asset_type):
|
|||
|
||||
subdirs = ['textures', 'models', 'scenes', 'materials'] # brushes get stored only globally.
|
||||
for subd in subdirs:
|
||||
subdir = ddir + os.sep + subd
|
||||
subdir = os.path.join(ddir, subd)
|
||||
if not os.path.exists(subdir):
|
||||
os.makedirs(subdir)
|
||||
if subdmapping[asset_type] == subd:
|
||||
|
|
|
@ -1173,6 +1173,6 @@ def unregister_search():
|
|||
|
||||
for c in classes:
|
||||
bpy.utils.unregister_class(c)
|
||||
|
||||
bpy.app.timers.unregister(timer_update)
|
||||
if bpy.app.timers.is_registered(timer_update):
|
||||
bpy.app.timers.unregister(timer_update)
|
||||
|
||||
|
|
|
@ -29,8 +29,9 @@ if "bpy" in locals():
|
|||
download = importlib.reload(download)
|
||||
bg_blender = importlib.reload(bg_blender)
|
||||
colors = importlib.reload(colors)
|
||||
tasks_queue = importlib.reload(tasks_queue)
|
||||
else:
|
||||
from blenderkit import paths, ratings, utils, search, upload, ui_bgl, download, bg_blender, colors
|
||||
from blenderkit import paths, ratings, utils, search, upload, ui_bgl, download, bg_blender, colors, tasks_queue
|
||||
|
||||
import bpy
|
||||
|
||||
|
@ -1151,6 +1152,8 @@ def update_ui_size(area, region):
|
|||
ui.rating_y = ui.bar_y - ui.bar_height
|
||||
|
||||
|
||||
|
||||
|
||||
class AssetBarOperator(bpy.types.Operator):
|
||||
'''runs search and displays the asset bar at the same time'''
|
||||
bl_idname = "view3d.blenderkit_asset_bar"
|
||||
|
|
|
@ -463,6 +463,8 @@ def draw_panel_material_upload(self, context):
|
|||
layout.prop(props, 'tags')
|
||||
# layout.prop(props,'shaders')#TODO autofill on upload
|
||||
# row = layout.row()
|
||||
layout.prop(props, 'is_free')
|
||||
|
||||
layout.prop(props, 'pbr')
|
||||
layout.prop(props, 'uv')
|
||||
layout.prop(props, 'animated')
|
||||
|
|
|
@ -20,7 +20,7 @@ bl_info = {
|
|||
'location': 'File > Import-Export',
|
||||
'description': 'Import-Export as glTF 2.0',
|
||||
'warning': '',
|
||||
'wiki_url': "https://docs.blender.org/manual/en/latest/addons/io_scene_gltf2.html",
|
||||
'wiki_url': "https://docs.blender.org/manual/en/2.81/addons/import_export/io_scene_gltf2.html",
|
||||
'tracker_url': "https://github.com/KhronosGroup/glTF-Blender-IO/issues/",
|
||||
'support': 'OFFICIAL',
|
||||
'category': 'Import-Export',
|
||||
|
|
Loading…
Reference in New Issue