As mentioned last week, this week consisted mainly of debugging parts of blender.  As such, I believe that the amount of actual deliverables I produced this week is much less than it has been the first two weeks.  With that being said though, I believe that I have learned more about the blender codebase than the other weeks, by quite a bit.  I also found several tricks for the python API that weren&#39;t documented in the API documentation, which should eventually make the tests much cleaner.<div>



<br></div><div>This week I started working with tests for operators as apposed to directly with data.  The first problem I ran into was the immutability of bpy.context.  I was resorting to hacks to change the context, which only was working some of the time.  Thus, I went to GTest, giving it more time than I had planned on this week (a little over a day), because the C-API calls took in a bContext, rather than having it be implicit.  However, I never managed to get the linking right, any probes I put into the kernel or operators itself would result with many errors, even for functions that seemed to only allocate space, thus I never got a bContext made.</div>


<div><br></div><div>Fortunately ideasman42 pointed out to me that I could pass in a dictionary, and the operators would use that instead of the value in bpy.context.  I haven&#39;t gotten it to work in all of the situations I&#39;ve tried (yet), but many have worked, and it does seem promising.  However, that only solves some of the tests, it still would be valuable to run tests using bpy.context, or some other type of implicit context, for better code coverage.<br>


<div><div><br></div><div>One thing that I really didn&#39;t expect this week, was that most of the bugs I was trying to debug this week, were ones that I found.  I was planning on looking for bugs on <a href="http://projects.blender.org">projects.blender.org</a>, and I did find a few, but when I started building python scripts to test them, I found many more simple problems that  I had to deal with first, which took most of my time.</div>

<div><br></div><div>My plans for next week:  </div><div><br></div><div>My first order of business is to get several operators in bpy.ops.wm (mostly found in the windowmanager folder), working in the python console, and in a script (both when blender has a visible, and no visible window).  Currently, I&#39;m working on bpy.ops.wm.read_homefile(), and I&#39;ve made some progress.  However, the problem is that the bContext that is passed into it has several null elements in the console, which is expected to be non-null for windowmanager operations.  Once I&#39;ve finished that, I will finish my setup.py test, and proceed to use that as my setup method, at which point most of my tests module will become superfluous, and I may take some time dealing with that.  In fact, I could likely get rid of it, with the one exception of me using it&#39;s hashcode function.  I may also read in a pre-built empty file, rather than the default .b.blend file, which could possibly break the tests if the default was changed, which would be very bad.  Finally, as a side project, I&#39;m going to start reading up on how the python API&#39;s documentation is made (I know it&#39;s using sphinx, but I don&#39;t know how it works, yet), and I&#39;ll see what I can do to start helping minddrones with that.</div>

<div><br clear="all">~Leif Andersen<br><br>----------<br>That was easy: <a href="http://www.appbrain.com/app/net.leifandersen.mobile.android.easybutton" target="_blank">http://www.appbrain.com/app/net.leifandersen.mobile.android.easybutton</a><br>




</div></div></div>