[Bf-python] sceen objects and object creation

Campbell Barton cbarton at metavr.com
Tue Aug 22 17:56:29 CEST 2006


Hi, was discussing this with antont and kh_python

At the moment you can create objects not in a scene and with no data- 
this is bad and here are some ways get around it that we come up with.

add a new iterator "objects" to the scene, it will act most like pythons 
set type.

adding an object would look like this.

scn= Scene.GetCurrent()
ob= scn.objects.add(Mesh.New("NewMesh"))

objects.add() could be sloppy- accepting object data or existing 
objects. it will return an object in either case.

..Other things you could do

scn.objects.remove(ob)

obs= list(scn.objects) # convert int oa list from an iterator

if ob in scn.objects: ...

ob in scn.objects[:] = [] # clear all objects from the scene


I would not intend to have index access... or dict like access,
we discussed having
scn.objects["ObName"]= ObData
.. as a nice way to create a new object but this the only case dict like 
access would be usefull and it dosnt allow for getting the object you 
have created in 1 line.



This can be added soon and co-exist with scene.getChildren()

Feedback welcome
- Cam


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241



More information about the Bf-python mailing list