Results 1 to 8 of 8

Thread: Reverse animation without transition

  1. #1
    Join Date
    Jul 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Reverse animation without transition

    I have an animation which is a series of SequentialAnimation. I start it and it runs to the end. Is there a way of reversing it without using transitions or designing another series of SequentialAnimation the other way around?

    I run it by setting a variable to a 0 or or 1. I would like it to run when this variable is 1 and then reverse to the beginning from where it could be when the variable is 0 for instance.

    Any help is appreciated.

    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reverse animation without transition

    No, that's not possible.

    It might be possible to generate a second sequence that has the same list of sub animations but in reverse order, but it is, at least no generally, possible to reverse each child transition.

    E.g. the easing curve could not be exactly reversible, or the animation might only have a "to" value, so the reverse would miss its "to" value, etc.

    Cheers,
    _

  3. #3
    Join Date
    Jul 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Reverse animation without transition

    Thank you for your reply. I guessed that it wouldn't be possible so I have already produced a second reverse sequence. The issue however is if I stop the first sequence in the middle of the run and start the reverse sequence, since everything will start from the beginning, it will take a while to get to that particular point to then see the reverse effect take place. Do I make sense? Is there a way of avoiding that?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reverse animation without transition

    If you want the first sequence to jsut some to its end you could call complete(), so it would end with values that the reverse sequence expects to start with.

    Cheers,
    _

  5. #5
    Join Date
    Jul 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Reverse animation without transition

    I'm not worried about the values where it starts off from. What I want to do is if the sequence is in middle of run and when I want to reverse it the reverse should happen from that point. Just like a video clip if I start rewinding if from the midpoint it doesn't complete the clip before it reverses it, it just reverses it from that point.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reverse animation without transition

    Have you tried setting the duration of those animations you want to skip to 0?

    Cheers,
    _

  7. #7
    Join Date
    Jul 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Reverse animation without transition

    Every part has a duration, I'm not sure I understand what you're saying

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reverse animation without transition

    If I understood you correctly you have a reverse sequence that you want to start somewhere in the middle. not at the beginning.
    Since the sequence will always start at the first child animation, you could let all children before the wanted start have a 0 durationn.

    Alternatively you could create your own sequence handling, i.e. not use a SequentialAnimation.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 8th January 2015, 20:15
  2. Replies: 1
    Last Post: 27th July 2012, 17:33
  3. XML and reverse geocoding
    By seanasl in forum Qt Quick
    Replies: 0
    Last Post: 24th January 2012, 09:46
  4. Replies: 8
    Last Post: 10th February 2011, 17:31
  5. Animation not working on transition between states
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 2nd January 2010, 16:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.