• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Creating an avi file with a plugin

Scheduled Pinned Locked Moved Developers' Forum
13 Posts 6 Posters 700 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    kiesewetter
    last edited by 11 Nov 2010, 12:03

    hi!

    is possible to create an avi file of a sketchup animation with a ruby
    skript?
    thanks for your time.
    bye.

    tim

    1 Reply Last reply Reply Quote 0
    • G Offline
      Gaieus
      last edited by 11 Nov 2010, 12:04

      Hi Tim,

      Does it have to be ruby? Is the "normal" animation export not good?

      Gai...

      1 Reply Last reply Reply Quote 0
      • K Offline
        kiesewetter
        last edited by 11 Nov 2010, 12:30

        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?

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gaieus
          last edited by 11 Nov 2010, 13:48

          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.
          πŸ˜„

          Gai...

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 11 Nov 2010, 13:59

            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

            1 Reply Last reply Reply Quote 0
            • C Offline
              Chris Fullmer
              last edited by 11 Nov 2010, 16:41

              @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

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 11 Nov 2010, 18:35

                @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 a make_move.cmd file containing the line "mencoder.exe" "jpgs_folder" "30fps" "avi"... and run it with UI.openURL(path_to_cmd_file)...
                Finally use UI.openURL(path_to_avi_file) ???

                TIG

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Chris Fullmer
                  last edited by 11 Nov 2010, 20:11

                  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

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TIG Moderator
                    last edited by 11 Nov 2010, 21:02

                    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! πŸ˜„

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      Chris Fullmer
                      last edited by 11 Nov 2010, 21:23

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

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        kiesewetter
                        last edited by 11 Nov 2010, 21:27

                        here is a link that dirscribes how to start an exe with a ruby script.

                        Link Preview Image
                        NameBright - Coming Soon

                        favicon

                        (workingwithrails.com)

                        should be abel to save the images first and after that to invoke a programm that puts them together to a little movie, right?

                        1 Reply Last reply Reply Quote 0
                        • Dan RathbunD Offline
                          Dan Rathbun
                          last edited by 12 Nov 2010, 04:39

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

                          I'm not here much anymore.

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            Pout
                            last edited by 3 Dec 2010, 09:28

                            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

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Buy SketchPlus
                            Buy SUbD
                            Buy WrapR
                            Buy eBook
                            Buy Modelur
                            Buy Vertex Tools
                            Buy SketchCuisine
                            Buy FormFonts

                            Advertisement