RE: [K3d-development] Persistent data in Python
Brought to you by:
barche
From: Shead, T. <ts...@sa...> - 2005-11-28 21:16:07
|
> I'm designing a tool. Perhaps its a paint brush tool, and has=20 > a floating slider or perhaps its much simplier and its just a=20 > dialog box with some settings. >=20 > I want it to remember brush settings, user interface options,=20 > all sorts of other things. All of this stuff is stored in=20 > python in a class I design. >=20 > I'd like it to remember things per object in the scene, or=20 > perhaps I'd like to remember the last settings I used for=20 > next time in the document. >=20 > In Blender/Maya/Max/XSI I'd create a new property (of my new=20 > type, ie type being settings) on the object, or simply on the=20 > scene/document. >=20 > I might also create some functions that other scripts in k3d=20 > might call. Most likely, at startup, a bunch of startup=20 > scripts would run that added functionality to the program.=20 > Scripts running later would call these=20 > functions/objects/variables and would be able to work in a=20 > much richer environment than the application without these scripts. >=20 > Most tools are designed as scripts. A lot of the heavy=20 > lifting is done by the C++ code, and things the application's=20 > authored wrote to be taken advantage of by scripters. But a=20 > lot of the tools and functionality in most packages are=20 > provided by scripts/scripted tools. > The user can't tell what is a script and what is a tool. Not arguing the value of all this, but there are larger obstacles than just persistence here: * There are no hooks to script interactive tools. * We currently have trouble using PyGtk, so you aren't going to be able to create a UI. As I've said before, there are many more pressing issues than scripting. Tim |