How to synchronise the model with a server?

sketchup

#1

I am creating a viewer for a model. Initially whole model is exported to a server.
Now if user changes anything in the model I want to apply those changes to server file.
How can this be done ?
I can see some observer ruby class but which one to implement or there is simpler way to do this task ?


#2

The export format defines whether an incremental update could be done. Regardless, I believe it would be really messy…


#3

Let say if the export format is .skp .


#4

Either you transfer the whole changed model (saved file or exported model) or you transfer the differences that you can read out by observers (what needs to be added, removed, changed) and apply them to the model on the server-side.

Then you also need to decide whether you transfer differences of the file (comparing bytes on the file system level, like Github diffs) or of the model scene graph in memory (reading and comparing properties through the API/SDK and encoding them in your own format, e.g. JSON).

Note that SketchUp’s .skp format is a binary format and does not provide an option for incremental updates or diffs. You would need a tool to create binary diffs of the saved binary file, or you define your own format for encoding model entities or updates.


#5

When quiting …

Easiest Incremental …

You can use both, BTW.