I’ve been working on a script (with a GUI) where I want to call the directory where the current blend-file is located. So I use this code:
directory =Blender.Draw.Create(Blender.sys.dirname(Blender.sys.expandpath(Blender.Get('filename'))))
So what I basically do is call the location of the filename, convert it from a relative to an absolute path and get the directoryname of it. This will then be the value of directory.
When I print the value of the variable ‘directory’ it shows that it indeed works. However since I’ve included this line in the python code, blender constantly crashes on me. The console doesn’t give me any information on why it crashes, I just get a windows popup with the information that there was an error in the programme I was using and that any unsaved information might have been lost. I’m running windows XP home edition SP2.
So I did a test and started a new blend file (also with a GUI). I wrote some code and everything was fine. However some time after I included this particular line of code Blender started crashing again.
The strange thing is that Blender doesn’t crash at any particular thing I do. For example; at a certain time I opened the blend-file, wrote an extra line of code, ALT-P to run the script, Q to exit the script and it crashed. However when I opened the blend-file again and did exactly the same thing (adding exactly the same code at the same place), it didn’t crash. Sometimes it doesn’t even crash at all.
This might very well be caused by my computer, but I just wanted to know if there are any other people who have experienced the same problem.