sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Animation in SketchUp

    Scheduled Pinned Locked Moved Developers' Forum
    58 Posts 10 Posters 8.8k Views 10 Watching
    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.
    • J Offline
      Jim
      last edited by

      But please don't use timers - use the Animation class. Renderers already support it for rendering animations - I'm not sure they can hook into timer-based anims. My snippet in the previous post uses the Animation class.

      Hi

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        For my usage - animation would only be relevant if it would be possible to render it.

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          How exactly do renderers work with object animation - like in Sketchyphysics? How can they capture that movement?

          In my camera recorder script I ended up making a scene for each frame of the animation so that a renderer would be able to process scenes. But how can they use animation information? Is it something most of them have built in and it just a matter of writing the code according to their standards? Or do they have to implement object animation for each plugin that comes along and offers its own animation solution?

          chris

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

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            @chris fullmer said:

            How exactly do renderers work with object animation - like in Sketchyphysics? How can they capture that movement?

            I don't kow the answer to that. SketchyPhysics does use the Animation class, and I assume uses the physics engine to do the heavy calculations needed.

            They must be able to hook into that animation from the c/c++ code, since there can only be a single animation active at a time.

            Hi

            1 Reply Last reply Reply Quote 0
            • PixeroP Offline
              Pixero
              last edited by

              I see two different ways to do animation in SU. Both good in their own way:

              1. Fly around in realtime with something like LightUp's Tourtool mixed with Chris Fullmers Record camera. Then enhanced with a way of manually adjusting curves to reposition camera/object.

              2. Keyframe based animation with a timeline. Maybe a tool to drag and rotate the camera to the right position. A bit like the walktool but dragging instead of pushing the camera for better control. Maybe even adjustable curves in the UI like most animation software have. (I know you can draw curves like that with javascript.)

              1 Reply Last reply Reply Quote 0
              • chrisglasierC Offline
                chrisglasier
                last edited by

                @chrisglasier said:

                Will post again when found.

                Looping: Single vs. Multiple vs. Fixed Timelines, amongst other things.

                Also the demo - Click and drag to create more.

                With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                1 Reply Last reply Reply Quote 0
                • chrisglasierC Offline
                  chrisglasier
                  last edited by

                  @jim said:

                  Why wouldn't you want to use Scenes to define the keyframes?

                  Our (vaporous) dialog would allow defining what happens to objects between the keyframes (scenes): sets the number of frames (or seconds), easings, etc.

                  Sorry I missed this probably because of the vapor pouring from my brow.

                  The dialog basically deeply nests components and scenes in multiple collections, and records what components appear in what scenes, purchase orders and so on. All of this I am sure could be helpful in creating a conventional animation, but what I am more interested in is using it to create "living" 3D reports. Imagine a project manager having an automatically updating AR model sitting on his desk instead of huge piles of drawings, site reports, change orders and so forth.

                  So I shy away from keyframes - not because I think they are wrong but because I want to see how far I can get towards what I described.

                  With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    MartinRinehart
                    last edited by

                    @jim said:

                    But there is more types of animation than moving - what about rotation? color? model time (shadows)? focal length?, etc.

                    I've got my Conductor running. He's Timer based. I'll see if I can switch him to Animation.

                    He calls the run() method of objects that register during an interval they request. What your object's run() does is up to your object: move, rotate, scale, fly, explode ...

                    I've had nothing but issues with materials. Do simple colors work w/o Bug Splats?

                    Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      Yup. I use colors in many scripts and I've never plsatted from them. Though I've never had a texture splat on me either, so it might just be a workflow thing?

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

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        MartinRinehart
                        last edited by

                        @chris fullmer said:

                        Yup. I use colors in many scripts and I've never plsatted from them. Though I've never had a texture splat on me either, so it might just be a workflow thing?

                        Thanks. We're off topic. I'll reraise this as Wood Cherry Original.

                        Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                        1 Reply Last reply Reply Quote 0
                        • thomthomT Offline
                          thomthom
                          last edited by

                          @martinrinehart said:

                          I've had nothing but issues with materials. Do simple colors work w/o Bug Splats?

                          I remember from another thread that you demonstrated that you used entity.material = 'materialname', correct? Have you tried instead doing entity.material = model.materials['materialname']

                          I've also never had problems working with materials, textured or not, in SU ruby.

                          Thomas Thomassen — SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 Reply Last reply Reply Quote 0
                          • Chris FullmerC Offline
                            Chris Fullmer
                            last edited by

                            For animation, I do appreciate where your coming from on this Chris. Database driven animation is very important. I would love to see the two work side by side, maybe even hand in hand 😄 I'm sure they can, since its all just about the computer knowing when to start and stop an animation for specific object. It doesn't care if the markers are recorded in frames or days. I think a masterful GUI would be able to handle it all.

                            Chris

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

                            1 Reply Last reply Reply Quote 0
                            • J Offline
                              Jim
                              last edited by

                              In reply to #1

                              Another reason not to use a SketchUp timer is that is is an integer timer - it will round decimal values to the nearest whole number.

                              #2 - that is a solid way to do it. Yes, scaling does not work when interpolating the matrix. I never got around to trying to animate the scale of a Group/Instance.

                              Hi

                              1 Reply Last reply Reply Quote 0
                              • thomthomT Offline
                                thomthom
                                last edited by

                                @jim said:

                                Another reason not to use a SketchUp timer is that is is an integer timer - it will round decimal values to the nearest whole number.

                                Do we have other timer options?

                                Thomas Thomassen — SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  Jim
                                  last edited by

                                  When using the Animation class, you call view.show_frame(delay) with an optional delay argument. The question is if this delay can be fractional seconds, or is limited to whole seconds. If whole seconds, then you still will not be able to control the in-model frame-rate (which is really not important because the output frame-rate can be set.)

                                  Hi

                                  1 Reply Last reply Reply Quote 0
                                  • chrisglasierC Offline
                                    chrisglasier
                                    last edited by

                                    @thomthom said:

                                    Do we have other timer options?

                                    Don't you find this a good basis. Instead of dots in DOM you can do it to components in Sketchup.

                                    With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      Jim
                                      last edited by

                                      BTM's Animation Plugin moved here: http://forums.sketchucation.com/viewtopic.php?f=323&t=25196&p=215878#p215878

                                      Hi

                                      1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        MartinRinehart
                                        last edited by

                                        @jim said:

                                        Another reason not to use a SketchUp timer is that is is an integer timer - it will round decimal values to the nearest whole number.

                                        I want to switch to Animation, but in the mean time I'm getting good timer results at 25 frames per second. Wish I could explain this:

                                        
                                        # /r2/t.rb
                                        
                                        require 'sketchup'
                                        
                                        i = 0
                                        start = Time.now()
                                        id = UI.start_timer( 1.0/25, true ) { 
                                            i += 1
                                            if i > 25 
                                                UI.stop_timer( id ) 
                                                puts Time.now() - start 
                                            end
                                        }
                                        puts Time.now() - start
                                        
                                        

                                        Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          Jim
                                          last edited by

                                          Because your maximum "live" frame-rate is coincidentally about 25 fps?

                                          
                                          $t=Time.now;UI.start_timer(0.999) { puts Time.now - $t }
                                          0.02
                                          
                                          $t=Time.now;UI.start_timer(1.999) { puts Time.now - $t }
                                          1.002
                                          
                                          

                                          I don't know. I get 0.26 seconds when I run your example.

                                          Hi

                                          1 Reply Last reply Reply Quote 0
                                          • M Offline
                                            MartinRinehart
                                            last edited by

                                            @jim said:

                                            Because your maximum "live" frame-rate is coincidentally about 25 fps?

                                            Actually, not a coincidence. I was expecting 25 frames to take a second, more or less, at 25 fps. I'm getting half a second, consistently.

                                            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

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

                                            Advertisement