FBX Interface for JavaScript/TypeScript
This parser will parse FBX text files and convert them into a JavaScript-Object structure.
This is work in progress, and functionality can be easily added to cover more FBX features.
Installation
npm install @picode/fbx
Usage
import { FBX, FBXAxes } from '@picode/fbx'
import * as FBXParser from 'fbx-parser'
const fbx = new FBX(FBXParser.parse(await fs.readFileSync(fbxFile)))
const upAxes = fbx.globalSettings.getUpAxes() ?? FBXAxes.Y
const model = fbx.getModel('MyModel')
const rotNode = model.getRotationNode()
const rotationX = rotNode.getX()
const rotKeyY = model.getRotationKey(upAxes)
const rotationsYTimes = rotKeyY?.getTime()
const rotationsYValues = rotKeyY?.getValue()
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
MIT