Dev:2.4/Source/Python/2.4x API rewrite/Progress
< Dev:2.4 | Source | Python | 2.4x API rewrite
2010年4月1日 (木) 21:12時点におけるwiki>Terrywallworkによる版
目次
New API Progress Page
This page lists areas to work on in the new API, tasks that are finished are BOLD
Here are a list of things I plan to change. If you would like to change/discuss any of these modifications we can review on the bpython mailing list of after the Sunday meeting. --Ideasman42 14:05, 24 June 2007 (CEST)
(Bold for finished or mostly finished items)
General
- Layers set subtype for scene.layers, object.layers and group.layers
Finished (needs some testing) - Hash to track pyObjects and invalidate when blender removes them.
Working implementation for text and scenes, need to add for objects and groups. - Generate HTML docs from C api doc strings (no maintaining duplicate docs) - (done for Camera and Group)
- Unified material lists... data uses the same materials type - a list type that is kept in sync with blenders materials, textures and colorbands
Finished (needs some testing) - Add a color PyType for material, mesh, lamp colors, colorbands etc.
Colorbands are still not done. - add constants in the bpy module - Ken has added Objects, work in progress for other modules.
- remove Blender module
- move Blender.Types to bpy.types (rewritten)
- use radians rather then degrees the API.
- Re-Arrange the API in a new structure - done, see meeting minutes for details
TimeLine
- Implement dict like access
# Existing Syntax
time_line = scn.timeline
time_line.add (50)
time_line.add (100)
time_line.setName (50, 'first')
time_line.setName (100, 'second')
Has Become
time_line = scn.timeline
time_line[50] = ['first']
time_line[100] = ['second']
time_line[66].append('KeyFrame') # requires a wrapped list for this to work.
Each frame can have any number of keyframes so each frame's value should be a list of strings.
marker names cannot be keys because they are not unique.
Also added...
- del time_line[50]
- len(time_line)
- time_line.keys() # a list of marker names
- time_line.values() # a list of frames
Group
- Make sure its not possible to remove an object while looping through the groups objects
Object
- Move softbody into its own data - ob.softbody.mass
- Move particle deflector settings into their own data - ob.particleDeflect.type
- add access to texture space
- add access to vertex parent indicies.
Lamp
- Use generic functions for getting and setting floats and ints - rather then get/set functions per type
- Add Lamp Constants
- Add Lamp Texture support. (no support in existing API)
Lattice
- Rewrite with new style of syntax.
- Use wrapped vectors to modify lattice locations
- Support lattice deformgroups/weights
- Make sure lattice shapekeys work
Key
- Review weather we need a function to get the key data?
http://members.optusnet.com.au/cjbarton/BPY_API/Key.KeyBlock-class.html#getData
Since the shapykey can be set from the object now and then the data can be read. To write the data you can just edit the data and then run an obdata.update(key='somekey') - I have implemented this for Meshes and it works well and could be added for curves and lattices.
- add a way to remove keyblocks that invalidates the PyObject and others that may point to this keyblock.
Camera
- Remove deprecated code
- Finalize Keyframing (decision pending on keyable types)
Scene
- Make it so object removed from a scene are checked for and dosnt mess up iter's that are alredy running.
- scene.play() does not belong in scene. Moved to Window.Play()
- Make all derived data check the scenes been removed before accessing (render, timeline, radio, sequence)
Scene.RenderData
- rewrite to use getseters rather than functions with optional args.
- Dont crash when moving data from under it
- Use new constants
Scene.TimeLine
- Use Dictionary style access to timeline
- dont crash when the scenes removed from under it
- add a way to select/deselect markers
Text
- refactor Blenders text type to work like a python file object (implement buffer protocol).
Mesh
- Vertex coords, UVs and colors sync up with original data before use, and report when the datas removed.
- make me.faces.selected() that returns a list, into me.faces.selected which is an iter like me.faces that only deals with selected faces. as well as adding me.verts.selected and me.edges.selected
Modifier
- don't use "mod[key] = val" - was (own) bad decision. use getsetattrs instead. --Ideasman42 15:19, 24 June 2007 (CEST)
- investigate list subtypes for dealing with modifiers. (as opposed to the existing iter type)
- investigate subtyping a base modifier PyType, with each modifier being a subtype of this.
- make modifiers point to the object rather then a using a pointer directly. (solve bad pointer issues)
Armature
- Investigate using the ID hash for having only one armature PyObject per Armature (possibly help solve memory issues)
- Investigate not using editmode for armature editing operations.
- Add the Layer/Set subtype for Armature and Bone layers, as well as layerMask
- remove Bone.options use bone getseters for each option.
if Blender.Armature.NO_DEFORM in bone.options:
...becomes...
if bone.deform: - make armature.bones a list rather then a dictionary. (possibly keep boneDict)
- make bone.matrix["ARMATURESPACE"] and bone.matrix["BONESPACE"] into bone.matrixBone and bone.matrixArmature, same for bone.head and bone.tail
World
- refactor world to use getsetters
- add access to Ambient Occlusion settings.
- add color access to ambient, horizon, and zenith
- add access to world textures.
NLA
- remove NLA.CopyAction(), just have action.copy() and action.__copy__()
- remove NLA module, NewAction and GetActions are handled by the bpy.data.actions
- move constants into bpy
- make options from flags into getsetattrs (keep flags still)
NLA Action
- remove methods and make into getsetattrs
Image
- move Blender.Image.Sources constants into bpy.types.Image.Sources
- replace get/setPixel with dict like access to pixeldata - color = image[x,y]
image[x][y] would be more pythonic, however it would require writing an intermediate pytype, and that's too big a hassle for a small syntactical change.
We could avoid having both int and float options by making sure the color bpyType we add has int and float access also.
- remove image.makeCurrent()
- remove Blender.Image.GetCurrent()
---to be continued---