Please send suggestions for my scriptwriting

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

I tried the updated exposure sheet tool and all features works great so far, I'm running mac osx 10.4.6, the only thing I'm wondering about is the load list function, it loads the positions and data in timeline but it doesn't load the images, I don't know if it's supposed to do that? Anyway,thanks a lot for a handy script Fazek!
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

To BA: the latest version runs only as a tool, so copy it into the tool directory. I will update the README, it's confusing. If you click on it, an "Exposure Sheet" button arrives on the toolbar of the window. You must click on this button to get the dialog window. It is working this way because Moho handles dialog windows strangely. Many functions of the moho interface are working bad if you call them from a separate modal or modeless dialog window. You must create some Switch layers to see how it works.

To load images, use the "Import images" button. It's a good idea anyway, to add the possibility to load (the missing) images together with the list. (added 12/05/2006): Done it.

I have a problem with the existing "Source data..." list format (I don't know its official name). It uses the

("%d %s\r\n", frame, name) for a key, and

("%d \r\n", frame) (ie. only frame number, no name) for "no key here".

But if a key has the name "", (this is a valid name!) the result is the same! It could become a problem because the frame 0's default key is ""! This format is wrong because it cannot distinguish the two state! A new format needed! If there is one already, supported by Moho, please anybody, tell me! Otherwise, I'll create another one. Tell me also if you know other (good, widely-spreaded) existing formats that could be usable.

Multi-layer formats, like Toonz's .xsh would be supported later. The existing tool's idea is to work on a single "opened" layer. Maybe I'll add a dialog window for loading, to handle the different options, like "create new layers" or "load missing images" etc.

Now I won't be online for a couple of days, but I'll be back on last days of May again.
- - - Fazek
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Hello, I'm back again... It is a great surprise for me to see how dynamic was the forum these days! Thanks for the many new (or old?) download pages!

I have a question to Mac OS X users: is it possible to use the MPlayer (download: http://www.mplayerhq.hu ) media player under Macintosh? I know it is a kind of unix, so I'm hoping it works. Under Linux and Windows it is OK. and I have a plan to create a LUA script, based on MPlayer's batch and remote control features, to add real playback to Moho. But if MPlayer is not working on Mac or hard to install, I should find another solution.
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Hi Fazek!
Yes the Mplayer is working under osx and there is a precompiled version so it's simple to install, I don't know what audio formats it reads though but I made a quick try and it plays mp3 but not .aiff files, I'll give wav files a try too.

btw. it sounds like a great idea you have, to make moho have real playback functions :D
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

no luck with aif and wav files, only mp3, I guess I need some codecs but I'm not sure which and where to put them
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Thank you for the help. You should try the following from the command line:

mplayer -audiofile filename.wav

It is also interesting for me that the commands like

mplayer mf://filepath/name%06d.jpg -mf fps=25:type=jpg

are working or not (in this case, the image sequence begins with the filepath/name000001.jpg)
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

I got this message when running from terminal:
Ulrik-Bod-ns-dator-2:~ ulrikboden$ mplayer -audiofile /Users/ulrikboden/Desktop/psoul-bluenightsun.wav
dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/mplayer
Reason: Incompatible library version: mplayer requires version 10.0.0 or later, but libfreetype.6.dylib provides version 6.3.0
Trace/BPT trap
Ulrik-Bod-ns-dator-2:~ ulrikboden$

So there is an old codec in the path, I'm not so good at this sort of things but I will try to help out if I'm able to, I'll try to figure out how to get another codec in this path and report back later
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Silly MPlayer, the libfreetype is a widely-used truetype font support library...But I don't know... the newest version is 1.3.1, downloadable from SourceForge. I absolutely can't imagine why it is required to play a wav... I am sure you don't need any additional MPlayer plug-in to play it. FreeType is not an MPlayer-specific thing and you should download it from somewhere (or try to use an older version of MPlayer?)

Are you using the http://mplayerosx.sourceforge.net/ version?
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Fazek wrote:Are you using the http://mplayerosx.sourceforge.net/ version?
No, I'm using the one from the site you showed
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Now I'm working on the MPlayer based player tool. There is one big problem with MPlayer: it counts the time in seconds, so you cannot position to an exact FRAME and it views the timecode without frames in its OSD counter. But internally, it uses the frames so it is possible to step frame-by-frame in the film. It is possible to play multiple files with MPlayer, I want to use this feature too, to play separated scenes together.
- - - Fazek
User avatar
J. Baker
Posts: 1063
Joined: Wed Mar 23, 2005 7:22 pm
Location: USA
Contact:

Post by J. Baker »

The only tool I can get to work is the polygon tool. Is there something else that needs to be done?
User avatar
J. Baker
Posts: 1063
Joined: Wed Mar 23, 2005 7:22 pm
Location: USA
Contact:

Post by J. Baker »

hello?
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Hello,

Sorry for the late answer. The fa_sharedutils.lua file must be in the "utility" folder, and the other files must be in the "tool". If your Moho sends some error messages while running the programs, please tell me. The icons are similar to the LM's tools, but in dark blue.
- - - Fazek
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

The MPlayer frontend is downloadable now. MPlayer can play both movie files and image sequences, and it is possible to play a separated sound file together with the picture.

MPlayer has a remote-control mode when the user or a "frontend" program can control the playback with string commands, through a standard input "pipe". This control is very primitive because it can step frame-by-frame only forwards and it counts everything in integer seconds instead of frames.

Be careful: do not switch off the MPlayer window by hand, because it can crash your Moho. That's because lua cannot deal with a broken pipe (at least under Linux). You can keep the player window while you are working with other tools.

I need feedback information how this tool works on other platforms. It could be a problem to choose a right version of MPlayer for your system. Under Linux, it is the best if you make MPlayer from source (probably for OS X too), but there are precompiled versions, so don't give up if something wrong.

If my lua program has problems, you can check these:

1. Under Windows, I think you must change the invoking command of MPlayer to something like C:\Program files\mplayer\mplayer.exe ...

2. Maybe your MPlayer version's command set is incompatible. Maybe this is not possible, but all command strings are at the beginning of the lua file, so you can try to edit.

3. Your LUA does not support the io.popen() command. In this case, I can change it to an os.execute("mplayer <tempfile") style command. But I hope the popen works. If I have more information how to invoke MPlayer on the different platforms, I can make an intelligent solution.
- - - Fazek
User avatar
Rai López
Posts: 2242
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Ey, HI! :D I'm very intrigated but seems to me that something could be wrong in the link, cause if I click over the "fa_mplayer.zip" link to download it, the file that I get is "fa_switch_xsh.zip" ...Anyway THANK YOU very much again for all your dedication and I hope I can enjoy it soon :) ...CIAO!

EDIT: Hmmm... BTW! I'm very intrigated too for another thing/function, well, that called "Max search depth:" in your Creatre Shape tool version... hmmm... Any tip? :roll: (Thanks!)
Post Reply