Graphics

 View Only
  • 1.  Animating Text values

    Posted 09-12-2017 23:44
    Right, so I am now tasked with making a page for poll results, and what I would like to do is have the number value animate from 0-X% based on user input. So, if the result for the first response was 85%, I would want the text to animate from 0-85 as the bar from bar-graph builds in, while the response below it is maybe only 10% and it, likewise animates in the same fashion. It seems like the answer might lay somewhere in the string nodes for VL, but I am uncertain where to begin honestly.

    Can it be done?


  • 2.  RE: Animating Text values

    Posted 09-13-2017 07:45
    To achieve that, you'll need to use VL and script :

    1) Create an empty group and 2 text object (1 onair, the second not visible)
    2) Create a VL to link PosY of this group to Text of on air text value (a format block, or trunc block will be necessary to get an integer).
    3) Put a key at frame 0 with PosY of your empty group at 0 in an animcontroller of your main SD).
    4) Create a script into OnOnline that will set a keyframe on your animcontroller at the end of your animation (Set PosY of empty group to the value of the second text object).

    Value of your on air textobject will increase with your animcontroller...

    I hope you'll understand me...
    #XPression


  • 3.  RE: Animating Text values

    Posted 09-13-2017 17:27
    If the task involves scripting then it is beyond my capabilities as I do not know how to script in XPression, and there doesn't seem to be much in the way of education resources out there to bridge that knowledge gap. I was hoping the Counter function block could do it, but it has limited input acceptance. I feel like the counter should be able to accept the value of 2 text objects to serve as the range of the counter, with another input to determine he number of frames for which the counter takes to scroll from value 1 to value 2, but it doesn't appear to have been built that way.

    Anyway, I do appreciate the answer, if only to come to the conclusion that it cannot realistically be done - at least with my current skill-set. Fortunately, this was not a request by the client, but rather something I wanted to do to make for a more polished look. I really feel this is the sort of thing which should be achievable with VL alone, but alas... wall hit.

    Thanks Vinz, on to the next mountain...
    #XPression


  • 4.  RE: Animating Text values

    Posted 09-14-2017 03:01
    You could always build the bar using a quad with the width (or height depending on which direction you are going) set to a value of 1. Doing this will give you a 1:1 scale in which ever direction you set the bars to move. To make sure it moves completely correct, you'll have to also adjust the pivot to either -1 or 1 depending on which direction you are going for either x or y. All you'd have to do then is set an invisible text field in which you type in the poll results (i.e. 85%) and link this in VL to the scale value of the bar quad. You might also want to multiply the scale by some sort of scaling constant as a result of 85 would only make the bar 85 pixels wide (or tall), so maybe a value like 10 would do (or something other to better fit your scene). To animate the bar though, the best bet is to have a mask reveal the individual bars because you couldn't really set a keyframe for scale since it is being run through VL.

    I hope I'm getting at what you are trying. Let me know what you think.
    #XPression


  • 5.  RE: Animating Text values

    Posted 09-14-2017 15:33
    We built bar graphs to coincide with a music poll. I did pretty much what drew did including the scaling. Ours was based on percentages but it was still updated live. You might want to use the mask idea but on the bottom and push the bar up from the bottom of the screen, in case you have any 3d modeling to it so the top doesn't look like it's been sliced off. And Willie, there are a ton of people on here that are really good at scripting. That's how I have done most of my work, standing on the shoulders of others.
    #XPression


  • 6.  RE: Animating Text values

    Posted 09-14-2017 17:18

    Well, that's kind of what I built yesterday, although I used position instead of scale. My bars are oriented in X, and I have visible text fields in which one can enter the results. That number (with a multiplier of 7) determines the X Position of the bar, and a mask which animates the entire possible length subsequently reveals it. I have also made it so the result number lives at the end of the result bar, for a more dynamic look. It works, but what I really wanted was for he bars to grow, with the number following along the edge and have the displayed value climb from 0-X until it reaches the number input as the result. It would have better production value for sure, but I can't crack that nut.

    Here's a look at the logic setup:


    #XPression


  • 7.  RE: Animating Text values

    Posted 09-14-2017 17:28
    Yeah, I don't think there is a way to really use VL for something like that since the actual keyframing has to be dynamic according to what the values are. Probably have to look into scripting for this one. Sadly, I'm with you on my knowledge of scripting and wouldn't be the one to write out something for this. The only way it would really be possible is if there is an already set location for each visible percentage value (i.e. they all line up perfectly in a column). If you wanted their positions to be dependent on the size of the bar, then you'd have to rely on scripting.
    #XPression


  • 8.  RE: Animating Text values

    Posted 09-14-2017 18:05
    Yeah.. like I mentioned above, I wish the functionality of the Counter Function Block were a little more robust, allowing one to use the output of 2 text objects to serve as the start and end point of the counter, with maybe a value input that would determine the number of frames the count-up (or down if you wish) takes to resolve then use an event to trigger it That would at least solve the count-up look. If I could achieve that, I would probably be willing to forego the number following the end point of the bar gimmick, although there again, if I could drive the X-Position of the bar in that same way, with a range defined by two text objects or value blocks and a third for frames to resolve... hell a fourth that could be used as the start frame would be even cooler than an event trigger.

    Dare to dream...

    Yeah and with the scripting thing, I have 0 knowledge of how to script or even how to implement a script. It would be cool if there were a comprehensive set of video instruction on the topic and / or Ross hosted Scripting workshops. One thing that would be cool would be to have a 'script' function block in VL, like the Python XPresso Node in Cinema 4D
    #XPression


  • 9.  RE: Animating Text values

    Posted 09-14-2017 18:08
    I probably could build something using some combination of 100 text objects, Greater than or Equal to blocks, Input Selectors, and visibility toggles, but woof.. what a monster of a rig, and I'd need 6 of them

    #XPression