Hy all! I'm really needing some help, I spent really a lot of time with some trivial-looking problems. So if you could please take some time to have a look at my problem, this would be very appreciated!
I'm a complete python beginner, and in order to learn the basics of the blender scripting, I intended to make a simple two-particle system with the particle number 2 being attracted by number 1 (particle 2 tracks particle 1). So here's my code:
from Blender import *
# a simple increment printed in the console for debug purpose
# if the variables are set output some debug info, else set them
# update variables for the next script call
This works in Blender 2.23, and here's an output:
|64 # test
-5.84074544907 # bx
-5.66258335114 # ax
-5.66258335114 # link.loc.x
The first very strange thing is that I have to create two variable triplets (a* and b*), because a* is always the same as link.loc.*. Do you have any explaination for this behavior
Second problem, in Blender 2.25 this doesn't work, here's an output again:
|0 # test never increments
except # never entering the "try:" code
So my try-except stuff doesn't work, because the global variables don't seem to be preseved from one script call to another... But why
Thank you for having read my problem, and if any of you has any idea or suggestion, please help me.
Last edited by diz on Sun Jan 12, 2003 5:19 pm; edited 2 times in total
Ok, but that there *must* be a way to preseve a variable between two script calls. Otherwise this would be a *huge* restriction, because it wouldn't even be possible to transfer a variable between two scripts, two frames, ... Well in fact I hope there is a way of doing it...
Anyway thanks for the tip, actually the only solution I found was to go on working in Blender 2.23.