Graphics

 View Only
  • 1.  Transition Logic Problem

    Posted 03-26-2012 19:54
    I am trying to get the animation of one scene to play out as I take a new scene. For example, I take a bug then I want that bug to move over when I take a lower third. Likewise I want to take a lower third then play the exit animation of that lower third as the intro animation of a new one plays. I am told this is achieved through scripting. Here is my sample script:

    **This is all under the OnSceneOnline Scripting window**

    dim Controller as xpAnimController

    dim oFrameBuffer, sFrameBuffer as Integer

    dim oLayer, sLayer as Integer

    OnlineScene.GetOnline (oFrameBuffer, oLayer)

    Self.GetOnline (sFrameBuffer, sLayer)

    if (OnlineScene.Name="TB_NewTxt_NewHeader") and (oFrameBuffer = sFrameBuffer) then

    if Self.GetAnimControllerByName("3Headers1", controller) then Controller.PlayRange (40,80)

    end if

    Now I'm not sure if I have errors in my code or if I'm going about it wrong. The above text is located in the scene "TB_NewTxt_NewHeader" and the scene I want it to effect as I take it is "3_Headers_1"

    The only script currently in 3_Headers1 is in the OnScene scripting window and it is: Self.SceneDirector.PlayRange(0,40)

    Can anyone help me here?


  • 2.  RE: Transition Logic Problem

    Posted 03-31-2012 05:13
    The only thing I see right now is a missing 'end if'. You have your If (OnlineScene.Name =... and your If Self.GetAnimControllerByName..., but only 1 'end if'. Otherwise, at a glance it looks like you're in the right direction.

    What's happening, or not happening?

    #XPression


  • 3.  RE: Transition Logic Problem

    Posted 04-02-2012 06:16
    If I understand it correctly you have 2 scenes:

    1. "TB_NewTxt_NewHeader"

    2. "3_Headers_1"

    and you want Scene1 to animate Scene2 off screen when you take Scene1 online.

    If this is the case than this won't work. The OnSceneOnline-event of Scene1 only fires when the scene is put online (obviously). But when that happens Scene2 is no longer online since it has been replaced bij Scene1, i.e. you can not play an AnimController of Scene 2 anymore. Unless I got it wrong.

    #XPression


  • 4.  RE: Transition Logic Problem

    Posted 04-02-2012 21:32
    I'm trying to accomplish both a move animation and an animate out. The scripting above is for a move animation. I figured if I could get that working properly then I could figure out how to animate out another scene. I'm going to give the extra end if a try. I remember it told me there was an error with an extra end if... but maybe it was just glitching. Basically noting is happening. I take one item, then try and take the next. They both play out according to their keyed animations without effecting eachother.

    #XPression


  • 5.  RE: Transition Logic Problem

    Posted 04-04-2012 21:14
    I got it to work! The End If was not the problem. I'm actually not sure what was wrong or what settings I had differently, but I started over from scratch and it suddenly started working. I now know that if you do not hit the compile scene button, it will not update any changes to the script. I felt like I was always doing that until I noticed one time I didn't. Again, not sure if that was an issue or not, but at least the scenes are working properly.

    #XPression


  • 6.  RE: Transition Logic Problem

    Posted 04-05-2012 19:13
    Andrew,

    Thanks for the update. Please let us know if you have any other questions.

    Cheers,

    -g

    #XPression


  • 7.  RE: Transition Logic Problem

    Posted 04-10-2012 16:50
    Oh, and for future reference, if someone is working with transition logic I found it better to use Self.SceneDirector.PlayRange (xx,xx) instead of Self.GetAnimControllerByName("3Headers1"³, controller) then Controller.PlayRange (40,80) because it will still pay attention to any events you add into your scene (providing more customizeable animations) whereas the AnimController will ONLY play the key frames inside that specific animation controller. Of course if you are working with muliple overlaying/overlapping animation controllers that might not be the best option, but I personally prefer to use the SceneDirector.

    #XPression


  • 8.  RE: Transition Logic Problem

    Posted 04-10-2012 16:57
    It's all personal preference. The sample I sent out was intended to allow the customer to cut-and-paste the script in, and just make animation controllers with the proper name, and not have to worry about a play range. Essentially, I was trying to make it so the user had to change as few variables as possible. For a more advanced user such as yourself, it may make more sense to do what you're doing. There's no right way to do it. Just an easier way to support it for someone who has little to no scripting experience.

    Chris

    #XPression