• Login
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 14 Apr 2011, 16:52

    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 15 Apr 2011, 13:48

      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 16 Apr 2011, 05:56

        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 16 Apr 2011, 15:25

          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 18 Apr 2011, 14:09

            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 19 Apr 2011, 12:23

              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 19 Apr 2011, 13:47

                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 19 Apr 2011, 18:46

                  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
                  1 / 1
                  • First post
                    8/8
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement