Sun Position: update translations
[blender-addons.git] / blender_id / README.md
blob8f73fbc7e1bf8e78a2ac862ebd5cbe94291c3d9c
1 Blender ID addon
2 ================
4 This addon allows you to authenticate your Blender with your
5 [Blender ID](https://www.blender.org/id/) account. This authentication
6 can then be used by other addons, such as the
7 [Blender Cloud addon](https://developer.blender.org/diffusion/BCA/)
9 Blender compatibility
10 ---------------------
12 Blender ID add-on version 1.2.0 removed some workarounds necessary for
13 Blender 2.77a. As such, versions 1.1.x are the last versions compatible with
14 Blender 2.77a, and 1.2.0 and newer require at least Blender 2.78.
16 Blender ID add-on version 2.0 is the first to support and require Blender 2.80+.
19 Building & Bundling
20 -------------------
22 * To build the addon, run `python3 setup.py bdist`
23 * To bundle the addon with Blender, run `python3 setup.py bdist bundle --path
24   ../blender-git/blender/release/scripts/addons`.
25 * If you don't want to bundle, you can install the addon from Blender
26   (User Preferences → Addons → Install from file...) by pointing it to
27   `dist/blender_id*.addon.zip`.
30 Using the addon
31 ---------------
33 * Install the addon as described above.
34 * Enable the addon in User Preferences → Addons → System.
35 * Sign up for an account at the
36   [Blender ID site](https://www.blender.org/id/) if you don't have an
37   account yet.
38 * Log in with your Blender ID and password. You only have to do this
39   once.
41 Your password is never saved on your machine, just an access token. It
42 is stored next to your Blender configuration files, in
44 * Linux and similar: `$HOME/.config/blender/{version}/config/blender_id`
45 * MacOS: `$HOME/Library/Application Support/Blender/{version}/config/blender_id`
46 * Windows: `%APPDATA%\Blender Foundation\Blender\{version}\config\blender_id`
48 where `{version}` is the Blender version.
51 Using the addon from another addon
52 ----------------------------------
54 The following functions can be used from other addons to use the Blender
55 ID functionality:
57 **blender_id.get_active_profile()** returns the `BlenderIdProfile` that
58 represents the currently logged in user, or `None` when the user isn't
59 logged in:
61     lang=python
62     class BlenderIdProfile:
63         user_id = '41234'
64         username = 'username@example.com'
65         token = '41344124-auth-token-434134'
68 **blender_id.get_active_user_id()** returns the user ID of the logged
69 in user, or `''` when the user isn't logged in.
71 **blender_id.is_logged_in()** returns `True` if the user is logged
72 in, and `False` otherwise.
75 Here is an example of a simple addon that shows your username in its
76 preferences panel:
78     lang=python,name=demo_blender_id_addon.py
79     # Extend this with your info
80     bl_info = {
81         'name': 'Demo addon using Blender ID',
82         'location': 'Add-on preferences',
83         'category': 'System',
84         'support': 'TESTING',
85     }
87     import bpy
90     class DemoPreferences(bpy.types.AddonPreferences):
91         bl_idname = __name__
93         def draw(self, context):
94             import blender_id
96             profile = blender_id.get_active_profile()
97             if profile:
98                 self.layout.label('You are logged in as %s' % profile.username)
99             else:
100                 self.layout.label('You are not logged in on Blender ID')
103     def register():
104         bpy.utils.register_module(__name__)
107     def unregister():
108         bpy.utils.unregister_module(__name__)
111     if __name__ == '__main__':
112         register()