@galacean/effects-core 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.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime core 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
  /******************************************************************************
@@ -682,7 +682,7 @@ function asserts(condition, msg) {
682
682
  * Name: @galacean/effects-specification
683
683
  * Description: Galacean Effects JSON Specification
684
684
  * Author: Ant Group CO., Ltd.
685
- * Version: v1.2.0-beta.0
685
+ * Version: v1.2.0
686
686
  */
687
687
 
688
688
  /*********************************************/
@@ -8193,19 +8193,19 @@ var BezierCurvePath = /** @class */ (function (_super) {
8193
8193
  var perc = 0, point = new Vector3();
8194
8194
  var keyTimeData = Object.keys(this.curveSegments);
8195
8195
  if (!keyTimeData.length) {
8196
- return point;
8196
+ return point.toArray();
8197
8197
  }
8198
8198
  var keyTimeStart = Number(keyTimeData[0].split('&')[0]);
8199
8199
  var keyTimeEnd = Number(keyTimeData[keyTimeData.length - 1].split('&')[1]);
8200
8200
  if (t <= keyTimeStart) {
8201
8201
  var pathCurve = this.curveSegments[keyTimeData[0]].pathCurve;
8202
8202
  point = pathCurve.getPointInPercent(0);
8203
- return point;
8203
+ return point.toArray();
8204
8204
  }
8205
8205
  if (t >= keyTimeEnd) {
8206
8206
  var pathCurve = this.curveSegments[keyTimeData[keyTimeData.length - 1]].pathCurve;
8207
8207
  point = pathCurve.getPointInPercent(1);
8208
- return point;
8208
+ return point.toArray();
8209
8209
  }
8210
8210
  for (var i = 0; i < keyTimeData.length; i++) {
8211
8211
  var _a = __read$3(keyTimeData[i].split('&'), 2), xMin = _a[0], xMax = _a[1];
@@ -8215,7 +8215,7 @@ var BezierCurvePath = /** @class */ (function (_super) {
8215
8215
  point = bezierPath.getPointInPercent(perc);
8216
8216
  }
8217
8217
  }
8218
- return point;
8218
+ return point.toArray();
8219
8219
  };
8220
8220
  BezierCurvePath.prototype.getPercValue = function (curveKey, time) {
8221
8221
  var curveInfo = this.curveSegments[curveKey];
@@ -21864,7 +21864,7 @@ var filters = {
21864
21864
  * Name: @galacean/effects-specification
21865
21865
  * Description: Galacean Effects JSON Specification
21866
21866
  * Author: Ant Group CO., Ltd.
21867
- * Version: v1.2.0-beta.0
21867
+ * Version: v1.2.0
21868
21868
  */
21869
21869
 
21870
21870
  /*********************************************/
@@ -23353,6 +23353,9 @@ function version24Migration(json) {
23353
23353
  }
23354
23354
  function convertParam(content) {
23355
23355
  var e_2, _a;
23356
+ if (!content) {
23357
+ return;
23358
+ }
23356
23359
  try {
23357
23360
  for (var _b = __values(Object.keys(content)), _c = _b.next(); !_c.done; _c = _b.next()) {
23358
23361
  var key = _c.value;
@@ -24523,18 +24526,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24523
24526
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24524
24527
  if (Item.isComposition(itemProps)) {
24525
24528
  var refId = itemProps.content.options.refId;
24526
- var props = this.composition.refCompositionProps.get(refId);
24527
- if (!props) {
24528
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24529
- }
24530
- props.content = itemProps.content;
24531
- 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);
24529
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24532
24530
  item.contentProps = itemProps.content;
24533
24531
  item.transform.parentTransform = this.transform;
24534
24532
  this.composition.refContent.push(item);
24535
24533
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24536
24534
  this.composition.autoRefTex = false;
24537
24535
  }
24536
+ item.createContent();
24538
24537
  }
24539
24538
  else {
24540
24539
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24666,6 +24665,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24666
24665
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24667
24666
  this.items.forEach(function (item) { return item.setVisible(visible); });
24668
24667
  };
24668
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24669
+ if (this.content) {
24670
+ this.content.startSize = new Vector3(x, y, z);
24671
+ }
24672
+ };
24673
+ CompVFXItem.prototype.scale = function (x, y, z) {
24674
+ if (this.content) {
24675
+ var startSize = this.content.startSize.clone();
24676
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24677
+ }
24678
+ };
24669
24679
  CompVFXItem.prototype.getUpdateTime = function (t) {
24670
24680
  var startTime = this.startTimeInms;
24671
24681
  var now = this.timeInms;