@galacean/effects 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/weapp.js CHANGED
@@ -7124,9 +7124,9 @@ var Float16ArrayWrapper = /** @class */ (function () {
7124
7124
  this.data = new Uint16Array(num);
7125
7125
  }
7126
7126
  else if (num && typeof num === 'object' && Number.isInteger(num.length)) {
7127
- var data_1 = this.data = new Uint16Array(num.length);
7128
- for (var i = 0; i < data_1.length; i++) {
7129
- data_1[i] = toHalf(num[i]);
7127
+ var data = this.data = new Uint16Array(num.length);
7128
+ for (var i = 0; i < data.length; i++) {
7129
+ data[i] = toHalf(num[i]);
7130
7130
  }
7131
7131
  }
7132
7132
  }
@@ -7499,9 +7499,9 @@ var CurveValue = /** @class */ (function (_super) {
7499
7499
  CurveValue.getAllData = function (meta, halfFloat) {
7500
7500
  var ret = new (halfFloat ? Float16ArrayWrapper : Float32Array)(meta.index * 4);
7501
7501
  for (var i = 0, cursor = 0, curves = meta.curves; i < curves.length; i++) {
7502
- var data_1 = curves[i].toData();
7503
- ret.set(data_1, cursor);
7504
- cursor += data_1.length;
7502
+ var data = curves[i].toData();
7503
+ ret.set(data, cursor);
7504
+ cursor += data.length;
7505
7505
  }
7506
7506
  return halfFloat ? ret.data : ret;
7507
7507
  };
@@ -7510,17 +7510,17 @@ var CurveValue = /** @class */ (function (_super) {
7510
7510
  var max = -Infinity;
7511
7511
  //formatted number
7512
7512
  if (Number.isFinite(props[0]) && Number.isFinite(props[1])) {
7513
- var keys_1 = [];
7513
+ var keys = [];
7514
7514
  for (var i = 2; i < props.length; i++) {
7515
7515
  // FIXME
7516
- keys_1.push(props[i].slice(0, 4));
7516
+ keys.push(props[i].slice(0, 4));
7517
7517
  }
7518
- this.keys = keys_1;
7518
+ this.keys = keys;
7519
7519
  this.min = props[0];
7520
7520
  this.dist = props[1] - props[0];
7521
7521
  }
7522
7522
  else {
7523
- var keys_2 = props.map(function (item) {
7523
+ var keys = props.map(function (item) {
7524
7524
  if (isArray(item)) {
7525
7525
  min = Math.min(min, item[1]);
7526
7526
  max = Math.max(max, item[1]);
@@ -7535,22 +7535,22 @@ var CurveValue = /** @class */ (function (_super) {
7535
7535
  throw new Error('invalid keyframe');
7536
7536
  });
7537
7537
  var dist = max - min;
7538
- this.keys = keys_2;
7538
+ this.keys = keys;
7539
7539
  if (dist !== 0) {
7540
- for (var i = 0; i < keys_2.length; i++) {
7541
- var key = keys_2[i];
7540
+ for (var i = 0; i < keys.length; i++) {
7541
+ var key = keys[i];
7542
7542
  key[1] = (key[1] - min) / dist;
7543
7543
  }
7544
7544
  }
7545
- var key0 = keys_2[0];
7545
+ var key0 = keys[0];
7546
7546
  if (key0[0] > 0) {
7547
7547
  key0[2] = 0;
7548
- keys_2.unshift([0, key0[1], 0, 0]);
7548
+ keys.unshift([0, key0[1], 0, 0]);
7549
7549
  }
7550
- var key1 = keys_2[keys_2.length - 1];
7550
+ var key1 = keys[keys.length - 1];
7551
7551
  if (key1[0] < 1) {
7552
7552
  key1[3] = 0;
7553
- keys_2.push([1, key1[1], 0, 0]);
7553
+ keys.push([1, key1[1], 0, 0]);
7554
7554
  }
7555
7555
  this.min = min;
7556
7556
  this.dist = dist;
@@ -7925,14 +7925,14 @@ function curveValueIntegrateByTime(t1, keyframe0, keyframe1) {
7925
7925
  function getKeyFrameMetaByRawValue(meta, value) {
7926
7926
  if (value) {
7927
7927
  var type = value[0];
7928
- var keys_3 = value[1];
7928
+ var keys = value[1];
7929
7929
  if (type === ValueType$1.CURVE) {
7930
- meta.curves.push(keys_3);
7931
- var keyLen = keys_3.length;
7932
- if (keys_3[0][0] > 0) {
7930
+ meta.curves.push(keys);
7931
+ var keyLen = keys.length;
7932
+ if (keys[0][0] > 0) {
7933
7933
  keyLen++;
7934
7934
  }
7935
- if (keys_3[keys_3.length - 1][0] < 1) {
7935
+ if (keys[keys.length - 1][0] < 1) {
7936
7936
  keyLen++;
7937
7937
  }
7938
7938
  meta.index += keyLen;
@@ -7940,19 +7940,19 @@ function getKeyFrameMetaByRawValue(meta, value) {
7940
7940
  meta.curveCount += keyLen;
7941
7941
  }
7942
7942
  else if (type === ValueType$1.LINE) {
7943
- var keyLen = keys_3.length;
7944
- if (keyLen === 2 && keys_3[0][0] === 0 && keys_3[1][0] === 1) {
7943
+ var keyLen = keys.length;
7944
+ if (keyLen === 2 && keys[0][0] === 0 && keys[1][0] === 1) {
7945
7945
  return;
7946
7946
  }
7947
- if (keys_3[0][0] > 0) {
7947
+ if (keys[0][0] > 0) {
7948
7948
  keyLen++;
7949
7949
  }
7950
- if (keys_3[keys_3.length - 1][0] < 1) {
7950
+ if (keys[keys.length - 1][0] < 1) {
7951
7951
  keyLen++;
7952
7952
  }
7953
7953
  var uniformCount = Math.ceil(keyLen / 2);
7954
7954
  meta.lineSegCount += uniformCount;
7955
- meta.curves.push(keys_3);
7955
+ meta.curves.push(keys);
7956
7956
  meta.index += uniformCount;
7957
7957
  meta.max = Math.max(meta.max, uniformCount);
7958
7958
  }
@@ -10433,9 +10433,9 @@ var KTXTexture = /** @class */ (function () {
10433
10433
  for (var level = 0; level < mipmapCount; level++) {
10434
10434
  var imageSize = new Int32Array(this.arrayBuffer, this.baseOffset + dataOffset, 1)[0]; // size per face, since not supporting array cubemaps
10435
10435
  for (var face = 0; face < this.numberOfFaces; face++) {
10436
- var data_1 = new Uint8Array(this.arrayBuffer, this.baseOffset + dataOffset + 4, imageSize);
10436
+ var data = new Uint8Array(this.arrayBuffer, this.baseOffset + dataOffset + 4, imageSize);
10437
10437
  mipmaps.push({
10438
- data: data_1,
10438
+ data: data,
10439
10439
  width: width,
10440
10440
  height: height,
10441
10441
  });
@@ -13264,16 +13264,16 @@ var InteractVFXItem = /** @class */ (function (_super) {
13264
13264
  var nx = position[0] - width;
13265
13265
  var ny = position[1] - height;
13266
13266
  if (options.dxRange) {
13267
- var _d = __read$3(options.dxRange, 2), min_1 = _d[0], max_1 = _d[1];
13268
- nx = clamp$1(nx, min_1, max_1);
13269
- if (nx !== min_1 && nx !== max_1 && min_1 !== max_1) {
13267
+ var _d = __read$3(options.dxRange, 2), min = _d[0], max = _d[1];
13268
+ nx = clamp$1(nx, min, max);
13269
+ if (nx !== min && nx !== max && min !== max) {
13270
13270
  (_a = event.origin) === null || _a === void 0 ? void 0 : _a.preventDefault();
13271
13271
  }
13272
13272
  }
13273
13273
  if (options.dyRange) {
13274
- var _e = __read$3(options.dyRange, 2), min_2 = _e[0], max_2 = _e[1];
13275
- ny = clamp$1(ny, min_2, max_2);
13276
- if (ny !== min_2 && ny !== max_2 && min_2 !== max_2) {
13274
+ var _e = __read$3(options.dyRange, 2), min = _e[0], max = _e[1];
13275
+ ny = clamp$1(ny, min, max);
13276
+ if (ny !== min && ny !== max && min !== max) {
13277
13277
  (_b = event.origin) === null || _b === void 0 ? void 0 : _b.preventDefault();
13278
13278
  }
13279
13279
  }
@@ -13387,11 +13387,11 @@ var SpriteMesh = /** @class */ (function () {
13387
13387
  var item = items[i];
13388
13388
  var texture = item === null || item === void 0 ? void 0 : item.renderer.texture;
13389
13389
  var textureIndex = texture ? textures.indexOf(texture) : -1;
13390
- var data_1 = this.getItemInitData(item, i, pointCount, textureIndex);
13391
- aPointLen += data_1.aPoint.length;
13392
- indexLen += data_1.index.length;
13393
- datas.push(data_1);
13394
- pointCount += data_1.aPoint.length / 6;
13390
+ var data = this.getItemInitData(item, i, pointCount, textureIndex);
13391
+ aPointLen += data.aPoint.length;
13392
+ indexLen += data.index.length;
13393
+ datas.push(data);
13394
+ pointCount += data.aPoint.length / 6;
13395
13395
  this.updateItem(item, true);
13396
13396
  }
13397
13397
  var bundle = {
@@ -13403,10 +13403,10 @@ var SpriteMesh = /** @class */ (function () {
13403
13403
  index: 0,
13404
13404
  };
13405
13405
  var _loop_1 = function (i) {
13406
- var data_2 = datas[i];
13406
+ var data = datas[i];
13407
13407
  Object.keys(bundle).forEach(function (name) {
13408
13408
  var arr = bundle[name];
13409
- var ta = data_2[name];
13409
+ var ta = data[name];
13410
13410
  arr.set(ta, cursor[name]);
13411
13411
  cursor[name] += ta.length;
13412
13412
  });
@@ -13673,14 +13673,14 @@ var SpriteMesh = /** @class */ (function () {
13673
13673
  for (var y = 0; y < row; y++) {
13674
13674
  var base = (y * 2 + x) * 4;
13675
13675
  // @ts-expect-error
13676
- var split_1 = textureSheetAnimation ? [0, 0, 1, 1, splits[0][4]] : splits[y * 2 + x];
13677
- var texOffset = split_1[4] ? [0, 0, 1, 0, 0, 1, 1, 1] : [0, 1, 0, 0, 1, 1, 1, 0];
13676
+ var split = textureSheetAnimation ? [0, 0, 1, 1, splits[0][4]] : splits[y * 2 + x];
13677
+ var texOffset = split[4] ? [0, 0, 1, 0, 0, 1, 1, 1] : [0, 1, 0, 0, 1, 1, 1, 0];
13678
13678
  var dw = ((x + x + 1) / col - 1) / 2;
13679
13679
  var dh = ((y + y + 1) / row - 1) / 2;
13680
- var tox = split_1[0];
13681
- var toy = split_1[1];
13682
- var tsx = split_1[4] ? split_1[3] : split_1[2];
13683
- var tsy = split_1[4] ? split_1[2] : split_1[3];
13680
+ var tox = split[0];
13681
+ var toy = split[1];
13682
+ var tsx = split[4] ? split[3] : split[2];
13683
+ var tsy = split[4] ? split[2] : split[3];
13684
13684
  var origin_1 = [
13685
13685
  originData[0] / col + dw,
13686
13686
  originData[1] / row + dh,
@@ -13777,13 +13777,13 @@ function generateFeatureTexture(engine, feather) {
13777
13777
  }
13778
13778
  else {
13779
13779
  var len = 128;
13780
- var data_3 = new Uint8Array(len);
13780
+ var data = new Uint8Array(len);
13781
13781
  for (var i = 0, s = len - 1; i < len; i++) {
13782
13782
  var p = i / s;
13783
13783
  var val = feather.getValue(p);
13784
- data_3[i] = Math.round(val * 255);
13784
+ data[i] = Math.round(val * 255);
13785
13785
  }
13786
- tex = Texture.createWithData(engine, { width: len, height: 1, data: data_3 }, {
13786
+ tex = Texture.createWithData(engine, { width: len, height: 1, data: data }, {
13787
13787
  name: 'feather',
13788
13788
  format: glContext.LUMINANCE,
13789
13789
  minFilter: glContext.LINEAR,
@@ -13941,22 +13941,22 @@ var SpriteGroup = /** @class */ (function () {
13941
13941
  * 需要则添加到meshToModify数组
13942
13942
  */
13943
13943
  for (var i = 0; i < splits.length; i++) {
13944
- var split_1 = splits[i];
13944
+ var split = splits[i];
13945
13945
  // @ts-expect-error
13946
- var spriteMesh = split_1.spriteMesh;
13947
- if (split_1.items.length === 0) {
13946
+ var spriteMesh = split.spriteMesh;
13947
+ if (split.items.length === 0) {
13948
13948
  throw new Error('split not combined');
13949
13949
  }
13950
- if (split_1.dirty) {
13951
- var priority = split_1.indexStart;
13950
+ if (split.dirty) {
13951
+ var priority = split.indexStart;
13952
13952
  if (spriteMesh.mesh.priority !== priority) {
13953
13953
  spriteMesh.mesh.priority = priority;
13954
13954
  meshToModify.push(spriteMesh.mesh);
13955
13955
  }
13956
- spriteMesh.setItems(split_1.items.map(function (item) { return item.content; }));
13956
+ spriteMesh.setItems(split.items.map(function (item) { return item.content; }));
13957
13957
  }
13958
13958
  spriteMesh.applyChange();
13959
- split_1.dirty = false;
13959
+ split.dirty = false;
13960
13960
  }
13961
13961
  /**
13962
13962
  * 有需要移除的meshSplit 则废弃对应的mesh 保留material
@@ -13964,8 +13964,8 @@ var SpriteGroup = /** @class */ (function () {
13964
13964
  */
13965
13965
  if (splitsToRemove.length) {
13966
13966
  for (var i = 0; i < splitsToRemove.length; i++) {
13967
- var split_2 = splitsToRemove[i];
13968
- var sp = split_2.spriteMesh;
13967
+ var split = splitsToRemove[i];
13968
+ var sp = split.spriteMesh;
13969
13969
  // @ts-expect-error
13970
13970
  var mesh = sp.mesh;
13971
13971
  mesh.dispose({ material: { textures: exports.DestroyOptions.keep } });
@@ -14082,7 +14082,7 @@ var SpriteGroup = /** @class */ (function () {
14082
14082
  addItemWithOrder(items, item, itemSortProperty);
14083
14083
  if (isSprite(item)) {
14084
14084
  var content = item.createContent();
14085
- var split_4 = {
14085
+ var split = {
14086
14086
  indexStart: item.listIndex,
14087
14087
  indexEnd: item.listIndex,
14088
14088
  items: [item],
@@ -14090,21 +14090,21 @@ var SpriteGroup = /** @class */ (function () {
14090
14090
  cacheId: content.renderInfo.cacheId,
14091
14091
  textures: [item.content.renderer.texture],
14092
14092
  };
14093
- splits.unshift(split_4);
14094
- return [split_4];
14093
+ splits.unshift(split);
14094
+ return [split];
14095
14095
  }
14096
14096
  return [];
14097
14097
  }
14098
14098
  var _loop_2 = function (i) {
14099
- var split_5 = splits[i];
14099
+ var split = splits[i];
14100
14100
  var listIndex = item.listIndex;
14101
14101
  if (isSprite(item)) {
14102
14102
  // @ts-expect-error
14103
- if (listIndex <= split_5.indexEnd) {
14103
+ if (listIndex <= split.indexEnd) {
14104
14104
  addItemWithOrder(items, item, itemSortProperty);
14105
14105
  var itemIndex_1 = items.indexOf(item);
14106
- var indexStart = Math.min(itemIndex_1, items.indexOf(split_5.items[0]));
14107
- var indexEnd = Math.max(itemIndex_1, items.indexOf(split_5.items[split_5.items.length - 1]));
14106
+ var indexStart = Math.min(itemIndex_1, items.indexOf(split.items[0]));
14107
+ var indexEnd = Math.max(itemIndex_1, items.indexOf(split.items[split.items.length - 1]));
14108
14108
  var neoSplits_1 = this_2.getMeshSplits(items, indexStart, indexEnd);
14109
14109
  var neoSplitIndex_1 = neoSplits_1.findIndex(function (split) { return split.items.includes(item); });
14110
14110
  if (neoSplits_1.length === 2) {
@@ -14112,14 +14112,14 @@ var SpriteGroup = /** @class */ (function () {
14112
14112
  //1 or 0
14113
14113
  Object.keys(neoSplits_1[1 - neoSplitIndex_1]).forEach(function (key) {
14114
14114
  // @ts-expect-error
14115
- split_5[key] = neoSplits_1[1 - neoSplitIndex_1][key];
14115
+ split[key] = neoSplits_1[1 - neoSplitIndex_1][key];
14116
14116
  });
14117
14117
  return { value: [neoSplits_1[neoSplitIndex_1]] };
14118
14118
  }
14119
14119
  else if (neoSplits_1.length === 3) {
14120
14120
  Object.keys(neoSplits_1[0]).forEach(function (key) {
14121
14121
  // @ts-expect-error
14122
- split_5[key] = neoSplits_1[0][key];
14122
+ split[key] = neoSplits_1[0][key];
14123
14123
  });
14124
14124
  splits.splice(i + 1, 0, neoSplits_1[1], neoSplits_1[2]);
14125
14125
  if (neoSplitIndex_1 !== 1) {
@@ -14133,25 +14133,25 @@ var SpriteGroup = /** @class */ (function () {
14133
14133
  //todo add case
14134
14134
  Object.keys(neoSplits_1[0]).forEach(function (key) {
14135
14135
  // @ts-expect-error
14136
- split_5[key] = neoSplits_1[0][key];
14136
+ split[key] = neoSplits_1[0][key];
14137
14137
  });
14138
14138
  return { value: [] };
14139
14139
  }
14140
14140
  }
14141
14141
  else {
14142
- if (listIndex < split_5.indexStart || listIndex === split_5.indexEnd) {
14142
+ if (listIndex < split.indexStart || listIndex === split.indexEnd) {
14143
14143
  addItemWithOrder(items, item, itemSortProperty);
14144
14144
  return { value: [] };
14145
14145
  // @ts-expect-error
14146
14146
  }
14147
- else if (listIndex < split_5.indexEnd) {
14147
+ else if (listIndex < split.indexEnd) {
14148
14148
  addItemWithOrder(items, item, itemSortProperty);
14149
- var lastItem = split_5.items[split_5.items.length - 1];
14149
+ var lastItem = split.items[split.items.length - 1];
14150
14150
  var endIndex = items.indexOf(lastItem);
14151
- var neoSplits_2 = this_2.getMeshSplits(items, items.indexOf(split_5.items[0]), endIndex);
14151
+ var neoSplits_2 = this_2.getMeshSplits(items, items.indexOf(split.items[0]), endIndex);
14152
14152
  Object.keys(neoSplits_2[0]).forEach(function (key) {
14153
14153
  // @ts-expect-error
14154
- split_5[key] = neoSplits_2[0][key];
14154
+ split[key] = neoSplits_2[0][key];
14155
14155
  });
14156
14156
  if (neoSplits_2.length === 2) {
14157
14157
  splits.splice(i + 1, 0, neoSplits_2[1]);
@@ -14212,10 +14212,10 @@ var SpriteGroup = /** @class */ (function () {
14212
14212
  * 遍历this.meshSplits,找到元素的listIndex在split的indexStart和indexEnd范围内的第一个meshSplit
14213
14213
  */
14214
14214
  for (var i = 0; i < splits.length; i++) {
14215
- var split_6 = splits[i];
14215
+ var split = splits[i];
14216
14216
  // @ts-expect-error
14217
- if (split_6.indexStart <= item.listIndex && split_6.indexEnd >= item.listIndex) {
14218
- targetSplit = split_6;
14217
+ if (split.indexStart <= item.listIndex && split.indexEnd >= item.listIndex) {
14218
+ targetSplit = split;
14219
14219
  targetSplitIndex = i;
14220
14220
  break;
14221
14221
  }
@@ -14325,8 +14325,8 @@ var SpriteGroup = /** @class */ (function () {
14325
14325
  // FIXME: 可选性
14326
14326
  var targetSplitIndex = void 0;
14327
14327
  for (var i = 0; i < splits.length; i++) {
14328
- var split_7 = splits[i];
14329
- if (split_7.items.includes(item)) {
14328
+ var split = splits[i];
14329
+ if (split.items.includes(item)) {
14330
14330
  targetSplitIndex = i;
14331
14331
  break;
14332
14332
  }
@@ -15477,10 +15477,10 @@ var ParticleMesh = /** @class */ (function () {
15477
15477
  var index = geometry.getIndexData();
15478
15478
  for (var i = 0; i < names.length; i++) {
15479
15479
  var name_1 = names[i];
15480
- var data_1 = geometry.getAttributeData(name_1);
15481
- if (data_1) {
15480
+ var data = geometry.getAttributeData(name_1);
15481
+ if (data) {
15482
15482
  // @ts-expect-error
15483
- geometry.setAttributeData(name_1, new data_1.constructor(0));
15483
+ geometry.setAttributeData(name_1, new data.constructor(0));
15484
15484
  }
15485
15485
  }
15486
15486
  // @ts-expect-error
@@ -16855,10 +16855,10 @@ function getGeometryTriangles(geometry, options) {
16855
16855
  var segment = segments[i];
16856
16856
  var p0 = points[i];
16857
16857
  var p1 = points[i + 1] || points[0];
16858
- var keys_1 = segment;
16858
+ var keys = segment;
16859
16859
  var point = [0, 0];
16860
- for (var j = 0; j < keys_1.length - 1; j++) {
16861
- var key = keys_1[j];
16860
+ for (var j = 0; j < keys.length - 1; j++) {
16861
+ var key = keys[j];
16862
16862
  getBezier2DValue(point, key, p0, p1, p0[4], p0[5], p1[2], p1[3]);
16863
16863
  setPoint(point[0], point[1]);
16864
16864
  }
@@ -16917,11 +16917,11 @@ function getGeometryByShape(shape, uvTransform) {
16917
16917
  var index = 0;
16918
16918
  for (var i = 0; i < geometries.length; i++) {
16919
16919
  var geometry = geometries[i];
16920
- var data_1 = getGeometryTriangles(geometry, { indexBase: indexBase, uvTransform: uvTransform });
16921
- indexBase += data_1.aPoint.length / 5;
16922
- datas.push(data_1);
16923
- aPoint += data_1.aPoint.length;
16924
- index += data_1.index.length;
16920
+ var data = getGeometryTriangles(geometry, { indexBase: indexBase, uvTransform: uvTransform });
16921
+ indexBase += data.aPoint.length / 5;
16922
+ datas.push(data);
16923
+ aPoint += data.aPoint.length;
16924
+ index += data.index.length;
16925
16925
  }
16926
16926
  if (datas.length === 1) {
16927
16927
  return datas[0];
@@ -16930,11 +16930,11 @@ function getGeometryByShape(shape, uvTransform) {
16930
16930
  var indexData = new Uint16Array(index);
16931
16931
  // @ts-expect-error
16932
16932
  for (var i = 0, pointIndex = 0, idx = 0; i < datas[i]; i++) {
16933
- var data_2 = datas[i];
16934
- aPointData.set(data_2.aPoint, pointIndex);
16935
- pointIndex += data_2.aPoint.length;
16936
- indexData.set(data_2.index, idx);
16937
- idx += data_2.index.length;
16933
+ var data = datas[i];
16934
+ aPointData.set(data.aPoint, pointIndex);
16935
+ pointIndex += data.aPoint.length;
16936
+ indexData.set(data.index, idx);
16937
+ idx += data.index.length;
16938
16938
  }
16939
16939
  return {
16940
16940
  aPoint: aPointData,
@@ -17245,10 +17245,10 @@ var TrailMesh = /** @class */ (function () {
17245
17245
  var pointCountPerTrail = this.pointCountPerTrail;
17246
17246
  if (index >= 0 && index < pointCountPerTrail) {
17247
17247
  var startIndex = (trail * pointCountPerTrail + index) * 24 + 8;
17248
- var data_1 = this.geometry.getAttributeData('aColor');
17249
- out.x = data_1[startIndex];
17250
- out.y = data_1[1 + startIndex];
17251
- out.z = data_1[2 + startIndex];
17248
+ var data = this.geometry.getAttributeData('aColor');
17249
+ out.x = data[startIndex];
17250
+ out.y = data[1 + startIndex];
17251
+ out.z = data[2 + startIndex];
17252
17252
  return out;
17253
17253
  }
17254
17254
  };
@@ -18654,14 +18654,14 @@ var TextMesh = /** @class */ (function (_super) {
18654
18654
  for (var y_1 = 0; y_1 < row; y_1++) {
18655
18655
  var base = (y_1 * 2 + x_1) * 4;
18656
18656
  // @ts-expect-error
18657
- var split_1 = textureSheetAnimation ? [0, 0, 1, 1, splits[0][4]] : splits[y_1 * 2 + x_1];
18658
- var texOffset = split_1[4] ? [0, 0, 1, 0, 0, 1, 1, 1] : [0, 1, 0, 0, 1, 1, 1, 0];
18657
+ var split = textureSheetAnimation ? [0, 0, 1, 1, splits[0][4]] : splits[y_1 * 2 + x_1];
18658
+ var texOffset = split[4] ? [0, 0, 1, 0, 0, 1, 1, 1] : [0, 1, 0, 0, 1, 1, 1, 0];
18659
18659
  var dw = ((x_1 + x_1 + 1) / col - 1) / 2;
18660
18660
  var dh = ((y_1 + y_1 + 1) / row - 1) / 2;
18661
- var tox = split_1[0];
18662
- var toy = split_1[1];
18663
- var tsx = split_1[4] ? split_1[3] : split_1[2];
18664
- var tsy = split_1[4] ? split_1[2] : split_1[3];
18661
+ var tox = split[0];
18662
+ var toy = split[1];
18663
+ var tsx = split[4] ? split[3] : split[2];
18664
+ var tsy = split[4] ? split[2] : split[3];
18665
18665
  var origin_1 = [
18666
18666
  originData[0] / col + dw,
18667
18667
  originData[1] / row + dh,
@@ -23341,13 +23341,13 @@ var CompositionSourceManager = /** @class */ (function () {
23341
23341
  if (renderContent.renderer) {
23342
23342
  renderContent.renderer = _this.changeTex(renderContent.renderer);
23343
23343
  _this.processMask(renderContent.renderer);
23344
- var split_1 = renderContent.splits && !renderContent.textureSheetAnimation && renderContent.splits[0];
23344
+ var split = renderContent.splits && !renderContent.textureSheetAnimation && renderContent.splits[0];
23345
23345
  if (Number.isInteger(renderContent.renderer.shape)) {
23346
23346
  // TODO: scene.shapes 类型问题?
23347
- renderContent.renderer.shape = getGeometryByShape((_a = _this.jsonScene) === null || _a === void 0 ? void 0 : _a.shapes[renderContent.renderer.shape], split_1);
23347
+ renderContent.renderer.shape = getGeometryByShape((_a = _this.jsonScene) === null || _a === void 0 ? void 0 : _a.shapes[renderContent.renderer.shape], split);
23348
23348
  }
23349
23349
  else if (renderContent.renderer.shape && isObject(renderContent.renderer.shape)) {
23350
- renderContent.renderer.shape = getGeometryByShape(renderContent.renderer.shape, split_1);
23350
+ renderContent.renderer.shape = getGeometryByShape(renderContent.renderer.shape, split);
23351
23351
  }
23352
23352
  }
23353
23353
  else {
@@ -23359,14 +23359,14 @@ var CompositionSourceManager = /** @class */ (function () {
23359
23359
  if (renderContent.filter) {
23360
23360
  renderContent.filter = __assign$1({}, renderContent.filter);
23361
23361
  }
23362
- var name_1 = item.name, _b = item.delay, delay = _b === void 0 ? 0 : _b, id_1 = item.id, parentId = item.parentId, duration = item.duration, endBehavior = item.endBehavior, pluginName = item.pluginName, pn = item.pn, transform = item.transform;
23362
+ var name_1 = item.name, _b = item.delay, delay = _b === void 0 ? 0 : _b, id = item.id, parentId = item.parentId, duration = item.duration, endBehavior = item.endBehavior, pluginName = item.pluginName, pn = item.pn, transform = item.transform;
23363
23363
  // FIXME: specification 下定义的 Item 不存在 refCount 类型定义
23364
23364
  // @ts-expect-error
23365
23365
  var refCount = item.refCount;
23366
23366
  var _c = _this.jsonScene.plugins, plugins = _c === void 0 ? [] : _c;
23367
23367
  option.name = name_1;
23368
23368
  option.delay = delay;
23369
- option.id = id_1;
23369
+ option.id = id;
23370
23370
  if (parentId) {
23371
23371
  option.parentId = parentId;
23372
23372
  }
@@ -23828,8 +23828,8 @@ var AssetManager = /** @class */ (function () {
23828
23828
  return [2 /*return*/, resultImage];
23829
23829
  case 3:
23830
23830
  // 如果是加载图片且是数组,设置变量,视频情况下不需要
23831
- if (background && !Array.isArray(url_1) && variables) {
23832
- variables[background.name] = url_1;
23831
+ if (background && Array.isArray(url_1) && variables) {
23832
+ variables[background.name] = resultImage.src;
23833
23833
  }
23834
23834
  return [4 /*yield*/, combineImageTemplate(resultImage, template, variables, this.options, img.oriY === -1)];
23835
23835
  case 4: return [2 /*return*/, _b.sent()];
@@ -23977,14 +23977,14 @@ var AssetManager = /** @class */ (function () {
23977
23977
  }());
23978
23978
  function fixOldImageUsage(usedImages, compositions, imgUsage, images, renderLevel) {
23979
23979
  for (var i = 0; i < compositions.length; i++) {
23980
- var id_1 = compositions[i].id;
23981
- var ids = imgUsage[id_1];
23980
+ var id = compositions[i].id;
23981
+ var ids = imgUsage[id];
23982
23982
  if (ids) {
23983
23983
  for (var j = 0; j < ids.length; j++) {
23984
- var id_2 = ids[j];
23985
- var tag = images[id_2].renderLevel;
23984
+ var id_1 = ids[j];
23985
+ var tag = images[id_1].renderLevel;
23986
23986
  if (passRenderLevel(tag, renderLevel)) {
23987
- usedImages[id_2] = true;
23987
+ usedImages[id_1] = true;
23988
23988
  }
23989
23989
  }
23990
23990
  }
@@ -24090,18 +24090,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24090
24090
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24091
24091
  if (exports.Item.isComposition(itemProps)) {
24092
24092
  var refId = itemProps.content.options.refId;
24093
- var props = this.composition.refCompositionProps.get(refId);
24094
- if (!props) {
24095
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24096
- }
24097
- props.content = itemProps.content;
24098
- item = new CompVFXItem(__assign$1(__assign$1({}, props), { refId: refId, delay: itemProps.delay, id: itemProps.id, name: itemProps.name, duration: itemProps.duration, endBehavior: itemProps.endBehavior, parentId: itemProps.parentId, transform: itemProps.transform }), this.composition);
24093
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24099
24094
  item.contentProps = itemProps.content;
24100
24095
  item.transform.parentTransform = this.transform;
24101
24096
  this.composition.refContent.push(item);
24102
24097
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24103
24098
  this.composition.autoRefTex = false;
24104
24099
  }
24100
+ item.createContent();
24105
24101
  }
24106
24102
  else {
24107
24103
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24233,6 +24229,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24233
24229
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24234
24230
  this.items.forEach(function (item) { return item.setVisible(visible); });
24235
24231
  };
24232
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24233
+ if (this.content) {
24234
+ this.content.startSize = new Vector3(x, y, z);
24235
+ }
24236
+ };
24237
+ CompVFXItem.prototype.scale = function (x, y, z) {
24238
+ if (this.content) {
24239
+ var startSize = this.content.startSize.clone();
24240
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24241
+ }
24242
+ };
24236
24243
  CompVFXItem.prototype.getUpdateTime = function (t) {
24237
24244
  var startTime = this.startTimeInms;
24238
24245
  var now = this.timeInms;
@@ -25755,10 +25762,10 @@ var GLTexture = /** @class */ (function (_super) {
25755
25762
  var target = this.target;
25756
25763
  var gl = this.pipelineContext.gl;
25757
25764
  if (gl && this.textureBuffer) {
25758
- var data_1 = new Uint8Array([255]);
25765
+ var data = new Uint8Array([255]);
25759
25766
  this.bind();
25760
25767
  if (target === gl.TEXTURE_2D) {
25761
- gl.texImage2D(target, 0, gl.LUMINANCE, 1, 1, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data_1);
25768
+ gl.texImage2D(target, 0, gl.LUMINANCE, 1, 1, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data);
25762
25769
  }
25763
25770
  else if (target === gl.TEXTURE_CUBE_MAP) {
25764
25771
  var faces = [
@@ -25770,7 +25777,7 @@ var GLTexture = /** @class */ (function (_super) {
25770
25777
  gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
25771
25778
  ];
25772
25779
  for (var i = 0; i < faces.length; i++) {
25773
- gl.texImage2D(faces[i], 0, gl.LUMINANCE, 1, 1, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data_1);
25780
+ gl.texImage2D(faces[i], 0, gl.LUMINANCE, 1, 1, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data);
25774
25781
  }
25775
25782
  }
25776
25783
  // rewrite mipmap
@@ -29755,10 +29762,10 @@ var Player = /** @class */ (function () {
29755
29762
  }
29756
29763
  else if (gl) {
29757
29764
  this.canvas = gl.canvas;
29758
- var version_1 = gl instanceof weapp.WebGLRenderingContext ? 'webgl' : 'webgl2';
29759
- if (framework !== version_1) {
29760
- logger.error("The gl context(".concat(version_1, ") is inconsistent with renderFramework or default version(").concat(framework, ")"));
29761
- framework = version_1;
29765
+ var version = gl instanceof weapp.WebGLRenderingContext ? 'webgl' : 'webgl2';
29766
+ if (framework !== version) {
29767
+ logger.error("The gl context(".concat(version, ") is inconsistent with renderFramework or default version(").concat(framework, ")"));
29768
+ framework = version;
29762
29769
  }
29763
29770
  }
29764
29771
  else {
@@ -30464,7 +30471,7 @@ Renderer.create = function (canvas, framework, renderOptions) {
30464
30471
  Engine.create = function (gl) {
30465
30472
  return new GLEngine(gl);
30466
30473
  };
30467
- var version = "1.3.0";
30474
+ var version = "1.3.2";
30468
30475
  logger.info('player version: ' + version);
30469
30476
 
30470
30477
  exports.AbstractPlugin = AbstractPlugin;