

In the Python Console, the bpy library is automatically imported and available to use immediately. It contains nine main modules that enable you to control Blender using Python those are bpy.app, bpy.context, bpy.data, bpy.msgbus, bpy.ops, bpy.path, bpy.props, bpy.types, and bpy.utils. The bpy library is what makes all of the magic happen. You’re looking at a new scene with a cube located at an x-y-z coordinate of (0, 0, 0). If you have it open already, create a new Blender file using File > New > General. Of course, there’s plenty more to creative coding with Blender, but that’s all I cover in this short series of tutorials.īefore proceeding, launch Blender (using the command line). I’ll also touch on how to import code from other Python files, as well as using other code editors to write your Blender code.

I’ll review the all-important bpy library using a selection of attributes and methods from the bpy.data module. To combine all of those techniques, you’ll create a wavy pattern of cones-a cool-looking animation that you can convert into a looping GIF.

In this final part, you’ll learn some Blender scripting techniques-like how to address, manipulate, copy, and animate mesh primitives using code.
