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

Typically: "How do I... ", "How can I... " questions
Post Reply
tor
Posts: 21
Joined: 18 Oct 2015, 11:56

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

Post 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.

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

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

Post 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

tor
Posts: 21
Joined: 18 Oct 2015, 11:56

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

Post by tor »

It works like a charm :)
Thanks a lot.

Post Reply