Python Scripts and API

There have been a large number of script additions and script updates, as well as API improvements since the last release.

New scripts (partial list)

Some of the additions are:

Autodesk FBX  (Export Menu)
exports mesh objects and their texface textures, multiple uv layers, vertex color layers as well as materials, lights, and cameras. (animation related features are not yet supported).

Cal3D (Export Menu)

This script has been added back in since it is now maintained.

  • Material support
  • Multiple materials per mesh
  • Multiple UV coords per mesh
  • Write new XML cal3d files only (older binary files can no longer be written)
  • Posebones IK's etc are optionally baked and exported.

Torus (Add>Mesh Menu)
Adds a Torus with radius and segment options.

Solid Wireframe (Mesh>Scripts Menu)
This script uses the mesh edges to make a wireframe copy of the model.

Unfolder (Mesh>Scripts)
Excellent mesh unfolder script by Matthew Chadwick.
See celeriac.net/unfolder/

Drop Onto Ground (Object>Scripts Menu)
Drops objects onto terrain, either a group or the active object. using either the Z axis or view axis.

Find By Data Use (Object>Scripts Menu)
Used for finding an object by the data its linked to.

Quake 3 (.map) (Export Menu)
Quake map exporter that  supports cubes as 'brushes', complex meshes face per 'brush' and nurbs surfaces as a quake 'patch' and lamps.

Seams From Islands (UVs>Scripts Menu)
Adds seams at the boundries of existing UV islands.  This is useful when modifying the UV's of existing models.

Lightmap UVPack (UVs>Scripts Menu Menu) - A script for packing uv coordinates witout waisting texture space, it also has the option of creating a new image and UVLayer per selected model. This is useful when baking lightmaps.

Selection to DupliGroug (Object>Scripts Menu) - creates a dupliGroup from a set of selected objects. Then, when you move/rotate/resize on of the objects of the Group, the whole group is moved/rotates/resized along.

Updated Scripts

A number of scripts were updated and improved this release cycle,

Unwrap (smart Projections) (
UVCalculation Menu)

  •  Added option 'Init from View', so you can use the view axis for the first projection vector.
  • Box packing function was rewritten in C.

xfig export (.fig) (Export Menu)

  • Use popup interface wither then using a window.
  • Use all meshes rather then just the active mesh.
  • Use edges rather then faces to write lines.
  • Use objects transformation and derived data such as particles and dupli objects.


Unweld (
Mesh>Scripts Menu)
 - Dont allow on multires mesh
 - Warn that it will destroy multi UVs
 - Fixed some errors.

Motion Capture (.bvh) (Import Menu)
Bone offset was incorrectly calculated relative to the parent bone.

3D Studio (.3ds) (
Export Menu)
fixed errors related to 3ds files not openning in other applications because of the 12 character limit of names and filenames in 3ds files.  Also was optimized.

Lightwave (.lwo) (
Import Menu)

  • Improved compatibility
  • Changed model orientation to match Blenders on import


SVG (Import>Paths Menu)

  • Added units managements
  • Correction of the rotate matrix
  • Correction of the skew matrix
  • Correction of an error in the scale transform management
  • Correction (bad) on handle management with V and H commands.
  • Now the new object curve is added in the current layer.
  • When a svg file contains several curves they can be imported in separate object.
  • Management of paths name when paths are imported as separate curves.
  • A menu was added to select between separate or joined curves
  • Management of svg colors as materials.
  • Corrected a scale problem that only appears when one uses beveldepth in separate curve option, name is also given to the curve data.
  • Use as list of svg's color names (147) and modified the color's method to work with.
  • Correction of a zero division error in the calc_arc function.

AC3D (Export Menu)
Updated ac3d exporter to use first material found in the mesh for loose edges (lines) color.

AC3D (Import Menu)

  • Updated ac3d importer to be even more forgiving to bad data.
  • Added option to turn transparency on in the 3D View for models using materials with alpha < 1.0.
  • Added optional support for ac3d's subdiv tag, works by adding a subsurf modifier to the imported model(s) that have this tag, so they appear as intended.

Cleanup Meshes (Mesh>Scripts Menu)
added an option to remove all white vcol layers. this is useful when loading old blend files where every  UV mapped mesh has vcolor's even if they are all white (because of how texface used to be stored before vcol layers)

Object and Mesh Script Templates
(access from the text window: File, Script Templates)

Moved Mesh>Bridge/Loft/Skin, into the FKey menu for quicker access.  Now you can select 2 edge loops, press FKey, and skin them.

API Changes

Misc API related changes

  • Python access has been removed from the OOPS data.
  • Python slots were added to the Add>Mesh, Add>Armature, FKEY face menu and a new Submenu called 'Script Templates' added to the text file menu, so that custom scripts can be added at those locations.
  • Nested folders now work for scripts.
  • Blender version is now a float since we have a sub version.
  • Consistency between modules has been improved with more getsetters available and common access methods being implemented.
  • All libdata has been made hashable
  • All libdata now has the following attributes 'name', 'users', 'fakeUser', 'properties', 'tag', and 'lib', where lib is the filename of the library these models are stored in, or None for local models.

Per module changes

Object

  • ob.action can now be set (was previously read only)
  • Added a constant dictionary "Blender.Object.IpoKeyTypes" to pass to ob.insertIpoKey(keytype), previously these constants were not well documented.

Mesh

  • All new data (faces, edges, verts) is selected.
  • Added a keyword argument to mesh.transform() - "selected_only"

Camera

  • Camera.c - added a veriable .angle to camera, same as .lens but adjusts the camera angle in degrees (like the D button)

Mathutils

  • Added PointInTriangle2D

Registry

  • SetKey() had a limit of 60 that would keep counting up every time you used SetKey() until it would always be 60 and nothing would save.

Library

  • Appending after linking will no longer make all existing datablocks local.

Draw

  • Draw.Label can be used to draw user theme fonts
  • UIBlock is a new way of adding a popup user interface that you can add your own buttons to.
  • Buttons can have their own callback functions.

PyDrivers

Adding name "self" to the pydriver's dictionary, so that objects can

be easily referenced in their own expressions. For example, the expression: self.LocY for the LocY channel of an object would force this object's location in Y to be equal to its location in Y.