From BlenderWiki
Blender 2.46 Python API Release Notes
Blender
- Added "mipmap" and "compressfile" as an option for Blender.Get/Set
- Blender.SaveUndoState()
- Blender.GetPaths( absolute=0 ) returns a list of files this blend file uses: (libraries, images, sounds, fonts, sequencer movies etc).
Object
- Scriptlinks for ObjectUpdate and ObDataUpdate events, So python scripts can run whenever an object is changed or its data is changed.
- object.matrixParentInverse
- object.dupliFaceScale object.dupliFaceScale
- Added support for python keyframing object layers
- Read access to Track and Up axis attributes for Object.
- Added an optional argument for object.getBoundBox(worldspace) - so you can get localspace boundboxes, this is useful when getting a dipli's boundbox where the objects worldspace matrix has no useful meaning.
Mesh
- mesh.renderColorLayer and mesh.renderUVLayer
- Smooth keyword for new faces: mesh.faces.extend([..., smooth=True)]
- Added a keyword argument for mesh.pointInside(point, selected_only=True)
This means only selected faces are tested when doing the inside/outside test, disabled by default. - mesh.addMultiresLevel()
- mesh.getTangents()
Armature
- LayerMask access for Armatures and Bones and PoseBones
- Enabled setting the pose_bone.poseMatrix, this does not set the matrix directly, only the pose bones loc/size/rot, when dealing with an armature without constraints this works as expected. it uses the same code as Copy Visual Loc/Size/Rot. (Useful for baking animation)
Image
- image.updateDisplay() to update display image from floating point image.
- Python access to high color depth's getPixelHDR & setPixelHDR()
Material
- Added fromDupli and fromOrig MTex boolean setting.
- Access to TEXFACE_ALPHA option.
- gloss settings: glossMir, sampGlossMir, glossTra, sampGlossTra
NLA
Curve
- Made it possible to remove curves from python with "del curve[i"]
- CurNurb.smooth addition.
- knot vector access for SurfNurb
Window
- Window.TestBreak() - True if the user pressed escape.
- Window.ViewLayers() so you can set the layer for each viewport.
- Window.GetPivot() and Window.SetPivot()
- Window.PoseMode() read only check for posemode
Texture
- texture.evaluate can now accept tuples of numbers as well as vectors.
- Added support for texture flags TEX_PRV_ALPHA, TEX_REPEAT_XMIR and TEX_REPEAT_YMIR to tex.flags attribute.
Draw
Geometry
Modifier
Lamp
BGL
Sys
Scene
Scene.Render
- Access to Bake functionality, api access and for automated baking.
- This adds fractional FPS support to blender and should finally
make NTSC work correctly.
NTSC has an FPS of 30.0/1.001 which is approximately 29.97 FPS.
Therefore, it is not enough to simply make frs_sec a float, since you can't represent this accurately enough.
I added a separate variable frs_sec_base and FPS is now. frs_sec / fpsBase - Api access for OpenEXR settings
scene.render.halfFloat, scene.render.zbuf and scene.render.preview - scene.render.touch and scene.render.noOverwrite
- scene.render.getFrameFilename() to get the filename of the image that will be rendered.
- Added the MULTILAYER image type.
PyNodes
- http://wiki.blender.org/index.php/BlenderDev/PyNodes
- http://wiki.blender.org/index.php/BlenderDev/PyNodes/API
PyConstraints
- (no docs for this new api yet)
Scripts Updates and Changes
tree wizard
tree wizard, makes a subsurfed skin from curves. also adds UV's (and soon bones) needs a user interface.
user interface added for 'Tree from curves' tool. renamed Filter to Blur to Filter for #define as well
automatic armature generation follows branch's
Branch's now have weights assigned to the mesh and an armature modifier applied so the bones effect the tree.
tree branch bones can now animate using drivers that reference textures, so animation can be controlled from clouds, noise settings after being created. still need to add user preferences for animation speed and magnitude.
curve2tree - animation settings - speed and magnitude Python api - texture.evaluate can now accept tuples of numbers as well as vectors
saving and loading of settings per tree, also added a way to get unique animation using object locations in drivers
branch cap ends, UV scale options, Automatic update option added. as well as some bugs fixed.
better segment collapsing (check for radius/angle difference) remove vert groups from existing mesh when its being reused
Rewrote the part that converted blenders curves into branches, Was converting into a mesh and then doing location checks, to figure out what the radius should be and then interpolating. this was the slowest part of the script and it made a mesh every time.
Now use blenders bezier interpolation function and calculate points like blender does.
fixed a driver syntax error for the Z axis (typo)
Loop in parents cant happen anymore, better dealing with segments with more then 4 children. print timing stats.
'Twigs' - branch's added to the existing, made from blending existing branches into new ones.
Some user settings for scale, orientation randomness, number of twigs and recursive twigs.
new UV scaling option works better for big/small branches.
Can constrain twigs to only grow in a bounding mesh. And an option to prune twigs that grow out.
An option to lengthen child twigs.
- Automatic alpha blended, textured image joins using material textures and UV layers. Also added some detail options and made it easier to get low poly results.
more twig options
gravity (like particles) follow parent (like gravity but use the parent normal) limit the number of twigs on each branch limit the radius that a twig may be placed on a branch trim the base of branches in a way that better deals with small branches on large branches
initial leaf support (need to use in production, at the moment its really simple)
Option to generate variation's - This modifies the original shape to make a variation on the original.
made twig taper a float rather then a bool, added type conversion when loading settings.
- Improved Fill Twigs, they now join to make a continues skin like other branches.
- Improved dupli-leaf placement - (should be good enough to use for final renders)
- option to face leaves up or down
- random pitch and roll options
- place 2 leaves on a point for denser leaves
- random seed entry so you can get reproducible results
- better weighting for fill twig placement
- curve direction isnt used anymore - just make the small end the last.
initial support for leaves as duplifaces
new twig type that gives more even results - "Fill Twigs" option
Weightpaint Normalize
New options to weightpaint normalize script
- "Armature only" - so when using weight groups for other things only armature groups are affected,
- "Active only" - so you can normalize all weight groups
always use active object (local view was messing up the context)
Weightpaint Invert
Simple weight invert script for the weightpaint menu
DXF Importer
http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D
Updated FLT scripts
Blender FLT I/O scripts have been updated to have more features.In addition several utility scripts/applets have been added to aid in working with FLT databases within Blender.
Documentation can be found here:
http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_flt http://wiki.blender.org/index.php/Scripts/Manual/Export/openflight_flt http://wiki.blender.org/index.php/Scripts/Manual/FLTools
Object Timeoffset follow active
Script to set timeoffset of all selected objects using the animated path of an active object. This means you can have 100's of objects animations run by animating an empty over them, Easy to setup and time a Mexican wave for instance ;)
Save RenderLayers
script to save renderlayers to a file so you can load them in other blend's - useful when applying settings in a pipeline (andy tells me ;) )
blend2renderinfo
Standalone reads a list of scene, start frame, end frame from blend files without having to load them in blender. Scenes must be tagged to render, (old render daemon button) but selecting scenes in the data browser (shoft+f4) sets this also.
Using this script to generate jobs for the renderfarm much faster then loading blender.
this script can run from the command line and will print out the star,end,scene otherwise if its imported it will just have the function read_blend_rend_chunk(path) which returns a list of [(start,end,scene),...]
Import Lightwave Motion
Import lightwave motion to the active object
Milkshape 3D binary importer
milkshape3d model importer, can import a textured model with materials and animation
Cal3d Exporter
Removing cal3d importer, since the soya3d maintain their own and I could not fix a bug in weird bone exporting.
Text Editor Templates
Script templates
- Metaball creation
- Camera script
- Ipo
- PyConstraint
X3D Export
- Added support for exporting dupli objects
- Option to export modifier applied objects
- Option to export quads as tri's







![[]](/skins/blender/open.png)
