Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var readline = require('readline');
- var fs = require('fs');
- var dir = './sc3d';
- if (!fs.existsSync(dir)){
- fs.mkdirSync(dir);
- }
- var rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout
- });
- console.log("Parser by BlaCoiso! Dumb script thing by idot garlfin.");
- console.log("Any errors that talk about git don't matter!");
- console.log("Before you comment you have an error, please check if the dae is there!");
- console.log("Subscribe, like, and donate to my Patreon to support me!");
- console.log("Share the video with friends, teach them how to do this too!");
- console.log("As of now, you can only use _geo.scw. Don't use animation scw's!");
- rl.question("Enter the name of the scw (eg. sandy_geo.scw)\n", function(answer) {
- // TODO: Log the answer in a database
- console.log("Running as:", answer);
- const SC3D = require("./SC3D");
- SC3D.importPath = "Change me to your sc3d path!";
- //Make sure to use \\ or / instead of \ in your path!
- const lib1 = SC3D.importLib(answer);
- const out = lib1.exportModel();
- var path = require('path');
- //Extract the filename:
- var withoutname = path.basename(answer,'.scw');
- var extension = ".dae";
- var filename = __dirname+"\\"+withoutname+extension;
- fs.writeFile(filename, out, (err) => {
- // throws an error, you could also catch it here
- if (err) throw err;
- // success case, the file was saved
- console.log(answer+" saved as "+withoutname+".dae at "+__dirname+"\\");
- });
- rl.close();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement