Graphics

 View Only
  • 1.  Scene Director script events not working

    Posted 01-30-2019 05:14
    Hello all,

    I'm having an issue with a script placed on my Scene Director.

    I have created a scene with an animation in it. The animation is actually broken down into 5 steps with after each step a sort of living hold. So there is a small loopinganimation so that it keeps on moving before moving on to the next step.

    In order to control the scene I have created two tracks on my Scene Director. One which holds the Loop Events and one that holds scripts.

    The scripts are placed one frame beyond the loop event.
    The idea behind this is that when I disable the loop track, one frame past the loop event, the loop track becomes enabled again so that it will continue until the next loop point and then starts looping again.

    Through my control application I'm setting the track.enabled to false so that the animation continues to play to the next looping point. This is working without any problem.

    My problem is that the script does not enable the track again.

    And I don't understand why.

    This is the code I have used in my Script Event on my Scene Director:

    dim sd as xpSceneDirector
    dim track as xpSceneDirectorTrack

    Scene.getSceneDirectorByName("SD_Player1", sd)
    sd.getTrackByName("LoopEvents", track)
    track.Enabled = true

    I have tested if the script event works by trying to make it stop the Scene Director from playing which works perfectly, but as soon as I try to manipulate the track, then it stops working.

    I also checked if the track was detected by getting the name of the track and displaying it into a textbox which was also showing the right name.
    So the track is linked but it seems the Enabled-property is not supported in scripting?


    Anybody has an idea how to solve this?

    Thanks,
    Kenneth


  • 2.  RE: Scene Director script events not working

    Posted 01-31-2019 10:46

    Hello cainnech,

    if the track that hold the loop animation contains only one animController , you can use the xpAnimController object :

    Dim anim as xpAnimController
    
    scene.GetAnimControllerByName("AnimControllerName",anim)
    
    anim.PlayMode = 2 'ping pong

    and then call anim.Play() or anim.Pause()

    Keep the track disabled to avoid the animController being played within the scenedirector.


    Another way could be to put all your looping animation in a second scenedirector and control it from the primary sceneDirector with scenedirector triggers.
    see sample project : TYT_PauseAndLoop_trigger_001.zip


    #XPression


  • 3.  RE: Scene Director script events not working

    Posted 02-05-2019 15:12
    Thank you for the suggestion @amignon but I'm afraid this is not a workable solution for me.

    The item on my Scene Director track is an OBJ-sequence that holds a number of animations and not an animController, as such I can not use the Loop or PlayRanges.

    Also using separate Scene Directors could be a possibility, but it would involve me building 144 different Scene Directors. That doesn't seem like good project management ;-)

    Since the animations are quite linear in playout, the easiest would be for me to use track events, but I can't add events through the API so I'm a bit blocked with that approach too.

    So for now, the only solution I see is to work with enabling and disabling the different tracks.
    #XPression


  • 4.  RE: Scene Director script events not working

    Posted 02-05-2019 20:57
    I may be wrong but :
    It seems that if there is a animation controller and scripts at the same time on the same track, the scripts are not always executed.
    If the scripts events are on another track that contains only scripts events, it seems to work better. (test done with xpression version 8.0)

    hope it helps

    #XPression