Read-only Pillar server URL and project_uuid.

These properties have also been removed from the UI. This is to limit the
scope of the addon for the first release, allowing us to test properly.
This commit is contained in:
Sybren A. Stüvel 2016-04-19 11:37:46 +02:00
parent 090a9bc5c6
commit 6be1e4ced9
2 changed files with 22 additions and 15 deletions

View File

@ -19,17 +19,17 @@
# <pep8 compliant> # <pep8 compliant>
bl_info = { bl_info = {
"name": "Blender Cloud Texture Browser", 'name': 'Blender Cloud Texture Browser',
"author": "Sybren A. Stüvel and Francesco Siddi", 'author': 'Sybren A. Stüvel and Francesco Siddi',
"version": (0, 2, 0), 'version': (0, 2, 0),
"blender": (2, 77, 0), 'blender': (2, 77, 0),
"location": "Ctrl+Shift+Alt+A anywhere", 'location': 'Ctrl+Shift+Alt+A anywhere',
"description": "Allows downloading of textures from the Blender Cloud. Requires " 'description': 'Allows downloading of textures from the Blender Cloud. Requires '
"the Blender ID addon.", 'the Blender ID addon and Blender 2.77a or newer.',
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/" 'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/'
"Scripts/System/BlenderCloud", 'Scripts/System/BlenderCloud',
"category": "System", 'category': 'System',
"support": "TESTING" 'support': 'TESTING'
} }
import logging import logging

View File

@ -18,17 +18,21 @@ log = logging.getLogger(__name__)
class BlenderCloudPreferences(AddonPreferences): class BlenderCloudPreferences(AddonPreferences):
bl_idname = ADDON_NAME bl_idname = ADDON_NAME
# The following two properties are read-only to limit the scope of the
# addon and allow for proper testing within this scope.
pillar_server = bpy.props.StringProperty( pillar_server = bpy.props.StringProperty(
name='Blender Cloud Server', name='Blender Cloud Server',
description='URL of the Blender Cloud backend server', description='URL of the Blender Cloud backend server',
default='https://cloudapi.blender.org/' default='https://cloudapi.blender.org/',
get=lambda self: 'https://cloudapi.blender.org/'
) )
# TODO: Move to the Scene properties? # TODO: Move to the Scene properties?
project_uuid = bpy.props.StringProperty( project_uuid = bpy.props.StringProperty(
name='Project UUID', name='Project UUID',
description='UUID of the current Blender Cloud project', description='UUID of the current Blender Cloud project',
default='5703957698377322577be77d' # TODO: change default to something more generic default='5672beecc0261b2005ed1a33',
get=lambda self: '5672beecc0261b2005ed1a33'
) )
local_texture_dir = StringProperty( local_texture_dir = StringProperty(
@ -80,8 +84,11 @@ class BlenderCloudPreferences(AddonPreferences):
# options for Pillar # options for Pillar
sub = layout.column() sub = layout.column()
sub.enabled = blender_id_icon != 'ERROR' sub.enabled = blender_id_icon != 'ERROR'
sub.prop(self, "pillar_server")
sub.prop(self, "project_uuid") # TODO: let users easily pick a project. For now, we just use the
# hard-coded server URL and UUID of the textures project.
# sub.prop(self, "pillar_server")
# sub.prop(self, "project_uuid")
sub.operator("pillar.credentials_update") sub.operator("pillar.credentials_update")