Graphics

 View Only
  • 1.  transition logic and images

    Posted 09-27-2014 00:42

    hello I have the following error, I have used the transition logic example script from ross to adapt it but I have one big problem: the photos change before the change between pages is made. The other problem is that I have a lower third that is checking for this graphics to enter on layer 4, but to make it work, I set this script to run on take Item layer 3.

    this is the script so you guys can take a look at it, thank you in advance. I just want to know why the text behave correctly (the old text leaves before the new text enters) but the images change when my second scene enter online.



    dim j, k as integer

    dim distritoIN, distritoOUT, debug, conteo1, conteoP, tipo_lugar, cod_lugar as xptextobject

    k = 3

    dim foto(k) as xpquadobject

    dim mat as xpMaterial

    dim shader as xpBaseShader

    dim dirfoto(k) as string

    dim candfoto(k) as xptextobject

    self.getobjectbyname("tipo_lugar", tipo_lugar)

    self.getobjectbyname("cod_lugar", cod_lugar)

    self.getobjectbyname("distritoIN", distritoIN)

    self.getobjectbyname("distritoOUT", distritoOUT)

    self.getobjectbyname("conteo1", conteo1)

    self.getobjectbyname("conteoP", conteoP)

    self.getobjectbyname("debug", debug)

    for j = 1 to k

    self.getobjectbyname("foto" & j, foto(j))

    self.getobjectbyname("candfoto" & j, candfoto(j))

    next j

    j = 0

    distritoIN.text = UCase(distritoIN.text)

    distritoOUT.text = distritoIN.text

    if conteoP.text = "" then

    conteo1.text = conteo1.text

    else

    conteo1.text = conteo1.text & " " & conteoP.text & "%"

    end if

    for j = 1 to k

    dirfoto(j) = Engine.ProjectPath & "fotos" & tipo_lugar.text & "" & cod_lugar.text & "" & candfoto(j).Text & ".png"

    foto(j).getmaterial(0, mat)

    mat.GetShader(0, shader)

    shader.SetFileName(dirfoto(j))

    next j

    j = 0

    'debug.text = dirfoto(1)

    Dim OutputFB as xpOutputFrameBuffer

    Dim OutgoingCG as xpScene

    Dim InSD, OutSD as xpSceneDirector

    Dim InTrack, OutTrack as xpSceneDirectorTrack

    Dim todoIN, todoOUT, dataIN, dataOUT as string

    Dim LayerMoveDirection, i, FB, Layer as Integer

    todoIN = "todoIN"

    todoOUT = "todoOUT"

    dataIN = "dataIN"

    dataOUT = "dataOUT"

    LayerMoveDirection = 1

    Self.GetOnline(FB, Layer)

    InSD = Self.SceneDirector

    i = 0

    InSD.GetTrack(i, InTrack)

    Do

    InTrack.Enabled = False

    i = i + 1

    Loop While InSD.GetTrack(i, InTrack)

    Engine.GetOutputFrameBuffer(FB, OutputFB)

    If OutputFB.GetSceneOnLayer(Self.DefaultFramebufferLayer + 1, OutgoingCG)

    OutputFB.MoveLayer(OutgoingCG.DefaultFramebufferLayer + 1, OutgoingCG.DefaultFramebufferLayer + 2)

    OutputFB.MoveLayer(Self.DefaultFramebufferLayer, Self.DefaultFramebufferLayer + 1)

    OutSD = OutgoingCG.SceneDirector

    i = 0

    OutSD.GetTrack(i, OutTrack)

    Do

    OutTrack.Enabled = False

    i = i + 1

    Loop While OutSD.GetTrack(i, OutTrack)

    If InSD.GetTrackByName(dataIN, InTrack) = False then

    InSD.GetTrackByName(todoIN, InTrack)

    End If

    If OutSD.GetTrackByName(dataOUT, OutTrack) = False

    OutSD.GetTrackByName(todoOUT, OutTrack)

    End If

    Else

    InSD.GetTrackByName(todoIN, InTrack)

    End If

    OutputFB.MoveLayer(Self.DefaultFramebufferLayer, Self.DefaultFramebufferLayer + 1)

    InTrack.Enabled = True

    OutTrack.Enabled = True

    InSD.Position = 0

    OutSD.Position = 0

    InSD.Play

    OutSD.Play


  • 2.  RE: transition logic and images

    Posted 09-29-2014 19:09
    Nevermind, I solved.

    Basically I created random materials ononline and then delete them when the scene goes offline at the end of the director timeline.

    #XPression