[Bf-committers] keyboard configuration issues

Martin Poirier theeth at yahoo.com
Thu Aug 19 17:57:19 CEST 2010



--- On Thu, 8/19/10, Campbell Barton <ideasman42 at gmail.com> wrote:

> A simple solution to this is to have a package in cfg so
> scripts/cfg/blender_keyconfig/__init__.py
> scripts/cfg/blender_keyconfig/maya.py, etc
> ...this way only sys.modules["blender_keyconfig"] is added
> and the
> submodules can be added & removed without worrying
> about naming
> collisions.
> 
> But thinking about this I wonder if its a good idea to load
> all key
> configurations on startup at all. Say we have 3-4
> configurations, each
> are fairly big python scripts and run many functions to
> build a
> keyboard layout with operator properties.
> 
> How about use a system similar to our presets, where the
> files in a
> directory are used to fill a menu, and the script runs only
> when
> selected by the user.
> A string can be saved for the active layout and this can
> run automatic
> on startup when set.

If we go for a package, we get conditional load for free (importing a package doesn't import submodules by default).

We could just do dir(blender_keyconfig) to get a list of available configs and import blender_keyconfig.ConfigA to initialize it.

Martin




More information about the Bf-committers mailing list