pixijs / animate-extension

Custom Platform Plugin for Adobe Animate CC (Formerly Adobe Flash CC) - to export animation for the PixiJS renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Masked layers with many keyframes are not published properly

andrewstart opened this issue · comments

If a single keyframe of a mask is masking a layer with many keyframes, the published file creates the mask instance once for each masked keyframe (overwriting the same variable), then masks only the first keyframe. After that, it adds the mask as a timed child for the length of its frame once for each masked keyframe.

//Example Output
var mask = new Graphics()
            .drawCommands(shapes.Example[0])
            .setRenderable(false);
var mask = new Graphics()
            .drawCommands(shapes.Example[0])
            .setRenderable(false);
var mask = new Graphics()
            .drawCommands(shapes.Example[0])
            .setRenderable(false);
var frame1 = new Sprite(fromFrame("foobar"))
            .setMask(mask);
var frame2 = new Sprite(fromFrame("foobar2"));
var frame3 = new Sprite(fromFrame("foobar3"));
this.addTimedChild(mask, 0, 3, {
                "0": {
                    x: 0,
                    y: 0
                }
            })
            .addTimedChild(mask, 0, 3, {
                "0": {
                    x: 0,
                    y: 0
                }
            })
            .addTimedChild(mask, 0, 3, {
                "0": {
                    x: 0,
                    y: 0
                }
            })
            .addTimedChild(frame1, 0, 1, {
                "0": {
                    x: 0,
                    y: 0
                }
            })
            .addTimedChild(frame2, 1, 1, {
                "1": {
                    x: 0,
                    y: 0
                }
            })
            .addTimedChild(frame1, 2, 1, {
                "2": {
                    x: 0,
                    y: 0
                }
            })

Example Timeline:
mask_issue