Announcement

Collapse
No announcement yet.

Animate a TL toggle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Animate a TL toggle

    Hello All,

    is there a way to animate a toggle in TL without using a Take out callup page? I have a clock that runs and when it gets to zero i would like it to trigger the O toggle in the default scene for that element.

  • #2
    it is the neverending story of bypassing the MSE and that will rarely end well. You can do several things like ExecutionLogic but have a condition look at a variable in the template. There are a few examples of the logic conditions here https://forum.vizrt.com/forum/viz-co...-the-templates.
    The commands for controlling the toggle are straight forward or can be copy pasted from the console
    Code:
    RENDERER*UPDATE SET 1
    RENDERER*MAIN_LAYER SET_OBJECT SCENE*MyScenePath/Master
    SCENE*MyScenePath/Master*TREE*$NameOfMyToggleContainer*FUNCTION*Toggle*object SET
    RENDERER*MAIN_LAYER*STAGE*DIRECTOR*NameOfMyToggleDirector SHOW $O
    RENDERER*MAIN_LAYER*TREE*$NameOfMyToggleContainer*FUNCTION*Toggle*switch INVOKE
    Or to find the syntax or options, write in the console
    send MAIN_SCENE*TREE*$NameOfMyToggleContainer*FUNCTION*Toggle COMMAND_INFO

    It can also be done with the REST API, sorry for not remembering who shared this snippet on the forum(someone from BFMTV i guess) i saved it in my goodiepile.
    Code:
    Dim MapKey As string
    system.TcpSendAsync(mapkey, host, 8580, query, 3000)
    
    Sub SudUp()
        PrintLn("Action SUD UP")
        Dim method As String = "POST"
        Dim host as String = "localhost"
        Dim port as String = "8580"
        Dim uri_location As String = "/profiles/TEST_BFMTV/take"
        Dim content_type As String = ""
        Dim content As String = "/element_collection/storage/shows/%7BDE5A80E7-8DD7-4CC4-8FAA-F629605929FA%7D/elements/900"
        ' appel de la fonction
        Dim RestReturn As String
        RestReturn = CreateHttpRequest(method, host, port, uri_location, content_type, content)
        printLn "Retour de la commande REST (UP) = " & RestReturn
    End Sub
    
    Function CreateHttpRequest(method As String, host As String, port As String, uri_location As String, content_type As String, content As String) As String
        Dim request As String = ""
        Dim c_type As String = content_type
        if (c_type.Length = 0) then
            c_type = "text/plain"
        end if
    
        uri_location.URLEncode()
        request &= method & " " & uri_location & " HTTP/1.1\r\n"
        request &= "Host: " & host & ":" & port & "\r\n"
        request &= "Content-type: " & c_type & "\r\n"
    
        if (method = "GET") then
            request &= "Accept: text/html,application/xhtml+xml,application/xml,q=0.9,*/*;q=0.8\r\n"
            request &= "Cache-control: max-age=0\r\n\r\n"
        elseif (method = "POST") then
            request &= "Content-length: " & CStr(content.Length) & "\r\n"
            if (content.Length > 0) then
                request &= "\r\n"
                request &= content & "\r\n"
            end if
        end if
    
        CreateHttpRequest = request
    End Function

    Comment


    • #3
      Wow, thanks for the explanation and example Lars. Much Appreciated!!!!

      Comment

      Working...
      X