Ejemplo n.º 1
0
    def export(self, path):
        filePath = FilePath(path)
        filePath = filePath.join("%s.glsl" % self._name)
        filePath.ensureExists()

        str = self.getFieldFragmentShaderText()

        with filePath.edit() as fh:
            fh.write(str)

        return
Ejemplo n.º 2
0
 def __onNewProject(self):
     currentPath = self.__changeProjectHelper('Creating new project')
     if currentPath is None:
         return
     res = FileDialog.getSaveFileName(self, 'Create new project', currentPath, 'Project folder')
     if not res:
         return
     shutil.copytree(DEFAULT_PROJECT, res, ignore=lambda p, f: [] if os.path.basename(p).lower() == 'Scenes' else [n for n in f if os.path.splitext(n)[-1].lower() in IGNORED_EXTENSIONS])
     projectFile = FilePath(res).join(os.path.basename(res) + PROJ_EXT)
     projectFile.ensureExists()
     self.__openProject(projectFile)