Graphics

 View Only
  • 1.  AnimControler change duration with VB - SDK API

    Posted 08-01-2013 12:09
    Hi,

    I have a scene with AnimControler1 that has duration 200

    engine.loadproject "c:project_before.xpf"

    engine.GetSceneByName "Scene1", myScene

    myScene.GetAnimControllerByName "AnimController1", AnimCont1

    'Im try to change the duration of animation controler

    AnimCont1.Duration = 125

    'Then save the project (different name)

    Engine.Saveproject "c:project_after.xpf"

    'but the duration has the old value 200

    How can I change the duration ?

    Thanks in advance


  • 2.  RE: AnimControler change duration with VB - SDK API

    Posted 08-01-2013 12:18
    Hi Elias,

    In VB when you link the scenes in Xpression to the Scene-objects in VB you are actually creating duplicates.

    when you do engine.GetSeneByName "SCENENAME", xpScene

    there is actually a third parameter which is AsCopy which defaults to true.

    Meaning that everytime that you change something in that scene, it's done on the virtual scene which was created by Xpression at runtime and not on the original scene that you have in your project. If you want to prevent this and actually work on the scene that you have created you need to set this property to false.

    So if you do engine.GetSeneByName "SCENENAME", xpScene, false

    the code should work.

    Keep us posted.

    Kenneth

    #XPression


  • 3.  RE: AnimControler change duration with VB - SDK API

    Posted 08-01-2013 12:31
    Hi Kenneth,

    Im try to fix up the crawl sample code that you send me. It works, but if the duration of animation controler is 200 (at design), and I need an animation from 0 to 120 frame, the animation play till to 200.

    If I need animation from 0 to 300 frame, the animation stops to 200 frame.

    I need to change the total duration because of different text width, in order to keep the same 'speed'.

    So I can't change the duration to feet my needs (for speed)

    The above example (of saving the project) I use it in order to check if animationcaontroler accepts my changes.

    #XPression


  • 4.  RE: AnimControler change duration with VB - SDK API

    Posted 08-01-2013 12:47
    Hi Elias,

    I see your point. However, when you create an animation which goes for example from 0 to 150, once it reaches frame 150 the textfield is out of the screen. The tmrCheck-function will detect this and stop the animation automatically. So there's no need to change the duration of the Animation Controller.

    In the other case that the animation takes 300 frames, then it's something different.

    But I just make my Animation Controllers in design-mode a 1000 frames. That way I'm sure that they are long enough and I don't have to worry because once I have reached my last keyframe VB will stop my animation controller.

    So just try to make it a 1000 frames and see if that works for you.

    If you plan on having really long messages which take 40 seconds or more to crawl by, feel free to make your animation controllers even longer.

    #XPression


  • 5.  RE: AnimControler change duration with VB - SDK API

    Posted 08-01-2013 12:52
    One more remark concerning the debugging of your VB-app.

    I see that you are loading your project dynamically. Which is ok, but it sometimes works better and faster if you remove the engine.load and just open your project in XPression itself and run the VB-app on the project which is open in XPression. There's nothing more frustrating then having to wait for Xpression to finish loading the project :-)

    Also if you use the false-method I showed you before, you can actually see the keyframes in Xpression which have been placed dynamically. Also a great way to help you debug complex animations.

    #XPression