Graphics

 View Only
  • 1.  Loop through images from DATALINQ

    Posted 09-19-2012 19:14
    I'm a looking for some sample scripts for a project and tips on how I should approach this scene. What I need to create is a loop of sponsor images, each on air for a set time then cross to the next image. This needs to be connected to a spread sheet that contains date ranges and images.

    There are lots of ways I can think of doing this. I could make one scene with an image place holder. Run a simple if statement for the dates and increment a global count. Does Xpression support globals? Is there away to run a script outside of a scene or should I just use an otherwise empty scene to run the script?

    Thanks

    Richie


  • 2.  RE: Loop through images from DATALINQ

    Posted 10-01-2012 22:13
    This may be different than what you're looking for, but we currently use DataLinq to manage headshots for our election graphics build. We built a dummy field for the candidate called "Pic_ID," to which we'll put in a six-character ID for that candidate. Within XPression, we then have a blank placeholder for their image, as well as a dummy text field (which we don't render by turning off the eyeball). The text field picks up the Pic_ID from DataLinq, then a script takes over the rest:



    dim PicTag as xpTextObject

    dim Pic as xpBaseObject

    dim PicMat as xpMaterial

    dim PicShad as xpBaseShader

    dim FilePath as String

    dim i as Integer

    For i = 1 to 2

    Self.GetObjectByName("Pic Tag " & i, PicTag)

    FilePath = Engine.ProjectPath & "Election Headshots" & PicTag.Text & ".png"

    Self.GetObjectByName("Pic " & i, Pic)

    Pic.GetMaterial(0, PicMat)

    PicMat.GetShader(0, PicShad)

    PicShad.SetFileName(FilePath)

    Next i



    The script takes the text out of Pic_ID, creates a file path with that at the end, and assigns it as a shader to the place holder material.

    You may be able to break this off and use multiple images (is it a constant number?) the same way, and just loop scene director for the roll between them all.

    #XPression


  • 3.  RE: Loop through images from DATALINQ

    Posted 10-09-2012 02:04
    The number will vary every few months. I was thinking about using a scene on different layer to run the script which would load the sponsor image into the material. That way I could just create a scene with the image and have it set to dissolve for the in and out. Has anyone used a script in one scene to control another one? Am I overthinking this?

    #XPression


  • 4.  RE: Loop through images from DATALINQ

    Posted 10-10-2012 14:32
    I don't think you're overthinking it, but there is a way to have one scene run a script in another. For example purposes, we'll call them Scene A and B, with scene A being you "image loop" and B being your crawl.

    You would need to write your script in Scene A under the OnSceneOnline tab and specify Scene B as the OnlineScene. Then when Scene B goes online, the script begins running on Scene A.

    I'm not sure how exactly to script that, but that would be the area to start looking in. Hopefully that helps. I'm staying on this topic because I'm interested now and am hoping someone else can clarify past where I've taken it.

    #XPression