Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Converting excel spreadsheet to motion xml?

Community Beginner ,
Apr 18, 2017 Apr 18, 2017

I'm trying to make a simple animation -- just a rectangle following a path and rotating.  actin-tests.gif

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:

 

Timexyangle
1231.38054031.6610
2253.13844045.5952.087635
3277.47854231.384.86381
4278.81384323.0928.011356
5244.00124114.5025.44807
6172.5554053.0244.493519
7134.42723715.021.968241
8139.55353097.636-5.41789
9166.62133039.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

472
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 19, 2017 Apr 19, 2017

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.

Translate
LEGEND ,
Apr 18, 2017 Apr 18, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2017 Apr 19, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 19, 2017 Apr 19, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2017 Apr 19, 2017

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"/>)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 19, 2017 Apr 19, 2017
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines