Is it possibile to execute a render through scripting?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

Is it possibile to execute a render through scripting?

Post 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?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post by synthsin75 »

Just off hand, yes, using the command line renderer and Lua OS library commands....I think.
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

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

Post 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?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post by synthsin75 »

moho.AppDir()
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

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

Post 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.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post 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.
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

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

Post 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.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

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