Graphics

 View Only
  • 1.  Visual Logic question

    Posted 08-07-2020 20:06

    I have this graphic that has two sports team logos that contain metadata. The third tag stores the name of the league/conference they are in. I'm pulling the values in visual logic and trying to compare them. If they are equal, I would like to pass the actual string to a selector that would choose a material containing the logo for that league/conference and then apply it to another object.

    I'm still new to coding/visual logic and can't quite figure out how to get from the comparison of the two strings to check if they're equal (which generates a true/false condition to then passing that actual string value to say, another string.

    Can this even be accomplished via visual logic?

    My reason for comparing the strings is because of American colleges/universities. They usually play teams in the same conference (that would simply call for the logo of that conference). But sometimes they play non-conference games against teams in other conferences (in this case we would use an overall "NCAA" logo).

     



  • 2.  RE: Visual Logic question

    Posted 08-07-2020 23:52

    I'm just trying to get this right in my mind. Let's say one team is Alabama (SEC) and the other is Utah (PAC 12). Are you saying you want to compare those two teams? If so, they will never be equal. But if you want to compare Utah with it's conference metadata I would make a hidden txt field that you would use to compare. If the opponent is anything other than PAC 12, the NCAA logo would be used. Scripting would make this pretty easy. I suppose you could do it in visual logic but I would go to an if/else sort of loop that looks and sees the conference then matches, or goes to the next conference to see if it matches. Let me know if you want to try that and I can point you in the right direction. 


    #XPression


  • 3.  RE: Visual Logic question

    Posted 08-08-2020 00:26

    Sorry. It's kind of confusing, I know. I understand it in my head but have a difficult time explaining what I want to accomplish to others. Basically I want to look at both metadata tags and if they are the same, then assign that logo to the third image object. So, yes, if both teams are SEC, it would load the SEC logo, if both teams were PAC 12, it would load PAC 12. But if Bama was playing Utah, it would be the "NCAA" version.  And the pro leagues are in this mix too. So, they would ALWAYS load the associated logo, (NFL, NBA, NHL, MLB, etc.)

    I sort-of got it to work by doing some visual logic that, first, compares the two metadata tags (that are loading into hidden text objects). If they match (same leagues/conferences), it sends the contents of the first text object through to another "master" hidden text object. If they don't match, it sends a string value of "NCAA".

    Then I have another set of logic that looks at the contents of that third text object (containing the result of that comparison) and comparing that to an array of string values containing all the possible leagues/conferences. It sends those comparisons to a multiplier that is sent to a max value sent to an input selector that contains all the possible materials (with the league/conference logos).

    It works. It's just not very "elegant".

     

    If you think coding might be a better approach, then by all means, point me!


    #XPression


  • 4.  RE: Visual Logic question

    Posted 08-10-2020 16:29

    I somewhat figured this out, but it's not very "clean" logic. Maybe someone else can help?

    So, I ONLY want the part in red to run IF both variables (circled in green) contain data (strings). Otherwise, I would like to simply pass the value of the first string to that "LEAGUE_MASTER text object.

    Does that make sense?

    What's happening is it always puts the NCAA logo on screen UNTIL you select a second team (the LEAGUE_R object), regardless of what the metatag for the first object is. So, I only want the comparison of the two strings to occur when they are both NOT EMPTY.


    #XPression


  • 5.  RE: Visual Logic question

    Posted 08-10-2020 20:51

    I get it now. My bad. Let me play around just a bit and get back to you. Would you prefer visual logic to scripting so you can look at what it's doing?


    #XPression


  • 6.  RE: Visual Logic question

    Posted 08-10-2020 20:54

    Whatever you think works the best. I don't personally know as much about scripting yet, but if it's a better approach to accomplish something like this, by all means. Perhaps I can learn something from that.


    #XPression