text source from datafile

Moderators: Disciple, zlovatt

Post Reply
darkmoon3d
Posts: 6
Joined: July 13th, 2006, 5:40 pm

I'm trying to import text data into 'text source' from a data file using clipboard method. Have been able to do so with objects and cameras using keyframe data and am trying to something similar but for text instead.

Here is example of what I'm trying to import so far:

Code: Select all

Adobe After Effects 6.0 Keyframe Data 
  
	Units Per Second	30
	Source Width	640
 	Source Height	480
	Source Pixel Aspect Ratio	1.0
	Comp Pixel Aspect Ratio	1.0
 
Text
	Frame
	0		"0.0 Units/Frame "
	1		"0.0668086 Units/Frame "
	2		"0.198629 Units/Frame "
	3		"0.327769 Units/Frame "
	4		"0.454212 Units/Frame "
	5		"0.577968 Units/Frame "
	6		"0.699023 Units/Frame "
	7		"0.817402 Units/Frame "
	8		"0.933084 Units/Frame "
	9		"1.04607 Units/Frame "
	10		"1.15638 Units/Frame "
	11		"1.26399 Units/Frame "
	12		"1.36891 Units/Frame "
	13		"1.47114 Units/Frame "
	14		"1.57069 Units/Frame "
 
End of Keyframe Data 



Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

When I try creating some source text keyframes, copy them and paste the clipboard data into a text file, the text source data doesn't appear in the clipboard text. Which suggests that the source text data is a custom data type that isn't revealed as clipboard text. Which suggests that you can't do the reverse either, which I think is what you're wanting to do.

It is however possible to create a script that will import the data from a text file. Not in AE6 though as scripting wasn't really fully fledged until AE 6.5.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Thinking about this more I realised you could do it with an expression too. Paste this expression into a text layer's source text property:

Code: Select all

theTextArray = ["0.0 Units/Frame",
"0.0668086 Units/Frame",
"0.198629 Units/Frame",
"0.327769 Units/Frame",
"0.454212 Units/Frame",
"0.577968 Units/Frame",
"0.699023 Units/Frame",
"0.817402 Units/Frame",
"0.933084 Units/Frame",
"1.04607 Units/Frame",
"1.15638 Units/Frame",
"1.26399 Units/Frame",
"1.36891 Units/Frame",
"1.47114 Units/Frame",
"1.57069 Units/Frame"];
curFrame = time/thisComp.frameDuration;
curFrame = Math.min(curFrame, theTextArray.length-1);
theTextArray[Math.round(curFrame)];
darkmoon3d
Posts: 6
Joined: July 13th, 2006, 5:40 pm

Thanks!! Worked great and helped save time with trying to find other solutions.
Post Reply