Hi all,
I'm currently working on a script that allows for space-switching
between objects, and came across some general questions regarding data
persistence.
In short, I have a couple classes I've created that represent parents,
children, etc, and was thinking about how to keep track of some of
this data. In the past, I've used the tried-and-true method of
connecting .message attributes between objects and then checking for
them later. While this works, it's not terribly elegant, and when I
start having a lot
of data I want to keep track of, it becomes cumbersome to inspect all
of those connections.
I was wondering if anyone had experimented with creating file-like
objects from script nodes (or other nodes) that would allow something
like this:
f = ScriptNodeFile("spaceSwitching", "r")
f.write("Some line of text \n.")
f.close()
It would also be very very cool if you could pickle data to this
ScriptNodeFile object!
Obviously, pickling/saving an external file with this data would work,
but I'm almost certain these would be quickly lost in our file
system. I think it would be very handy indeed to be able to store and
recall data to a node within the scene file. Just wondered if anyone
out there had come across anything like this, or had any bright ideas
that might help me with this sort of thing.
Thanks!
--
http://groups.google.com/group/python_inside_maya