2.54 r32707: Python (caching?) issues

User-contributed CVS development builds. Please test and give feedback!

Moderators: jesterKing, stiv

Tiberius
Posts: 1
Joined: Tue Oct 26, 2010 1:06 pm

2.54 r32707: Python (caching?) issues

Postby Tiberius » Tue Oct 26, 2010 1:19 pm

Hi everybody,
currently using blender to develop a small game. I'm using blender 2.54 with python 3.1.1 on Ubuntu.
I experience the following weird issue:

It appears like some changed lines of python scripts are not used properly when I change them.

Example:
1) I renamed an object from Sphere.002 to Haptik
2) I changed the python code that operates on it to use objects["Haptik"] instead of objects["Sphere.002"]
...it worked - but only for a while
3) I added a new object to the scene and wrote some more lines of code
4) I tried to launch it again and get the following error:

Python module can't be imported - controller "And4#CONTR#6":
Traceback (most recent call last):
File "/home/*username*/stab/blender/latest.blend/wall1force.py", line 16, in <module>
hapticPosition=hapticScene.objects["Haptik"].position
KeyError: "CList[key]: ''Sphere.002'' key not in list"
Python module can't be imported - controller "Python Script1#CONTR#2":


The python-error does not match the line that causes the error. Before my change this line contained the word Sphere.002 - which leads me to the assumption that it might be some kind of caching issue.
I even tried deleting the .pyc but it did not help.
Any ideas for a workaround for this bug?

Thank you very much

ldo
Posts: 544
Joined: Sun Nov 07, 2010 11:30 pm
Location: Hamilton, New Zealand

Postby ldo » Thu Jan 13, 2011 3:14 am

So you changed your script, but it looks like Blender is still trying to run the old script?

Next to your .py file containing the installed script, there should be a .pyc (compiled Pytnon) file. Check that the .py file is indeed the latest version of the script. Blender should automatically regenerate the .pyc file if the latter is older than the former.


Return to “Testing Builds”

Who is online

Users browsing this forum: No registered users and 0 guests