Simplified Wrapper and Interface Generator (SWIG)

I came across the following website: http://www.swig.org when searching for something completely unrelated to it. It tweaked my interest & I downloaded it. The package is pretty cool and allows rapid generation of Python (among other languages) modules via wrappers.

The question occasionaly comes up on the blender python mailing list: Why didn’t you guys use SWIG to wrap the Blender API?

The short answer is that Blender has no API to wrap, at least not at the moment. It wasn’t designed that way.

The Blender Python scripting interface is more like one of those alien brainsuckers that latches on to Blender’s head and sends alien tentacles into its brain, taking control and making it dance to our twisted desires. BWAHAHAHAHA.

This was merely a suggestion for use when designing plugins that would require C/C++ more than Python itself. There are several free & opensource libraries that are written in C++ and these could be used in Python by wrapping required functionality via SWIG.

I didn’t think of wrapping Blender functions via SWIG. As a matter of fact, I never found any mention of SWIG in these forums or any other.

[Edit] BTW, SWIG eliminates the need to write ugly Python related code for a module and focus on the implementation of the modules functions[/Edit]