Graphics

 View Only
  • 1.  Trying to Change a Scene Material based on Another Scene that's Online

    Posted 05-27-2020 20:19

    Hello, I'm trying to change a scene's materials based on another scene that is already online. I've got some of it working but not all of it. Here's what I've got so far. Any help would be appreciated.

    dim fb as xpOutputFramebuffer

    dim mainl3 as xpScene

    dim bar as xpBaseObject

    dim sep as xpBaseObject

    dim flag as xpBaseObject

    dim redborder as xpMaterial

    dim blueborder as xpMaterial

    dim redsep as xpMaterial

    dim bluesep as xpMaterial

    dim redflag as xpMaterial

    dim blueflag as xpMaterial

    'Get Objects in Scene'
    Self.GetObjectByName("Bar",bar)
    Self.GetObjectByName("Seperator",sep)
    Self.GetObjectByName("Flag",flag)

    'Get Materials'
    Engine.GetMaterialByName("New Subtext Lower Third Longer_Image",blueborder)
    Engine.GetMaterialByName("Section Seperator_Image",bluesep)
    Engine.GetMaterialByName("FlagBG_Image",blueflag)
    Engine.GetMaterialByName("Breaking Subtext L",redborder)
    Engine.GetMaterialByName("Section Seperator_Image1",redsep)
    Engine.GetMaterialByName("Breaking Flag",redflag)


    Engine.GetOutputFrameBuffer(0, fb)
    fb.GetSceneOnLayer(-2, mainl3)
    if mainl3.Name="2020 Breaking News Lower Thirds"then

    bar.SetMaterial(0, redborder)
    sep.SetMaterial(0, redsep)
    flag.SetMaterial(0, redflag)

    else if mainl3.Name="2020 Main Lower Thirds"then
    bar.SetMaterial(0, blueborder)
    sep.SetMaterial(0, bluesep)
    flag.SetMaterial(0, blueflag)

    end if




  • 2.  RE: Trying to Change a Scene Material based on Another Scene that's Online

    Posted 05-28-2020 02:36

    Hey I figured it out on my own.

    I'm gonna post my final code here just in case someone else has a similar project. I added a couple strings to help prevent myself from creating typos. I also had an unnecessary space in my elseif statement. I'm pretty new to scripting in Xpression, so I hope my code doesn't look like total trash to people who have been doing it for a long time lol

    dim fb as xpOutputFramebuffer

    dim mainl3 as xpScene

    dim bar,sep,flag as xpBaseObject

    dim redborder,blueborder,redsep,bluesep,redflag,blueflag as xpMaterial

    dim Breaking as String
    Breaking="2020 Breaking Main Lower Thirds"

    dim NormalL3 as String
    NormalL3="2020 Main Lower Thirds"


    'Get Objects in Scene'
    Self.GetObjectByName("Bar",bar)
    Self.GetObjectByName("Seperator",sep)
    Self.GetObjectByName("Flag",flag)
    Self.GetObjectByName("Text1",MainText)

    'Get Materials'
    Engine.GetMaterialByName("New Subtext Lower Third Longer_Image",blueborder)
    Engine.GetMaterialByName("Section Seperator_Image",bluesep)
    Engine.GetMaterialByName("FlagBG_Image",blueflag)
    Engine.GetMaterialByName("Breaking Subtext L",redborder)
    Engine.GetMaterialByName("Section Seperator_Image1",redsep)
    Engine.GetMaterialByName("Breaking Flag",redflag)

    Engine.GetOutputFrameBuffer(0, fb)
    fb.GetSceneOnLayer(-2, mainl3)

    if mainl3.Name = Breaking then

    bar.SetMaterial(0,redborder)
    sep.SetMaterial(0,redsep)
    flag.SetMaterial(0,redflag)

    elseif mainl3.Name = NormalL3 then

    bar.SetMaterial(0,blueborder)
    sep.SetMaterial(0,bluesep)
    flag.SetMaterial(0,blueflag)

    end if

     

     

     

     


    #XPression