I tried to script by myself but my limits where reached very quickly. Today our programmer helped me and it finally works.
Now all we have to do is to overwrite the avi clip every week and at its end the graphics automatically move out.
This is great! Thanks again.
Original Message:
Sent: 01-02-2024 19:55
From: Aleksander Stalsberg
Subject: Using the end of a video file as a trigger
Yup! That's the one I was referring to!
Can confirm it works as well. I am using it for live arena production where we never know how long a video is. Works like a charm, triggering a scene director for animation out when the clip has 5 frames left of play time.
------------------------------
Aleksander Stalsberg
Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
Norway
Original Message:
Sent: 01-02-2024 15:42
From: Garner Millward
Subject: Using the end of a video file as a trigger
I think this is an example of the script being discussed.
Notes from change log and SDK about xpMaterial.Duration:
[implemented] xpMaterial.Duration read only property which returns the duration in frames of the material (returns the longest duration of any used shader)
The duration of a material is controlled by the shaders it contains. For example the duration of a material containing a video clip would be the duration of the video clip. Materials without video clips would generally have no duration.
Dim track as xpSceneDirectorTrack
Dim clip as xpSceneDirectorClip
Dim obj as xpBaseObject
Dim mat as xpMaterial
Self.GetObjectByName("objectname", obj)
Obj.getmaterial(0,mat)
Self.scenedirector.GetTrackByName("track2", track)
Track.GetClipByName("event1", clip)
Clip.position = mat.duration
Original Message:
Sent: 01-02-2024 09:19
From: Aleksander Stalsberg
Subject: Using the end of a video file as a trigger
Hi there!
This can indeed be done with some scripting and VB.
If you look through the Xpression SDK, and under the xpMaterial Object, there is a "Duration Property". This can be used in a scene director script event for example to look at the material of a quad, get the length of the material, and then move another trigger in the scene director to match the length of the clip in the material.
I cant give you the exact code now, but if I find the project where I tested this I'm sure I could give you a few more pointers.
------------------------------
Aleksander Stalsberg
Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
Norway
Original Message:
Sent: 12-15-2023 12:22
From: Régis Blank
Subject: Using the end of a video file as a trigger
As I'm not a scripting person, I'll have to ask our programmer for this. thanks a lot!
------------------------------
Régis Blank
TELEBASEL
Original Message:
Sent: 12-15-2023 12:06
From: Azathoth Son of Cthulhu
Subject: Using the end of a video file as a trigger
I don't have time to try this, but here's an idea to try.
Use scripting to get the length of the video.
https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.mediaplayer.naturalduration?view=windowsdesktop-8.0
Haven't found a VB version of this.
Also, xpVideoShader has an OutPoint property. Same as length?
Once you have the length, design a pause. Maybe create a timestamp for when it starts playing then a loop that checks the difference between current time and the timestamp against the video length. I don't know if you can create a pause event with Engine, but that would be the easiest.
Hope this helps.
------------------------------
Azathoth
Son of Cthulhu
Original Message:
Sent: 12-14-2023 06:12
From: Régis Blank
Subject: Using the end of a video file as a trigger
Hi there,
I would like to use a video file to trigger an event.
To be more specific, I would like the event to be triggered by the ending point of the video file.
The length of this video file changes every week so the idea is to overwrite it in the video folder and let the magic happen without touching the timeline.
Is this possible?
Thanks beforehand for your answer.
Régis
------------------------------
Régis Blank
TELEBASEL
------------------------------