4
$\begingroup$

Blender 2.78 came with a perhaps overlooked feature with the Blender ID authentication add-on. It's very strait-forward to use as long as you have registered a Blender ID, but I don't see how it can be very useful to third-party developers like the release notes claim.

Blender 2.78 features the official Blender ID add-on, which allows you to be logged-in within Blender so that other (3rd party) add-ons can provide you with a more tailored experience.

enter image description here

I can't find any material about how to incorporate this into a third-party add-on (except for the Blender Cloud add-on which really isn't even third-party).

$\endgroup$
  • 2
    $\begingroup$ The Blender Cloud add-on may not be third-party, but it does use the ID in the same way other add-ons would use it (as far as I am aware). Obviously it's not the same as having detailed instructions on how to use it, but it should serve as an example. Maybe @Sybren can help? $\endgroup$ – Ray Mairlot Dec 24 '16 at 15:07
3
$\begingroup$

The readme file in the blender cloud add-on gives more direction. This page discusses the simple way to use the Blender ID with your own add-on.

Using the addon from another addon The following functions can be used from other addons to use the Blender ID functionality:

blender_id.get_active_profile() returns the BlenderIdProfile that represents the currently logged in user, or None when the user isn't logged in:

class BlenderIdProfile:
    user_id = '41234'
    username = 'username@example.com'
    token = '41344124-auth-token-434134'

blender_id.get_active_user_id() returns the user ID of the logged in user, or '' when the user isn't logged in.

blender_id.is_logged_in() returns True if the user is logged in, and False otherwise.

As is mentioned there, you have access to the user's username (email) and whether or not they are logged in.


This is simply a module that you can import:

import blender_id

# returns True or False
print(blender_id.is_logged_in())

# user's email username
print(blender_id.get_active_profile().username)

Here is a mini demo in Blender's console:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.