Download and save obj file.
Download and save obj file.
I want download from server a xxx.obj file or xxxxx.fbx and save it in runtime. I can download with WWW api from the server and with other scripts I can transform in gameobject. My question. Can I save a gameobject with Easy save? or can I download obj file and save it? Thanks for the answer.
Re: Download and save obj file.
Hi there,
To save the obj file to local storage, you can use ES3.SaveRaw(www.bytes, "myfile.obj"); to store the data downloaded from your WWW request.
All the best,
Joel
To save the obj file to local storage, you can use ES3.SaveRaw(www.bytes, "myfile.obj"); to store the data downloaded from your WWW request.
All the best,
Joel
Re: Download and save obj file.
Thanks for your answer. If you can help me a bit...
I save the object with GameObject piramide = ES3.LoadRawBytes ("piramide.obj");
to load I use ES3.SaveRaw(http://www.bytes, "piramide.obj"); and this return a byte[].
My question. How can I transform byte[] to gameobject or obj file?
I save the object with GameObject piramide = ES3.LoadRawBytes ("piramide.obj");
to load I use ES3.SaveRaw(http://www.bytes, "piramide.obj"); and this return a byte[].
My question. How can I transform byte[] to gameobject or obj file?
Re: Download and save obj file.
Ok I save with ES3.Save<GameObject>("myGameObject", importedObject); and load with Instantiate (ES3.Load<GameObject>("myGameObject")); But it give me an object without mesh. ¿Do yo know why? I must change some parameter....
Thanks for the answer.
Thanks for the answer.
Re: Download and save obj file.
Hi there,
The Mesh is a reference type, so it will be stored by reference. If there is no reference at runtime, it won't have anything to load.
Instead you should save the Mesh separately. i.e.
Joel
The Mesh is a reference type, so it will be stored by reference. If there is no reference at runtime, it won't have anything to load.
Instead you should save the Mesh separately. i.e.
ES3.Save<Mesh>("myMesh", this.GetComponent<MeshFilter>.sharedMesh); this.GetComponent<MeshFilter>.sharedMesh = ES3.Load<Mesh>("myMesh");All the best,
Joel
Re: Download and save obj file.
Sorry only one question more and thanks to your answers:
ES3.Save<GameObject>("myGameObject", importedObject); ES3.Save<Mesh>("myMesh", importedObject.GetComponent<MeshFilter>.sharedMesh); Destroy (importedObject); loadObject = ES3.Load<GameObject>("myGameObject"); importedObject.GetComponent<MeshFilter>.sharedMesh = ES3.Load<Mesh>("myMesh"); loadObject.AddComponent<Move> ();Unity no recognize sharedmesh. what can i write to in this context to save the mesh?
Re: Download and save obj file.
Hi there,
I'm not sure why sharedMesh is not being recognised by Unity, as it's very clearly in their API: https://docs.unity3d.com/ScriptReferenc ... ilter.html
You may need to contact them regarding this, as it appears to be working fine at my end.
You can try to simply use mesh instead of sharedMesh, but presumably this won't be recognised either.
All the best,
Joel
I'm not sure why sharedMesh is not being recognised by Unity, as it's very clearly in their API: https://docs.unity3d.com/ScriptReferenc ... ilter.html
You may need to contact them regarding this, as it appears to be working fine at my end.
You can try to simply use mesh instead of sharedMesh, but presumably this won't be recognised either.
All the best,
Joel
Re: Download and save obj file.
Not run because the object is in a runtime enviroment there aren't a instance. I think is it, but I don't know how change. Thanks for all.
Re: Download and save obj file.
Hi there,
I'm not sure I understand what you mean. Would you be able to demonstrate in more detail?
All the best,
Joel
I'm not sure I understand what you mean. Would you be able to demonstrate in more detail?
All the best,
Joel