Creating an avi file with a plugin
-
Hi Tim,
Does it have to be ruby? Is the "normal" animation export not good?
-
hi Gaieus,
the normal animation export is good enough, but i dont know how to create scenes and to invoke the export in a ruby script.
is that possible? -
Well, I do not know if possible (I am not a scripter myself) just saw your (first) post and was not sure if you missed the native export or want to do something else.
I am just the housekeeper here and the one who says hello and good bye so welcome to SCF and be patient until one of those ruby talents answer.
-
You can't auto-run the .avi export via Ruby in the same way that you can say export a .dae file.
However, there are ways of making multiple scene tabs [like model.pages.add("page")] and ways of changing between pages and exporting an image [.jpg/.png etc] from each page in turn.
There are already scripts to add multiple pages [scene-tabs] - Chris Fullmer's screen_recorder [?] springs to mind...
You then need to use a 3rd party app to join these image files into a movie format - ones like Windows Movie Maker 'between' the images to make smooth frame transitions... -
@tig said:
Chris Fullmer's screen_recorder [?]
So close!, camera recorder.
There is mencoder that is a command line video encoder that will take series of jpegs and turn them into a movie. I've just never gotten around to trying to run it from a ruby script.
mencoder works on mac and PC and linux, so thats a big plus for it. Though I have not idea how to run a command line file (mencoder.exe) and send paramters to it from ruby script. I would hope its something like:
run (mencoder.exe jpgs_folder, 30fps, avi, etc)
But I've never tried it. But it would sure make my camera recorder cooler if I could write my own video types, including .mov on a PC, mpg4, etc.
Chris
-
@chris fullmer said:
@tig said:
Chris Fullmer's screen_recorder [?]
So close!, camera recorder.
There is mencoder that is a command line video encoder that will take series of jpegs and turn them into a movie. I've just never gotten around to trying to run it from a ruby script.
mencoder works on mac and PC and linux, so thats a big plus for it. Though I have not idea how to run a command line file (mencoder.exe) and send paramters to it from ruby script. I would hope its something like:
run (mencoder.exe jpgs_folder, 30fps, avi, etc)
But I've never tried it. But it would sure make my camera recorder cooler if I could write my own video types, including .mov on a PC, mpg4, etc.
Chris
My memory's not what it used to be and I was too lazy to research!
So use your tool to add the scenes.
Write a simple script to export each scene as a jpg/png [RickW has a working script example] into a folder.
When the image files are all made you then make the movie...
On PC if you could have 'mencoder.exe' - so we write amake_move.cmd
file containing the line "mencoder.exe" "jpgs_folder" "30fps" "avi"... and run it withUI.openURL(path_to_cmd_file)
...
Finally useUI.openURL(path_to_avi_file)
??? -
It sounds do-able. I've never tried to run any outside programs from within ruby. I have no idea what the actual parameters for the mencoder.exe are, but those are simple approximations.
I've wanted to do this for my camera recorder script. It already exports the series of jpegs and I'd rather it not even make scenes. I only added that afterwards so that someone could export a movie of the camera path.
I might try to get this up and running here soon. This is one that I could put to use too.
Chris
-
I run Octane.exe from my Octane Render Exporter will a mile long string of arguments vis a cmd file [command on MAC] so it is quite doable!
-
That sounds really good. When I get around to it (hopefully tonight) I'll probably be looking around for some more help
Thanks for getting me pointed in the right direction TIG.
I hope this helps the original poster starter person too...
-
here is a link that dirscribes how to start an exe with a ruby script.
http://workingwithrails.com/forums/4-ask-a-rails-expert/topics/926-how-to-run-exe-file-in-ruby
should be abel to save the images first and after that to invoke a programm that puts them together to a little movie, right?
-
Just DO NOT use exec() as in the last post in that topic (link above.)
It will cause Sketchup's Ruby subprocess to exit. (.. and probably Sketchup to crash.) -
hmm tried mencoder a lot of times and it is not that easy to get ruby running the mencoder line in a command window (things with locatiosn of the imgages and the mencoder exe come back to mind)
ffmpeg is easier
Advertisement