9 Replies Latest reply on Nov 8, 2006 4:40 AM by foq

    How to change the playrate...

    foq Level 1

      I really hope you can help me with this one:

      I know I can set the playrate of individual models using
      member(whichCastmember).model(whichModel).keyframePlayer.playRate

      But what if I want my whole scene to play slower / faster? Do I have to set it on every model manually? Isn´t there a quick and easy way to do that?

      Thanks a lot for the help.
      Best Regards
        • 1. Re: How to change the playrate...
          Level 7
          foq wrote:

          > I really hope you can help me with this one:
          >
          > I know I can set the playrate of individual models using
          > member(whichCastmember).model(whichModel).keyframePlayer.playRate
          >
          > But what if I want my whole scene to play slower / faster? Do I have to set it
          > on every model manually? Isn´t there a quick and easy way to do that?

          There´s no easy way but instead of doing it with many lines, you can use
          iterations. E-mail Lingo:

          repeat with n = 1 to member(whichCastmember).model.count
          thisModel = member(whichCastmember).model[n]
          thisModelHasKeyframePlayer = FALSE
          repeat with n = 1 to thisModel.modifier.count
          if thisModel.modifier[n] = #keyframePlayer then
          thisModelHasKeyframePlayer = TRUE
          exit repeat
          end if
          end repeat
          if thisModelHasKeyframePlayer then thisModel.keyframePlayer.playRate=0.5
          end repeat
          end

          That code (hopefully) will detect which models has #keyframePlayer
          modifier attached and set they playrate to half of the speed.

          Regards,
          --
          Agustín María Rodríguez

          www.onwine.com.ar > Macromedia Director demos & code
          • 2. Re: How to change the playrate...
            foq Level 1
            Thanks a lot for the help, Agustin.
            It makes sense, but it crahses Director...
            • 3. Re: How to change the playrate...
              tedalde2 Level 2
              Yes, change the counter "n" in repeat with n = 1 to thisModel.modifier.count to a different variable.
              • 4. How to change the playrate...
                _lw Level 1
                of using "getone" to detect the modifier:

                cnt=pWorld.model.count
                repeat with n=1 to cnt
                modifier_list=pWorld.model[n].modifier
                if modifier_list.getone(#keyframePlayer) = 1 then
                pWorld.model[n].playRate=0.5
                end if
                end repeat


                • 5. Re: How to change the playrate...
                  Level 7
                  hondo3000 wrote:
                  > of using "getone" to detect the modifier:
                  >
                  > cnt=pWorld.model.count
                  > repeat with i=1 to cnt
                  > modifier_list=pWorld.model .modifier
                  > if modifier_list.getone(#keyframePlayer) = 1 then
                  > pWorld.model
                  .playRate=0.5
                  > end if
                  > end repeat
                  >
                  >
                  >
                  hehe Thanks for that one! I knew I was missing an easier way but didn´t
                  have time to think what it was until I saw your post ;)

                  Cheers!
                  --
                  Agustín María Rodríguez

                  www.onwine.com.ar > Macromedia Director demos & code
                  • 6. How to change the playrate...
                    _lw Level 1
                    there was something wrong... it shoud be ...getone(#keyframePlayer) <> 0
                    so this should work with models that have not the keyframeplayer in the first position
                    of the modifier list.

                    repeat with n=1 to pWorld.model.count
                    if (pWorld.model[n].modifier).getone(#keyframePlayer) <>0 then pWorld.model[n].playRate=0.5
                    end repeat

                    >hehe Thanks for that one! I knew I was missing an easier way but didn´t
                    >have time to think what it was until I saw your post ;)

                    (this is now the shortest one i can imagine :) )

                    cheers!

                    p.s.: there is no linebreak in the repeat loop... this website breakes the line because it's too long... :(

                    • 7. Re: How to change the playrate...
                      tyree_2 Level 2
                      changing the framerate of the 3d member would also slow or speed up the entire scene. click somewhere on the 3d scene of the timeline and right click, insert keyframes, click on a keyframe go to modify, frame, tempo change the tempo framerate. where ever you click on keyframe and change the playrate. it will play at the speed you tell it to instead of the default 30
                      • 8. Re: How to change the playrate...
                        _lw Level 1
                        this will have no effect on the keyframe or bonesplayer, they are timebased and tempo can only be changed by setting the playrate.
                        • 9. Re: How to change the playrate...
                          foq Level 1
                          Thanks a lot everyone!