[Bf-committers] BPython API changes since 2.42

Campbell Barton cbarton at metavr.com
Thu Jan 4 03:57:28 CET 2007

Hi, I noticed theres no reference to the python API in the release log.
since a fair bit of works going on heres a list of changes to the API 
since 2.42 (internal changes and bugfixes ommited)


* Python scripts can be added to the UV Image menu - "Image"

* Python scripts can be added to the UV "UVCalculate" menu.

* Blender.Get('icondir') - returns the icon directory.

* Blender.Mathutils (vectors)- Multiplying a 3d vector by a 4x4 matrix, 
now applied the translation component. (resizing the vector to 4d isnt 
needed anymore)

* Blender.Mathutils (vectors) - you can divide a vector by a float again.

* Blender.Mathutils (vectors) - undeprecated vector.negate() method. 
-vector now dosnt modify the vector in place.

* Blender.Mathutils (vectors) - vector.length can be set - it scales the 
vector to the desired length.

* Blender.Mathutils (matrix,vector,euler,quat) - added .copy() methodm 
as an alternative to the existing.

* Blender.Mathutils.RotationMatrix() - now accept values outside 360.

* Blender.Mesh - new faces added from Mesh are now white by default 
(were black)

* Blender.Mesh - mesh data now has a texMesh attribute.

* Blender.Mesh - Added an optional arg to getFromObject to 'render' so 
you can choose to get the mesh displayed in the 3d view or generate one 
with render settings.

* Blender.Mesh - Nested loops with mesh verts, faces, face.verts work as 
expected now, (they used to conflict with each other)

* Blender.Mesh - Added .key .removeAllKeys() and .insertKey()

* Blender.Mesh - Added list like access to face colors col[0] is the 
same as col.r

* Blender.Mesh - made mesh.getFromObject() accept a python object as 
well as the object name.

* Blender.Mesh - Added sharp edge flag access.

* Blender.Mesh - Added edge.key and face.edge_keys to edge and face data.

* Blender.Mesh - allow image of mesh's UV faces to be removed/cleared by 
"del f.image" or "f.image = None.

* Blender.Mesh - New keyword parameters for Mesh.faces.extend() method:
     * ignoreDups: turns off checks for duplicate faces in the input 
list and
       existing mesh faces.  Intended for constructing new meshes where the
       faces are known to be unique.
     * indexList: makes the method return a list of new faces indices's, 
       can be used to index new faces to add other attributes like 
color.  If
       duplicate faces are removed, None is placed in their list slot.
   * allow faces with 2 verts or duplicate
       verts to remain in the input list (although they are still not 
added to the
       mesh) so that indexList option can return None for them.  The 
goal is for all
       faces which are discarded to still be ignored but return None.

* Blender.Mesh - Added multires variables to Mesh data. multires, 
multiresLevelCount, multiresDrawLevel, multiresEdgeLevel, 
multiresPinLevel, multiresRenderLevel (cannot add ore remove multires 
data yet)

* Blender.Mesh - Added access to UV and VCol layers with... 
getColorLayerNames(), getUVLayerNames(), addColorLayer(name), 
addUVLayer(name), removeColorLayer(name), removeUVLayer(name), 
renameColorLayer(name, newname), renameUVLayer(name, newname), and 
attributes activeColorLayer and activeUVLayer.

* Blender.Text3d - Renamed Text3d.Font.New() to Text3d.Font.Load() since 
New was acting like load anyway.

* Blender.Text3d.Font.Get() was just calling Text3d.Font.New(), made it 
get from a name or return a list of all fonts.

* Blender.Text3d.Font (font data) - renamed the 'name' to 'filename' and 
added access to the id name.

* Blender.Sound (sound data) - added setName() and setFilename() and 
made the filename attribute writable.

* Blender.Object (object data) - added a "passIndex", "game_properties" 
and "type" attribute, can be used instead of "getType()"

* Blender.Object (object data) - Added Read only object property to be 
used for the collada exporter ob.parentType and a constant dict 

* Blender.Object (object data) - Added restrictDraw/Select/Render 
attributes set in the outliner.

* Blender.Object (object data) - rbHalfExtents was accidentally named 
wrongly rbShapeBoundType.

* Blender.Object (object data) - Enable/Disable DupFaces from the Python 

* Blender.Object (object data) - Adding ob_arm.makeParentBone([ob1, 
ob2...], bonename), ob.parentbonename is also settable now as long as it 
already has a bone parent.

* Blender.Object (object data) - adding ob.activeMaterial - allows you 
to get/set the active material for an object.

* Blender.Effect (getting particles) - now gets strands as a list of 
vectors and other improvements, see docs for details.

* Blender.Effect (effect attributes) - "disp" and "staticStep" data 
access added.

* Blender lib data - Added a __copy__() method to data types Armature, 
Object, Mesh, Material, Metaball, Lattice, Lamp, Curve, Group, Camera 
and World (still missing from texture, NLA and IPOs) - this returns a 
copy of the data.

* Blender lib data - Added "fakeUser" attribute to data types Armature, 
Object, Mesh, Material, Metaball, Group and Camera.

* Blender lib data - Added comparison function to many python types so 
you can now do == and =!, Effects Armature, Constraint, Curve, Font, 
Group, Image, Ipo, IpoCurve, Key, Lamp, Lattice, Material, Mesh, NLA, 
Object, Pose, Scene, Sound, Text and World.

* Blender lib data - Added IDproperties to most libdata - a way you can 
assign arbitrary properties data to any Blender libdata.

* Blender.Material (material data) - Added access to the materials 
"lightGroup" and "shadAlpha" attribute.

* Blender.Material (material data) - Added tangent_v and tangent space 
modes to python material modes.

* Blender.Material (material data) - Added the flag group_exclusive to 

* Blender.Curve (curve point) - Added access to the curves "radius" 

* Blender.Curve (curve data) -  Add .materials attribute to BPy Curve API.

* Blender.Constraint (new constrants) - added python access to new 
constraints loc/rot/size limit, 6DOF and rigidbody.

* Blender.Camera - added camera.dofDist attribute.

* Blender.Modifiers - Added missing settings to Modifiers 

* Blender.Modifiers - Made it possible to copy modifiers from the python 
API ob1.modifiers = ob2.modifiers

* Blender.Armature - Added tipRadius and headRadius bone attributes.

* Blender.Scene - new iterator type for scene data called "objects" has 
methods .new() .link() and .unlink() and attributes .active, .context 
and .selected see Scene docs for details.

* Blender.Curve - New API for accessing surface data (SurbNurb type)

* Blender.Window.windowTheme - added access to iconTheme and sharp_edge 

* Blender.Window - Added Node space to Window.Types dict.

* Blender.NLA - Adds toggle to Object API for enabling NLA animation 
versus active Action animation. Object.enableNLAOverride=True sets to 
use NLA;  Object.enableNLAOverride=False sets to use active Action;

* Blender.NLA - Adds groupTarget get/setters to the NLA API. Takes an 
object and returns an object. groupTarget tells the animation system 
which object within a dupligroup should be used for NLA. Equivalent to 
filling in the "target" field in the NLA N-key panel.

* Blender.Pose (posebone) - added .sel to pose bones as well as read 
only .parent property.

* Blender.Pose (posebone) - added pose_bone.displayObject for 
getting/setting custom bones.

* Blender.Image - Added img.makeCurrent() and img.has_data so you can 
see if an image contains pixel info.

* Blender.Image - added img.fields, img.fields_odd, img.antialias

*  Blender.Metaballs API Refactor - many changes including...
       * removed get/set in favor of setsetattrs
       * added an element iterator to the metaball data type.
       * now accepts vectors and quat for location dimensions and rotation.

* Blender.Library - Added the option to Blender.Library to 'link' data.

* Blender.Library - Blender.Library now supports loading relative 
libraries. the // at the start of the path mean that the file will be 
loaded relaive to the existing blend files path.

* Blender.Geometry - Added python func 

* Blender.Lattice - Removed lattice.applyDeform()

* Blender.Group - Added group.layers bitfield.

* Blender.Group (group data) - deprecated grp.append() and grp.remove() 
and replaced with .link() and .unlink() to match scene.objcts

* Blender.Draw -  Added Draw.BeginAlign(), Draw.EndAlign() to allow 
python scripts to control button alignment.

* Blender.Draw - added Draw.Normal() for the normal rotating sphere 
button, mostly the same as the ColorPicker in code and syntax.

* Blender.IpoCurve - Added ipoCurve.driverExpression to get and set the 
string for a python expression.

More information about the Bf-committers mailing list