def save(self, name, path=application.asset_folder, filetype='ursinamesh'): if filetype == 'ursinamesh': if not '.' in name: name += '.ursinamesh' with open(path / name, 'w') as f: recipe = self.recipe.replace('LVector3f', '') f.write(recipe) elif filetype == 'obj': from ursina.mesh_importer import ursina_mesh_to_obj ursina_mesh_to_obj(self, name, path)
def save(self, name='', path=application.compressed_models_folder): if not name and hasattr(self, 'path'): name = self.path.stem if not '.' in name: name += '.ursinamesh' if name.endswith('ursinamesh'): with open(path / name, 'w') as f: recipe = self.recipe.replace('LVector3f', '') f.write(recipe) print('saved .ursinamesh to:', path / name) elif name.endswith('.obj'): from ursina.mesh_importer import ursina_mesh_to_obj ursina_mesh_to_obj(self, name, path) elif name.endswith('.bam'): success = self.writeBamFile(path / name) print('saved .bam to:', path / name)