Page 1 of 1

How do I use easy save to save TriLib2 loaded models

Posted: Mon Mar 13, 2023 8:16 am
by OopsAngela
Hi,Joel ,This a nice asset,i like it ! but I have a problem.
I want to load a FBX model when unity runtime,so i was used "TriLib 2".And, i wish to save the model by easy save.( ES3.save()) and Load it.
But, It can't save and load. I saw a previous article that had the same situation with me.(https://moodkie.com/forum/viewtopic.php?t=1600).
sorry , I still don't understand how to solve it,please help me thanks

(BuildingParent is empty object, JZ01_R is my fbx model,I use TriLib 2 assets to Load it)

Re: How do I use easy save to save TriLib2 loaded models

Posted: Mon Mar 13, 2023 8:52 am
by Joel
Hi there,

Because TriLib models have aspects which are not serializable at runtime (such as RenderTextures), I'm afraid we can't support saving and loading of models loaded with TriLib. Instead you would need to save the FBX itself, and then import it each time using TriLib.

To save the FBX file to the persistent data path you can use ES3.LoadRawBytes(fbxPath) to get it's bytes, and ES3.SaveRaw(bytes, filename) to save those bytes to a file. To then import that file using TriLib you would need to consult their documentation as we are not affiliated with them. However, you can get the path to the persistent data folder using Application.persistentDataPath.

All the best,
Joel