Graphics

 View Only
  • 1.  Do - While loop

    Posted 12-13-2017 20:35
    We have a player who is donating $500 per goal this season to charity. I'd like to build an animation that counts up from $500 (or whatever starting point) to $1,000 (or the next $500 increment) using visual logic. I can't find anything that looks like a Do-While loop. Any ideas?


  • 2.  RE: Do - While loop

    Posted 12-13-2017 22:23

    Hi Cam,

    As far as I know there is no Do-While loop in XPression.
    But luckily you don't need it for what you're trying to accomplish.

    You can use another method for creating an animation like this.

    You need to add three textfields to your scene:
    "¢ One which will have the starting-amount in it and which should be hidden
    "¢ One which will have the amount that needs to be added to the startamount and which should also be hidden
    "¢ One which will show the counting animation

    You will also need a quad. But you don't have to do anything with it, we're actually abusing the scale-property of this quad.
    This quad should be also best hidden in your scene.

    I usually tend to put the objects that need to be hidden in a DUMMY-group which I then hide and lock just to make sure nobody touches it by accident ;-)

    You will also need to create an animationcontroller which has one animation in it: it will adjust the scale (x for example) of the quad from 0 to 1


    So what is the goal of this?

    In Visual Logic you can use the scale of the dummy-quad as a multiplier for the amount you want to add to the start-amount.

    When the animation starts it's at 0, so 500x0 = 0

    When the animation is halfway the scale will be at 0.5, so 500x0.5 = 250

    when the animation is finished, the scale will be at 1 resulting in 500x1 = 500

    By using visual logic you can continuously update the value while the animation is running.

    The best part is that you can put this scene in the sequencer and just have the operator fill in the startamount and the amount that needs to be added.
    Easy!


    #XPression


  • 3.  RE: Do - While loop

    Posted 12-15-2017 19:14
    That makes perfect sense! Unfortunately, our guy is out 4-6 weeks now. I'll test it out soon and let you know.
    #XPression


  • 4.  RE: Do - While loop

    Posted 12-23-2017 20:29
    @cainnech That worked perfectly. Thanks for the help!
    #XPression