Graphics

 View Only
Expand all | Collapse all

Start Video Material at frame X - visual logic

Simon Latus

Simon Latus10-07-2020 10:49

  • 1.  Start Video Material at frame X - visual logic

    Posted 10-02-2020 11:08

    So, I must be missing something really easy here...

    I'm looking to start playing a video material at frame 125, meaning the video layer is until then hidden, and I want to start playing the clip at that point. The linked clip on this material can also change through DataLinq.

    So, I know about EventMarkers... I know about the visual logic materials parts where you can find the video layer and have the "play" trigger... Buuuut nothing happens...
    The "layer1.vide.play" node from the material in VL expects an "action" in on the input, but I cant find a single way to actually trigger this!

    Ayone got a tip for me here?



  • 2.  RE: Start Video Material at frame X - visual logic

    Posted 10-02-2020 14:12

    Hi Aleksander

    You need to put the material onto a scene director (drag it from the Materials tab onto a track). Then in Visual Logic you can obtain the position of that scene director and do a compare with a value, 125 in your case, that could change the visibility of the quad or whatever is holding your video material.

    You will need to get the scene director with your material in to play, so either use a Scene Director Trigger from your main scene director, or just have it play when the scene goes online - you can do that in Visual Logic as well.

    Hope that helps

    Simon


    #XPression


  • 3.  RE: Start Video Material at frame X - visual logic

    Posted 10-02-2020 21:18

    Uhm.. Sorry... But I dont understand that one...

    I dragged the material into the scene director, and placed it at the frame I want the video to start, but I guess that was wrong?
    Use a Scene Director Trigger? Yes, but that cant affect a material can it?
    Is the material supposed to be in it's own scene director? Or in a separate track from the original scene director?


    #XPression


  • 4.  RE: Start Video Material at frame X - visual logic

    Posted 10-03-2020 09:01

    Hi

    You don't have to have the video material in its own scene director, but it may make things easier if you want to start and stop it independently of anything else in the scene. But if it was sharing a scene director it would be on its own track yes.

    You're right in that a scene director trigger can't affect a material, it can only affect another scene director.

    If you have datalinqed your material that holds the video, then that should deal with the video being changed and nothing further needs to be done, unless you change the video whilst the scene is online, then you'll need to reset the scene director with the video on, and that may require a different approach as you'd need to know when that video change happened.

    Simon

     


    #XPression


  • 5.  RE: Start Video Material at frame X - visual logic

    Posted 10-04-2020 21:44

    But what does adding the material to the scene director actually DO? From what I can see, it does basically nothing?
    Adding a material with a video shader to the scene director gives me no power over the video at all, either in scrubbing through the scene director and/or when it comes to actually playing the scene in the sequencer?

    I cant preview the video in the designer...
    I cant move the material in the scene director to frame 100 to delay it from playing for 4 seconds (EU standard here)...
    I can pause the scene director yes, but other than that... Nothing really changes does it?

    Am I just wrong here? I just cant get anything to happen at all with this...
    Will be comming back to you if I can find some sollution to this... I'm sure the sollution is so incredibly simple... I just cant seem to wrap my head around it atm...


    #XPression


  • 6.  RE: Start Video Material at frame X - visual logic

    Posted 10-04-2020 23:32

    Well... I thought I had it... But I guess not!
    I amde another scene with a video material in it. This time as well I wanted the video to start at frame 50.
    However this one is "static" in that it does not fetch the video file through DataLinq...

    And it works! Did exactly as I expected and as you said...

    Now.. I'm trying to redo the one that's causing issues for me on the other scene.
    Going with what I had above, I'm not even gonna grab the data from DataLinq, I'm just going to publish the material this time, so I can edit it as I please...
    So, created the material, add video shader, play once, no auto start, nothing checked...
    I add the material to the scene director, and YES! I can actually play it at frame 50! Perfect! Or so I thought...

    I go back out in the sequencer, I delete the old parts just to make sure, and I go about adding 3 of these just to try...
    I go into template links, change the text fields as I want, then I change the video...
    I take one online, and the video just freezes at frame 1 of the video.

    • Material is created new.
    • Material has no "auto start" or what not checked...
    • Material is set in the scene director.
    • Scene director is set to be the in-scene in Transition Logic
    • Scene director is NOT the typical default scene director (know this can cause bugs, at least in older versions)
    • The video file DOES play when scrubbing through or playing the scene director in Layout (Edit Mode).

    I'm out of ideas...


    #XPression


  • 7.  RE: Start Video Material at frame X - visual logic

    Posted 10-04-2020 23:35

    Here's another fun one... If I DONT change the video source at all, it plays perfectly.
    The problem ONLY occurs once I change the video file in the template data.

    BUG?!


    #XPression


  • 8.  RE: Start Video Material at frame X - visual logic

    Posted 10-05-2020 10:29

    Hi Aleksander

    I've just tried what you've set up and realise why it's not working. When you publish the material on the quad (I'm assuming it's a quad) the act of changing it in the sequencer creates a new temporary material if you select a filename directly, so the original material is untouched, and will still be playing in your scene director, only there is no object bound to it any more. You can prove this by making a copy of your quad and placing them side by side. In the sequencer change one quad to point to a new video, and when you bring the scene online the original quad will play, then second will just show the 1st frame of your new video. Even if you select a material in the sequencer that is already set to your video, your scene won't know about the change of material.

    If you need to change the filename of the video, I suggest datalinqing in the Video shader of the material.  If you Datalinq at the quad end, you'll need to have all the possible videos already loaded as materials.

     

    Alternatively, keep what you have and put this code into Scene OnLine event. This then shouldn't matter how you change your video, datalinq or template link change.  I'm on V9.5, and I think this should work on earlier versions.

    You need to name your quad with the video MyVideoQuad, and have a scene director called VideoDir. Don't rename any of the tracks in the new scene director, it looks for Track 1.

    This code now gets the material assigned to the quad, even it's a new temporary material, adds it to the scene director and plays it.  You change the position of where the scene director plays from in the final line of code.  You could also use Visual Logic to play the scene director, and remove the last line of code.

    Simon

    dim quad as xpQuadObject
    dim mat as xpMaterial
    dim newSceneDirClip as xpSceneDirectorClip
    dim dir as xpSceneDirector
    dim trk as xpSceneDirectorTrack

    self.GetObjectByName("MyVideoQuad", quad)
    quad.GetMaterial(0, mat)
    self.GetSceneDirectorByName("VideoDir", dir)
    dir.GetTrackByName("Track1", trk)
    trk.CreateMaterialClip(0, mat, newSceneDirClip)

    dir.AutoStop = true
    dir.PlayRange(0, dir.Duration)

    #XPression


  • 9.  RE: Start Video Material at frame X - visual logic

    Posted 10-05-2020 12:53

    Hmmmm..... So I think I get it...

    When creating the video material (let's call this material A1), and then drag Material A1 into the scene director, this works in the sequencer because, well, the scene director controls the playback of the material A1.

    However is using the Template Data to change the video on material A1, it created another temporary material (let's call this A2), and since the scene director in question still looks for and controls material A1, the new temporary material A2 will not start as expected.

    But when using DataLinq to change the actual file it will read from, the material A1 will just change the file location, and A1 will now hold the new video file, but keep its properties, and still be played from the scene director that looks for A1....

    Not sure if that made sense, but I THINK I got it!
    Now I tried your scrips on v9.0 build 4842 (64-bit), and I got this error message:

    Exception class: EOleException
    Could not load file or assembly 'xpression.net, Version=9.0.0.4842, Culture=neutral, PublicKeyToken=9632b4b433765424' or one of its dependencies. The system cannot find the file specified.

     


    #XPression


  • 10.  RE: Start Video Material at frame X - visual logic

    Posted 10-05-2020 13:12

    Yep, you got it! Your A1 and A2 scenario is correct. The only difference would be if you selected an existing material instead of just a new filename, then a new temporary material wouldn't be created. The material exists but your scene director is still looking at the original material.

    And changing the material via datalinq does as you say as well.

     

    What flavour of v9.0 are you using. I know this works in Studio and Developer.

    I've just had a look at the various editions available and they should all be able to do this script. You may need to try and reinstall XPression.

    Simon


    #XPression


  • 11.  RE: Start Video Material at frame X - visual logic

    Posted 10-05-2020 13:20

    This was done in Xpression Designer v9.0 build 4842 (64-bit) - [Tessera Single Engine]

    It will be running on a Xpression Studio SCE v9.0 build 4842 - [Tessera Single Engine] Graphite...
    Eventually this will be run through DataLinq, so that's all good, but right now I could really use this script... Heh...


    #XPression


  • 12.  RE: Start Video Material at frame X - visual logic

    Posted 10-05-2020 13:34

    As far as I can make it it should work on the tessera verison too. Look here https://www.rossvideo.com/products-services/acquisition-production/cg-graphics-systems/xpression/editions/ under Creative & Control Editions.

    The fact you can even get to the scripting section on a scene must mean it's available.

    My email is mail@simonlatus.co.uk if you want to take this offline. I could TeamViewer in and take a look if you want,

     

    Simon


    #XPression


  • 13.  RE: Start Video Material at frame X - visual logic

    Posted 10-05-2020 13:50

    Can do! Will send you an email now with TeamViewer info.


    #XPression


  • 14.  RE: Start Video Material at frame X - visual logic

    Posted 10-07-2020 09:11

    Got Scripting working again after a reinstall of the XPression designer. Script worked perfectly, and the delayed start of the video material works perfectly with any change made to the material (either DataLinq or Template Data).

    Used last night in live product ion, and it works like a charm!


    #XPression


  • 15.  RE: Start Video Material at frame X - visual logic

    Posted 10-07-2020 10:49

    Glad it all worked out!


    #XPression


  • 16.  RE: Start Video Material at frame X - visual logic

    Posted 10-08-2020 21:04

    Hey Simon!

    I got a follow up for you here... I've been looking through it on the Xpression SDK as well, trying to find this one on my own as well, but I cant quite figure this one out, and I believe it would be "easy" to fix in scripting.

    I got the "auto" sorting and lineup done now, and it works like it's supposed to now.
    However, if I've been in the editor and especially the scene director and triggered the playing of the material, and then try to start up again from the start, it bugs out. As in the material/video doesnt play. This only happens the first time the scene is taken online though... The second time the same scene is taken online (different datalinq data on the player, but technically still same material) it plays just as it's supposed to.

    I suspect that it might be because the material doesnt "rewind" unless it has actually finished playing.

    Any tips?


    #XPression


  • 17.  RE: Start Video Material at frame X - visual logic

    Posted 10-09-2020 05:30

    Hi
    If you’ve brought the scene online in the editor you’ll end up with a clip in the video scene director which it expects to be blank every time the scene goes online. Might be that?


    #XPression