[Bf-committers] Blender's Variable Registry..
Fri, 6 Feb 2004 11:23:37 -0700
I think Like Meino Christian but abstract it to a localized database of
settings for all of blender.
Think Windows Registry, but then imagine the registry in blender, and it
accessible by users, python and programmers of blender. Then make it
so that the registry has levels of access, settable on the programmer's
Variables registered by users are accessible to everyone, variables
registered by python are accessible by everyone.
Variables registered by programmers in the blender code are
accessible by default only to the programmers. Then allow that
to be changed so that python or users can see it and change it.
Imagine in Meino Christian's case, that some of the variables define
errors that are shown in the interface, then imagine being able to define
errors in any language (dutch, german, russian, japanese, english etc.).
This would allow anyone to have the level of error detail they need to
solve problems, for the users it might be "Sorry can't do that" or some
message with some easy to understand buttons or for the programmers it
might be "looks like this failed in mod.c contact firstname.lastname@example.org" .
Then it would also be possible with the code that checks registry values
sets them, to "grep" the source for the setting of registry values.. It
possible if the registry is stored as a simple tree to define some macros
easily access the registry keys, possibly even to verify the type of key,
node = find_node(registry, "PROJECTION");
if (this_key_is_matrix(node)) use_as_2D_projection(node);
The nodes of the registry could be structs, but for every struct there
some code to varify correctness of the struct.. Like "is_matrix()" and
This would also allow python and the users to set complex types like the
for the camera, or things of this sort.. On the fly.. Without requiring the
programmers to get
too involved with the creation of interfaces (which can be a big time
waster if you just want to
add one little thing to blender but make it accessible to users).
It would also be possible to create widgets for some complex registry
if the parameter in the registry was a color, you could offer a button
popup a color requester. And if it was a matrix you could popup a matrix
And so on..