Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate cc optimize Animation.json with meaningless key #4

Closed
urunky opened this issue May 10, 2019 · 9 comments
Closed

Animate cc optimize Animation.json with meaningless key #4

urunky opened this issue May 10, 2019 · 9 comments

Comments

@urunky
Copy link

urunky commented May 10, 2019

Hi Daniel!

I am always thankful for your efforts.
Thank you for Starling, and this extension. I'm appreciate with this.

Anyway, the Animate CC's new feature - optimize Animation.json - makes Animation.json with meaningless names.

https://helpx.adobe.com/animate/using/create-sprite-sheet.html?mv=product&mv2=an#texture-atlas

When Optimize animation.json file option is checked, this option removes indentation, decomposed matrix and shortens the names used (default option).
When Optimize animation.json file option is unchecked, this option exports with indentation and with meaningful names.

the result is like this

{
"AN": {
"N": "npc_20_word",
"SN": "npc_20",
"TL": {
"L": [
{
"LN": "Layer_1",
"FR": [
{
"N": "_1",
"I": 0,
"DU": 16,
"E": []
},
{
"N": "_2",
"I": 16,
"DU": 2,
"E": []
......

full result is attached.

Animation.zip

I'm happy with this new feature added in new Animate CC 19.2, but this result was not expected.

@PrimaryFeather
Copy link
Contributor

Thanks a lot for making me aware of this! It's not a bad idea that they're now offering this option, as those keys really take up a lot of space.

Could you please send me a complete sample animation, i.e. including a texture atlas, so I can test this? You could e.g. open up the "ninja girl" animation that's part of this repository and export it with this setting. I'm afraid I'm currently without a CC subscription. Thanks in advance!

@urunky
Copy link
Author

urunky commented May 13, 2019

ninja-girl.zip

Thanks, Daniel!

This is your ninja-girl files using optimize Animation.json.

@PrimaryFeather
Copy link
Contributor

I just made a first attempt at adding compatibility with the new export keys!
The new "Ninja Girl" version now plays again, but for some reason, its size is somewhat off. That could mean that (a) they have changed some export detail or (b) my 'fix' still lacks a specific change or (c) something went wrong when you made that export.

I'd say you simply try out the new version with your actual animation. If that's wrong, too, then I'll need to do some more research. 😉

@urunky
Copy link
Author

urunky commented May 13, 2019

I just had tried with my animations. And it works quite well!!!
I think you did well enough like usual!!!

But.. there is one strange thing. It's not your fault...

why Adobe Animate CC exports texture atlas files with suffix '1' ??

Animation.json
spritemap1.json <-- why?
spritemap1.png <-- why??

because of this, I can use these files after remove suffix '1'.

Anyway.. Thanks for your fast response.

I'm very happy with your extension.

If I find something wrong, I will tell you again.

@PrimaryFeather
Copy link
Contributor

That's good news! Thanks a lot for trying it out! 😄

As for the suffix ... hm ... could this maybe be the scale factor? If you set the scale factor on, say, "2" on export, do you then get that suffix instead?

If it's like that, I could maybe incorporate that into the code.

@urunky
Copy link
Author

urunky commented May 13, 2019

I tested with Resolution - scale factor related value - 2x, 3x. but suffixes are same '1'.

oh! there is a key 'resolution' in spritemap1.json

2019-05-14 02;06;30

@PrimaryFeather
Copy link
Contributor

I just changed the file name logic slightly — the extension now recognizes the "spritemap" files when they end with one or more digits. So you don't need to rename them any longer!

As for the resolution: if you could send me a sample with two scale factors (ideally "1" and "2"), I could check which changes are necessary for this, too! Thanks in advance! :-)

I closed this issue, because there's actually another one (#2) for the resolution.

@urunky
Copy link
Author

urunky commented May 15, 2019

Thanks Daniel!

Here is ninja-girl-1(scale x1), ninja-girl-2(scale x2) files.

ninja-girl-1.zip
ninja-girl-2.zip

@PrimaryFeather
Copy link
Contributor

Thanks a lot for those samples! I'll have a look! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants