2015-03-03 16:10:12 -06:00
|
|
|
from direct.stdpy import threading
|
|
|
|
|
|
|
|
import DNALoader
|
|
|
|
from DNAStorage import DNAStorage
|
|
|
|
from DNASuitPoint import DNASuitPoint
|
|
|
|
from DNAGroup import DNAGroup
|
|
|
|
from DNAVisGroup import DNAVisGroup
|
|
|
|
from DNADoor import DNADoor
|
|
|
|
|
|
|
|
class DNABulkLoader:
|
|
|
|
def __init__(self, storage, files):
|
|
|
|
self.dnaStorage = storage
|
|
|
|
self.dnaFiles = files
|
|
|
|
|
|
|
|
def loadDNAFiles(self):
|
|
|
|
for file in self.dnaFiles:
|
|
|
|
print 'Reading DNA file...', file
|
|
|
|
loadDNABulk(self.dnaStorage, file)
|
|
|
|
del self.dnaStorage
|
|
|
|
del self.dnaFiles
|
|
|
|
|
|
|
|
def loadDNABulk(dnaStorage, file):
|
|
|
|
dnaLoader = DNALoader.DNALoader()
|
2015-03-04 21:28:56 -06:00
|
|
|
file = 'resources/' + file
|
|
|
|
if config.GetBool('want-uplevel-res', False):
|
|
|
|
file = '../resources/' + file
|
2015-03-03 16:10:12 -06:00
|
|
|
dnaLoader.loadDNAFile(dnaStorage, file)
|
|
|
|
dnaLoader.destroy()
|
|
|
|
|
|
|
|
def loadDNAFile(dnaStorage, file):
|
|
|
|
print 'Reading DNA file...', file
|
|
|
|
dnaLoader = DNALoader.DNALoader()
|
2015-03-04 21:28:56 -06:00
|
|
|
file = 'resources/' + file
|
|
|
|
if config.GetBool('want-uplevel-res', False):
|
|
|
|
file = '../resources/' + file
|
2015-03-03 16:10:12 -06:00
|
|
|
node = dnaLoader.loadDNAFile(dnaStorage, file)
|
|
|
|
dnaLoader.destroy()
|
|
|
|
if node.node().getNumChildren() > 0:
|
|
|
|
return node.node()
|
|
|
|
return None
|
|
|
|
|
|
|
|
def loadDNAFileAI(dnaStorage, file):
|
|
|
|
dnaLoader = DNALoader.DNALoader()
|
2015-03-04 21:28:56 -06:00
|
|
|
file = 'resources/' + file
|
|
|
|
if config.GetBool('want-uplevel-res', False):
|
|
|
|
file = '../resources/' + file
|
2015-03-03 16:10:12 -06:00
|
|
|
data = dnaLoader.loadDNAFileAI(dnaStorage, file)
|
|
|
|
dnaLoader.destroy()
|
|
|
|
return data
|
|
|
|
|