Text-based save file format

Requests or suggestions for new features
mfloyd
Posts: 21
Joined: 29 Oct 2014, 23:06

Re: Text-based save file format

Post by mfloyd »

I agree that a text-based file save format would be very useful. I have wanted it for reasons already stated: better use with version control tools, checking what changed between files, etc.
I had a thought recently though, that perhaps a diff/merge tool could be made that works with the binary files. Maybe such a tool could read the parameters of the binary files and display the parameters that changed between them. This would be useful if a text based file format isn't feasible, or couldn't be ready as quickly as the diff tool would be. I imagine it would also be useful for comparing the files that are already saved in the current file format even if a textual file save format is made later. It could also be written such that the binary files still always remain consistent when saved, which was one of the concerns about a textual file format.
I realize that creating such a tool might actually be more work than changing the file save format, but thought I'd add the suggestion since it would at least partially address some of the issues that motivate the need for a textual file save format.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Text-based save file format

Post by coppelia »

A binary diff/merge tool can only work on the V-REP binary files, if you disable compression. You can do this in the system/usrset.txt file: set compressFiles to false.

Cheers

mdam
Posts: 6
Joined: 09 Oct 2014, 21:34

Re: Text-based save file format

Post by mdam »

Does the newer versions of V-REP have the text-based save file format? I saw in this format that Coppelia started the implementation last year. I was wondering where to get started and which ones are the configuration text files. Thanks in advance.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Text-based save file format

Post by coppelia »

Hello,

this is unfortunately not yet supported, we started development but put this on hold for a while (the task is not as straightforward as expected, and priorities change from time to time). But we recognize that this will eventually be needed.

Cheers

Justus
Posts: 42
Joined: 24 Jan 2017, 07:37

Re: Text-based save file format

Post by Justus »

Hi,
Just a little bump ("upvote") for this feature, it would be a great help during development!
regards,
Justus

nex
Posts: 29
Joined: 07 Nov 2016, 15:48

Re: Text-based save file format

Post by nex »

Adding my "vote" as well. It really would be very helpful to track changes in version control.

yale.lee
Posts: 4
Joined: 24 Oct 2022, 18:20

Re: Text-based save file format

Post by yale.lee »

Same here, I could definitely use a text-based format! Any chance you planned it in your backlog?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Text-based save file format

Post by coppelia »

Hello,

There are two ways of doing this:
1. The recommended way of doing would be to use the binary format (*.ttt or *.ttm files), and to keep the scripts separate (i.e. included from an external file). All you have to do is write your Lua or Python code in a *.lua or *.py file, in the same folder as your scene file. Then, include your external code via one of following directives:

Lua:

Code: Select all

require('myExternalFile') -- i.e. without the extension
Python:

Code: Select all

#python
include myExternalFile

# myExternalFile is the pythonScript name or path (absolute or relative), without quotes nor the ending '.py'
# searched paths include:
# <CoppeliaSim executable path>/ 
# <CoppeliaSim executable path>/python 
# <current scene path>/ 
# <additional path>/ (see system/usrset.txt and value 'additionalPythonPath')
# additional include paths passed via #luaExec additionalIncludePaths={'c:/Python38'}
2. Additionally, you can also import/export CoppeliaSim scenes and models via an XML format.

Cheers

Post Reply