Hello everyone,<br>
<br>
Here is my week 1 report. If you want more details on my development
progress, I try to post updates regularly on my blog:
<a href="http://maximecurioni.com/gsoc2008">http://maximecurioni.com/gsoc2008</a>. If you have remarks or suggestions, please let me know. My latest revision is 15047.<br>
<br>
<br>
a) What you did in the previous week;<br>
<br>
This week, I completed the most important part of the first phase,
creating the first Freestyle-based renders within Blender. Up to last
week, I had only managed to open the 3ds file with lib3ds and hadn't gotten the view map calculations working. The basic execution
process is divided in these few steps:<br>
<br>
1. instantiate the config path, the controller and the view<br>
2. set the controller's view to the instantiated view and set up the view dimensions<br>
3. load a 3ds file<br>
4. insert a style module<br>
5. compute the view map<br>
6. draw the strokes<br>
7. render the image<br>
<br>
The original Freestyle program uses a Qt widget QGLViewer to display
and manipulate 3D objects (step 6 and 7). I found out this week that
the widget's functionality is also needed for the view map calculations
(step 5). I managed to modify QGLViewer's code (which is open source)
to only keep the strict necessary for the job. After a few trials, I
got it working.<br>
<br>
The strokes are rendered using commands in a style module, coded in
Python. Python commands are executed through a class called
PythonInterpreter, that routes calls to Python's C interface
(PyRun_SimpleString and PyErr). Unfortunately, these methods simply
crash, probably due to Blender's Python environment. Instead of
fighting against the system in place, I decided to do some phase 2 work, having
Freestyle use Blender's Python environment directly for its execution. It just worked. That is
going to save me time in the next phase.<br>
<br>
Once the Python commands were sent, I had to make the connection
between Python and Freestyle possible, which is a SWIG wrapper. I
managed to get that working: I compiled the SWIG wrapper as a shared
library, used by the Python runtime. I haven't found a way to generate
that library automatically with scons so right now, the wrapper module
is compiled and linked manually (instructions are in the source/blender/freestyle/SConscript file)<br>
<br>
Once that was working, I corrected a few integration bugs related to
replacing Qt image library with ImBuf and got to a first render. I
thought I would have to play around with the OpenGL context but that
seems to work by itself (but it only works if "Render Display" is set
to "Render Window"). My first render was incomplete (colors were
inverted) but I realized that I had only gone up to step 6. By using
the view's drawing method, the render became now correct (see
<a href="http://maximecurioni.com/gsoc2008/?p=18">http://maximecurioni.com/gsoc2008/?p=18</a> for examples).<br>
<br>
<br>
b) What you plan to do in the following week;<br>
<br>
Right now, the result is limited to a static scene and a static style
module (compiled in code). The next step is removing this fixed information
and rendering the scene model, using the camera information. I will use
Blender's 3ds export capabilities to produce a 3ds file reimported
later into Freestyle. I will also need to set up a Freestyle render
panel to control the different options used by the view.<br>
<br>
Before I do that, I want to make sure my work compiles and runs well on
different platforms. Jean-Luc has tried compiling it and is facing
issues with SWIG. I also had mfoxdogg help me compile it on Linux but
didn't have a chance to finish it. I hope to do that in the next few
days.<br>
<br>
<br>
c) Describe any issues you are having that may require extra attention;<br>
<br>
On my setup, I have no particular issue but I need to make sure that's
also the case for other people. I also have had a crash with a
particular 3ds file during view map calculations. I am not sure whether
it is a problem with Freestyle's algorithm, lib3ds or something else.
Once I get the scene model imported, I'll test it again. Stéphane (one
of the original Freestyle authors) also mentioned that the image aspect
ratio is maybe wrong. I set the view's dimensions to the render window's; I will have to determine whether OpenGL projection
matrices need to be tweaked.<br>
<br>
<br>
d) Let us know whether you feel that you are on schedule, ahead of schedule, or behind schedule\<br>
<br>
So far, I feel I am a little bit ahead of schedule. I had planned to
have my first render by the end of this week-end (the first phase is
due for June 8). Even though that's a good thing, I probably spent more
time than I should have and I am running a bit late in some
of my school work. I will try to get some of it covered this
week-end.<br>
<br>