Is it possible to mask out a string that will be a user password for loggining into an asset server?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
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.