Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesCreative Cloud DebateFAQ

Import XML from local file

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Pete AddingtonImport XML from local file
by on May 8, 2012 at 3:44:25 pm

I might have missed something obvious here, but I cant seem to find any example of someone using After Effects to load an XML file (although i see people are moving data to and fro in this format somehow)

I am writing a camera exporter from a 3d package. I could export the transform data as a javascript file, but I would prefer to export as XML and read this in to create the data in afx. Im not writing the file in AFX, just trying to read the data from one that is already created.

I see many examples of using javascript within a browser, but this is not relevant to what I am trying to do.

Should my approach be to open the xml file with the file.open command, read the contents to a string and then pass this to the extendscript xml class?

I'm new to javascript as of this week but I'm not new to programming. Im enjoying the idea of adding functionality to after effects though. thanks


Return to posts index
Reply   Like  

Pete AddingtonRe: Import XML from local file
by on May 8, 2012 at 5:12:21 pm

ok , seems like i am getting somewhere with the file open approach - a can at least see some xml now. I'll post when I get a robust solution.


Return to posts index
Reply   Like  

Dan EbbertsRe: Import XML from local file
by on May 8, 2012 at 7:27:19 pm

Basically it's like this to read the XML file into AE:


var fileOK = myXmlFile.open("r");
if (fileOK){
var myXmlString = myXmlFile.read();
var myRoot = new XML (myXmlString);
myXmlFile.close();
}



Dan



Return to posts index
Reply   Like  


Pete AddingtonRe: Import XML from local file
by on May 8, 2012 at 9:19:38 pm

hi Dan,


thanks for your code sample. I had just figured it out myself when your reply came in!

the javascript xml class looks pretty good actually, i will look into writing a class to hold the xml data.


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]