[Bf-python] Python API proposals

Campbell Barton ideasman42 at gmail.com
Wed Nov 23 14:22:22 CET 2011


currently blender doesnt really have a way to store global data in a
blend file... data is attached to a scene/screen normally, why do you
need this?

Not what you are asking for but related, IMHO we should have a way to
deal with user preferences for addons (or just any script).

I plan to add at some stage and probably isn't all that hard - just
need to add the ability to have user preference define new property
types like we have now for IDs.

While - bpy.data.global_preferences, could be added, Im not convinced
we need it when we have scene properties and user preferences (albeit
not for py scripts yet).

The difference is that you have to save user preferences explicitly so
the data wont necessarily be available across sessions.

Regarding scenes for settings - that a scene is renamed shouldn't
matter since you deal with the active scene (scenes store tool
settings for example and renaming scenes isnt an issue), so guessing
that your using a scene to store something which you in fact shouldn't
be stored there.

If you want you can always pickle any script runtime data and store in
the blender user dir, and manage on your own.

Interested to know how you intend to use this.

- Campbell

On Thu, Nov 24, 2011 at 12:01 AM, Dima Glibitsky <dima.glib at gmail.com> wrote:
> Hi, yet another proposal:
>
> Some scripts need to store their global settings with .blend file, but
> currently there is no way to do it reliably (properties added to
> WindowManager are not saved, and properties added to Screen can become
> inaccessible if the screen is renamed or deleted).
>
> - It would be a good practice to have data storage specifically for
> this purpose, e.g. bpy.data.global_preferences.
> - Also, it might be useful to have two types of such storage: one
> modifications to which are tracked in Undo history, and one which
> lives outside of Undo.
> - Perhaps it was already requested, but it would be nice if there was
> a tab in UserPreferences, or maybe a separate space type, devoted to
> the addons' preferences (this could lessen the clutter in the main GUI
> by moving rarely used settings to Prefernces).
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



More information about the Bf-python mailing list