Me Presenting at Libreplanet

This year at Libreplanet I gave a small talk about Python in Blender. My primary goal behind was to talk about the ways that Blender, by exposing its Python API directly in the interface, there for users to discover, gives a new meaning to ‘free software’ not just in licensing or community (though these things are important) but also in the design of the program itself. How many programs do you know that have an ‘edit source’ button for each interface element?

One of the elements of the talk was a tutorial on how to use Blender’s Python API, and add a new primitive type into the Add Mesh menu. This is made very easy thanks to the template scripts included in Blender, that allow you to create your own with just a few edits, and by the fact that you can grab data from Blender, and pipe it into your script directly.

I’m not sure if the video from the conference will be available from the FSF; they are slowly putting talks up on the FSF mediagoblin site – I’ll post something if it does. In the meantime, I recorded a Python tutorial for just this part:

Going back and recording the tutorial actually made it better than what I presented at the conference. I used the Addon template, instead of the Operator template, which makes it even easier to share the code. Interestingly, during the presentation, I found a bug in the operator template, which I fixed after it was over. The fix is now in Blender 2.77, a nice way in which a presentation about a free software project leads directly to a contribution 😉

Finally, here are my files, slides, etc. for you to follow along:
The Gnu Mesh in .blend format
The finished “add_gnu.py” addon from the tutorial
Slides from LibrePlanet

  1. wow, i was wondering how to do that!, that’s cool!, if i wanted to make that same thing but to add an object with UV’s what would be different about it?

  2. It gets trickier as you need access to UVs. It might be easier to use the bmesh api for it (I haven’t done it, so just guessing here)
    there’s a operator_mesh_uv.py that seems to use bmesh for it. In addition, you’d need to create new UV layers for your new mesh, before you can copy the UVs over – there are some operators, or you could possibly do this with bmesh.

©URCHIN 2015