Persistent Table - Create a table that automatically saves itself to documents.

Updated to support vec4 and matrix

I’m guessing there’s no way to save a function…?

@skyTheCoder It does now.

Function support added.

@Briarfox - I bet you’re hoping there’s nothing else… [-O<

@Ignatz Meshes and classes…

@Briarfox, thanks for sharing this. I’d like to use this for saving animations created in my project. Is there an easy method to check which persistent tables already exist, as I don’t want users to create duplicate named animations? Also, what would happen if a persistent table was initiated again when it did already exist?

Sorry for the questions, I couldn’t figure them out from your code.

@time_trial When you do tbl = pTable(“fileName”) pTables will load the table if it exists and if not, it will create an empty table and save it (if auto save is enabled". I’d save all animation info into one pTable. Just check if the save name exists before adding a new field to the table.

Thanks for the quick reply, @Briarfox, but how do I check if the save name exists?

I mean create a table. When saving check tbl[“saveName”] to see if you have a save.

Just create one pTable to hold all the save info. No need to have separate tables. Use a file name unique to your project to avoid it being overwritten by another project. Have the pTable have a table with saved names and just add to it or overwrite it when there is a new save.

Thanks, I have it working. I am saving one pTable per animation, mostly because I’m still getting my head around handling all my class objects.

I did get a failure to load message every time until I used a name with an extension, i.e. “Stick Man.FlipPadAnimation”.

Is the link to the code expired or is it just my iPad? I was going to use this for something