diff --git a/npm/fbx2gltf/LICENSE b/npm/fbx2gltf/LICENSE deleted file mode 100644 index 8d53340..0000000 --- a/npm/fbx2gltf/LICENSE +++ /dev/null @@ -1,44 +0,0 @@ -BSD License - -For FBX2glTF software - -Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------------- - -This software contains Autodesk® FBX® code developed by Autodesk, Inc. Copyright -2017 Autodesk, Inc. All rights, reserved. Such code is provided “as is” and -Autodesk, Inc. disclaims any and all warranties, whether express or implied, -including without limitation the implied warranties of merchantability, fitness -for a particular purpose or non-infringement of third party rights. In no event -shall Autodesk, Inc. be liable for any direct, indirect, incidental, special, -exemplary, or consequential damages (including, but not limited to, procurement -of substitute goods or services; loss of use, data, or profits; or business -interruption) however caused and on any theory of liability, whether in -contract, strict liability, or tort (including negligence or otherwise) arising -in any way out of such code. diff --git a/npm/fbx2gltf/README.md b/npm/fbx2gltf/README.md deleted file mode 100644 index 4dbcc83..0000000 --- a/npm/fbx2gltf/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# FBX2glTF - -[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) - -This is a command line tool for converting 3D model assets on the -well-established [FBX](https://www.autodesk.com/products/fbx/overview) format to -[glTF 2.0](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0), -a modern runtime asset delivery format. - -# Platform Binaries - -This package contains three versions of `FBX2glTF`, compiled for three platforms -and located in three eponymous directories: - - bin/Darwin/FBX2glTF - - bin/Linux/FBX2glTF - - bin/Windows_NT/FBX2glTF.exe - -# Usage - -```js -/** - * Converts an FBX to a GTLF or GLB file. - * @param string srcFile path to the source file. - * @param string destFile path to the destination file. - * This must end in `.glb` or `.gltf` (case matters). - * @param string[] [opts] options to pass to the converter tool. - * @return Promise a promise that yields the full path to the converted - * file, an error on conversion failure. - */ -convert(srcPath :string, destPath :string, args :?string[]) :Promise -``` - -For example: - -```js -const convert = require('fbx2gltf'); -convert('path/to/some.fbx', 'path/to/target.glb', ['--khr-materials-unlit']).then( - destPath => { - // yay, do what we will with our shiny new GLB file! - }, - error => { - // ack, conversion failed: inspect 'error' for details - } -); -``` - -# Authors - - Pär Winzell - - J.M.P. van Waveren - - Amanda Watson - -# Legal - -FBX2glTF is licensed under the [3-clause BSD license](LICENSE). - -``` -This software contains Autodesk® FBX® code developed by Autodesk, Inc. Copyright -2017 Autodesk, Inc. All rights, reserved. Such code is provided “as is” and -Autodesk, Inc. disclaims any and all warranties, whether express or implied, -including without limitation the implied warranties of merchantability, fitness -for a particular purpose or non-infringement of third party rights. In no event -shall Autodesk, Inc. be liable for any direct, indirect, incidental, special, -exemplary, or consequential damages (including, but not limited to, procurement -of substitute goods or services; loss of use, data, or profits; or business -interruption) however caused and on any theory of liability, whether in -contract, strict liability, or tort (including negligence or otherwise) arising -in any way out of such code. -``` diff --git a/npm/fbx2gltf/bin/Darwin/.keep b/npm/fbx2gltf/bin/Darwin/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/npm/fbx2gltf/bin/Linux/.keep b/npm/fbx2gltf/bin/Linux/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/npm/fbx2gltf/bin/README b/npm/fbx2gltf/bin/README deleted file mode 100644 index 1e5d5bf..0000000 --- a/npm/fbx2gltf/bin/README +++ /dev/null @@ -1,6 +0,0 @@ -This directory must be populated with the following files prior to building the -NPM package: - -Darwin/FBX2glTF -Linux/FBX2glTF -Windows/FBX2glTF.exe diff --git a/npm/fbx2gltf/bin/Windows_NT/.keep b/npm/fbx2gltf/bin/Windows_NT/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/npm/fbx2gltf/index.js b/npm/fbx2gltf/index.js deleted file mode 100644 index 9810856..0000000 --- a/npm/fbx2gltf/index.js +++ /dev/null @@ -1,97 +0,0 @@ -/** -* Copyright (c) 2014-present, Facebook, Inc. -* All rights reserved. -*/ - -const childProcess = require('child_process'); -const fs = require('fs'); -const os = require('os'); -const path = require('path'); -const rimraf = require('rimraf'); - -const binaries = { - 'darwin': `bin/darwin/Fbx2Gtlf`, - 'linux': `bin/linux/Fbx2Gtlf`, - 'win32': `bin\windows\Fbx2Gtlf.exe`, -}; - -/** - * Converts an FBX to a GTLF or GLB file. - * @param string srcFile path to the source file. - * @param string destFile path to the destination file or destination path. - * This must end in `.glb` or `.gltf` (case matters). - * @param string[] [opts] options to pass to the converter tool. - * @return Promise a promise that yields the full path to the converted - * file, an error on conversion failure. - */ -function convert(srcFile, destFile, opts = []) { - return new Promise((resolve, reject) => { - try { - let binExt = os.type() === 'Windows_NT' ? '.exe' : ''; - let tool = path.join(__dirname, 'bin', os.type(), 'FBX2glTF' + binExt); - if (!fs.existsSync(tool)) { - throw new Error(`Unsupported OS: ${os.type()}`); - } - - let destExt = path.extname(destFile).toLowerCase(); - - if (!destExt) { - destExt = '.gltf' - - const srcFilename = path.basename(srcFile, path.extname(srcFile)) - destFile = path.join(destFile, srcFilename + destExt) - } - - if (destExt !== '.glb' && destExt !== '.gltf') { - throw new Error(`Unsupported file extension: ${destFile}`); - } - - const binary = opts.includes('--binary') || opts.includes('-b'); - - if (binary && destExt !== '.glb') { - destExt = '.glb'; - } else if (!binary && destExt === 'glb') { - opts.push('--binary'); - } - - let srcPath = fs.realpathSync(srcFile); - let destDir = fs.realpathSync(path.dirname(destFile)); - let destFilename = path.basename(destFile, path.extname(destFile)) + destExt; - let destPath = path.join(destDir, destFilename); - - let args = opts.slice(0); - args.push('--input', srcPath, '--output', destPath); - let child = childProcess.spawn(tool, args); - - let output = ''; - child.stdout.on('data', (data) => output += data); - child.stderr.on('data', (data) => output += data); - child.on('error', reject); - child.on('close', code => { - // the FBX SDK may create an .fbm dir during conversion; delete! - let fbmCruft = srcPath.replace(/.fbx$/i, '.fbm'); - // don't stick a fork in things if this fails, just log a warning - const onError = error => - error && console.warn(`Failed to delete ${fbmCruft}: ${error}`); - try { - fs.existsSync(fbmCruft) && rimraf(fbmCruft, {}, onError); - } catch (error) { - onError(error); - } - - // non-zero exit code is failure - if (code != 0) { - reject(new Error(`Converter output:\n` + - (output.length ? output : ""))); - } else { - resolve(destPath); - } - }); - - } catch (error) { - reject(error); - } - }); -} - -module.exports = convert; diff --git a/npm/fbx2gltf/package-lock.json b/npm/fbx2gltf/package-lock.json deleted file mode 100644 index 5cee6e3..0000000 --- a/npm/fbx2gltf/package-lock.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "fbx2gltf", - "version": "0.12.9", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "requires": { - "glob": "^7.1.3" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/npm/fbx2gltf/package.json b/npm/fbx2gltf/package.json deleted file mode 100644 index 2960ee8..0000000 --- a/npm/fbx2gltf/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "fbx2gltf", - "version": "0.9.7-p1", - "description": "Node wrapper around FBX2glTF tools.", - "main": "index.js", - "repository": { - "type": "git", - "url": "git+https://github.com/facebookincubator/FBX2glTF.git" - }, - "contributors": [ - "Pär Winzell ", - "J.M.P. van Waveren", - "Amanda Watson" - ], - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/facebookincubator/FBX2glTF/issues" - }, - "homepage": "https://github.com/facebookincubator/FBX2glTF", - "files": [ - "LICENSE", - "README.md", - "bin", - "index.js" - ], - "dependencies": { - "rimraf": "^2.6.2" - } -} diff --git a/npm/fbx2gltf/yarn.lock b/npm/fbx2gltf/yarn.lock deleted file mode 100644 index 4b318f6..0000000 --- a/npm/fbx2gltf/yarn.lock +++ /dev/null @@ -1,82 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -rimraf@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=