[Bf-python] Modularizing scene

Campbell Barton cbarton at metavr.com
Wed Aug 30 07:03:13 CEST 2006


Hi Folks,

Ebjects refactor opens up a wider issue with scene,
Should we make it more modular?.

at the moment you can do,,

scn.addScriptLink()
scn.remopeScriptLink()

With more data being added to the scenes (tool options) and for general 
API nice-ness

I think we should devide Scene into parts... this has alredy been 
started with renderdata and radiosity


# At the moment we have
scn.addScriptLinks()
||| <cid:part1.07090903.02060509 at metavr.com>|scn.getScriptLinks()
scn.clearScriptLinks()

# scriptlinks could be an iterator with add/remove functons
scn.scriptlinks.add()
scn.scriptlinks.remove()
scn.scriptlinks.clear() # or = []


# We could allow access to tool settings (they are stored in the scene too)
scn.tools.color= someColor
scn.tools.threshold= 1.0


The question- we we want to move  functionality into their own namespace..

scn.addMesh(...) is very conventient for new users but kinda pollutes 
the namespace IMHO..

NMesh was an example of how this was messy-
  me= ob.data

you could do
  me.faces.append(...)
or
  me.addFace(...)


Currently we have
  ob= scn.getActiveObject()
it could be
  ob= scn.obejcts.active


Why support both modes? 

maybe we need a wiki for this discussion also.




More information about the Bf-python mailing list