|
|
@@ -5,7 +5,7 @@ from DirectUtil import *
|
|
|
from DirectGeometry import *
|
|
|
|
|
|
class DirectGrid(NodePath, DirectObject):
|
|
|
- def __init__(self,gridSize=100.0,gridSpacing=5.0,planeColor=(0.5,0.5,0.5,0.5)):
|
|
|
+ def __init__(self,gridSize=100.0,gridSpacing=5.0,planeColor=(0.5,0.5,0.5,0.5),parent = None):
|
|
|
# Initialize superclass
|
|
|
NodePath.__init__(self, 'DirectGrid')
|
|
|
# Don't wireframe or light
|
|
|
@@ -13,7 +13,7 @@ class DirectGrid(NodePath, DirectObject):
|
|
|
|
|
|
# Load up grid parts to initialize grid object
|
|
|
# Polygon used to mark grid plane
|
|
|
- self.gridBack = loader.loadModel('models/misc/gridBack')
|
|
|
+ self.gridBack = loader.loadModel('models/misc/gridBack.bam')
|
|
|
self.gridBack.reparentTo(self)
|
|
|
self.gridBack.setColor(*planeColor)
|
|
|
|
|
|
@@ -35,7 +35,7 @@ class DirectGrid(NodePath, DirectObject):
|
|
|
self.centerLines.setThickness(3)
|
|
|
|
|
|
# Small marker to hilight snap-to-grid point
|
|
|
- self.snapMarker = loader.loadModel('models/misc/sphere')
|
|
|
+ self.snapMarker = loader.loadModel('models/misc/sphere.bam')
|
|
|
self.snapMarker.node().setName('gridSnapMarker')
|
|
|
self.snapMarker.reparentTo(self)
|
|
|
self.snapMarker.setColor(1, 0, 0, 1)
|
|
|
@@ -48,7 +48,7 @@ class DirectGrid(NodePath, DirectObject):
|
|
|
self.gridSize = gridSize
|
|
|
self.gridSpacing = gridSpacing
|
|
|
self.snapAngle = 15.0
|
|
|
- self.enable()
|
|
|
+ self.enable(parent = parent)
|
|
|
|
|
|
def enable(self, parent = None):
|
|
|
if parent:
|