Production Switchers

 View Only
  • 1.  xpSceneObject is undefined

    Posted 03-18-2013 17:26
    I'm trying to trigger two scenes at once. Here's the script that I have on my main scene.

    dim MySuper as xpSceneObject

    Engine.getSceneByName(Super, MySuper)

    MySuper.SetOnline(1)

    I get an error saying xpSceneObject is undefined even though I got the code from the Xpression SDK. Am I missing something?


  • 2.  RE: xpSceneObject is undefined

    Posted 03-18-2013 21:08
    Hi,

    You need to put the Super between brackets.

    And you need to define on which layer you want to put your graphic.

    You are putting the scene online on your second output, is that correct?

    The outputs are zero based, so your first output is Framebuffer 0 and your second one is Framebuffer 1.

    So try this:

    dim MySuper as xpSceneObject

    Engine.getSceneByName("Super", MySuper)

    MySuper.SetOnline(1,0,0)

    Does that work for you?

    Best regards,

    Kenneth

    #CrossOver


  • 3.  RE: xpSceneObject is undefined

    Posted 03-19-2013 12:29
    Oops. I had the quotes, just missed it in my example. The SDK said that the layer was optional but it's no big deal to add it. Unfortunately it still says that xpSceneObject is undefined.

    I am applying this code to another scene if that makes any difference.

    EDIT: I have also tried xpScene and that was recognized but the script didn't work.

    EDIT2: I tried adding only the first line, 'dim mysuper as xpSceneObject', in a different project and still got the same error

    #CrossOver


  • 4.  RE: xpSceneObject is undefined

    Posted 03-19-2013 19:53
    try declaring dim MySuper as xpScene (instead of xpSceneObject)

    #CrossOver


  • 5.  RE: xpSceneObject is undefined

    Posted 03-19-2013 20:41
    You're absolutely right Luis!

    I didn't even spot it in the example. It should be xpScene and not xpSceneObject.

    On what event are you executing this code? onSceneOnline?

    #CrossOver


  • 6.  RE: xpSceneObject is undefined

    Posted 03-20-2013 01:00
    Cool. I was browsing other topics and noticed xpScene in other code. I tried it but unfortunately the script still didn't work. At least it compiles though! Thanks for getting me on the right track!

    I am executing at the onSceneOnline event. That seemed to be the best choice but I just started using the software a week ago so there's probably a lot I haven't really noticed.

    #CrossOver


  • 7.  RE: xpSceneObject is undefined

    Posted 03-20-2013 14:51

    I had to place my script at the OnOnline event rather then the OnSceneOnline event to get it to work. Can somebody explain how the behaviors differ between the two events?

    Also, the animation in my super scene doesn't run. Is there a way to load the scene at frame 0 ( setOnline(0,-3,0) ) and play it's animation at the same time as my main scene? Right now I'm using setOnline(0,-3,80) to jump past the animation because otherwise nothing is on the screen yet.

    EDIT: Alright guys. Here's what I've come up with to get the animation going but it still didn't work.

    dim MySuper as xpScene
    
    dim MyAnimation as xpSceneDirector
    
    Engine.getSceneByName("Super", MySuper)
    
    MySuper.setOnline(0,-3,0)
    
    MySuper.getTrack(1, MyAnimation)
    
    MyAnimation.play()

    It would be great if you could let me know if I did something wrong there and then I'll leave ya'll alone. Thanks again!

    EDIT2: I got it! Instead of calling the track I called on the animcontroller and we're good to go!

    dim MySuper as xpScene
    
    Engine.getSceneByName("Super", MySuper)
    
    MySuper.setOnline(0,-3,0)
    
    MySuper.SceneDirector.Play()

     


    #CrossOver


  • 8.  RE: xpSceneObject is undefined

    Posted 03-20-2013 17:52
    OnOnline is fired when your specific scene (MySuper) goes online.

    OnSceneOnline is fired every time a scene (of your project) goes online when your specific scene (MySuper) is online...

    In example, when "MySuper" is online, when you set online another scene, you can play an animcontroller on MySuper.

    #CrossOver


  • 9.  RE: xpSceneObject is undefined

    Posted 03-21-2013 01:32
    Very cool. Thanks everyone!

    #CrossOver