Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

Is it possible to mask out a string that will be a user password for loggining into an asset server?

eg.

 password1

shows

 *********
share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

Yes, use the subtype='PASSWORD' for a StringProperty:

bpy.types.Scene.password = bpy.props.StringProperty(subtype='PASSWORD')

You can add it to the Scene tab for a quick test by running:

bpy.types.SCENE_PT_scene.prepend(
    lambda self, context: self.layout.prop(context.scene, "password"))

The property can be read and written like any property, but each character is drawn as an asterix if added to a panel. It is also not shown in tooltip (since 2.70), but it's possible to copy and paste. The main purpose is to hide the password on screen for video recordings, not to protect or encrypt it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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