Page 1 of 1

Is it possibile to execute a render through scripting?

Posted: Tue May 20, 2014 10:25 am
by Breinmeester
I'd like to code an export script with certain set properties, but i wouldn't know where to start with the actual export command. Any help?

Re: Is it possibile to execute a render through scripting?

Posted: Tue May 20, 2014 12:38 pm
by synthsin75
Just off hand, yes, using the command line renderer and Lua OS library commands....I think.

Re: Is it possibile to execute a render through scripting?

Posted: Thu May 22, 2014 1:07 pm
by Breinmeester
Hi Synthsin,

Thanks for your input.

I got it to work using:

Code: Select all

os.execute('start "Anime Studio Pro" "C:\\Program Files\\Anime Studio Pro 10\\Anime Studio Pro Win32.exe" -r "C:\\Projects\\file.anme"')
Do you know if there is a way to call the application path of AS?

Re: Is it possibile to execute a render through scripting?

Posted: Fri May 23, 2014 12:42 am
by synthsin75
moho.AppDir()

Re: Is it possibile to execute a render through scripting?

Posted: Fri May 23, 2014 10:51 am
by Breinmeester
Yeah, i found that one, but it points to a location where it saves or gets data from. On Windows its path somtimes even goes: users/me/appdata/roaming/...
I think i'll have to ask the user to point towards the .exe and use SavePrefs(prefs), prefs:SetString(path) to be able to recall it.

Re: Is it possibile to execute a render through scripting?

Posted: Fri May 23, 2014 1:01 pm
by synthsin75
Are you saying it points to the working directory? If so, did you change the working directory in your script? If not, this may be a scripting interface bug. I'll test some when I get home tonight.

Re: Is it possibile to execute a render through scripting?

Posted: Fri May 23, 2014 3:18 pm
by Breinmeester
Nah, haven't changed a thing. I think it gave me back these two paths in different instances:
C:\Program Files\Anime Studio Pro 10\Resources\Support
C:\Users\me\AppData\Roaming\Smith Micro\Anime Studio Pro\10

I'm guessing the path changes to wherever it last gathered data from.

If you could check, that would be awesome.

Re: Is it possibile to execute a render through scripting?

Posted: Sat May 24, 2014 4:00 am
by synthsin75
Oops, should have been: moho:AppDir()

But that first path (correct one) is the only one I can get AS to produce with this function. I can't even guess at why you are getting any other path, especially without seeing your code.

Once you sort that out, it's just a matter of stripping the path down to the directory the exe is in and using: moho:BeginFileListing(const char *dir, bool listHiddenAndSystemFiles = true)
And:
moho:GetNextFile()
To make sure you have the AS exe.