Bug with classes in 2.49b? Expert advice needed...

Hello, I am currently trying to port this script (it reads data from the NImate program):


into blender 2.49b…

Here is what I have currently, (change the .zip to a .py)

NImateGEupdate249.zip (5.73 KB)

I am only interested in the GE parts of the script, and so I quickly deleted much of it. Now I have adjusted everything to match the old blender and python syntax (including all the python 2-3 differences)

If I set the last line to run in a loop for 100 times it works great, and I can see that it does everything it should. Unfortunately, when I just tell it to run every frame (always actuator with pulse true) when it runs the “run” method from the class instance created on the GameLogic module, it forgets everything about the global environment. It doesn’t even recognize ‘True’ as a defined variable! Why is this? Calling a class stored on the GameLogic module like this works in Blender 2.62, so why is it acting so strange here? Is this a bug in 2.49b?

Is there a different way I should call it in order to pass global variables to it or something?

I realize this is rather a technical question, but I am keeping my fingers crossed that someone can help…


-Andrew Miller

you want to port to 2.49b ?

i think it is time to move on :slight_smile:

I know… Unfortunately open CV uses python 2.6, and I am hoping to use that concurrently in blender to read in the kinects camera data.

So I have used python 2.6 to compile open cv, and it now works great in blender 2.49b

This script seems like it should work fine in 2.49, I have changed everything and verified it works correctly, the only problem is that the environment is somehow different when it is loaded through a new instance of the script…