Large, constant variables
On 26/03/2013 at 15:58, xxxxxxxx wrote:
In short: I'm wondering right now what's the best way to bring in a massive list of variables that doesn't need to be "reloaded" between frames (just referenced).
In long: I managed to jerry-rig some kind of amateur plugin that will write out particle information from a different 3D application (Houdini, in this case) that can be brought in to C4D. I did it (don't laugh at me) by making an object-sequence-esque string of .txt files that contain each particle's position and alignment vectors.
The dumb thing about it being that every frame python has to open and close a .txt. Putting it all in one .txt was, needless to say, worse, since it has to open it every frame. My ultimate question is: would it be better to/how do I bring in all the information I need (say on frame 0) and store it away on... something... in C4D...? Am I making sense? Should I be taking this in a completely different direction?
Thanks a million for your time and patience with me; please let me know how I can be more clear. When you look at something up close long enough, sometimes it's hard to explain from the beginning.
On 26/03/2013 at 16:03, xxxxxxxx wrote:
It is important to know in what environment you are working. In a Python Tag (not Tag Plugin), you
can use a global variable and read in the file once if the variable was not initialized at the point you
want to read from it. In a Tag Plugin, it can be done the same way, but using an instance attribute.
On 26/03/2013 at 16:28, xxxxxxxx wrote:
Oh my goodness, Niklas, it was that simple. I was thinking in a non-C4D context regarding global variables, so it just never occurred to me.
Thank you so much.