I am needing to save addee varibles to object for my physics script… like velocity, acceration, mass force, etc… becuase each time the script is ran the varibles get reset… Is there anyways to save them in blender or would I need to write an IO stream for saveing the data to a text file?
There are two ways of doing this, the official current method would be to use this in your script:
import Blender
Blender.ReleaseGlobalDict(0)
or a hack is to use the game engine method, hide it in the Blender module itself:
import Blender
Blender.variable_name = value
Both of these method work perfectly until there’s a runtime error. Whenever there’s an error, the Blender module is reseted, so in the first case, you loose the setting, and in the second, you loose your variables.
A really safe way to do it would be combining one of those methods with saving the varaibles in an external file (either a text base file or using pickling or whatever method you want).
Martin
Hi
The method that I use is to create a new text script in blender then I read and write my values to it. The benifit of this is that the values are stored with the blend file when you save or load.
Chris