How do I use easy save to save TriLib2 loaded models

Discussion and help for Easy Save 3
Post Reply
OopsAngela
Posts: 1
Joined: Mon Mar 13, 2023 7:58 am

How do I use easy save to save TriLib2 loaded models

Post 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)
Attachments
屏幕截图 2023-03-13 161150.jpg
屏幕截图 2023-03-13 161150.jpg (128.75 KiB) Viewed 4329 times
屏幕截图 2023-03-13 161116.jpg
屏幕截图 2023-03-13 161116.jpg (128.8 KiB) Viewed 4329 times
屏幕截图 2023-03-13 161059.jpg
屏幕截图 2023-03-13 161059.jpg (140.91 KiB) Viewed 4329 times
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

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

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply