From 632b212bd64c6f9c607654755c1d89eac537ae4f Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Thu, 29 Aug 2002 17:59:08 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/leveleditor/LevelEditor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/direct/src/leveleditor/LevelEditor.py b/direct/src/leveleditor/LevelEditor.py index 69b2c0b617..8b89897e84 100644 --- a/direct/src/leveleditor/LevelEditor.py +++ b/direct/src/leveleditor/LevelEditor.py @@ -1404,12 +1404,15 @@ class LevelEditor(NodePath, PandaObject): # Reset last Code (for autoPositionGrid) if DNAClassEqual(dnaNode, DNA_STREET): - self.snapList = OBJECT_SNAP_POINTS[dnaNode.getCode()] + self.snapList = self.getSnapPoint(dnaNode.getCode()) # Select the instance direct.select(newNodePath) # Update grid to get ready for the next object self.autoPositionGrid() + def getSnapPoint(self, code): + return OBJECT_SNAP_POINTS.get(code, [(Vec3(0.0,0,0), Vec3(0)), (Vec3(0), Vec3(0))]) + def addGroup(self, nodePath): """ Add a new DNA Node Group to the specified Node Path """ # Set the node path as the current parent @@ -1949,7 +1952,7 @@ class LevelEditor(NodePath, PandaObject): self.toggleShowLandmarkBlock() # Reset last Code (for autoPositionGrid) if DNAClassEqual(dnaNode, DNA_STREET): - self.snapList = OBJECT_SNAP_POINTS[dnaNode.getCode()] + self.snapList = self.getSnapPoint(dnaNode.getCode()) else: pointOrCell, type = self.findPointOrCell(nodePath) if pointOrCell and (type == 'suitPointMarker'):