Copy link to clipboard
Copied
Summary: In the context of a texture atlas animation, Free Transforming a symbol instance can affect the scale of other instances of the same symbol. The animation looks fine in Animate, but when rendering it from Animation.json, those other instances will be too big.
Demo: ("scaling-bug.docx" is actually a ZIP file containing a project "bug.fla" and a texture atlas export in the "bug" directory. You should be able to open it if you rename the file from "scaling-bug.docx" to "scaling-bug.zip". Sorry for the inconvenience--it would not let me upload a zip.)
Open the attached project "bug.fla", select the "Stage" symbol, and press play. You will see a transformed square for 1 second, and then a normal square for 2 seconds.
Now, play the attached video "scaling-bug.mp4". This video was generated directly from the files produced by running "Generate Texture Atlas" on the "Stage" symbol. In the video, you will see a transformed square for 1 second, a normal square for 1 second, and then a big square for 1 second. The big square in the last second is the bug--it should be a normal square.
Steps to reproduce:
Detailed explanation:
If you look in spritemap1.json, the sprites for "Square" and "Square Wrapper" use the same image. However, the image has been scaled to 133x133, which means that it will need to be scaled back down to 100x100 in Animation.json.
Indeed, if we look in Animation.json, under SYMBOL_DICTIONARY, we can see that the ATLAS_SPRITE_instance for "Square" has a Matrix3D which scales the sprite image to 0.75x the original size. But, if look at the Matrix3D for "Square Wrapper", we can see that it is the identity matrix. This means that "Square Wrapper" is using the 133x133 sprite without scaling it down. This causes the big square at the end of "scaling-bug.mp4".
To sumarize, Free Transforming the "Square" instance causes its sprite in spritemap1.png to be scaled up. To compensate, Animation.json defines the "Square" symbol with a Matrix3D that scales down the image. But, this downscaling is not propagated to the "Square" instance nested in "Square Wrapper". So, "Square Wrapper"'s square ends up being too big.
System details:
Animate version: 21.0.5
Build: 40714
OS: macOS Catalina
Have something to add?