Graphics

 View Only
  • 1.  When to Script instead of using VL?

    Posted 03-07-2018 23:54
    Hey Guys,

    So we have a client that we built a package for last year - for me it was my indoctrination into XPression, and I was pretty proud of the end result - and now the client is wanting to enhance, and add to the package for this year's season. One of their producers also works with a large sporting outlet and uses an XPression package there. He likes some of the functionality of that package and has asked us to incorporate similar stuff in ours. He was able to supply us with an xpp of said package for us to digest.

    What I have seen is that there are some cool things like typing a 0-4 value to bring up a different layout of player image, which upon looking at the scene in Layout I can see was accomplished with scripting. Looking at what it is actually doing though, I get the impression that these things could be done with VL easily enough. I hope this is true as I know NOTHING about scripting, and though I want to learn it, I'm not going to become production ready at it in a mere couple of weeks, so I have to ask the experts here:

    Are there situations in which scripting MUST be used as VL isn't quite up to the task, and in situations like the one I outlined above where either seemingly could be used, is there an advantage to using one over the other?

    Thanks in advance
    - Willie


  • 2.  RE: When to Script instead of using VL?

    Posted 03-08-2018 00:48
    Hi Willie,

    I think I can give you an answer. I'm no expert on scripting in XPression, though I'm a software engineer and have had over 20 years experience in software development and programming, and am pretty handy with VL. There are two fundamental differences between using scripting and VL: scripting allows procedural steps, VL is a "finite state machine", meaning it works on values it is given at a particular point in time, and so can't do procedural steps. You can fake this in VL by using timers or animation controllers that VL can use to choose what to do with a specific value in said timers or animation controllers, but that get tedious and complicated. I've had to do this sort of thing with our XPression system because it's PRIME, which means it lacks scripting. It did my head in initially.

    So in my opinion, there are cases when scripting is better (i.e. easier) than using VL, but you can do some pretty crazy stuff with VL nonetheless.

    James.
    #XPression


  • 3.  RE: When to Script instead of using VL?

    Posted 03-08-2018 01:25
    thanks james. That's helpful, especially regarding the 'procedural' nature of scripting. I do need to learn to the scripting for sure, but I wish to do so in context and preferable with an instructor vs watching a video or reading a book.. I just learn better that way.
    #XPression


  • 4.  RE: When to Script instead of using VL?

    Posted 03-08-2018 02:51
    I generally prefer to use scripting whenever possible. I often find visual logic somewhat tedious to use. I think it's a lot easier to navigate around, copy scripts, make quick changes, as opposed to having to find, drag, and connect a bunch of little boxes.

    You also have the whole VB and Xpression apis available to you with scripts, as opposed to subset you get with visual logic. That can open you up to some fun features like volatile textures and regular expressions.

    That being said, there isn't really anything wrong with visual logic. When I use it it's usually for cases where a script wouldn't make sense, like fluidly changing the size/position of an object.
    #XPression


  • 5.  RE: When to Script instead of using VL?

    Posted 03-08-2018 12:22
    I'd say it also depends on the type of objects you use in Visual Logic/Scripting. Visual Logic is weird in that it is essentially re-rendering every frame whenever that scene is online. This can be good for things like data, but if you are using it for things like setting logos, colors, layouts, etc., you might notice a drop in performance. I once had an issue where a team logo would come online as normal, but would then cut out/in, once I changed this over to scripting, the issue went away. That being said, I prefer to script whenever I'm setting file paths for textures and creating multiple layouts on one scene. Because you can set your script to things like OnOnline and OnPreview, your script will only run in these instances and not re-render while online unless you tell them to. I feel like using scripting to decide the basic look of the graphic is its best use, whereas Visual Logic is good for setting relative positions of data and scaling of a graphic (if the scaling of the graphic is based on data). Usually if it is something you know will be updated while online, I'd use VL, if its something you was to setup before you take to air, use scripting.
    #XPression


  • 6.  RE: When to Script instead of using VL?

    Posted 03-08-2018 16:30
    We recently had a trainer from Ross come and she described it this way: Visual Logic is running roughly 30 times per second, scripting runs only when you tell it to. So, in an example I have a score bar with time outs. I had been using visual logic to display the correct number of time outs (graphically represented, not just a number). So, every frame visual logic checked to see if the incoming data had changed, using memory to do so. Each time we have a time out, the score bar is taken off line so a simple one line script checks the time out data field when the scene is put on line, and doesn't run again until the scene is taken off line, and then back on. So to make my long response even longer, decide how often you want something to happen and that can help you decide how to address the need.

    This has helped me: https://www.tutorialspoint.com/vb.net/vb.net_environment_setup.htm
    #XPression


  • 7.  RE: When to Script instead of using VL?

    Posted 03-08-2018 18:33
    Interesting responses, and that does make perfect sense. For me, as a visual guy, I prefer VL as it's easier for me to 'see' the flow of things and their relationship to one another with a node layout as opposed to looking at a block of text in what is essentially a foreign language, but I see now why both exist and what the advantage is of scripting vs VL...

    In my specific example, I have a client that wants to be able to enter a number, and have that number determine which layout of player shot is output within the context of a larger graphic, or how many rows a graphic will have with the corresponding number determining the spacing between rows and the size of the rendered font*. I know how to do all of this with VL, but insomuch as these are 'set once' values, it would seem that running them in VL would be inefficient. The scenes aren't super heavy to begin with, so I know there is head room there, but still... why push it if you don't have to?

    Looks like I will be diving into a scripting baptism by fire in short order.

    * with respect to changing the text font sizes dynamically, at present the only way I know of to do this is to link the text values to duplicate text objects of a larger font size and tie their visibility to the appropriate selection of the number of rows. If there is a more clever (read: more efficient) way of doing this, I'd be interesting in hearing it.

    Thanks so much for the knowledge drops everyone. I'll likely be bugging you a lot in the coming months with scripting questions.
    #XPression


  • 8.  RE: When to Script instead of using VL?

    Posted 03-08-2018 23:30
    I believe that "set once" values are the reason for VL. It makes those easier to do. In terms of efficiency of VL, it only really becomes a problem when you have lots of nodes and lots of VLs in the one scene. If you're only using it to do basic positioning of things from a "set once" value, then it's perfectly fine.

    As I don't have access to scripting, I use VL for all sorts of things. Even as a substitute for TL (which I also don't have either). Our system gets really bogged down, but not enough to drop frames or cause noticeable delays; full frame videos hit it much harder than the VL I use, even though said VLs can have 20 to 30 nodes in them and multiple like that per scene.

    The description of VL running for each frame is a good one. That's what I meant by "finite state machine", which is more of an engineering term than one that's easy to understand. :P
    #XPression