def __init__(self, camera=None, light=None, file_string=None, name="", x=0.0, y=0.0, z=0.0, rx=0.0, ry=0.0, rz=0.0, sx=1.0, sy=1.0, sz=1.0, cx=0.0, cy=0.0, cz=0.0): """uses standard constructor for Shape extra Keyword arguments: *file_string* path and name of obj or egg file """ super(Model, self).__init__(camera, light, name, x, y, z, rx, ry, rz, sx, sy, sz, cx, cy, cz) if '__clone__' in file_string: # Creating a copy but with pointer to buf. return self.exf = file_string[-3:].lower() if VERBOSE: print "Loading ",file_string if self.exf == 'egg': self.model = loaderEgg.loadFileEGG(self, file_string) return self.model elif self.exf == 'obj': self.model = loaderObj.loadFileOBJ(self, file_string) return self.model else: print self.exf, "file not supported" return None
def __init__(self, fileString, texs, name="", x=0.0, y=0.0, z=0.0, rx=0.0, ry=0.0, rz=0.0, sx=1.0, sy=1.0, sz=1.0, cx=0.0, cy=0.0, cz=0.0): super(Model, self).__init__(name, x, y, z, rx, ry, rz, sx, sy, sz, cx, cy, cz) self.exf = fileString[-3:].lower() self.texs = texs if VERBOSE: print "Loading ",fileString if self.exf == 'egg': self.model = loaderEgg.loadFileEGG(self, fileString, texs) return self.model elif self.exf == 'obj': self.model = loaderObj.loadFileOBJ(self, fileString, texs) return self.model else: print self.exf, "file not supported" return None