Sunday, August 23, 2009

Release of Data Origami Library 0.006

The Data Origami Library for Blender 2.49a has been updated. This library's goal is to reduce the number of lines of python required to generate a useful image, animation, or game in Blender.

In this release, the image class now supports the following methods:

  • Orienting the camera by using a lookAt and lookFrom location
  • Adding Blocks defined by opposing corners
  • Adding Cylinders defined by end locations
  • Adding Spheres
  • Adding Text boxes
  • Adding Lighting which can be aimed at a target
  • Adding Tubes which can be used to draw arbitrary curves from either piecewise lines or smooth curves.

The library can be downloaded here. To install, simply unzip to a working directory and execute the test scripts from the Blender command line.

The images above were generated by the test scripts contained in the zip files.

This example shows how the library can be used to generate an image with just a few lines of python.

# setup to allow the module to be imported from the same directory
#   the script is in
import sys
import os
filename = sys.argv[2]
filepath = os.path.dirname(filename)
import OLib as MyLib

import Blender
import Blender.Mathutils
from Blender.Mathutils import *
from Blender import *

image = MyLib.Image('MyScene')

ob = image.addPolyline()

To copy the code snippets easily, see:

To execute the script in Blender, see:

To work with the script in a simple IDE, see:

No comments:

Post a Comment