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>2019-05-19 16:39:22 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-05-19 16:59:49 +0300
commit90a0e8d0312c29bbbeaaa5b0f6f324f6ecf4c619 (patch)
treea2061fe888da6be267c161bd3c749cd27c78b844 /blenderkit/ui_panels.py
parent7d92fb16c9fc8e4b39c4d63f9da66e3f9e36dbba (diff)
BlenderKit: temporarily hiding OAuth changes, webpages aren't ready yet.
Diffstat (limited to 'blenderkit/ui_panels.py')
-rw-r--r--blenderkit/ui_panels.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py
index 8d732214..d09e83f3 100644
--- a/blenderkit/ui_panels.py
+++ b/blenderkit/ui_panels.py
@@ -393,7 +393,10 @@ class VIEW3D_PT_blenderkit_profile(Panel):
@classmethod
def poll(cls, context):
- return True
+ user_preferences = bpy.context.preferences.addons['blenderkit'].preferences
+ if user_preferences.enable_oauth:
+ return True
+ return False
def draw(self, context):
# draw asset properties here
@@ -574,12 +577,17 @@ class VIEW3D_PT_blenderkit_unified(Panel):
return
if len(user_preferences.api_key) < 20 and user_preferences.asset_counter > 20:
- layout.operator("wm.blenderkit_login", text="Login/ Sign up",
- icon='URL')
- # layout.label(text='Paste your API Key:')
- # layout.prop(user_preferences, 'api_key', text='')
+ if user_preferences.enable_oauth:
+ layout.operator("wm.blenderkit_login", text="Login/ Sign up",
+ icon='URL')
+ else:
+ op = layout.operator("wm.url_open", text="Get your API Key",
+ icon='QUESTION')
+ op.url = paths.BLENDERKIT_SIGNUP_URL
+ layout.label(text='Paste your API Key:')
+ layout.prop(user_preferences, 'api_key', text='')
layout.separator()
- elif bpy.data.filepath == '':
+ if bpy.data.filepath == '':
label_multiline(layout, text="It's better to save the file first.", width=w)
layout.separator()