From fa6c9f890ece5c9afbefd88cfa97ea98bd71f2f3 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 9 Jul 2014 21:34:38 -0400 Subject: [PATCH] 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. --- korman/exporter/convert.py | 1 - korman/exporter/manager.py | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/korman/exporter/convert.py b/korman/exporter/convert.py index b1ce339..2bf8fbb 100644 --- a/korman/exporter/convert.py +++ b/korman/exporter/convert.py @@ -116,7 +116,6 @@ class Exporter: ci = self.mgr.find_create_key(bo, plCoordinateInterface) so.coord = ci ci = ci.object - ci.owner = so.key # Now we have the "fun" work of filling in the CI ci.worldToLocal = utils.matrix44(bo.matrix_basis) diff --git a/korman/exporter/manager.py b/korman/exporter/manager.py index 8291a01..a7793ee 100644 --- a/korman/exporter/manager.py +++ b/korman/exporter/manager.py @@ -85,7 +85,15 @@ class ExportManager: node.addSceneObject(pl.key) elif pl.ClassIndex() in _pool_types: 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): # BuiltIn.prp