Graphics

 View Only
  • 1.  Simple control of Animation controller

    Posted 11-07-2012 12:43
    I want to be able to control a simple animation controller from a SmartGPI. In the SmartGPI config I set up a script event and tried this script:

    --

    dim fly as xpAnimController

    dim vsset as xpScene

    Engine.GetSceneByName("Scene6", vsset)

    vsset.GetAnimControllerByName("MonitorUpp", fly)

    fly.play

    --

    I've also tried fly.start() and fly.playrange(0,35) but I just can't seem to get the animation controller to play. I've looked in some sample project, and as far I can see, the script should be correct... Does anyone have any idea why I can't get this to work?

    thx Martin


  • 2.  RE: Simple control of Animation controller

    Posted 11-12-2012 00:57
    You can't use GetSceneByName() to get a scene that is put online from the sequencer. This is because the sequencer puts a "Copy" of the scene online.. It uses a copy because the sequencer changes the data in the scene (for any published fields) so it must use a copy otherwise you would not be able to have the same scene on multiple times (with different field data)..

    So, in order to get your script to work you should use Engine.GetOutputFrameBuffer() to get the xpOutputFramebuffer object that represents the output that your scene is on, then use xpOutputFrameBuffer.GetSceneOnLayer() to get the actual copy of the scene that is online.

    Then you can use the GetAnimControllerByName and .Play() methods as your current script does.

    #XPression