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

Extend lottie-web for new animation #22

Open
lucemia opened this issue Apr 28, 2020 · 1 comment · May be fixed by #23
Open

Extend lottie-web for new animation #22

lucemia opened this issue Apr 28, 2020 · 1 comment · May be fixed by #23

Comments

@lucemia
Copy link

lucemia commented Apr 28, 2020

測試需要花多少工作才能夠 extend bodymovin 到一個特定的版型

@lucemia lucemia linked a pull request Apr 28, 2020 that will close this issue
@lucemia
Copy link
Author

lucemia commented Apr 28, 2020

bodymovin 沒有支援 displacement map
但 SVG 是有支援的 https://codepen.io/osublake/pen/WQyBJb

extension 有定義 id 27 = displacementMap

var effectTypes = {
sliderControl: 0,
angleControl: 1,
colorControl: 2,
pointControl: 3,
checkboxControl: 4,
group: 5,
noValue: 6,
dropDownControl: 7,
customValue: 9,
layerIndex: 10,
maskIndex: 11,
tint: 20,
fill: 21,
stroke: 22,
tritone: 23,
proLevels: 24,
dropShadow: 25,
radialWipe: 26,
displacementMap: 27,
matte3: 28,
gaussianBlur2: 29,
twirl: 30,
mesh_warp: 31,
ripple: 32,
spherize: 33,
freePin3: 34,
ccPageTurn: 100
};

資料有正確的 export 出來

{
                            "ty": 27,
                            "nm": "Displacement Map 1",
                            "np": 10,
                            "mn": "ADBE Displacement Map",
                            "ix": 5,
                            "en": 1,
                            "ef": [
                                {
                                    "ty": 10,
                                    "nm": "Displacement Map Layer",
                                    "mn": "ADBE Displacement Map-0001",
                                    "ix": 1,
                                    "v": {
                                        "a": 0,
                                        "k": 7,
                                        "ix": 1
                                    }
                                },
                                {
                                    "ty": 7,
                                    "nm": "Use For Horizontal Displacement",
                                    "mn": "ADBE Displacement Map-0002",
                                    "ix": 2,
                                    "v": {
                                        "a": 0,
                                        "k": 5,
                                        "ix": 2
                                    }
                                },
                                {

但是 player 沒有對 id=27 反應

filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 21) {
count += 1;
filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 22) {
filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 23) {
count += 1;
filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 24) {
count += 1;
filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 25) {
count += 1;
filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 28) {
//count += 1;
filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
} else if (elem.data.ef[i].ty === 29) {
count += 1;
filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
} else if (elem.data.ef[i].ty === 100) {
filterManager = new SVGCCPageTurnEffect(fil, elem.effectsManager.effectElements[i], elem);
} if (filterManager) {

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

Successfully merging a pull request may close this issue.

1 participant