Graphics

 View Only
  • 1.  Skip a scene, when text field is empty

    Posted 11-03-2020 15:04

    Is it possible in visual logic to skip a scene (which is in between a series of other scenes),

    when a text field from the same scene is empty?

     

    Otherwise in scripting?



  • 2.  RE: Skip a scene, when text field is empty

    Posted 11-04-2020 15:47

    No idea if you can do it in Visual Logic but I've got a script that seems to work in the OnBeforeOnline sub in the scene.

    This is example is for a two line name strap but you get the idea.

    Dim lineOne As xpTextObject
    Dim lineTwo As xpTextObject

    Self.GetObjectByName("Name", lineOne)
    Self.GetObjectByName("Designation", lineTwo)

    ' Handle empty text fields.
    If Trim(lineOne.Text) = "" AndAlso Trim(lineTwo.Text) = "" Then
    Engine.WriteToLog("Name Strap - Text fields empty - Aborting Online")
    AbortSetOnline = True
    Exit Sub
    End If

    #XPression


  • 3.  RE: Skip a scene, when text field is empty

    Posted 11-04-2020 19:18

    Thanks Peter, I tested your script, and it does stop the scene. But It doesn't skip the scene.

    I have a group / carousel with a number of scenes, in which I want to add this scene. When I now have this scene in between some other, this scene is not skipped but it stops the entire carrousel.

     


    #XPression


  • 4.  RE: Skip a scene, when text field is empty

    Posted 11-04-2020 21:48

    Ah, that's no good then, maybe something like this then? Again in the OnBeforeOnline sub

    Providing all the scenes are on the same layer this seems to work (edited to not require group name anymore :D )

    Dim lineOne As xpTextObject
    Dim lineTwo As xpTextObject
    Dim opFramebuffer As xpOutputFrameBuffer
    Dim group As xpTakeItemGroup
    Dim currentItem As xpTakeItem
    Dim thisItem As xpTakeItem
    Dim nextItem As xpTakeItem

    Self.GetObjectByName("Name", lineOne)
    Self.GetObjectByName("Designation", lineTwo)

    ' Handle empty text fields.
    If Trim(lineOne.Text) = "" AndAlso Trim(lineTwo.Text) = "" Then
    Engine.WriteToLog("Name Strap - Text fields empty - Skipping Scene")
    AbortSetOnline = True

    Engine.GetOutputFrameBuffer(FramebufferIndex, opFramebuffer)
    opFramebuffer.GetTakeItemOnLayer(Layer, currentItem)

    currentItem.GetGroup(group)
    If Not group.GetNextTakeItem(currentItem, thisItem) Then
    group.GetFirstTakeItem(thisItem)
    End If
    If Not group.GetNextTakeItem(thisItem, nextItem) Then
    group.GetFirstTakeItem(nextItem)
    End If

    nextItem.Execute()
    End If

    #XPression


  • 5.  RE: Skip a scene, when text field is empty

    Posted 11-05-2020 09:36

    Almost... :D

    The script works and skips the scene in question, but then plays the next scene only once, then scene stops. Also the entire group wil not continue anymore. 

    Also the red "ACTIVE" message in the group (which tell us that the group is live, went out....)  

    And when I put this scene in a group twice or more, the script doesn't work at all. Do you see what's causing this, and can you explain it to me?

     

    My group settings:

    The playout mode is Timed, and repeat is set to "when done". So I made a little carroussel


    #XPression


  • 6.  RE: Skip a scene, when text field is empty

    Posted 11-05-2020 19:39

    And if I read your script, it makes sense. You say that the item that is going to come "AbortSetOnline".

    That actually indirectly means that you also interrupt the playing of the "group".

    ACTIVE - DISAPPEARS

    After this promotion, we look at which item should be online again and then we put it online. Only then our "Group" is no longer running ...

    Is there any action to get around this?

     

    I also tried to make de duration of the animcontroller 0 frames -> That doesn't work

    and also tried self.setOffline, but none of these "skip" my item...

     

     


    #XPression


  • 7.  RE: Skip a scene, when text field is empty

    Posted 11-05-2020 20:38

    So after much messing around the best I can come up with (in the OnPrepare sub this time, so remove any of the other bits from OnBeforeOnline) is this.

    Basically it loops through the group with the name My Group and disables any items with no data, it also re-enables items that have data.

    It's a bit clunky but seems to work at least...

    Dim group As xpTakeItemGroup
    Dim currentItem As xpTakeItem
    Dim takeItem As xpTakeItem

    Engine.Sequencer.GetGroupByName("My Group", group)

    While True
    If takeItem Is Nothing Then
    group.GetFirstTakeItem(takeItem)
    Else
    Dim previousItem As xpTakeItem = takeItem
    If Not group.GetNextTakeItem(previousItem, takeItem) Then
    Exit While
    End If
    End If

    Dim skipItem As Boolean = True

    For i As Integer = 0 To takeItem.PublishedObjectCount - 1 Step 1

    Dim publishedObject As xpPublishedObject
    takeItem.GetPublishedObject(i, publishedObject)

    For j As Integer = 0 To publishedObject.PropertyCount - 1 Step 1

    Dim value As String
    publishedObject.GetPropertyString(j, value)
    If Trim(value) <> "" Then
    skipItem = False
    End If

    Next
    Next

    If skipItem Then
    takeItem.Disabled = True
    Else
    takeItem.Disabled = False
    End If
    End While

    #XPression


  • 8.  RE: Skip a scene, when text field is empty

    Posted 11-06-2020 09:44

    That works really well! Thank you. I just have a problem with automating the text...
    The script looks at the values that are filled in the scene director when formatting, and not at the values that are current in the sequenser.

    When I format the items and link a data link, it is automatically filled with results. I place this item in the sequenser, so it is included in the group.

    But if during the view, it appears that no information more available is, trough datalinq, then it will be displayed. That's because the script looks at the values in original state. Even if I have checked "return empty" via datalinq.

    I also tried to link datalinq, last way via the sequenser, but this produces the same result...

    Datalinq seems to retrieve the information later than your script performs the check.


    #XPression


  • 9.  RE: Skip a scene, when text field is empty

    Posted 11-06-2020 09:49

    Ah blast, in which case I'm stumped I'm afraid!

    I guess the DataLinq feed doesn't update until just before the Scene goes online but trying to manipulate the scene at that points seems to end up taking the whole group offline (or simply breaks if you have two empty Take Items in a row)

    Perhaps someone from Ross Support will have a better idea on how to achieve this?


    #XPression


  • 10.  RE: Skip a scene, when text field is empty

    Posted 11-26-2020 08:52

    Sollution:

    now working in the script editor of the scene on the "OnBeforeOnline" tab.

    Text2 is my text object... Replace it with your dynamic textObject

    dim Text as xpTextObject

    Self.GetObjectByName("Text2", Text)


    if Text.Text = "" then

    AbortSetOnline = True

    end if


     


    #XPression