|
|
@ -13,23 +13,23 @@ and all that stuff) to be exported in a way that keeps the skinning information, |
|
|
|
we have to go about it in a more roundabout way: |
|
|
|
we have to go about it in a more roundabout way: |
|
|
|
|
|
|
|
|
|
|
|
- Export the model as a Resonite Package, place in `test/Test.resonitepackage` |
|
|
|
- Export the model as a Resonite Package, place in `test/Test.resonitepackage` |
|
|
|
- Open the package, which is actually just disguised `.zip` archive |
|
|
|
- Open the package, which is actually just a disguised `.zip` archive |
|
|
|
- Parse the `R-Main.record` entry, a JSON file |
|
|
|
- Read the `R-Main.record` entry, a JSON file |
|
|
|
- The `assetUri` field points to the main asset file in the archive |
|
|
|
- The `assetUri` field points to the main asset file in the archive |
|
|
|
- Parse this file using [BSON], a horrible "Binary JSON" format |
|
|
|
- Parse this file using [BSON], a very horrible "Binary JSON" format |
|
|
|
- The resulting `DataTree` contains the hierarchical node and component info |
|
|
|
- The resulting `DataTree` contains the hierarchical node and component info |
|
|
|
- Types are encoded as IDs, which we can decode using a lookup array |
|
|
|
- Types are encoded as IDs, which we can decode using a lookup array |
|
|
|
- Process supported asset types: Meshes, textures, and materials |
|
|
|
- Process assets we care about, so meshes, textures, and materials |
|
|
|
- These assets can then be referenced by their ID by other nodes |
|
|
|
- These assets can then be referenced by their ID by other nodes |
|
|
|
- Go through all node and attach meshes to them if they have some |
|
|
|
- Go through all nodes and attach meshes to them if they have some |
|
|
|
- Export the whole thing as `test/scene.glb` with [SharpGLTF] |
|
|
|
- Export the whole thing as `test/scene.glb` with [SharpGLTF] |
|
|
|
|
|
|
|
|
|
|
|
**NOTE:** It might be possible to parse a good chunk of this with Resonite's |
|
|
|
**NOTE:** It might be possible to parse a good chunk of this with Resonite's |
|
|
|
own library, but it probably requires setting up an `Engine` or so for it to |
|
|
|
own library, but it probably requires setting up an `Engine` or so for it to |
|
|
|
parse all the related files, I don't have the know-how to do that. |
|
|
|
process all the related files. I don't have the know-how to do that. |
|
|
|
|
|
|
|
|
|
|
|
**NOTE:** The path to the Resonite libraries is hardcoded in `Res2tf.csproj` |
|
|
|
**NOTE:** The paths to the Resonite libraries are hardcoded in `Res2tf.csproj` |
|
|
|
so if you'd like to use this yourself you will have to change this. |
|
|
|
so if you'd like to use this yourself you will have to change them. |
|
|
|
|
|
|
|
|
|
|
|
[Resonite]: https://resonite.com/ |
|
|
|
[Resonite]: https://resonite.com/ |
|
|
|
[SharpGLTF]: https://github.com/vpenades/SharpGLTF |
|
|
|
[SharpGLTF]: https://github.com/vpenades/SharpGLTF |
|
|
|