Graphics

 View Only
  • 1.  Visual Logic to Select Logo

    Posted 08-04-2021 15:02
    Hey Everyone,
    I'm new to Visual Logic and trying to wrap my brain around using it for better functionality.
    I want to take a name from a Datalinq source, and use it to select a corresponding logo. For example: if the Datalinq source field is "Miami", I want the quad to display the "Miami" logo from my images folder. It would be at location: d:\\images\miami.png for example.
    Using Concatenate I am able to create the correct filepath text, but I can't figure out how to use that output to select the logo. Or maybe there is a better way to go about it? Any help would be appreciated. Thanks!


    ------------------------------
    Kurt
    ------------------------------


  • 2.  RE: Visual Logic to Select Logo

    Posted 08-04-2021 15:40
    What version of XPression are you using, if you are using version 10 you can use dynamic materials.
    https://www.youtube.com/watch?v=nJ26YiJ9RUI

    ------------------------------
    Simon Redmile
    Ross Video
    ------------------------------



  • 3.  RE: Visual Logic to Select Logo

    Posted 08-04-2021 15:57
    We are on: 9.5 Build 5013

    Not sure if or when we might upgrade to 10. Is there any way to do this in 9.5?

    Thanks for the response!

    ------------------------------
    Kurt
    ------------------------------



  • 4.  RE: Visual Logic to Select Logo

    Posted 08-04-2021 15:59
    If you're on 9.5 then using visual logic you'd need to bring the items in as materials first which I assume is what you're trying to avoid. 

    Have you ever scripted before?

    ------------------------------
    Simon Redmile
    Ross Video
    ------------------------------



  • 5.  RE: Visual Logic to Select Logo

    Posted 08-04-2021 16:03
    I have not scripted yet. Definitely open to learning if it will help.

    I was trying to avoid bringing them in as materials so that I could dynamically add to the images folder or make changes as needed without needing to re-bring in each new image.

    Thanks again!

    ------------------------------
    Kurt
    ------------------------------



  • 6.  RE: Visual Logic to Select Logo

    Posted 08-04-2021 17:58
    Start to script by follow this video.
    https://www.youtube.com/watch?v=dppZSzdXl4c

    After that this will make sense. 

    If you right-click and edit the script on your scene object and write this in OnOnline and OnPreview.

    dim square as xpbaseobject
    dim name as xpTextObject

    self.getObjectByName("Quad1", square)
    self.getObjectByName("Text1", name)

    square.SetVolatileTextureFile(0, "D:\Your file path here\" & name.text & ".png")


    Whatever is written in the object called Text1 will complete the path and set the first face on the object called Quad1.
    For example, if you wrote "Miami" in Text1 the path above would be "D:\Your file path here\Miami.png"



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    United Kingdom
    ------------------------------



  • 7.  RE: Visual Logic to Select Logo

    Posted 08-05-2021 14:07
    Thanks Red. That worked!

    Appreciate the help!

    ------------------------------
    Kurt
    ------------------------------



  • 8.  RE: Visual Logic to Select Logo

    Posted 08-04-2021 18:28
    Kurt, 
    Scripting is my favorite way to get things done. I second Red when he tells you to try that way. I am on the road and don't have my xpression laptop with me but feel free to reach out and I can give you a hand.

    Malcolm

    ------------------------------
    Malcolm Thorpe
    TV Syndicate/Icon Fitness
    ------------------------------