@picode/fbx
Version:
Provides an interface to use FBX data.
45 lines (28 loc) • 1.32 kB
Markdown
[](https://www.npmjs.com/package/@picode/fbx)

[](https://github.com/picode7/fbx/actions)
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.
```bash
npm install @picode/fbx
```
```ts
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()
```
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)