Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
90a0e8d0
Commit
90a0e8d0
authored
6 years ago
by
Vilem Duha
Browse files
Options
Downloads
Patches
Plain Diff
BlenderKit: temporarily hiding OAuth changes, webpages aren't ready yet.
parent
7d92fb16
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
blenderkit/__init__.py
+9
-1
9 additions, 1 deletion
blenderkit/__init__.py
blenderkit/ui_panels.py
+14
-6
14 additions, 6 deletions
blenderkit/ui_panels.py
with
23 additions
and
7 deletions
blenderkit/__init__.py
+
9
−
1
View file @
90a0e8d0
...
...
@@ -1222,6 +1222,8 @@ class BlenderKitAddonPreferences(AddonPreferences):
default_global_dict
=
paths
.
default_global_dict
()
enable_oauth
=
False
api_key
:
StringProperty
(
name
=
"
BlenderKit API Key
"
,
description
=
"
Your blenderkit API Key. Get it from your page on the website
"
,
...
...
@@ -1322,8 +1324,14 @@ class BlenderKitAddonPreferences(AddonPreferences):
layout
=
self
.
layout
if
self
.
api_key
.
strip
()
==
''
:
layout
.
operator
(
"
wm.blenderkit_login
"
,
text
=
"
Login/ Sign up
"
,
if
self
.
enable_oauth
:
layout
.
operator
(
"
wm.blenderkit_login
"
,
text
=
"
Login/ Sign up
"
,
icon
=
'
URL
'
)
else
:
op
=
layout
.
operator
(
"
wm.url_open
"
,
text
=
"
Register online and get your API Key
"
,
icon
=
'
QUESTION
'
)
op
.
url
=
paths
.
BLENDERKIT_SIGNUP_URL
layout
.
prop
(
self
,
"
api_key
"
,
text
=
'
Your API Key
'
)
# layout.label(text='After you paste API Key, categories are downloaded, so blender will freeze for a few seconds.')
layout
.
prop
(
self
,
"
global_dir
"
)
...
...
This diff is collapsed.
Click to expand it.
blenderkit/ui_panels.py
+
14
−
6
View file @
90a0e8d0
...
...
@@ -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
()
el
if
bpy
.
data
.
filepath
==
''
:
if
bpy
.
data
.
filepath
==
''
:
label_multiline
(
layout
,
text
=
"
It
'
s better to save the file first.
"
,
width
=
w
)
layout
.
separator
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment