How to get a video from an object template?

Tue 16. Jul 2019, 15:21

Hello, I am fairly new to Articy and have been succesful in implementing it with Unity thus far.
Currently, I am able to reference a flow node with a UnityCallbackPause, get access to any object attached to it, as well as getting multiple values from this object template.
For example, here is how i get access to a value of type String:

Code: Select all
Scope scope = flowElement.Attachments[0] as Scope;
ScopeUI.cardiac = scope.Template.Scope.CardiacRythm.ToString();


However, I am now trying to acces a value of type VideoClip/Video which I created in Articy without any problem (I can even access it through Unity's clip search), but I cannot find a way to convert ArticyObject into a VideoClip, or making Unity accept it through code. As this video is subject to change, I need to access it dynamicaly.
Does anyone have a solution for this? Do you think I should be doing it another way?
Also don't hesitate to ask for more precisions, I can be confusing when explaining my problems.
AlexandreOct
 
Posts: 4
Joined: Tue 16. Jul 2019, 15:05

Re: How to get a video from an object template?

Tue 16. Jul 2019, 15:56

Hi AlexandreOct,

Its important to understand that in articy:draft an Asset is a container object for an actual asset on your harddisk. So your Articy Asset knows what kind of file it links to but can also live inside articy in a folder, can have a template and so on and so forth. So your Asset(ArticyObject) cast to an IAsset will provide you with a LoadAsset<TTYpe>() method, which will load the underlying physical asset.
You should be able to call this method by supplying the unity Type for this kind of asset, Texture2D, AudioClip or in this case VideoClip.

Code: Select all
var videoClip = ((myObj.Template.Feature.MyVideoClip) as IAsset).LoadAsset<VideoClip>()


Hope that helps

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: How to get a video from an object template?

Wed 17. Jul 2019, 07:44

Thank you very much, that was exactly what I needed, and it works perfectly!
AlexandreOct
 
Posts: 4
Joined: Tue 16. Jul 2019, 15:05

Return to Technical Discussion

Who is online

Users browsing this forum: No registered users and 8 guests

Who We Are
Contact Us
Social Links