Graphics

 View Only
  • 1.  Animation controllers in multiple scene directors

    Posted 07-26-2015 02:07
    Hello! I am using XPression SCE 5.7 build 3064

    I was recently tasked with designing a graphics package in XPression and I seem to be having a problem with my animation controllers. I have one scene that is my main scene where all the animations happen. I have two more scenes (Animation1/2) which are used to trigger the scene directors in the first scene. When I put the main scene online and then put the first trigger scene online, it works. When I put the main scene online and then put the second trigger scene online, it works. However, when I put the main scene online, put the first trigger scene online and offline, and then put the second trigger scene online, the second trigger scene will only animate the objects that were not animated by the first trigger scene. What's even weirder is that if I switch the order I put the trigger scenes online, it's still the second trigger scene that won't work. I have the debug console active and open and I'm not getting any errors.

    Here is the script that I have in the OnSceneOnline event in the main scene:

    ' === Banner Animation ===

    ' Check if the Info Banner went online

    if(OnlineScene.Name = "Animation1")

    ' Get the info banner scene director

    dim xsdInfo as xpSceneDirector

    if(Self.GetSceneDirectorByName("sdBannerInfo", xsdInfo))

    ' Play the animation

    xsdInfo.PlayRange(0, xsdInfo.Duration)

    else

    Engine.DebugMessage("sdBannerInfo not found!", 2)

    end if

    end if

    ' Check if the Left Clock Banner went online

    if(OnlineScene.Name = "Animation2")

    ' Get the info banner scene director

    dim xsdInfo as xpSceneDirector

    if(Self.GetSceneDirectorByName("sdBannerClockLeft", xsdInfo))

    ' Play the animation

    xsdInfo.PlayRange(0, xsdInfo.Duration)

    else

    Engine.DebugMessage("sdBannerClockLeft not found!", 2)

    end if

    end if


    I also have the project packaged up if you want to see it in action. However I'm not sure how to use the ross.brickftp.com site that everyone uses. It won't take my username and password and uploading it anonymously doesn't give me a link.

    If anyone could give me some advice, it would be much appreciated!

    Thanks!

    Tyler


  • 2.  RE: Animation controllers in multiple scene directors

    Posted 07-26-2015 05:18
    Do a .stop of your scene director when you finish to play with...

    Animcontroller are in conflict because they are played from different source.

    #XPression


  • 3.  RE: Animation controllers in multiple scene directors

    Posted 07-28-2015 02:40
    Thank you so much, Vincent!

    I didn't realize that the PlayRange command pauses the scene director at the end instead of stopping it. If anyone is curious, here is my new code:

    ' === Banner Animation ===

    ' Get scene directors

    dim xsdBannerInfo as xpSceneDirector

    dim xsdBannerClockLeft as xpSceneDirector

    if(not Self.GetSceneDirectorByName("sdBannerInfo", xsdBannerInfo))

    Engine.DebugMessage"sdBannerInfo not found!", 2)

    end if

    if(not Self.GetSceneDirectorByName("sdBannerClockLeft", xsdBannerClockLeft))

    Engine.DebugMessage("sdBannerClockLeft not found!", 2)

    end if

    ' Check if the Info Banner went online

    if(OnlineScene.Name = "Animation1")

    xsdBannerClockLeft.Stop()

    xsdBannerInfo.PlayRange(0, xsdBannerInfo.Duration)

    end if

    ' Check if the Left Clock Banner went online

    if(OnlineScene.Name = "Animation2")

    xsdBannerInfo.Stop()

    xsdBannerClockLeft.PlayRange(0, xsdBannerClockLeft.Duration)

    end if


    #XPression


  • 4.  RE: Animation controllers in multiple scene directors

    Posted 07-28-2015 16:27
    There is a property of the xpSceneDirector you can set called AutoStop that will stop it when it reaches the end (instead of pausing it).

    Just use something like:

    `Director.AutoStop = true`

    before you call Play or PlayRange.

    #XPression