@galacean/effects 1.4.0-beta.1 → 1.4.0

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime player for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v1.4.0-beta.1
6
+ * Version: v1.4.0
7
7
  */
8
8
 
9
9
  'use strict';
@@ -686,7 +686,7 @@ function asserts(condition, msg) {
686
686
  * Name: @galacean/effects-specification
687
687
  * Description: Galacean Effects JSON Specification
688
688
  * Author: Ant Group CO., Ltd.
689
- * Version: v1.2.0-beta.0
689
+ * Version: v1.2.0
690
690
  */
691
691
 
692
692
  /*********************************************/
@@ -8197,19 +8197,19 @@ var BezierCurvePath = /** @class */ (function (_super) {
8197
8197
  var perc = 0, point = new Vector3();
8198
8198
  var keyTimeData = Object.keys(this.curveSegments);
8199
8199
  if (!keyTimeData.length) {
8200
- return point;
8200
+ return point.toArray();
8201
8201
  }
8202
8202
  var keyTimeStart = Number(keyTimeData[0].split('&')[0]);
8203
8203
  var keyTimeEnd = Number(keyTimeData[keyTimeData.length - 1].split('&')[1]);
8204
8204
  if (t <= keyTimeStart) {
8205
8205
  var pathCurve = this.curveSegments[keyTimeData[0]].pathCurve;
8206
8206
  point = pathCurve.getPointInPercent(0);
8207
- return point;
8207
+ return point.toArray();
8208
8208
  }
8209
8209
  if (t >= keyTimeEnd) {
8210
8210
  var pathCurve = this.curveSegments[keyTimeData[keyTimeData.length - 1]].pathCurve;
8211
8211
  point = pathCurve.getPointInPercent(1);
8212
- return point;
8212
+ return point.toArray();
8213
8213
  }
8214
8214
  for (var i = 0; i < keyTimeData.length; i++) {
8215
8215
  var _a = __read$3(keyTimeData[i].split('&'), 2), xMin = _a[0], xMax = _a[1];
@@ -8219,7 +8219,7 @@ var BezierCurvePath = /** @class */ (function (_super) {
8219
8219
  point = bezierPath.getPointInPercent(perc);
8220
8220
  }
8221
8221
  }
8222
- return point;
8222
+ return point.toArray();
8223
8223
  };
8224
8224
  BezierCurvePath.prototype.getPercValue = function (curveKey, time) {
8225
8225
  var curveInfo = this.curveSegments[curveKey];
@@ -21868,7 +21868,7 @@ var filters = {
21868
21868
  * Name: @galacean/effects-specification
21869
21869
  * Description: Galacean Effects JSON Specification
21870
21870
  * Author: Ant Group CO., Ltd.
21871
- * Version: v1.2.0-beta.0
21871
+ * Version: v1.2.0
21872
21872
  */
21873
21873
 
21874
21874
  /*********************************************/
@@ -23357,6 +23357,9 @@ function version24Migration(json) {
23357
23357
  }
23358
23358
  function convertParam(content) {
23359
23359
  var e_2, _a;
23360
+ if (!content) {
23361
+ return;
23362
+ }
23360
23363
  try {
23361
23364
  for (var _b = __values(Object.keys(content)), _c = _b.next(); !_c.done; _c = _b.next()) {
23362
23365
  var key = _c.value;
@@ -24527,18 +24530,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24527
24530
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24528
24531
  if (exports.Item.isComposition(itemProps)) {
24529
24532
  var refId = itemProps.content.options.refId;
24530
- var props = this.composition.refCompositionProps.get(refId);
24531
- if (!props) {
24532
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24533
- }
24534
- props.content = itemProps.content;
24535
- 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);
24533
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24536
24534
  item.contentProps = itemProps.content;
24537
24535
  item.transform.parentTransform = this.transform;
24538
24536
  this.composition.refContent.push(item);
24539
24537
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24540
24538
  this.composition.autoRefTex = false;
24541
24539
  }
24540
+ item.createContent();
24542
24541
  }
24543
24542
  else {
24544
24543
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24670,6 +24669,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24670
24669
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24671
24670
  this.items.forEach(function (item) { return item.setVisible(visible); });
24672
24671
  };
24672
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24673
+ if (this.content) {
24674
+ this.content.startSize = new Vector3(x, y, z);
24675
+ }
24676
+ };
24677
+ CompVFXItem.prototype.scale = function (x, y, z) {
24678
+ if (this.content) {
24679
+ var startSize = this.content.startSize.clone();
24680
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24681
+ }
24682
+ };
24673
24683
  CompVFXItem.prototype.getUpdateTime = function (t) {
24674
24684
  var startTime = this.startTimeInms;
24675
24685
  var now = this.timeInms;
@@ -30901,7 +30911,7 @@ Renderer.create = function (canvas, framework, renderOptions) {
30901
30911
  Engine.create = function (gl) {
30902
30912
  return new GLEngine(gl);
30903
30913
  };
30904
- var version = "1.4.0-beta.1";
30914
+ var version = "1.4.0";
30905
30915
  logger.info('player version: ' + version);
30906
30916
 
30907
30917
  exports.AbstractPlugin = AbstractPlugin;