@Ted S : I wonder how close this might be to what you were looking for:

https://github.com/dustractor/UserPrefsBaseline

It's something I started but never finished or published and if you think
its in the right ballpark.  I just tested and it still seems to work.

The usage video should give an overview, but for those reading here's my
quick summary:

It is an addon that stores sets of user-preferences and puts them on a
menu.  It has to be re-calibrated with each blender version in order to
pick up api changes because it only stores the delta from the factory
settings.

Anyway, you're welcome to do whatever you want with the code, if that helps.

On Wed, Aug 31, 2016 at 5:00 AM, <[email protected]> wrote:

> Send Bf-python mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.blender.org/mailman/listinfo/bf-python
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Bf-python digest..."
>
>
> Today's Topics:
>
>    1. Preferred way to persist settings? (Ted Schundler)
>    2. Re: Preferred way to persist settings? (Sybren A. St?vel)
>    3. Re: Preferred way to persist settings? (Sybren A. St?vel)
>    4. Re: Preferred way to persist settings? (Domino Marama)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 30 Aug 2016 22:23:44 -0700
> From: Ted Schundler <[email protected]>
> Subject: [Bf-python] Preferred way to persist settings?
> To: Blender Foundation Python list <[email protected]>
> Message-ID:
>         <CAO=DEgf_032JkdF28tRwqDXS07FqorB1eX6Gqv
> [email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> Is there a preferred way to persist settings in Blender?
>
> For example, I'd like the images as planes add-on to let me set defaults,
> since I generally want them shadeless. That's useful for compositing, but
> not as useful in a shaded 3D scene, so the right default depends on the
> user.
>
> I see the Blender ID add-on stores current credentials in a json file. But
> they may have other concerns about users leaking their credentials in
> shared preferences blend files.
>
> I was thinking attaching preferences as a custom property of the current
> scene, and if not found, look for other scenes. But that's a little clunky.
>
> Is there anything that can have custom properties that is global? I can't
> seem to attach custom properties to UserPreferences.
>
> Or is there another way?
>
>
> -Ted
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.blender.org/pipermail/bf-python/
> attachments/20160830/895aad23/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Wed, 31 Aug 2016 09:59:09 +0200
> From: Sybren A. St?vel <[email protected]>
> Subject: Re: [Bf-python] Preferred way to persist settings?
> To: Blender Foundation Python list <[email protected]>
> Cc: Blender Foundation Python list <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> On Tue, Aug 30, 2016 at 10:23:44PM -0700, Ted Schundler wrote:
> > I see the Blender ID add-on stores current credentials in a json
> > file. But they may have other concerns about users leaking their
> > credentials in shared preferences blend files.
>
> The credentials (which I understand to be username/password) aren't
> stored, just an authentication token. Since the Python scripts running
> in Blender have unlimited access to your machine anyway (this
> shouldn't come as a surprise), this one token isn't that much of a
> security issue.
>
> > I was thinking attaching preferences as a custom property of the
> > current scene, and if not found, look for other scenes. But that's a
> > little clunky.
> >
> > Is there anything that can have custom properties that is global? I
> > can't seem to attach custom properties to UserPreferences.
>
> It's all Open Source. Why not alter those add-ons you're interested in
> so that they have the preferences you need?
>
> --
> Sybren A. St?vel
>
> https://cloud.blender.org/
> https://stuvelfoto.nl/
> https://stuvel.eu/
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 819 bytes
> Desc: Digital signature
> Url : http://lists.blender.org/pipermail/bf-python/
> attachments/20160831/97a58f27/attachment-0002.pgp
>
> ------------------------------
>
> Message: 3
> Date: Wed, 31 Aug 2016 09:59:09 +0200
> From: Sybren A. St?vel <[email protected]>
> Subject: Re: [Bf-python] Preferred way to persist settings?
> To: Blender Foundation Python list <[email protected]>
> Cc: Blender Foundation Python list <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> On Tue, Aug 30, 2016 at 10:23:44PM -0700, Ted Schundler wrote:
> > I see the Blender ID add-on stores current credentials in a json
> > file. But they may have other concerns about users leaking their
> > credentials in shared preferences blend files.
>
> The credentials (which I understand to be username/password) aren't
> stored, just an authentication token. Since the Python scripts running
> in Blender have unlimited access to your machine anyway (this
> shouldn't come as a surprise), this one token isn't that much of a
> security issue.
>
> > I was thinking attaching preferences as a custom property of the
> > current scene, and if not found, look for other scenes. But that's a
> > little clunky.
> >
> > Is there anything that can have custom properties that is global? I
> > can't seem to attach custom properties to UserPreferences.
>
> It's all Open Source. Why not alter those add-ons you're interested in
> so that they have the preferences you need?
>
> --
> Sybren A. St?vel
>
> https://cloud.blender.org/
> https://stuvelfoto.nl/
> https://stuvel.eu/
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 819 bytes
> Desc: Digital signature
> Url : http://lists.blender.org/pipermail/bf-python/
> attachments/20160831/97a58f27/attachment-0003.pgp
>
> ------------------------------
>
> Message: 4
> Date: Wed, 31 Aug 2016 09:16:16 +0100
> From: Domino Marama <[email protected]>
> Subject: Re: [Bf-python] Preferred way to persist settings?
> To: Blender Foundation Python list <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> On 31/08/16 06:23, Ted Schundler wrote:
> > Is there a preferred way to persist settings in Blender?
> >
> > I see the Blender ID add-on stores current credentials in a json file.
> > But they may have other concerns about users leaking their credentials
> > in shared preferences blend files.
> Not checked how that addon does it, but my first choice for user
> specific config is to get a path to store it with:
>
> config_path = bpy.utils.user_resource('CONFIG', 'plugin_name')
>
>
> ------------------------------
>
> _______________________________________________
> Bf-python mailing list
> [email protected]
> https://lists.blender.org/mailman/listinfo/bf-python
>
>
> End of Bf-python Digest, Vol 135, Issue 3
> *****************************************
>
_______________________________________________
Bf-python mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-python

Reply via email to