Graphics

 View Only
Expand all | Collapse all

Scripting a pause or take offline with script event

Vincent Detune

Vincent Detune11-07-2014 10:56

  • 1.  Scripting a pause or take offline with script event

    Posted 11-07-2014 09:55
    Hi there

    I'm trying to script an event to either take the scene offline or pause the scene. My script looks the following at the moment:

    dim counterM as xptextobject

    scene.getobjectbyname("COUNTER MACROS", counterM)

    if counterM.text < 2 then

    engine.ClearFrameBufferLayer(0,0)

    else

    engine.Pause()

    end if

    any suggestions?


  • 2.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:09
    In "OnSetText" of COUNTER MACROS :

    [CODE] if Cint(Text)
    #XPression


  • 3.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:14
    Dear Vincent

    Thank you for the fast reply.

    I think there is a little misunderstanding. The script is on a "Script Event" in the Scene Director. How would it work from there?

    #XPression


  • 4.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:20
    Oh sorry :

    [CODE]Dim counterM as xptextobject = nothing

    scene.getobjectbyname("COUNTER MACROS", counterM)

    if Cint(counterM.Text)
    #XPression


  • 5.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:20
    To make you better understand my problem, here is what I want to achieve:

    Text Layer is published where it is possible to declare how many full frame pictures are showed one after another. So if there for example are three pictures to be shown, the first three will have to have a pause and where the pause for the fourth image comes, will be the take offline event.

    #XPression


  • 6.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:21
    There is another script on the scene which triggers the visibility of the images.

    #XPression


  • 7.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:22
    I'll try it right away, thanks.

    #XPression


  • 8.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:52
    It does not work the way I'd like it to. I just sent you the package of the scene in a mail. Maybe you could have a look at it?

    #XPression


  • 9.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:56
    Which mail ?

    #XPression


  • 10.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 10:57
    The Mail was blocked by your Firewall. Here is a link:

    www.zweigleis.ch/MACRO-TEST.xpp

    #XPression


  • 11.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 11:31
    In ScriptEvent, replace Scene.SceneDirector.Stop() by Scene.SceneDirector.Pause()

    Delete first pause, replace it by same script event with ">1". Move 1 frame before each script event.

    #XPression


  • 12.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 13:18
    Thank you Vincent.

    It now works, but only in Layout mode. Won't this work in the Sequencer?

    #XPression


  • 13.  RE: Scripting a pause or take offline with script event

    Posted 11-07-2014 14:27
    Is there any way to make this work in the Sequencer as well?

    #XPression


  • 14.  RE: Scripting a pause or take offline with script event

    Posted 11-27-2014 09:24
    It doesn't work in the Sequencer because the script events that pause the scene director are not recognized by the Sequencer as pause events. Only a pause event can be a trigger-able item in the sequencer - not a script that pauses the scene director.

    To accomplish what you want you will need to use multiple scene directors. Each scene director would contain the anim controller and pause event for your individual full frame pictures. You'll need to write a script that controls how many scene directors are activated based on your control variable.

    #XPression


  • 15.  RE: Scripting a pause or take offline with script event

    Posted 11-27-2014 17:34
    Thank you for the support. Actually I'm a little surprised about the 'Msgbox("MSG") within the script you provided me with, maybe you have an explanation for that:

    dim test as xpSceneDirector

    'Msgbox("MSG")

    scene.getscenedirectorbyname("SceneDirector2", test)

    'Msgbox("MSG")

    test.play

    'Msgbox("MSG")

    But anyway, it works to trigger SceneDirector2, but in there again, scripts aren't working anymore. So I can not trigger SceneDirector3 with a script from SceneDirector2.

    Script after Pause SceneDirector1:

    Dim anzahl as xptextobject

    dim macro2 as xpSceneDirector

    dim macro3 as xpSceneDirector

    dim macro4 as xpSceneDirector

    dim macro5 as xpSceneDirector

    scene.getobjectbyname("ANZAHL BILDER", anzahl)

    scene.getscenedirectorbyname("SD2", macro2)

    scene.getscenedirectorbyname("SD3", macro3)

    scene.getscenedirectorbyname("SD4", macro4)

    scene.getscenedirectorbyname("SD5", macro5)

    if Cint(anzahl.Text) >1 then

    macro2.play

    End If

    Then follows a script to take the layer offline if it was the only one to play at frame 36:

    Dim anzahl as xptextobject

    scene.getobjectbyname("ANZAHL BILDER", anzahl)

    if Cint(anzahl.Text) 2 then

    macro3.play

    End If

    And so on. but as mentioned above, SD2 won't trigger SD3. Is that a bug in the version I'm working with (XP Studio SCE v5.15)?

    #XPression


  • 16.  RE: Scripting a pause or take offline with script event

    Posted 11-28-2014 05:49
    Remo,

    I am very sorry about that. I was messing around with the scripts very late at night and was a little tired/frustrated and using the MsgBox to debug. Please accept my apologies. Our forum admin has removed the language.

    I think you might be right about the version - as there is this fix in a newer build than 5.15:

    "¢ [fixed] resuming a take item would not resume secondary scene directors that were in a paused state

    Please email me at gmillward@rossvideo.com and I will send you a link to download the latest release of XPression Studio SCE.

    I am going to test your script right now and see if it works on the newer version.

    #XPression


  • 17.  RE: Scripting a pause or take offline with script event

    Posted 11-28-2014 06:09
    Remo,

    I just tried the scripts in 5.7 and they work perfectly.

    Then I tried them in 5.15 and they don't work at all! I'm surprised you've gotten as far as you have!

    Email me ASAP and I'll get you an update for XPression Studio SCE.

    #XPression


  • 18.  RE: Scripting a pause or take offline with script event

    Posted 11-28-2014 08:22
    Dear Garner

    No problem about the language, I can understand the frustration that can come up while programming :D.

    Thank you for testing with 5.7, we already have that version, but not installed yet because we have to update the newsroom-system as well and that takes a little planning. We should be there in January.

    But at the other TV-Station the new versions are installed and I will try to test it there.

    #XPression