• Editor
  • After Effects and Photoshop export script for Spine

Fantastic! I'll definitely have a look at that approach, and I agree that simple horizontally offset control points should be fine.

This should work great for temporal easing, but curved paths that control the value itself would need to be supported in Spine.

Nimai

Related Discussions
...

Awesome!

Hi Nimai!

I've just found a way to correctly convert speed and influence into x and y. For example for rotation:

if (key <= thisLayer.rotation.numKeys - 1 && thisLayer.rotation.keyOutInterpolationType(key) == KeyframeInterpolationType.BEZIER){
   duration = rotation.keyTime(key + 1) - rotation.keyTime(key);
   amount = Math.abs(rotation.keyValue(key + 1) - rotation.keyValue(key));
   averageSpeed = amount/duration;
   curve1U = rotation.keyOutTemporalEase(key)[0].influence/100;
   curve1V = rotation.keyOutTemporalEase(key)[0].speed/averageSpeed * curve1U;
   curve2U = rotation.keyInTemporalEase(key + 1)[0].influence/100;
   curve2V = rotation.keyInTemporalEase(key + 1)[0].speed/averageSpeed * curve2U;
   f.write(", \"curve\": [" + curve1U + ", " + curve1V + ", " + (1 - curve2U) + ", " + (1 - curve2V) + "]");
}

We just need to round the results to make them shorter. :rofl:

Very cool stuff. Yes, I know what you mean about those giant floating point numbers in JSON! I'm sure 8 places would be fine, but more accuracy isn't a bad thing either.

By the way, do you have a plan to convert puppet pins in AE into mesh deform in Spine?
Moreover, in AE, I see a very cool feature. It lets us transform a layer in 3D. I think it is possible to simulate that perspective look into Spine using mesh deform.

How do you think? Do you have time to further develop the script? I see that your thread was not updated in the last 5 months, so I just wonder.

Great questions. I've pretty much taken this script as far as it needs to go for our purposes.

I have given some thought to what it would take to support "standard" deformations in many Adobe products. (See here).

Puppet support would be amazing! I don't have the time to pursue it, though.

Puppet support would be amazing! I don't have the time to pursue it, though.

The last time I approached that issue (before Spine existed) it was not possible as the mesh data was never serialized in a way that could be exported. It was a proprietary mesh-generating algorithm that only took in a few parameters.

Hi Mitch. Thanks for the info. I have an idea of even simulating that algorithm and adapt it to Spine, although I know this will be difficult.


Nimai, is it possible to make several animations in AE (each animation is a composition), and then export all of them to only one json file?

@famevn - I assume you mean that multiple compositions would be output as one JSON file, and each composition would be it's own animation? That would be pretty useful. Each composition would have to have the exact same layers. Is that what you're thinking?

Yes exactly!

I don't see any technical reason why that couldn't be done. For now, you should be able to copy-paste and consolidate animations from multiple exports into one.

Do you mean I should manipulate the JSON files?

I meant, for now, I don't have plans to add multi-animation output to my scripts, but there are any number of things you could do! I was suggesting you export multiple JSON files, load them all in as separate skeletons in Spine, and copy-paste the animations onto one skeleton for use in your game. Just one possibility. Of course, you could edit the JSON files in a text editor or using a script, etc. etc. Lots of work-arounds. (Any more about this specifically here would be drifting off-topic, but you're welcome to PM or email me)

I tried to copy-paste an animation like you suggested but nothing happened. Editing the JSON file is too complicated to my fellow artists.

Nimai, can you help supporting this feature in your script, please? I would appreciate it very much.

14 Tage später

Hello Nimai, thank you for making the script and letting us use it.

I am trying to test it, but I do get this error "unable to execute script at line 443. Not well-formed (invalid token"

On AE CC 2014. I tried to export just one png layer where I made it follow a path. No luck. Then I just tried to export two png with no key frames.

Am I missing something?

Thank you.

Hey! I'll PM you. Maybe we can figure out what could be going wrong.

Sorry I'm late to the party! These scripts are super cool, thanks for sharing them! 🙂

3 Monate später

Updated the ae_to_spine.jsx script to export "blend" (normal, additive, multiply, screen) instead of "additive".
This will require use of Spine v2.1.26 or later.

Enjoy!

20 Tage später

Hi there,
just wondered if any-one might have similar issues with the script,

"unable to execute script at line 449. Not well formed (invalid token)"

It seems to happen with any animation in After Effects CC.
Thanks for any help 🙂
Lee