Graphics

 View Only
  • 1.  Material with movie, when changed via script or published disappears

    Posted 04-28-2018 14:17
    Hey guys,
    "‹So I have a material with a movie file attached to it, set to loop, but not auto start or free run. The object/material has a script attached to it to change the path based on away/home team. I call for the scene director to play a range, the movie just wont play.
    "‹If the material is not changed, it will play. If I have autostart turned on, it will play. What is causing this to be held up on frame 1 when you change the material movie file? I just want to trigger the movie to play.
    Thanks,
    Dave


  • 2.  RE: Material with movie, when changed via script or published disappears

    Posted 04-29-2018 09:42
    Hi,

    Do you change the .filename of the shader of this particular material ?
    #XPression


  • 3.  RE: Material with movie, when changed via script or published disappears

    Posted 04-29-2018 13:54
    Here is my script for the first way (put on a text field):
    dim movie01 as xpBaseObject
    dim logopath as string
    scene.GetObjectByName("Home_Movie_01", movie01)
    logopath = "D:\YourCallFootball\Team-Elements"
    if scene.iscopy then
    movie01.SetVolatileTextureFile(0, logopath & ucase(Replace(text," ","_")) & "/" & ucase(Replace(text," ","_")) & "_Movie_01.avi")
    end if

    "‹However, without any script, if I publish the material, and within the sequencer, change the material, it will not play either.

    #XPression


  • 4.  RE: Material with movie, when changed via script or published disappears

    Posted 04-29-2018 20:55
    SetVolatileTextureFile is only for Texture Shader (png, tga, jpg...), not Video Shader. You have to get the material of movie01, then get its shader, then set its filename property.
    #XPression


  • 5.  RE: Material with movie, when changed via script or published disappears

    Posted 04-30-2018 01:19
    When you call SetVolatileTextureFile it creates a new material and assigns it to the quad; so that material will not be on the scenedirector and cannot be started that way.
    If you have autostart/freerunning enabled on the material that is already assigned to the quad, then those properties will be copied over to the newly created volatile material.

    If you don't want to use autostart; then you will need another script on the scene director that would start the material playing.
    That script would get the Get the quad object, then call GetMaterial for that quad, then you can call Play for that material..

    Something like:

    dim quad as xpQuadObject
    dim mat as xpMaterial
    self.GetObjectByName("Quad1", quad)
    quad.GetMaterial(0, mat)
    mat.Play


    #XPression


  • 6.  RE: Material with movie, when changed via script or published disappears

    Posted 05-15-2018 01:23

    Hey, guys. I have a similar problem.

    I read in this forum (https://discussions.rossvideo.com/forum/default-forum-gc1/vision-production-switchers-gc15/1081-datalinq-with-material) how to replace the image from a material according to numerical or code value from datalinq. I tried to do it like you show there but remaking the code to work with conditional, but it doesn't work. I don't use the function for, i use if for every candidate.
    This is my script:

    --------

    dim Nombre1, Nombre2, Nombre3, Nombre4, Nombre5, Apellido1 as xptextobject

    dim Slab1 as xpBaseObject [I]'Slab1 is the name my empty slab[/I]
    dim Slab1Mat as xpMaterial
    dim Slab1Shad as xpBaseShader
    dim FilePath as String
    FilePath = Engine.ProjectPath

    self.getobjectbyname("Nombre1" ,Nombre1)
    self.getobjectbyname("Apellido1" ,Apellido1)
    self.getobjectbyname("Nombre2" ,Nombre2)
    self.getobjectbyname("Nombre3" ,Nombre3)
    self.getobjectbyname("Nombre4" ,Nombre4)
    self.getobjectbyname("Nombre5" ,Nombre5)
    Self.GetObjectByName("Slab1 " , Slab1) [I]'Here i call my slab[/I]


    [I]'Casilla 1 - Candidate 1[/I]

    if Nombre1.text = "001" then
    Nombre1.text = replace(Nombre1.text, "001", "Gustavo Petro")
    [I] 'So, inside this conditional i execute the function.[/I]
    Slab1.GetMaterial(1, Slab1Mat)
    Slab1Mat.GetShader(1, Slab1Shad)
    Slab1Shad.SetFileName(FilePath + "Candidatos" + Nombre1.Text + ".png")

    end if





    ------------------------


    I think that the layer inside material needs to be called.

    But, how i put the image inside material. I have Xpression 6.5.


    Thanks for your help and sorry for my english .


    #XPression