Unity Package for REXfile input and output
To install use Add package from git URL...
function in the Unity Package Manager.
The package is inside the path Assets/package
therefore the git URL should look like this:
https://github.com/roboticeyes/upm-rex-rexfile-io.git?path=/Assets/package
To select a specific version add #version
to the url
e.g.: https://github.com/roboticeyes/upm-rex-rexfile-io.git?path=/Assets/package#v1.0.17
An example Scene can be found under Assets/Example
This code starts an conversion from .rex to GameObjects
byte[] data = File.ReadAllBytes ("rexFile");
RexConverter.Instance.ConvertFromRex (data, (success, loadedObjects) =>
{
if (!success)
{
Debug.Log ("ConvertFromRex failed.");
return;
}
List<MeshFilter> meshFilters = new List<MeshFilter> ();
foreach (var item in loadedObjects.Meshes)
{
item.gameObject.SetActive (true);
meshFilters.Add (item.GetComponentInChildren<MeshFilter>());
}
});
MeshFilter[] meshesToWrite;
...
byte[] rexFile = RexConverter.Instance.GenerateRexFile (meshesToWrite);
- REX is an Augmented Reality platform. Find out more about REX
- REX data format is our open source file format to store REX-relevant information efficiently. Have a look at the specification