Freestyle integration into Blender

August 23, 2008

A few remarks

Filed under: Update — The dev team @ 9:27 AM

After meeting Ton at SIGGRAPH, elements of further development seem clearer:

  • due to Freestyle’s internal geometric data format and the calculations based on it, there is no easy solution for using Freestyle on strands. I’ll have to study more into detail if a conversion to triangles is possible.
  • strokes will be rendered by Blender’s internal renderer in separate layers, with one style module per Freestyle layer.  Hopefully, this limitation will be eased when the node-based system is in place.
  • a lot of user feedback needs to be gathered about how to ease using and tweaking style modules. Either a front-end to important style modules could be built (therefore having the corresponding parameters configurable in a Blender panel), or style modules could be gathered on a web site and tested on simple scenes (similarly to, made by more “technical” Blender users.

Usability is no doubt a big challenge to make Freestyle accessible to a larger array of users. I would therefore appreciate receiving more feedback on how to improve the current model and propositions.

I am also looking for someone to create a Windows build of my branch. I am wishing to collaborate closely with that person to get it working for all of the Blender users who have requested a Windows version of my GSoC work. I received some code patches during the summer from a couple of you but I am not sure I can use them with my last revision. I wish to incorporate them now. The summer program being over, I think it is important to make sure this type of integration is done to allow a bigger pool of users to test the code. While I am it, I am open to resolving any bug you might encounter using my branch.

Going back to school and settling to a new place these next few days, I cannot work on these issues right away. I should be able to start working on the project again later next week.


August 8, 2008

lib3ds removed

Filed under: Notes, Update — The dev team @ 9:23 AM

As of today, the integration is technically achieved: Freestyle runs natively in Blender without the use of any of its former libraries (Qt, SWIG, lib3ds). There are still remnants of libQGLViewer in the code, but they can considered part of Freestyle. This is great news as you should now be able to compile and test my branch on about every platform that Blender runs on. One thing to note is that only vlak-based shapes are supported. That means that strands or halos cannot be rendered by Freestyle yet (sorry, no BBB rendering this month…). I’ll see with Ton how to support these shape types.

Because I am going to SIGGRAPH tomorrow for a whole week and the Google Summer of Code ends on August 18, this is all that I would have been able to produce this summer. Looking back, I greatly underestimated the amount of work needed to replace SWIG. Removing SWIG and lib3ds took me about 5 weeks altogether, while I had only planned for 2-3 weeks. I also wasted two weeks trying to make renderbuffers work within Blender, which wouldn’t have been useful for the project anyway (strokes are to be rendered by Blender’s internal engine eventually).

I am proud of how far the project has gone but I am not totally satisfied. A lot more needs to be done:

  • a good amount of code needs to be refactored.
  • the last remaining style modules have to be supported.
  • Stéphane’s corrections have to be incorporated.
  • it would great to support a list of style modules, rather than just one.
  • the background paper texture should be removed eventually.
  • removing the need for an environment variable would be appreciated by non-technical users.

I’ll start making these changes today and I’ll continue again starting on August 18. Once I have strokes rendered by the Blender’s internal engine, I’ll continue implementing the original project proposal’s features, which will allow Freestyle to be manipulated and tweaked directly in the compositor via Python nodes.

Finally, due to requests, I have opened up comments on the blog. I won’t be able to monitor it much for a week so I hope it won’t get bogged down by spam…

August 2, 2008

Towards stabilization

Filed under: Other, Update — The dev team @ 8:49 AM

The past two days have been important in stabilizing the SWIG replacement. I have had to face many issues while testing. Style modules with Python shaders would not “hold” the stroke attributes and some valid modules would not show up at all. By carefully studying which data structures needed to be given by reference rather than value and by making sure that the most important methods were available from the Python interpreter, I was able to correct most problems. Here is an example of a tractor model rendered using the latest revision (the style modules are respectively, and

I tested all of the original style modules tonight, comparing the results produced by Blender with the one created by the native Freestyle application:

Style module Status WORKS NOTHING: steerable ViewMap level doesn’t exist NOTHING: steerable ViewMap level doesn’t exist WORKS INCOMPLETE: wrong shape (incorrect getPoint support ?) INCOMPLETE: wrong shape (incorrect getPoint support ?) INCOMPLETE: wrong shape (incorrect getPoint support ?) WORKS WORKS WORKS WORKS NOTHING: GetTimeStampCF is not implemented WORKS NOTHING: TypeError: an integer is required WORKS WORKS WORKS NOTHING: TypeError: an integer is required NOTHING: getFEdge(i1, i2) is not implemented WORKS WORKS NOTHING: can’t select object with id WORKS WORKS WORKS WORKS WORKS INCOMPLETE ? stroke issue NOTHING: GetTimeStampCF is not implemented NOTHING: GetTimeStampCF is not implemented NOTHING: GetTimeStampCF is not implemented INCOMPLETE ? color/stroke issue INCOMPLETE ? color/stroke issue WORKS NOTHING: no warning either WORKS WORKS WORKS WORKS

I consider the system stable enough to work on replacing lib3ds now. Hopefully, the job won’t be as tricky as getting SWIG out was. I’ll keep you all updated on that progress soon.

Create a free website or blog at