Question before purchasing - saving custom meshes?

Discussion and help for Easy Save 3
caduceus
Posts: 15
Joined: Tue Nov 02, 2021 12:23 pm

Question before purchasing - saving custom meshes?

Post by caduceus »

Hello

Before purchasing of asset I need to solve critical question for me.
I creating meshes in runtime (not from prefabs). I caclulating vetrexes, normals, UVs and put materials from files.

Is it possible to save/load my data using your asset?
I tried other assets - but they can operation only with prefabs.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Question before purchasing - saving custom meshes?

Post by Joel »

Hi there,

Saving and loading Meshes and Materials is indeed possible with Easy Save, and can be done as simply as:

Code: Select all

// To save
ES3.Save("mesh", mesh);
ES3.Save("material", material);

// To load
var mesh = ES3.Load<Mesh>("mesh");
var material = ES3.Load<Material>("material");
In particular the following will be saved for Meshes:
  • bounds
  • subMeshCount
  • boneWeights
  • bindposes
  • vertices
  • normals
  • tangents
  • uv
  • uv2
  • uv3
  • uv4
  • colors32
  • triangles
  • subMeshes
And the following will be saved for Materials:
  • name
  • shader
  • renderQueue
  • shaderKeywords
  • globalIlluminationFlags
  • mainTexture
  • properties (note that non-built-in/custom properties cannot be automatically serialized and will need to be saved separately).
Note that the Texture will be saved by reference, so you may also need to save this separately to ensure a reference exists.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
caduceus
Posts: 15
Joined: Tue Nov 02, 2021 12:23 pm

Re: Question before purchasing - saving custom meshes?

Post by caduceus »

Thank you!
Is this saving in binary or xml format? XML will be very large
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Question before purchasing - saving custom meshes?

Post by Joel »

Hi there,

We save data in JSON format, but we also provide compression:
https://docs.moodkie.com/easy-save-3/es ... ompression

Note that it's a misconception that binary serialization is inherently more compact than other methods; it's actually the unstructured nature of BinaryWriters/Readers which makes it more compact. As Meshes and Materials are structured data, you wouldn't be able to store these in an unstructured/sequential way without writing your own protocol to manage this (which would be inflexible, hard to maintain and proprietary).

This is why we provide compression rather than a binary option: it allows the flexibility of a structured data format and produces much smaller files than any unstructured/uncompressed method ever could, with a low performance impact relative to the serialization overhead.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
caduceus
Posts: 15
Joined: Tue Nov 02, 2021 12:23 pm

Re: Question before purchasing - saving custom meshes?

Post by caduceus »

Thank you.

Purchased your asset. But still have a question. Could you help me?

I running app. And create some mesh. This is not a prefab mesh. This is fully runtime generated mesh.
During app is running, I opening auto save settings, finding this my new object and check-on all checkboxes, including mesh. Ok

I added buttons Save and Load in my GUI.

In Save button code - ES3AutoSaveMgr.Current.Save();
In Load button code - S3AutoSaveMgr.Current.Load();

I press save - and yes, it save something in file.
I delete my shape, press Load - and fantastic - mesh in loading!!!! Great!!!

But!
If I close app, run again and press Load - it loading object, but absolutely without mesh. As I understand - EasySave dont not where get a mesh - because it did not save it, but I check-on "mesh" in autoload settings.

What I doing wrong and how fix it?
And other question - how to enable these check-boxes of autosave settings from script?

Thank you
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Question before purchasing - saving custom meshes?

Post by Joel »

Hi there,

Fields of Unity reference types are stored by reference. To save it by value you will need to save and load it directly using ES3.Save as described in my previous post.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
caduceus
Posts: 15
Joined: Tue Nov 02, 2021 12:23 pm

Re: Question before purchasing - saving custom meshes?

Post by caduceus »

Yes, I understand it, but where I can embedding this mesh saving? How I can correspond concrete mesh to concrete object after loading?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Question before purchasing - saving custom meshes?

Post by Joel »

Hi there,

You do this by applying the Mesh to the MeshFilter of that object. As this relates to Unity's functionality rather than ours, I recommend taking a look at their documentation for more information:
https://docs.unity3d.com/ScriptReferenc ... -mesh.html

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
caduceus
Posts: 15
Joined: Tue Nov 02, 2021 12:23 pm

Re: Question before purchasing - saving custom meshes?

Post by caduceus »

I know how to generate mesh and create components (I do it already in runtime)
My question - how to correspond each mesh and saved ojects without mesh in ES3AutoSaveMgr.Current.Save()?

Or I must saving whole scene manually without ES3AutoSaveMgr?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Question before purchasing - saving custom meshes?

Post by Joel »

Hi there,

Auto Save is only intended for saving Components. You would need to save and load the Mesh separately using code, and assign it manually to the MeshFilter after calling Auto Save.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply