Browse Source

Automate ObjInterface creation

This fixes DrawInterfaces not having their owner plSceneObject set. It
also makes life easier for when we will export more plObjInterface
subclasses.
pull/6/head
Adam Johnson 11 years ago
parent
commit
fa6c9f890e
  1. 1
      korman/exporter/convert.py
  2. 10
      korman/exporter/manager.py

1
korman/exporter/convert.py

@ -116,7 +116,6 @@ class Exporter:
ci = self.mgr.find_create_key(bo, plCoordinateInterface) ci = self.mgr.find_create_key(bo, plCoordinateInterface)
so.coord = ci so.coord = ci
ci = ci.object ci = ci.object
ci.owner = so.key
# Now we have the "fun" work of filling in the CI # Now we have the "fun" work of filling in the CI
ci.worldToLocal = utils.matrix44(bo.matrix_basis) ci.worldToLocal = utils.matrix44(bo.matrix_basis)

10
korman/exporter/manager.py

@ -85,7 +85,15 @@ class ExportManager:
node.addSceneObject(pl.key) node.addSceneObject(pl.key)
elif pl.ClassIndex() in _pool_types: elif pl.ClassIndex() in _pool_types:
node.addPoolObject(pl.key) node.addPoolObject(pl.key)
return pl # we may have created it...
# Make life easier for folks creating ObjInterfaces
if isinstance(pl, plObjInterface) and bl is not None:
so = self.find_key(bl, plSceneObject)
if so is not None:
pl.owner = so
# And we're done!
return pl
def create_builtins(self, age, textures): def create_builtins(self, age, textures):
# BuiltIn.prp # BuiltIn.prp

Loading…
Cancel
Save