Skip to content

Commit

Permalink
Added support of ListExportedFiles in ProjectExport to list all the f…
Browse files Browse the repository at this point in the history
…iles that have been generated in the final scene output.
  • Loading branch information
julien-moreau committed Aug 19, 2020
1 parent 49865c1 commit aecd6a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/renderer/editor/project/project-exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,21 @@ export class ProjectExporter {
return join(WorkSpace.DirPath!, "scenes", projectName);
}

/**
* Returns the list of ALL exported files located in the scene's output folder.
* @scenePath defines the absolute path to the .babylon file.
* @filesPaths defines the list of all resource files of the scene.
*/
public static async ListExportedFiles(): Promise<{ scenePath: string; filesPaths: string[]; }> {
const projectName = basename(dirname(WorkSpace.Workspace!.lastOpenedScene));
const projectDir = join(WorkSpace.DirPath!, "scenes", projectName);

const scenePath = join(projectDir, "scene.babylon");
const filesPaths = (await readdir(join(projectDir, "files"))).map((f) => join(projectDir, "files", f));

return { scenePath, filesPaths };
}

/**
* Eports the final scene.
* @param editor the editor reference.
Expand Down

0 comments on commit aecd6a5

Please sign in to comment.