There often seems to be no rhyme or reason to when it crashes. Sometimes it dies immediately on startup, sometimes runs a little while, so forth, so on.<br><br>I "demodularized" it (i.e., button variables are no longer stored in the module, and ShaderEditorGUI is loadable standalone), and it runs significantly longer before it crashes. As a means of testing, I added in a counter to see how many button objects are created and destroyed on successive calls to Redraw(), and I saw crashes at all number of values from ~200 buttons and above.
<br><br>By no means think that I'm creating 200 buttons on the screen at once :) That would be a bit extreme!<br><br>Bobby<br><br><div><span class="gmail_quote">On 1/22/06, <b class="gmail_sendername">Ken Hughes</b> <<a href="mailto:khughes@pacific.edu">
khughes@pacific.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">OK, I've cut the code in ShaderEditorGUI.py down to 35 lines, completely
<br>eliminating all modules except Blender.Draw, and I can still get the<br>crashs when exiting the script. It is very "twitchy" though; adding or<br>removing some seemingly unrelated code can make the bug disappear.
<br><br>Ken<br><br>Bobby Parker wrote:<br>> The majority of them aren't defined anywhere, it's just placeholder at<br>> the moment. The only ones that currently work are shader_draw,<br>> shader_event, and shader_bevent in the file
ShaderEditorGUI.py<br>><br>> The script callbacks that are being loaded, are imported from<br>> btor.ShaderEditorGUI.<br>><br>> Bobby<br>><br>> On 1/22/06, *Ken Hughes* <<a href="mailto:khughes@pacific.edu">
khughes@pacific.edu</a><br>> <mailto:<a href="mailto:khughes@pacific.edu">khughes@pacific.edu</a>>> wrote:<br>><br>> Bobby Parker wrote:<br>> > Hi,<br>> > I'm developing a script using the Python API, and I think I've
<br>> found a<br>> > nice memory bug.<br>><br>> Ok, I was finally able to get cgkit and aqsis installed, but wasn't able<br>> to follow your instructions for setting up BtoR.py. I did put it in its
<br>> own directory, modified BtoR.py to append that dir to sys.path so<br>> subsequent imports would find the other modules, and ran the script. I<br>> got somewhat different results probably because of this.
<br>><br>> 1) with no reload removed, I get an error on the first script execution<br>> inside the first call to master_gui(), when shader_draw() is called. It<br>> dies in PyObject_Malloc.<br>> 2) if I remove all the reloads except reload(
btor.ShaderEditorGui), I<br>> can run the script, kill with ESC, about 4 times, then get an error in<br>> PyObject_GC_UnTrack() called from PyDict_Clear() in BPY_clear_script().<br>> This is where the script global dict is cleared.
<br>> 3) if I remove all the reloads, everything works<br>> 4) if I just put a "return" in master_gui(), thing work OK for the<br>> scripts in 1) and 2).<br>><br>> So it is related to the script callbacks executing and the reloads.
<br>><br>> BTW, where the heck are the functions in master_gui() defined?<br>><br>> Ken<br><br>_______________________________________________<br>Bf-python mailing list<br><a href="mailto:Bf-python@projects.blender.org">
Bf-python@projects.blender.org</a><br><a href="http://projects.blender.org/mailman/listinfo/bf-python">http://projects.blender.org/mailman/listinfo/bf-python</a><br></blockquote></div><br>