@galacean/effects-threejs 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 threejs plugin 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';
@@ -708,7 +708,7 @@ function asserts(condition, msg) {
708
708
  * Name: @galacean/effects-specification
709
709
  * Description: Galacean Effects JSON Specification
710
710
  * Author: Ant Group CO., Ltd.
711
- * Version: v1.2.0-beta.0
711
+ * Version: v1.2.0
712
712
  */
713
713
 
714
714
  /*********************************************/
@@ -8219,19 +8219,19 @@ var BezierCurvePath = /** @class */ (function (_super) {
8219
8219
  var perc = 0, point = new Vector3();
8220
8220
  var keyTimeData = Object.keys(this.curveSegments);
8221
8221
  if (!keyTimeData.length) {
8222
- return point;
8222
+ return point.toArray();
8223
8223
  }
8224
8224
  var keyTimeStart = Number(keyTimeData[0].split('&')[0]);
8225
8225
  var keyTimeEnd = Number(keyTimeData[keyTimeData.length - 1].split('&')[1]);
8226
8226
  if (t <= keyTimeStart) {
8227
8227
  var pathCurve = this.curveSegments[keyTimeData[0]].pathCurve;
8228
8228
  point = pathCurve.getPointInPercent(0);
8229
- return point;
8229
+ return point.toArray();
8230
8230
  }
8231
8231
  if (t >= keyTimeEnd) {
8232
8232
  var pathCurve = this.curveSegments[keyTimeData[keyTimeData.length - 1]].pathCurve;
8233
8233
  point = pathCurve.getPointInPercent(1);
8234
- return point;
8234
+ return point.toArray();
8235
8235
  }
8236
8236
  for (var i = 0; i < keyTimeData.length; i++) {
8237
8237
  var _a = __read$3(keyTimeData[i].split('&'), 2), xMin = _a[0], xMax = _a[1];
@@ -8241,7 +8241,7 @@ var BezierCurvePath = /** @class */ (function (_super) {
8241
8241
  point = bezierPath.getPointInPercent(perc);
8242
8242
  }
8243
8243
  }
8244
- return point;
8244
+ return point.toArray();
8245
8245
  };
8246
8246
  BezierCurvePath.prototype.getPercValue = function (curveKey, time) {
8247
8247
  var curveInfo = this.curveSegments[curveKey];
@@ -21890,7 +21890,7 @@ var filters = {
21890
21890
  * Name: @galacean/effects-specification
21891
21891
  * Description: Galacean Effects JSON Specification
21892
21892
  * Author: Ant Group CO., Ltd.
21893
- * Version: v1.2.0-beta.0
21893
+ * Version: v1.2.0
21894
21894
  */
21895
21895
 
21896
21896
  /*********************************************/
@@ -23379,6 +23379,9 @@ function version24Migration(json) {
23379
23379
  }
23380
23380
  function convertParam(content) {
23381
23381
  var e_2, _a;
23382
+ if (!content) {
23383
+ return;
23384
+ }
23382
23385
  try {
23383
23386
  for (var _b = __values(Object.keys(content)), _c = _b.next(); !_c.done; _c = _b.next()) {
23384
23387
  var key = _c.value;
@@ -24549,18 +24552,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24549
24552
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24550
24553
  if (exports.Item.isComposition(itemProps)) {
24551
24554
  var refId = itemProps.content.options.refId;
24552
- var props = this.composition.refCompositionProps.get(refId);
24553
- if (!props) {
24554
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24555
- }
24556
- props.content = itemProps.content;
24557
- 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);
24555
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24558
24556
  item.contentProps = itemProps.content;
24559
24557
  item.transform.parentTransform = this.transform;
24560
24558
  this.composition.refContent.push(item);
24561
24559
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24562
24560
  this.composition.autoRefTex = false;
24563
24561
  }
24562
+ item.createContent();
24564
24563
  }
24565
24564
  else {
24566
24565
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24692,6 +24691,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24692
24691
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24693
24692
  this.items.forEach(function (item) { return item.setVisible(visible); });
24694
24693
  };
24694
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24695
+ if (this.content) {
24696
+ this.content.startSize = new Vector3(x, y, z);
24697
+ }
24698
+ };
24699
+ CompVFXItem.prototype.scale = function (x, y, z) {
24700
+ if (this.content) {
24701
+ var startSize = this.content.startSize.clone();
24702
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24703
+ }
24704
+ };
24695
24705
  CompVFXItem.prototype.getUpdateTime = function (t) {
24696
24706
  var startTime = this.startTimeInms;
24697
24707
  var now = this.timeInms;
@@ -27393,7 +27403,7 @@ Geometry.create = function (engine, options) {
27393
27403
  Mesh.create = function (engine, props) {
27394
27404
  return new ThreeMesh(engine, props);
27395
27405
  };
27396
- var version = "1.4.0-beta.1";
27406
+ var version = "1.4.0";
27397
27407
  logger.info('THREEJS plugin version: ' + version);
27398
27408
 
27399
27409
  exports.AbstractPlugin = AbstractPlugin;