[Bf-python] Python API proposals

Dima Glibitsky dima.glib at gmail.com
Sun Oct 9 13:10:52 CEST 2011


Hello,
While developing a script (
http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/3D_interaction/Enhanced_3D_Cursor),
I found out that I have to emulate some Blender functionality via indirect
means. To make things simpler for script developers, I propose the following
extensions to the Blender Python API:

* Make unified access to both predefined and custom TransformOrientations:
** Scene.orientations should return a collection containing both predefined
and custom transform orientations.
** Predefined ones are read-only (cannot be removed or modified), but
otherwise their name and matrix can be accessed.
** No two orientations should have same name (if there is a conflict, one of
the orientations should be automatically renamed, just like other ID blocks
do).

* Introduce a method for creating custom tranform orientations without
having to call bpy.ops.transform.create_orientation()
** For example: Scene.orientations.new(name, [matrix])

* Introduce a method for getting location of current pivot (or, better, any
kind of pivot):
** SpaceView3D.pivot_point_location([pivot_type]) -- returns the location of
the specified pivot point in global coordinates; if pivot_type is not
specified, active pivot point is returned.

* Add a drawing callback that gets called after rendering of common 3D
objects, but before rendering X-Ray objects.
** E.g. 'PRE_XRAY'

* Add a property definition for storing references to ID blocks (Objects,
Materials, etc.):
** E.g. bpy.props.IDBlockProperty(type="", name="", description="",
options={'ANIMATABLE'}, update=None)

dairin0d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20111009/925ab4ba/attachment.html>


More information about the Bf-python mailing list