CompInterface.js 1019 B

12345678910111213141516171819202122232425262728
  1. const CompExpressionInterface = (function () {
  2. return function (comp) {
  3. function _thisLayerFunction(name) {
  4. var i = 0;
  5. var len = comp.layers.length;
  6. while (i < len) {
  7. if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
  8. return comp.elements[i].layerInterface;
  9. }
  10. i += 1;
  11. }
  12. return null;
  13. // return {active:false};
  14. }
  15. Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm });
  16. _thisLayerFunction.layer = _thisLayerFunction;
  17. _thisLayerFunction.pixelAspect = 1;
  18. _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
  19. _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
  20. _thisLayerFunction.pixelAspect = 1;
  21. _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
  22. _thisLayerFunction.displayStartTime = 0;
  23. _thisLayerFunction.numLayers = comp.layers.length;
  24. return _thisLayerFunction;
  25. };
  26. }());
  27. export default CompExpressionInterface;