Graphics

 View Only
  • 1.  Scripting the play mode of xpVideoShader

    Posted 03-17-2021 13:12

    In Xpression v9.5, I would like to script the xpVideoShader.  The Play Mode should be set to either Play Once or Loop.  I can find anything along these lines in the Xpression SDK. 

    Anyone know how I can do this?  

    Thanks in advance.
    Mike



  • 2.  RE: Scripting the play mode of xpVideoShader

    Posted 03-19-2021 11:38


  • 3.  RE: Scripting the play mode of xpVideoShader

    Posted 03-19-2021 11:50

    Care to elaborate?  I dont see a script that allows me to define the Run Mode: Loop vs Play Once or Stopped or Ping Pong for that matter.  

    Blend mode, field mode, loop points, etc.  Nothing that I can see fits what I am looking for.    
    Am I missing it?  


    #XPression


  • 4.  RE: Scripting the play mode of xpVideoShader

    Posted 03-19-2021 12:46

    Good point, I am looking for a "mode" or something but not seeing it myself. 


    #XPression


  • 5.  RE: Scripting the play mode of xpVideoShader

    Posted 03-19-2021 15:13

    Mike,

    There's a SetPlayMode Method on the xpMaterial object:

     

    So to set the play mode to Play Once for a Material on a Quad, a script like this would work:

    dim Quad as xpBaseObject
    dim Video as xpMaterial

    self.GetObjectByName("Quad1",Quad)
    Quad.GetMaterial(0,Video)

    Video.SetPlayMode(0)


    #XPression


  • 6.  RE: Scripting the play mode of xpVideoShader

    Posted 03-19-2021 15:14

    THAT IS IT!  I didnt even think to check material.

    I have a text object called PlayMode with defined strings one can choose in the sequencer, Loop or PlayOnce

    This is in the onOnline script

    dim Background, PlayMode as xpBaseObject
    Self.GetObjectByName("Background",Background)
    Self.GetObjectByName("PlayMode",PlayMode)

    dim Material as xpMaterial
    Background.GetMaterial(0,Material)

    if PlayMode.Text = "Loop" then
    Material.SetPlayMode(1)
    else ' PlayOnce
    Material.SetPlayMode(0)
    end if

    Thanks all for your time


    #XPression


  • 7.  RE: Scripting the play mode of xpVideoShader

    Posted 03-19-2021 17:01

    Nice one Jeff, I knew there was a way to set the mode somewhere but couldn't think where. 


    #XPression