sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Start animation on frame

    Scheduled Pinned Locked Moved SketchyPhysics
    8 Posts 2 Posters 932 Views 2 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.
    • W Offline
      wyatt
      last edited by

      I have created a scene with multiple SP animations. I need two objects to begin moving at the start of the animation. I would like the third object to begin at a specified frame #. If I set everything to run from the beginning, the file works fine. If I change Object 3 to start on a delay (I have tried using "if frame>200" and also tried "if frame==200"), Objects 1 and 2 start to move, but after Object 3 starts, the file crashes. I'm using ontick for all 3 objects. Is there a different set of commands I should be using?

      1 Reply Last reply Reply Quote 0
      • W Offline
        wyatt
        last edited by

        Any help from SP users? Is delaying part of simulation possible?

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mr.K.1
          last edited by

          It is possible yes, you probably just have some errors in the code/model.

          Best if you attach your model, or paste the code so we can have a look at it.

          1 Reply Last reply Reply Quote 0
          • W Offline
            wyatt
            last edited by

            That model is on my computer at work, but I'll stop by there later and post part of it. The code I have is all probably your stuff anyway, ha! Thanks.

            1 Reply Last reply Reply Quote 0
            • W Offline
              wyatt
              last edited by

              Mr. K, here is the model with some more detail on what I'd like to do and what I've tried.


              SP_DelayAnimation.skp

              1 Reply Last reply Reply Quote 0
              • M Offline
                Mr.K.1
                last edited by

                Think I got what you needed.

                I was going to explain the script line by line but this forum is exceptionally horrible for posting code, so if there is anything specifically you won't understand just ask me later.


                SP_DelayAnimation.skp

                1 Reply Last reply Reply Quote 0
                • W Offline
                  wyatt
                  last edited by

                  This works perfectly, and even the curves stayed oriented the right way. Compensating for stopping distance was brilliant. This was more complicated than the one line of code I was trying to change. Thanks so much!

                  The one thing I don't understand is the second line below:

                  dir=position.vector_to(evalCurveAbs("camera3", @new_distance1))
                  dir.length/=5
                  setVelocity(dir.to_a)

                  The first line sets the direction of the object to follow the path named camera3 for a set distance. The third line sets the speed. What does "dir.length/=5" do?

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    Mr.K.1
                    last edited by

                    dir.length/=5 simply divides the pulling vector length/strength by 5, that way the pull is more gentle and the starts are smoother( a more car like movement), greater the number gentler the pull.
                    But going too far with speed and smoothing can cause rubber banding.

                    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