Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filipemeneses/unity-to-json
NPM package to convert unity scene and FBX files into JSON
https://github.com/filipemeneses/unity-to-json
threejs unity unity-editor unity3d
Last synced: 4 days ago
JSON representation
NPM package to convert unity scene and FBX files into JSON
- Host: GitHub
- URL: https://github.com/filipemeneses/unity-to-json
- Owner: filipemeneses
- License: mit
- Created: 2023-09-07T13:16:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-09T13:47:43.000Z (over 1 year ago)
- Last Synced: 2024-09-27T23:21:13.372Z (5 months ago)
- Topics: threejs, unity, unity-editor, unity3d
- Language: TypeScript
- Homepage:
- Size: 1.35 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unity-to-json
Node.js package to convert Unity scene and FBX files into JSON
---
[![npm package][npm-img]][npm-url]
[![Build Status][build-img]][build-url]
[![Issues][issues-img]][issues-url]
[![Code Coverage][codecov-img]][codecov-url]
[![Commitizen Friendly][commitizen-img]][commitizen-url]
[![Semantic Release][semantic-release-img]][semantic-release-url]## Install
```bash
npm install unity-to-json
``````bash
yarn add unity-to-json
```## Usage
### Generate files once
```js
import path from 'path';
import { convertUnityProjectToJson } from 'unity-to-json';const {
version,
files
} = await convertUnityProjectToJson({
unityProjectRootFolderPath: path.resolve('../path/to/unity-project-root'),
});
```### Generate files and watch for changes
```js
import path from 'path';
import { convertUnityProjectToJson, interpretScene } from 'unity-to-json';createUnityProjectToJsonWatcher({
unityProjectRootFolderPath: path.resolve('../path/to/unity-project-root'),
sceneFilename: 'SampleScene.unity',
onSceneChange({ version , files }) => {
// files = all FBX, Unity, Meta files
}
});
```## Examples
- [Svelte + Vite + Typescript + Three.js](https://github.com/filipemeneses/svelte-vite-unity-threejs)
[build-img]:https://github.com/filipemeneses/unity-to-json/actions/workflows/release.yml/badge.svg
[build-url]:https://github.com/filipemeneses/unity-to-json/actions/workflows/release.yml
[downloads-img]:https://img.shields.io/npm/dt/unity-to-json
[npm-img]:https://img.shields.io/npm/v/unity-to-json
[npm-url]:https://www.npmjs.com/package/unity-to-json
[issues-img]:https://img.shields.io/github/issues/filipemeneses/unity-to-json
[issues-url]:https://github.com/filipemeneses/unity-to-json/issues
[codecov-img]:https://codecov.io/gh/filipemeneses/unity-to-json/branch/main/graph/badge.svg
[codecov-url]:https://codecov.io/gh/filipemeneses/unity-to-json
[semantic-release-img]:https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-release-url]:https://github.com/semantic-release/semantic-release
[commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen-url]:http://commitizen.github.io/cz-cli/