Copy link to clipboard
Copied
I'm trying to make a simple animation -- just a rectangle following a path and rotating.
I have a spreadsheet with frame #, x,y and angle for the motion path I want the rectangle to follow but I'm having trouble figuring out the best way to import it into animate (I ended up entering it almost manually which took waaaay too long).
My data looks something like this:
Time | x | y | angle |
1 | 231.3805 | 4031.661 | 0 |
2 | 253.1384 | 4045.595 | 2.087635 |
3 | 277.4785 | 4231.38 | 4.86381 |
4 | 278.8138 | 4323.092 | 8.011356 |
5 | 244.0012 | 4114.502 | 5.44807 |
6 | 172.555 | 4053.024 | 4.493519 |
7 | 134.4272 | 3715.02 | 1.968241 |
8 | 139.5535 | 3097.636 | -5.41789 |
9 | 166.6213 | 3039.38 | -6.26314 |
I'm going to have to do it for a pretty large number of different paths (~100). Can anybody recommend a good way to do this? Maybe a plugin or something that I don't know about?
Thanks a lot
Ah, scientific visualization. That makes more sense.
I'd recommend modifying your script to just export the raw data. Something like:
<proteins>
<frame time="1" x="14.05" y="22" angle="0" />
<frame time="2" x="200.05" y="46" angle="2.09" />
<frame time="3" x="292.05" y="47.8" angle="4.86" />
etc...
</proteins>
At runtime, import and parse this XML data.
Then, using the Tween class, animate the transitions between frames as you see fit.
Copy link to clipboard
Copied
It may take some coding. Do you have an example XML feed for us to try?
We could give you a lot of general tips, but with some real data we could maybe give you a script that works.
Copy link to clipboard
Copied
Sorry, I may have used some of the wrong terminology in my original post! (I haven't animated much since Flash CS5 or so.) Just to be clear, all I need is for a way to get the rectangle to follow the path from my excel file.
I wrote a short "quick and dirty" script that I thought would work, here's a sample output:
<Motion duration="7" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="24" x="4111.4" y="231" scaleX="1" scaleY="1" skewX="0" skewY="180" elementType="drawing object">
<dimensions>
<geom:Rectangle left="753" top="146.05" width="160.95" height="0"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.4998446722584657" y="NaN"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0"/>
<Keyframe index="1" x="14.05" y="22"/>
<Keyframe index="2" x="200.05" y="46"/>
<Keyframe index="3" x="292.05" y="47.80"/>
<Keyframe index="4" x="83.05" y="13"/>
<Keyframe index="5" x="22.05" y="-59"/>
<Keyframe index="6" x="-315.95 y="-97"/>
</Motion>
I thought I'd be able to just use Commands --> Import Motion XML and have my rectangle follow the imported path but apparently it doesn't work that way.
Copy link to clipboard
Copied
May I ask how on earth Excel(?!) got wedged into your animation workflow?
Also the example you posted isn't valid XML. You're missing a quote after the keyframe 6 x value.
Copy link to clipboard
Copied
I'm just trying to animate some scientific data (I actually use MATLAB, not Excel, but it's functionally the same as Excel which more people are familiar with).
Basically, I simulated rectangle-shaped proteins diffusing around inside of cells and my program spits out coordinates -- now I want to animate a bunch of examples of different things that can happen in my simulations.
The purpose of this animation is actually to explain what my simulation is doing. Normally I would just animate it using scientific programs (MATLAB and ImageJ) but there's a few things happening in the background that would be much easier to do in Animate than in the programs I usually use.
ClayUUID wrote
Also the example you posted isn't valid XML. You're missing a quote after the keyframe 6 x value.
Nice catch! I must've accidentally deleted when I was manually removing the trailing digits!
(<Keyframe index="6" x="-315.9499999999998" y="-97"/>)
Copy link to clipboard
Copied
Ah, scientific visualization. That makes more sense.
I'd recommend modifying your script to just export the raw data. Something like:
<proteins>
<frame time="1" x="14.05" y="22" angle="0" />
<frame time="2" x="200.05" y="46" angle="2.09" />
<frame time="3" x="292.05" y="47.8" angle="4.86" />
etc...
</proteins>
At runtime, import and parse this XML data.
Then, using the Tween class, animate the transitions between frames as you see fit.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now