Page 1 of 1

Can we access embedded scripts w/o opening the .ttt files?

Posted: 24 Oct 2015, 03:30
by tor
Hi Folks:

Can we access embedded scripts without opening the scene .ttt files?

So, my use case requires that a vrep scene is opened automatically/programmatically.
And often times, I need to modify the script (using an external editor) so
it is time consuming to always start-up vrep manually then open the .ttt scene then open the embedded script.
Hence, an access to the embedded _without_ opening the scene .ttt file seems to streamline such process.
Is that possible? If not, why not?
Of course, that independently-modified embedded script should somehow get called whenever the corresponding .ttt file is opened.

Thank you.

Re: Can we access embedded scripts w/o opening the .ttt file

Posted: 24 Oct 2015, 11:10
by coppelia
Hello,

yes, you can do that by including external lua files like in following example:

Code: Select all

local f = loadfile('myEmbeddedScriptCode.lua')
return f()
You can imagine having all your embedded scripts have a similar code as shown above, and all the relevant code would be located in external files.

Cheers

Re: Can we access embedded scripts w/o opening the .ttt file

Posted: 25 Oct 2015, 01:57
by tor
It works like a charm :)
Thanks a lot.