Articy Forum


https://www.articy.com:443/forum/

How to get a video from an object template?

https://www.articy.com:443/forum/viewtopic.php?f=33&t=18612

Page 1 of 1

How to get a video from an object template?

Posted: Tue 16. Jul 2019, 15:21
by AlexandreOct
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.

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

Posted: Tue 16. Jul 2019, 15:56
by [Articy] Nico Probst
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

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

Posted: Wed 17. Jul 2019, 07:44
by AlexandreOct
Thank you very much, that was exactly what I needed, and it works perfectly!

All times are UTC
Page 1 of 1