@galacean/effects-threejs 2.1.5 → 2.2.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 threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.1.5
6
+ * Version: v2.2.0
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -61,12 +61,8 @@ function __generator(thisArg, body) {
61
61
  },
62
62
  trys: [],
63
63
  ops: []
64
- }, f, y, t, g;
65
- return g = {
66
- next: verb(0),
67
- "throw": verb(1),
68
- "return": verb(2)
69
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
64
+ }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
65
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
70
66
  return this;
71
67
  }), g;
72
68
  function verb(n) {
@@ -12754,8 +12750,8 @@ var BezierCurve = /*#__PURE__*/ function(ValueGetter) {
12754
12750
  return data;
12755
12751
  };
12756
12752
  _proto.getMaxTime = function getMaxTime() {
12757
- var keyTimeData = Object.keys(this.curveMap);
12758
- return Number(keyTimeData[keyTimeData.length - 1].split("&")[1]);
12753
+ var keyTimeData = this.keyTimeData;
12754
+ return this.curveMap[keyTimeData[keyTimeData.length - 1]].timeEnd;
12759
12755
  };
12760
12756
  return BezierCurve;
12761
12757
  }(ValueGetter);
@@ -12833,19 +12829,22 @@ var BezierCurvePath = /*#__PURE__*/ function(ValueGetter) {
12833
12829
  timeInterval: timeInterval,
12834
12830
  valueInterval: valueInterval,
12835
12831
  easingCurve: easingCurve,
12836
- pathCurve: pathCurve
12832
+ pathCurve: pathCurve,
12833
+ timeStart: Number(s.x),
12834
+ timeEnd: Number(e.x)
12837
12835
  };
12838
12836
  }
12837
+ this.keyTimeData = Object.keys(this.curveSegments);
12839
12838
  };
12840
12839
  _proto.getValue = function getValue(time) {
12841
12840
  var t = numberToFix(time, 5);
12842
12841
  var perc = 0, point = new Vector3();
12843
- var keyTimeData = Object.keys(this.curveSegments);
12842
+ var keyTimeData = this.keyTimeData;
12844
12843
  if (!keyTimeData.length) {
12845
12844
  return point;
12846
12845
  }
12847
- var keyTimeStart = Number(keyTimeData[0].split("&")[0]);
12848
- var keyTimeEnd = Number(keyTimeData[keyTimeData.length - 1].split("&")[1]);
12846
+ var keyTimeStart = this.curveSegments[keyTimeData[0]].timeStart;
12847
+ var keyTimeEnd = this.curveSegments[keyTimeData[keyTimeData.length - 1]].timeEnd;
12849
12848
  if (t <= keyTimeStart) {
12850
12849
  var pathCurve = this.curveSegments[keyTimeData[0]].pathCurve;
12851
12850
  point = pathCurve.getPointInPercent(0);
@@ -12857,7 +12856,8 @@ var BezierCurvePath = /*#__PURE__*/ function(ValueGetter) {
12857
12856
  return point;
12858
12857
  }
12859
12858
  for(var i = 0; i < keyTimeData.length; i++){
12860
- var _keyTimeData_i_split = keyTimeData[i].split("&"), xMin = _keyTimeData_i_split[0], xMax = _keyTimeData_i_split[1];
12859
+ var xMin = this.curveSegments[keyTimeData[i]].timeStart;
12860
+ var xMax = this.curveSegments[keyTimeData[i]].timeEnd;
12861
12861
  if (t >= Number(xMin) && t < Number(xMax)) {
12862
12862
  var bezierPath = this.curveSegments[keyTimeData[i]].pathCurve;
12863
12863
  perc = this.getPercValue(keyTimeData[i], t);
@@ -12876,8 +12876,8 @@ var BezierCurvePath = /*#__PURE__*/ function(ValueGetter) {
12876
12876
  return clamp$1(value, 0, 1);
12877
12877
  };
12878
12878
  _proto.getMaxTime = function getMaxTime() {
12879
- var keyTimeData = Object.keys(this.curveSegments);
12880
- return Number(keyTimeData[keyTimeData.length - 1].split("&")[1]);
12879
+ var keyTimeData = this.keyTimeData;
12880
+ return this.curveSegments[keyTimeData[keyTimeData.length - 1]].timeEnd;
12881
12881
  };
12882
12882
  return BezierCurvePath;
12883
12883
  }(ValueGetter);
@@ -13030,15 +13030,18 @@ function createKeyFrameMeta() {
13030
13030
  }
13031
13031
 
13032
13032
  function _is_native_reflect_construct() {
13033
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
13034
- if (Reflect.construct.sham) return false;
13035
- if (typeof Proxy === "function") return true;
13033
+ // Since Reflect.construct can't be properly polyfilled, some
13034
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
13035
+ // Those polyfills don't allow us to subclass built-ins, so we need to
13036
+ // use our fallback implementation.
13036
13037
  try {
13037
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
13038
- return true;
13039
- } catch (e) {
13040
- return false;
13041
- }
13038
+ // If the internal slots aren't set, this throws an error similar to
13039
+ // TypeError: this is not a Boolean object.
13040
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
13041
+ } catch (_) {}
13042
+ return (_is_native_reflect_construct = function _is_native_reflect_construct() {
13043
+ return !!result;
13044
+ })();
13042
13045
  }
13043
13046
 
13044
13047
  function _construct(Parent, args, Class) {
@@ -15902,6 +15905,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15902
15905
  if (this.animated) {
15903
15906
  this.buildPath(this.data);
15904
15907
  this.buildGeometryFromPath(this.path.shapePath);
15908
+ this.animated = false;
15905
15909
  }
15906
15910
  };
15907
15911
  _proto.buildGeometryFromPath = function buildGeometryFromPath(shapePath) {
@@ -17009,14 +17013,10 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17009
17013
  var playableOutput2 = _step2.value;
17010
17014
  this.processFrameWithRoot(playableOutput2);
17011
17015
  }
17012
- // 更新节点时间
17013
- for(var _iterator3 = _create_for_of_iterator_helper_loose(this.playables), _step3; !(_step3 = _iterator3()).done;){
17014
- var playable = _step3.value;
17015
- this.updatePlayableTime(playable, dt / 1000);
17016
- }
17017
- };
17018
- _proto.connect = function connect(source, sourceOutputPort, destination, destinationInputPort) {
17019
- destination.connectInput(destinationInputPort, source, sourceOutputPort);
17016
+ // 更新节点时间
17017
+ // for (const playable of this.playables) {
17018
+ // this.updatePlayableTime(playable, dt / 1000);
17019
+ // }
17020
17020
  };
17021
17021
  _proto.addOutput = function addOutput(output) {
17022
17022
  this.playableOutputs.push(output);
@@ -17025,12 +17025,12 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17025
17025
  this.playables.push(playable);
17026
17026
  };
17027
17027
  _proto.processFrameWithRoot = function processFrameWithRoot(output) {
17028
- output.sourcePlayable.processFrameRecursive(output.context, output.getSourceOutputPort());
17028
+ output.sourcePlayable.processFrame(output.context);
17029
17029
  output.processFrame();
17030
17030
  };
17031
17031
  _proto.prepareFrameWithRoot = function prepareFrameWithRoot(output) {
17032
- output.sourcePlayable.prepareFrameRecursive(output.context, output.getSourceOutputPort());
17033
17032
  output.prepareFrame();
17033
+ output.sourcePlayable.prepareFrame(output.context);
17034
17034
  };
17035
17035
  _proto.updatePlayableTime = function updatePlayableTime(playable, deltaTime) {
17036
17036
  if (playable.getPlayState() !== 0) {
@@ -17045,24 +17045,15 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17045
17045
  * @since 2.0.0
17046
17046
  */ var Playable = /*#__PURE__*/ function() {
17047
17047
  function Playable(graph, inputCount) {
17048
- if (inputCount === void 0) inputCount = 0;
17049
17048
  this.onPlayablePlayFlag = true;
17050
17049
  this.onPlayablePauseFlag = false;
17051
17050
  this.duration = 0;
17052
17051
  this.destroyed = false;
17053
- this.inputs = [];
17054
- this.inputOuputPorts = [];
17055
- this.inputWeight = [];
17056
- this.outputs = [];
17057
17052
  this.playState = 0;
17058
- this.traversalMode = 0;
17059
17053
  /**
17060
17054
  * 当前本地播放的时间
17061
17055
  */ this.time = 0;
17062
17056
  graph.addPlayable(this);
17063
- this.inputs = new Array(inputCount);
17064
- this.inputOuputPorts = new Array(inputCount);
17065
- this.inputWeight = new Array(inputCount);
17066
17057
  }
17067
17058
  var _proto = Playable.prototype;
17068
17059
  _proto.play = function play() {
@@ -17085,56 +17076,6 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17085
17076
  break;
17086
17077
  }
17087
17078
  };
17088
- _proto.connectInput = function connectInput(inputPort, sourcePlayable, sourceOutputPort, weight) {
17089
- if (weight === void 0) weight = 1.0;
17090
- this.setInput(sourcePlayable, inputPort);
17091
- this.setInputWeight(inputPort, weight);
17092
- sourcePlayable.setOutput(this, sourceOutputPort);
17093
- if (this.inputOuputPorts.length < inputPort + 1) {
17094
- this.inputOuputPorts.length = inputPort + 1;
17095
- }
17096
- this.inputOuputPorts[inputPort] = sourceOutputPort;
17097
- };
17098
- _proto.addInput = function addInput(sourcePlayable, sourceOutputPort, weight) {
17099
- if (weight === void 0) weight = 1.0;
17100
- this.connectInput(this.getInputCount(), sourcePlayable, sourceOutputPort, weight);
17101
- };
17102
- _proto.getInputCount = function getInputCount() {
17103
- return this.inputs.length;
17104
- };
17105
- _proto.getInputs = function getInputs() {
17106
- return this.inputs;
17107
- };
17108
- _proto.getInput = function getInput(index) {
17109
- return this.inputs[index];
17110
- };
17111
- _proto.getOutputCount = function getOutputCount() {
17112
- return this.outputs.length;
17113
- };
17114
- _proto.getOutputs = function getOutputs() {
17115
- return this.outputs;
17116
- };
17117
- _proto.getOutput = function getOutput(index) {
17118
- return this.outputs[index];
17119
- };
17120
- _proto.getInputWeight = function getInputWeight(inputIndex) {
17121
- return this.inputWeight[inputIndex];
17122
- };
17123
- _proto.setInputWeight = function setInputWeight(playableOrIndex, weight) {
17124
- if (_instanceof1(playableOrIndex, Playable)) {
17125
- for(var i = 0; i < this.inputs.length; i++){
17126
- if (this.inputs[i] === playableOrIndex) {
17127
- this.inputWeight[i] = weight;
17128
- return;
17129
- }
17130
- }
17131
- } else {
17132
- if (this.inputWeight.length < playableOrIndex + 1) {
17133
- this.inputWeight.length = playableOrIndex + 1;
17134
- }
17135
- this.inputWeight[playableOrIndex] = weight;
17136
- }
17137
- };
17138
17079
  _proto.setTime = function setTime(time) {
17139
17080
  this.time = time;
17140
17081
  };
@@ -17150,18 +17091,14 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17150
17091
  _proto.getPlayState = function getPlayState() {
17151
17092
  return this.playState;
17152
17093
  };
17153
- _proto.setTraversalMode = function setTraversalMode(mode) {
17154
- this.traversalMode = mode;
17155
- };
17156
- _proto.getTraversalMode = function getTraversalMode() {
17157
- return this.traversalMode;
17158
- };
17159
17094
  // onGraphStart () {
17160
17095
  // }
17161
17096
  // onGraphStop () {
17162
17097
  // }
17163
- _proto.onPlayablePlay = function onPlayablePlay(context) {};
17164
- _proto.onPlayablePause = function onPlayablePause(context) {};
17098
+ // onPlayablePlay (context: FrameContext) {
17099
+ // }
17100
+ // onPlayablePause (context: FrameContext) {
17101
+ // }
17165
17102
  _proto.prepareFrame = function prepareFrame(context) {};
17166
17103
  _proto.processFrame = function processFrame(context) {};
17167
17104
  _proto.onPlayableDestroy = function onPlayableDestroy() {};
@@ -17173,76 +17110,6 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17173
17110
  // TODO 将节点从动画图中移除
17174
17111
  this.destroyed = true;
17175
17112
  };
17176
- /**
17177
- * @internal
17178
- */ _proto.prepareFrameRecursive = function prepareFrameRecursive(context, passthroughPort) {
17179
- if (this.destroyed || this.playState !== 0) {
17180
- return;
17181
- }
17182
- if (this.onPlayablePlayFlag) {
17183
- this.onPlayablePlay(context);
17184
- this.onPlayablePlayFlag = false;
17185
- }
17186
- if (this.onPlayablePauseFlag) {
17187
- this.onPlayablePause(context);
17188
- this.onPlayablePauseFlag = false;
17189
- }
17190
- if (passthroughPort === 0) {
17191
- this.prepareFrame(context);
17192
- }
17193
- // 前序遍历,用于设置节点的初始状态,weight etc.
17194
- switch(this.getTraversalMode()){
17195
- case 0:
17196
- for(var i = 0; i < this.getInputCount(); i++){
17197
- var input = this.getInput(i);
17198
- input.prepareFrameRecursive(context, this.inputOuputPorts[i]);
17199
- }
17200
- break;
17201
- case 1:
17202
- {
17203
- var input1 = this.getInput(passthroughPort);
17204
- input1.prepareFrameRecursive(context, this.inputOuputPorts[passthroughPort]);
17205
- break;
17206
- }
17207
- }
17208
- };
17209
- /**
17210
- * @internal
17211
- */ _proto.processFrameRecursive = function processFrameRecursive(context, passthroughPort) {
17212
- if (this.destroyed || this.playState !== 0) {
17213
- return;
17214
- }
17215
- // 后序遍历,保证 playable 拿到的 input 节点的估计数据是最新的
17216
- switch(this.getTraversalMode()){
17217
- case 0:
17218
- {
17219
- for(var i = 0; i < this.getInputCount(); i++){
17220
- var input = this.getInput(i);
17221
- input.processFrameRecursive(context, this.inputOuputPorts[i]);
17222
- }
17223
- break;
17224
- }
17225
- case 1:
17226
- {
17227
- var input1 = this.getInput(passthroughPort);
17228
- input1.processFrameRecursive(context, this.inputOuputPorts[passthroughPort]);
17229
- break;
17230
- }
17231
- }
17232
- this.processFrame(context);
17233
- };
17234
- _proto.setOutput = function setOutput(outputPlayable, outputPort) {
17235
- if (this.outputs.length < outputPort + 1) {
17236
- this.outputs.length = outputPort + 1;
17237
- }
17238
- this.outputs[outputPort] = outputPlayable;
17239
- };
17240
- _proto.setInput = function setInput(inputPlayable, inputPort) {
17241
- if (this.inputs.length < inputPort + 1) {
17242
- this.inputs.length = inputPort + 1;
17243
- }
17244
- this.inputs[inputPort] = inputPlayable;
17245
- };
17246
17113
  return Playable;
17247
17114
  }();
17248
17115
  /**
@@ -17250,20 +17117,14 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17250
17117
  * @since 2.0.0
17251
17118
  */ var PlayableOutput = /*#__PURE__*/ function() {
17252
17119
  function PlayableOutput() {
17253
- this.sourceOutputPort = 0;
17254
17120
  this.context = {
17255
17121
  deltaTime: 0,
17256
17122
  output: this
17257
17123
  };
17258
17124
  }
17259
17125
  var _proto = PlayableOutput.prototype;
17260
- _proto.setSourcePlayable = function setSourcePlayable(playable, port) {
17261
- if (port === void 0) port = 0;
17126
+ _proto.setSourcePlayable = function setSourcePlayable(playable) {
17262
17127
  this.sourcePlayable = playable;
17263
- this.sourceOutputPort = port;
17264
- };
17265
- _proto.getSourceOutputPort = function getSourceOutputPort() {
17266
- return this.sourceOutputPort;
17267
17128
  };
17268
17129
  _proto.setUserData = function setUserData(value) {
17269
17130
  this.userData = value;
@@ -17289,11 +17150,6 @@ var PlayState;
17289
17150
  PlayState[PlayState["Playing"] = 0] = "Playing";
17290
17151
  PlayState[PlayState["Paused"] = 1] = "Paused";
17291
17152
  })(PlayState || (PlayState = {}));
17292
- var PlayableTraversalMode;
17293
- (function(PlayableTraversalMode) {
17294
- PlayableTraversalMode[PlayableTraversalMode["Mix"] = 0] = "Mix";
17295
- PlayableTraversalMode[PlayableTraversalMode["Passthrough"] = 1] = "Passthrough";
17296
- })(PlayableTraversalMode || (PlayableTraversalMode = {}));
17297
17153
 
17298
17154
  var tempQuat$1 = new Quaternion();
17299
17155
  var seed$4 = 1;
@@ -17946,7 +17802,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17946
17802
  };
17947
17803
  /**
17948
17804
  * 添加组件
17949
- * @param classConstructor - 要添加的组件类型
17805
+ * @param classConstructor - 要添加的组件
17950
17806
  */ _proto.addComponent = function addComponent(classConstructor) {
17951
17807
  var newComponent = new classConstructor(this.engine);
17952
17808
  this.components.push(newComponent);
@@ -18189,7 +18045,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
18189
18045
  };
18190
18046
  _proto.fromData = function fromData(data) {
18191
18047
  EffectsObject.prototype.fromData.call(this, data);
18192
- var id = data.id, name = data.name, delay = data.delay, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _data_listIndex = data.listIndex, listIndex = _data_listIndex === void 0 ? 0 : _data_listIndex, _data_duration = data.duration, duration = _data_duration === void 0 ? 0 : _data_duration;
18048
+ var id = data.id, name = data.name, delay = data.delay, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _data_duration = data.duration, duration = _data_duration === void 0 ? 0 : _data_duration;
18193
18049
  this.props = data;
18194
18050
  //@ts-expect-error
18195
18051
  this.type = data.type;
@@ -18251,8 +18107,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
18251
18107
  this.rendererComponents.push(component.renderer);
18252
18108
  }
18253
18109
  }
18254
- // renderOrder 在 component 初始化后设置。确保能拿到 rendererComponent。
18255
- this.renderOrder = listIndex;
18256
18110
  };
18257
18111
  _proto.toData = function toData() {
18258
18112
  var _this_parent;
@@ -22798,12 +22652,6 @@ var AnimationStream = /*#__PURE__*/ function() {
22798
22652
  _proto.findCurveValue = function findCurveValue(componentType, propertyName) {
22799
22653
  return this.curveValues[componentType + propertyName];
22800
22654
  };
22801
- _proto.getInputStream = function getInputStream(index) {
22802
- var inputPlayable = this.playable.getInput(index);
22803
- if (_instanceof1(inputPlayable, AnimationPlayable)) {
22804
- return inputPlayable.animationStream;
22805
- }
22806
- };
22807
22655
  return AnimationStream;
22808
22656
  }();
22809
22657
 
@@ -23138,214 +22986,65 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
23138
22986
  return AnimationClipPlayable;
23139
22987
  }(Playable);
23140
22988
 
23141
- /**
23142
- * @since 2.0.0
23143
- */ var TimelineClip = /*#__PURE__*/ function() {
23144
- function TimelineClip() {
23145
- this.start = 0;
23146
- this.duration = 0;
23147
- }
23148
- var _proto = TimelineClip.prototype;
23149
- _proto.toLocalTime = function toLocalTime(time) {
23150
- var localTime = time - this.start;
23151
- var duration = this.duration;
23152
- if (localTime - duration > 0) {
23153
- if (this.endBehavior === EndBehavior.restart) {
23154
- localTime = localTime % duration;
23155
- } else if (this.endBehavior === EndBehavior.freeze) {
23156
- localTime = Math.min(duration, localTime);
23157
- }
23158
- }
23159
- return localTime;
23160
- };
23161
- return TimelineClip;
23162
- }();
23163
- var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
23164
- _inherits(TrackAsset, PlayableAsset);
23165
- function TrackAsset() {
22989
+ var TrackMixerPlayable = /*#__PURE__*/ function(Playable1) {
22990
+ _inherits(TrackMixerPlayable, Playable1);
22991
+ function TrackMixerPlayable() {
23166
22992
  var _this;
23167
- _this = PlayableAsset.apply(this, arguments) || this;
23168
- _this.trackType = 0;
23169
- _this.clipSeed = 0;
23170
- _this.clips = [];
23171
- _this.children = [];
22993
+ _this = Playable1.apply(this, arguments) || this;
22994
+ _this.clipPlayables = [];
22995
+ _this.clipWeights = [];
23172
22996
  return _this;
23173
22997
  }
23174
- var _proto = TrackAsset.prototype;
23175
- /**
23176
- * 重写该方法以获取自定义对象绑定
23177
- */ _proto.updateAnimatedObject = function updateAnimatedObject() {
23178
- if (this.parent) {
23179
- this.boundObject = this.parent.boundObject;
23180
- }
23181
- };
23182
- /**
23183
- * 重写该方法以创建自定义混合器
23184
- */ _proto.createTrackMixer = function createTrackMixer(graph) {
23185
- return new Playable(graph);
23186
- };
23187
- _proto.createOutput = function createOutput() {
23188
- var output = new PlayableOutput();
23189
- return output;
23190
- };
23191
- _proto.createPlayableGraph = function createPlayableGraph(graph, runtimeClips) {
23192
- var mixerPlayable = this.createMixerPlayableGraph(graph, runtimeClips);
23193
- return mixerPlayable;
23194
- };
23195
- _proto.createMixerPlayableGraph = function createMixerPlayableGraph(graph, runtimeClips) {
23196
- var clips = [];
23197
- for(var _iterator = _create_for_of_iterator_helper_loose(this.clips), _step; !(_step = _iterator()).done;){
23198
- var clip = _step.value;
23199
- clips.push(clip);
23200
- }
23201
- var mixerPlayable = this.compileClips(graph, clips, runtimeClips);
23202
- return mixerPlayable;
23203
- };
23204
- _proto.compileClips = function compileClips(graph, timelineClips, runtimeClips) {
23205
- var mixer = this.createTrackMixer(graph);
23206
- for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
23207
- var timelineClip = _step.value;
23208
- var clipPlayable = this.createClipPlayable(graph, timelineClip);
23209
- clipPlayable.setDuration(timelineClip.duration);
23210
- var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
23211
- runtimeClips.push(clip);
23212
- mixer.addInput(clipPlayable, 0);
23213
- mixer.setInputWeight(clipPlayable, 0.0);
22998
+ var _proto = TrackMixerPlayable.prototype;
22999
+ _proto.processFrame = function processFrame(context) {
23000
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.clipPlayables), _step; !(_step = _iterator()).done;){
23001
+ var clipPlayable = _step.value;
23002
+ clipPlayable.processFrame(context);
23214
23003
  }
23215
- return mixer;
23216
- };
23217
- _proto.createPlayable = function createPlayable(graph) {
23218
- return new Playable(graph);
23219
- };
23220
- _proto.getChildTracks = function getChildTracks() {
23221
- return this.children;
23222
- };
23223
- _proto.addChild = function addChild(child) {
23224
- this.children.push(child);
23225
- child.parent = this;
23226
- };
23227
- _proto.createClip = function createClip(classConstructor, name) {
23228
- var newClip = new TimelineClip();
23229
- newClip.asset = new classConstructor(this.engine);
23230
- newClip.name = name ? name : "TimelineClip" + newClip.id;
23231
- this.addClip(newClip);
23232
- return newClip;
23004
+ this.evaluate(context);
23233
23005
  };
23234
- _proto.getClips = function getClips() {
23235
- return this.clips;
23236
- };
23237
- _proto.findClip = function findClip(name) {
23238
- for(var _iterator = _create_for_of_iterator_helper_loose(this.clips), _step; !(_step = _iterator()).done;){
23239
- var clip = _step.value;
23240
- if (clip.name === name) {
23241
- return clip;
23006
+ _proto.setClipWeight = function setClipWeight(playableOrIndex, weight) {
23007
+ if (_instanceof1(playableOrIndex, Playable)) {
23008
+ for(var i = 0; i < this.clipPlayables.length; i++){
23009
+ if (this.clipPlayables[i] === playableOrIndex) {
23010
+ this.clipWeights[i] = weight;
23011
+ return;
23012
+ }
23013
+ }
23014
+ } else {
23015
+ if (this.clipWeights.length < playableOrIndex + 1) {
23016
+ this.clipWeights.length = playableOrIndex + 1;
23242
23017
  }
23018
+ this.clipWeights[playableOrIndex] = weight;
23243
23019
  }
23244
23020
  };
23245
- _proto.addClip = function addClip(clip) {
23246
- clip.id = (this.clipSeed++).toString();
23247
- this.clips.push(clip);
23021
+ _proto.getClipWeight = function getClipWeight(inputIndex) {
23022
+ return this.clipWeights[inputIndex];
23248
23023
  };
23249
- _proto.createClipPlayable = function createClipPlayable(graph, clip) {
23250
- return clip.asset.createPlayable(graph);
23024
+ _proto.getClipPlayable = function getClipPlayable(index) {
23025
+ return this.clipPlayables[index];
23251
23026
  };
23252
- _proto.fromData = function fromData(data) {
23253
- PlayableAsset.prototype.fromData.call(this, data);
23254
- for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
23255
- var child = _step.value;
23256
- child.parent = this;
23257
- }
23027
+ _proto.evaluate = function evaluate(context) {
23028
+ // Override
23258
23029
  };
23259
- return TrackAsset;
23260
- }(PlayableAsset);
23261
- __decorate([
23262
- serialize(TimelineClip)
23263
- ], TrackAsset.prototype, "clips", void 0);
23264
- __decorate([
23265
- serialize()
23266
- ], TrackAsset.prototype, "children", void 0);
23267
- TrackAsset = __decorate([
23268
- effectsClass(DataType.TrackAsset)
23269
- ], TrackAsset);
23270
- var TrackType;
23271
- (function(TrackType) {
23272
- TrackType[TrackType["MasterTrack"] = 0] = "MasterTrack";
23273
- TrackType[TrackType["ObjectTrack"] = 1] = "ObjectTrack";
23274
- })(TrackType || (TrackType = {}));
23275
- var RuntimeClip = /*#__PURE__*/ function() {
23276
- function RuntimeClip(clip, clipPlayable, parentMixer, track) {
23277
- this.clip = clip;
23278
- this.playable = clipPlayable;
23279
- this.parentMixer = parentMixer;
23280
- this.track = track;
23281
- if (_instanceof1(this.track.boundObject, VFXItem)) {
23282
- this.particleSystem = this.track.boundObject.getComponent(ParticleSystem);
23283
- }
23284
- }
23285
- var _proto = RuntimeClip.prototype;
23286
- _proto.evaluateAt = function evaluateAt(localTime) {
23287
- var clip = this.clip;
23288
- var weight = 1.0;
23289
- var ended = false;
23290
- var started = false;
23291
- var boundObject = this.track.boundObject;
23292
- if (localTime >= clip.start + clip.duration && clip.endBehavior === EndBehavior.destroy) {
23293
- if (_instanceof1(boundObject, VFXItem) && VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
23294
- weight = 1.0;
23295
- } else {
23296
- weight = 0.0;
23297
- ended = true;
23298
- }
23299
- } else if (localTime - this.clip.start >= 0) {
23300
- weight = 1.0;
23301
- started = true;
23302
- } else if (localTime < clip.start) {
23303
- weight = 0.0;
23304
- }
23305
- if (started && this.playable.getPlayState() !== PlayState.Playing) {
23306
- this.playable.play();
23307
- }
23308
- this.parentMixer.setInputWeight(this.playable, weight);
23309
- var clipTime = parseFloat(clip.toLocalTime(localTime).toFixed(3));
23310
- this.playable.setTime(clipTime);
23311
- // 判断动画是否结束
23312
- if (ended) {
23313
- if (this.playable.getPlayState() === PlayState.Playing) {
23314
- this.playable.pause();
23315
- }
23316
- }
23317
- };
23318
- _create_class(RuntimeClip, [
23319
- {
23320
- key: "enable",
23321
- set: function set(value) {
23322
- if (value) {
23323
- this.playable.play();
23324
- } else {
23325
- this.parentMixer.setInputWeight(this.playable, 0);
23326
- this.playable.pause();
23327
- }
23328
- }
23329
- }
23330
- ]);
23331
- return RuntimeClip;
23332
- }();
23030
+ return TrackMixerPlayable;
23031
+ }(Playable);
23333
23032
 
23334
- var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
23335
- _inherits(ActivationMixerPlayable, Playable);
23033
+ var ActivationMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23034
+ _inherits(ActivationMixerPlayable, TrackMixerPlayable);
23336
23035
  function ActivationMixerPlayable() {
23337
- return Playable.apply(this, arguments);
23036
+ return TrackMixerPlayable.apply(this, arguments);
23338
23037
  }
23339
23038
  var _proto = ActivationMixerPlayable.prototype;
23340
- _proto.processFrame = function processFrame(context) {
23039
+ _proto.evaluate = function evaluate(context) {
23341
23040
  var boundObject = context.output.getUserData();
23342
23041
  if (!_instanceof1(boundObject, VFXItem)) {
23343
23042
  return;
23344
23043
  }
23345
23044
  var boundItem = boundObject;
23346
23045
  var hasInput = false;
23347
- for(var i = 0; i < this.getInputCount(); i++){
23348
- if (this.getInputWeight(i) > 0) {
23046
+ for(var i = 0; i < this.clipPlayables.length; i++){
23047
+ if (this.getClipWeight(i) > 0) {
23349
23048
  hasInput = true;
23350
23049
  break;
23351
23050
  }
@@ -23359,22 +23058,7 @@ var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
23359
23058
  }
23360
23059
  };
23361
23060
  return ActivationMixerPlayable;
23362
- }(Playable);
23363
-
23364
- var ActivationTrack = /*#__PURE__*/ function(TrackAsset) {
23365
- _inherits(ActivationTrack, TrackAsset);
23366
- function ActivationTrack() {
23367
- return TrackAsset.apply(this, arguments);
23368
- }
23369
- var _proto = ActivationTrack.prototype;
23370
- _proto.createTrackMixer = function createTrackMixer(graph) {
23371
- return new ActivationMixerPlayable(graph);
23372
- };
23373
- return ActivationTrack;
23374
- }(TrackAsset);
23375
- ActivationTrack = __decorate([
23376
- effectsClass(DataType.ActivationTrack)
23377
- ], ActivationTrack);
23061
+ }(TrackMixerPlayable);
23378
23062
 
23379
23063
  var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
23380
23064
  _inherits(PropertyClipPlayable, Playable);
@@ -23388,16 +23072,61 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
23388
23072
  return PropertyClipPlayable;
23389
23073
  }(Playable);
23390
23074
 
23391
- var FloatPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
23392
- _inherits(FloatPropertyMixerPlayable, Playable);
23075
+ var ColorPropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23076
+ _inherits(ColorPropertyMixerPlayable, TrackMixerPlayable);
23077
+ function ColorPropertyMixerPlayable() {
23078
+ var _this;
23079
+ _this = TrackMixerPlayable.apply(this, arguments) || this;
23080
+ _this.propertyName = "";
23081
+ return _this;
23082
+ }
23083
+ var _proto = ColorPropertyMixerPlayable.prototype;
23084
+ _proto.evaluate = function evaluate(context) {
23085
+ var boundObject = context.output.getUserData();
23086
+ if (!boundObject) {
23087
+ return;
23088
+ }
23089
+ var hasInput = false;
23090
+ var value = boundObject[this.propertyName];
23091
+ if (!_instanceof1(value, Color)) {
23092
+ return;
23093
+ }
23094
+ value.setZero();
23095
+ // evaluate the curve
23096
+ for(var i = 0; i < this.clipPlayables.length; i++){
23097
+ var weight = this.getClipWeight(i);
23098
+ if (weight > 0) {
23099
+ var propertyClipPlayable = this.getClipPlayable(i);
23100
+ if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
23101
+ console.error("ColorPropertyMixerPlayable received incompatible input");
23102
+ continue;
23103
+ }
23104
+ var curveValue = propertyClipPlayable.value;
23105
+ value.r += curveValue.r * weight;
23106
+ value.g += curveValue.g * weight;
23107
+ value.b += curveValue.b * weight;
23108
+ value.a += curveValue.a * weight;
23109
+ hasInput = true;
23110
+ }
23111
+ }
23112
+ // set value
23113
+ if (hasInput) {
23114
+ boundObject[this.propertyName] = value;
23115
+ }
23116
+ };
23117
+ return ColorPropertyMixerPlayable;
23118
+ }(TrackMixerPlayable);
23119
+
23120
+ var FloatPropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23121
+ _inherits(FloatPropertyMixerPlayable, TrackMixerPlayable);
23393
23122
  function FloatPropertyMixerPlayable() {
23394
23123
  var _this;
23395
- _this = Playable.apply(this, arguments) || this;
23124
+ _this = TrackMixerPlayable.apply(this, arguments) || this;
23396
23125
  _this.propertyName = "";
23397
23126
  return _this;
23398
23127
  }
23399
23128
  var _proto = FloatPropertyMixerPlayable.prototype;
23400
- _proto.processFrame = function processFrame(context) {
23129
+ _proto.evaluate = function evaluate(context) {
23401
23130
  var boundObject = context.output.getUserData();
23402
23131
  if (!boundObject) {
23403
23132
  return;
@@ -23405,10 +23134,10 @@ var FloatPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
23405
23134
  var hasInput = false;
23406
23135
  var value = 0;
23407
23136
  // evaluate the curve
23408
- for(var i = 0; i < this.getInputCount(); i++){
23409
- var weight = this.getInputWeight(i);
23137
+ for(var i = 0; i < this.clipPlayables.length; i++){
23138
+ var weight = this.getClipWeight(i);
23410
23139
  if (weight > 0) {
23411
- var propertyClipPlayable = this.getInput(i);
23140
+ var propertyClipPlayable = this.getClipPlayable(i);
23412
23141
  if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
23413
23142
  console.error("FloatPropertyTrack added non-FloatPropertyPlayableAsset");
23414
23143
  continue;
@@ -23424,7 +23153,27 @@ var FloatPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
23424
23153
  }
23425
23154
  };
23426
23155
  return FloatPropertyMixerPlayable;
23427
- }(Playable);
23156
+ }(TrackMixerPlayable);
23157
+
23158
+ var ParticleMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23159
+ _inherits(ParticleMixerPlayable, TrackMixerPlayable);
23160
+ function ParticleMixerPlayable() {
23161
+ return TrackMixerPlayable.apply(this, arguments);
23162
+ }
23163
+ var _proto = ParticleMixerPlayable.prototype;
23164
+ _proto.evaluate = function evaluate(context) {};
23165
+ return ParticleMixerPlayable;
23166
+ }(TrackMixerPlayable);
23167
+
23168
+ var SpriteColorMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23169
+ _inherits(SpriteColorMixerPlayable, TrackMixerPlayable);
23170
+ function SpriteColorMixerPlayable() {
23171
+ return TrackMixerPlayable.apply(this, arguments);
23172
+ }
23173
+ var _proto = SpriteColorMixerPlayable.prototype;
23174
+ _proto.evaluate = function evaluate(context) {};
23175
+ return SpriteColorMixerPlayable;
23176
+ }(TrackMixerPlayable);
23428
23177
 
23429
23178
  var SerializationHelper = /*#__PURE__*/ function() {
23430
23179
  function SerializationHelper() {}
@@ -23916,7 +23665,8 @@ var SerializationHelper = /*#__PURE__*/ function() {
23916
23665
  this.timelinePlayable.setTime(time);
23917
23666
  // The properties of the object may change dynamically,
23918
23667
  // so reset the track binding to avoid invalidation of the previously obtained binding object.
23919
- this.resolveBindings();
23668
+ // this.resolveBindings();
23669
+ this.timelinePlayable.evaluate();
23920
23670
  this.graph.evaluate(dt);
23921
23671
  };
23922
23672
  _proto.createContent = function createContent() {
@@ -24049,6 +23799,20 @@ var SerializationHelper = /*#__PURE__*/ function() {
24049
23799
  }
24050
23800
  return regions;
24051
23801
  };
23802
+ /**
23803
+ * 设置当前合成子元素的渲染顺序
23804
+ * @internal
23805
+ */ _proto.setChildrenRenderOrder = function setChildrenRenderOrder(startOrder) {
23806
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
23807
+ var item = _step.value;
23808
+ item.renderOrder = startOrder++;
23809
+ var subCompositionComponent = item.getComponent(CompositionComponent);
23810
+ if (subCompositionComponent) {
23811
+ startOrder = subCompositionComponent.setChildrenRenderOrder(startOrder);
23812
+ }
23813
+ }
23814
+ return startOrder;
23815
+ };
24052
23816
  _proto.fromData = function fromData(data) {
24053
23817
  Behaviour.prototype.fromData.call(this, data);
24054
23818
  this.items = data.items;
@@ -24095,21 +23859,21 @@ var SubCompositionClipPlayable = /*#__PURE__*/ function(Playable) {
24095
23859
  return SubCompositionClipPlayable;
24096
23860
  }(Playable);
24097
23861
 
24098
- var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
24099
- _inherits(SubCompositionMixerPlayable, Playable);
23862
+ var SubCompositionMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23863
+ _inherits(SubCompositionMixerPlayable, TrackMixerPlayable);
24100
23864
  function SubCompositionMixerPlayable() {
24101
- return Playable.apply(this, arguments);
23865
+ return TrackMixerPlayable.apply(this, arguments);
24102
23866
  }
24103
23867
  var _proto = SubCompositionMixerPlayable.prototype;
24104
- _proto.processFrame = function processFrame(context) {
23868
+ _proto.evaluate = function evaluate(context) {
24105
23869
  var boundObject = context.output.getUserData();
24106
23870
  if (!_instanceof1(boundObject, CompositionComponent)) {
24107
23871
  return;
24108
23872
  }
24109
23873
  var compositionComponent = boundObject;
24110
23874
  var hasInput = false;
24111
- for(var i = 0; i < this.getInputCount(); i++){
24112
- if (this.getInputWeight(i) > 0) {
23875
+ for(var i = 0; i < this.clipPlayables.length; i++){
23876
+ if (this.getClipWeight(i) > 0) {
24113
23877
  hasInput = true;
24114
23878
  break;
24115
23879
  }
@@ -24121,18 +23885,28 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
24121
23885
  }
24122
23886
  };
24123
23887
  return SubCompositionMixerPlayable;
24124
- }(Playable);
23888
+ }(TrackMixerPlayable);
23889
+
23890
+ var TransformMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23891
+ _inherits(TransformMixerPlayable, TrackMixerPlayable);
23892
+ function TransformMixerPlayable() {
23893
+ return TrackMixerPlayable.apply(this, arguments);
23894
+ }
23895
+ var _proto = TransformMixerPlayable.prototype;
23896
+ _proto.evaluate = function evaluate(context) {};
23897
+ return TransformMixerPlayable;
23898
+ }(TrackMixerPlayable);
24125
23899
 
24126
- var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
24127
- _inherits(Vector4PropertyMixerPlayable, Playable);
23900
+ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23901
+ _inherits(Vector4PropertyMixerPlayable, TrackMixerPlayable);
24128
23902
  function Vector4PropertyMixerPlayable() {
24129
23903
  var _this;
24130
- _this = Playable.apply(this, arguments) || this;
23904
+ _this = TrackMixerPlayable.apply(this, arguments) || this;
24131
23905
  _this.propertyName = "";
24132
23906
  return _this;
24133
23907
  }
24134
23908
  var _proto = Vector4PropertyMixerPlayable.prototype;
24135
- _proto.processFrame = function processFrame(context) {
23909
+ _proto.evaluate = function evaluate(context) {
24136
23910
  var boundObject = context.output.getUserData();
24137
23911
  if (!boundObject) {
24138
23912
  return;
@@ -24144,10 +23918,10 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
24144
23918
  }
24145
23919
  value.setZero();
24146
23920
  // evaluate the curve
24147
- for(var i = 0; i < this.getInputCount(); i++){
24148
- var weight = this.getInputWeight(i);
23921
+ for(var i = 0; i < this.clipPlayables.length; i++){
23922
+ var weight = this.getClipWeight(i);
24149
23923
  if (weight > 0) {
24150
- var propertyClipPlayable = this.getInput(i);
23924
+ var propertyClipPlayable = this.getClipPlayable(i);
24151
23925
  if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
24152
23926
  console.error("Vector4PropertyTrack added non-Vector4PropertyPlayableAsset");
24153
23927
  continue;
@@ -24166,52 +23940,215 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
24166
23940
  }
24167
23941
  };
24168
23942
  return Vector4PropertyMixerPlayable;
24169
- }(Playable);
23943
+ }(TrackMixerPlayable);
24170
23944
 
24171
- var ColorPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
24172
- _inherits(ColorPropertyMixerPlayable, Playable);
24173
- function ColorPropertyMixerPlayable() {
23945
+ /**
23946
+ * @since 2.0.0
23947
+ */ var TimelineClip = /*#__PURE__*/ function() {
23948
+ function TimelineClip() {
23949
+ this.start = 0;
23950
+ this.duration = 0;
23951
+ }
23952
+ var _proto = TimelineClip.prototype;
23953
+ _proto.toLocalTime = function toLocalTime(time) {
23954
+ var localTime = time - this.start;
23955
+ var duration = this.duration;
23956
+ if (localTime - duration > 0) {
23957
+ if (this.endBehavior === EndBehavior.restart) {
23958
+ localTime = localTime % duration;
23959
+ } else if (this.endBehavior === EndBehavior.freeze) {
23960
+ localTime = Math.min(duration, localTime);
23961
+ }
23962
+ }
23963
+ return localTime;
23964
+ };
23965
+ return TimelineClip;
23966
+ }();
23967
+ var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
23968
+ _inherits(TrackAsset, PlayableAsset);
23969
+ function TrackAsset() {
24174
23970
  var _this;
24175
- _this = Playable.apply(this, arguments) || this;
24176
- _this.propertyName = "";
23971
+ _this = PlayableAsset.apply(this, arguments) || this;
23972
+ _this.trackType = 0;
23973
+ _this.clipSeed = 0;
23974
+ _this.clips = [];
23975
+ _this.children = [];
24177
23976
  return _this;
24178
23977
  }
24179
- var _proto = ColorPropertyMixerPlayable.prototype;
24180
- _proto.processFrame = function processFrame(context) {
24181
- var boundObject = context.output.getUserData();
24182
- if (!boundObject) {
24183
- return;
23978
+ var _proto = TrackAsset.prototype;
23979
+ /**
23980
+ * 重写该方法以获取自定义对象绑定
23981
+ */ _proto.updateAnimatedObject = function updateAnimatedObject() {
23982
+ if (this.parent) {
23983
+ this.boundObject = this.parent.boundObject;
24184
23984
  }
24185
- var hasInput = false;
24186
- var value = boundObject[this.propertyName];
24187
- if (!_instanceof1(value, Color)) {
24188
- return;
23985
+ };
23986
+ /**
23987
+ * 重写该方法以创建自定义混合器
23988
+ */ _proto.createTrackMixer = function createTrackMixer(graph) {
23989
+ return new TrackMixerPlayable(graph);
23990
+ };
23991
+ _proto.createOutput = function createOutput() {
23992
+ var output = new PlayableOutput();
23993
+ return output;
23994
+ };
23995
+ _proto.createPlayableGraph = function createPlayableGraph(graph, runtimeClips) {
23996
+ var mixerPlayable = this.createMixerPlayableGraph(graph, runtimeClips);
23997
+ return mixerPlayable;
23998
+ };
23999
+ _proto.createMixerPlayableGraph = function createMixerPlayableGraph(graph, runtimeClips) {
24000
+ var clips = [];
24001
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.clips), _step; !(_step = _iterator()).done;){
24002
+ var clip = _step.value;
24003
+ clips.push(clip);
24189
24004
  }
24190
- value.setZero();
24191
- // evaluate the curve
24192
- for(var i = 0; i < this.getInputCount(); i++){
24193
- var weight = this.getInputWeight(i);
24194
- if (weight > 0) {
24195
- var propertyClipPlayable = this.getInput(i);
24196
- if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
24197
- console.error("ColorPropertyMixerPlayable received incompatible input");
24198
- continue;
24199
- }
24200
- var curveValue = propertyClipPlayable.value;
24201
- value.r += curveValue.r * weight;
24202
- value.g += curveValue.g * weight;
24203
- value.b += curveValue.b * weight;
24204
- value.a += curveValue.a * weight;
24205
- hasInput = true;
24005
+ var mixerPlayable = this.compileClips(graph, clips, runtimeClips);
24006
+ return mixerPlayable;
24007
+ };
24008
+ _proto.compileClips = function compileClips(graph, timelineClips, runtimeClips) {
24009
+ var mixer = this.createTrackMixer(graph);
24010
+ for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
24011
+ var timelineClip = _step.value;
24012
+ var clipPlayable = this.createClipPlayable(graph, timelineClip);
24013
+ clipPlayable.setDuration(timelineClip.duration);
24014
+ var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
24015
+ runtimeClips.push(clip);
24016
+ mixer.clipPlayables.push(clipPlayable);
24017
+ mixer.setClipWeight(clipPlayable, 0.0);
24018
+ }
24019
+ return mixer;
24020
+ };
24021
+ _proto.createPlayable = function createPlayable(graph) {
24022
+ return new Playable(graph);
24023
+ };
24024
+ _proto.getChildTracks = function getChildTracks() {
24025
+ return this.children;
24026
+ };
24027
+ _proto.addChild = function addChild(child) {
24028
+ this.children.push(child);
24029
+ child.parent = this;
24030
+ };
24031
+ _proto.createClip = function createClip(classConstructor, name) {
24032
+ var newClip = new TimelineClip();
24033
+ newClip.asset = new classConstructor(this.engine);
24034
+ newClip.name = name ? name : "TimelineClip" + newClip.id;
24035
+ this.addClip(newClip);
24036
+ return newClip;
24037
+ };
24038
+ _proto.getClips = function getClips() {
24039
+ return this.clips;
24040
+ };
24041
+ _proto.findClip = function findClip(name) {
24042
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.clips), _step; !(_step = _iterator()).done;){
24043
+ var clip = _step.value;
24044
+ if (clip.name === name) {
24045
+ return clip;
24206
24046
  }
24207
24047
  }
24208
- // set value
24209
- if (hasInput) {
24210
- boundObject[this.propertyName] = value;
24048
+ };
24049
+ _proto.addClip = function addClip(clip) {
24050
+ clip.id = (this.clipSeed++).toString();
24051
+ this.clips.push(clip);
24052
+ };
24053
+ _proto.createClipPlayable = function createClipPlayable(graph, clip) {
24054
+ return clip.asset.createPlayable(graph);
24055
+ };
24056
+ _proto.fromData = function fromData(data) {
24057
+ PlayableAsset.prototype.fromData.call(this, data);
24058
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
24059
+ var child = _step.value;
24060
+ child.parent = this;
24211
24061
  }
24212
24062
  };
24213
- return ColorPropertyMixerPlayable;
24214
- }(Playable);
24063
+ return TrackAsset;
24064
+ }(PlayableAsset);
24065
+ __decorate([
24066
+ serialize(TimelineClip)
24067
+ ], TrackAsset.prototype, "clips", void 0);
24068
+ __decorate([
24069
+ serialize()
24070
+ ], TrackAsset.prototype, "children", void 0);
24071
+ TrackAsset = __decorate([
24072
+ effectsClass(DataType.TrackAsset)
24073
+ ], TrackAsset);
24074
+ var TrackType;
24075
+ (function(TrackType) {
24076
+ TrackType[TrackType["MasterTrack"] = 0] = "MasterTrack";
24077
+ TrackType[TrackType["ObjectTrack"] = 1] = "ObjectTrack";
24078
+ })(TrackType || (TrackType = {}));
24079
+ var RuntimeClip = /*#__PURE__*/ function() {
24080
+ function RuntimeClip(clip, clipPlayable, parentMixer, track) {
24081
+ this.clip = clip;
24082
+ this.playable = clipPlayable;
24083
+ this.parentMixer = parentMixer;
24084
+ this.track = track;
24085
+ if (_instanceof1(this.track.boundObject, VFXItem)) {
24086
+ this.particleSystem = this.track.boundObject.getComponent(ParticleSystem);
24087
+ }
24088
+ }
24089
+ var _proto = RuntimeClip.prototype;
24090
+ _proto.evaluateAt = function evaluateAt(localTime) {
24091
+ var clip = this.clip;
24092
+ var weight = 1.0;
24093
+ var ended = false;
24094
+ var started = false;
24095
+ var boundObject = this.track.boundObject;
24096
+ if (localTime >= clip.start + clip.duration && clip.endBehavior === EndBehavior.destroy) {
24097
+ if (_instanceof1(boundObject, VFXItem) && VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
24098
+ weight = 1.0;
24099
+ } else {
24100
+ weight = 0.0;
24101
+ ended = true;
24102
+ }
24103
+ } else if (localTime - this.clip.start >= 0) {
24104
+ weight = 1.0;
24105
+ started = true;
24106
+ } else if (localTime < clip.start) {
24107
+ weight = 0.0;
24108
+ }
24109
+ if (started && this.playable.getPlayState() !== PlayState.Playing) {
24110
+ this.playable.play();
24111
+ }
24112
+ this.parentMixer.setClipWeight(this.playable, weight);
24113
+ var clipTime = parseFloat(clip.toLocalTime(localTime).toFixed(3));
24114
+ this.playable.setTime(clipTime);
24115
+ // 判断动画是否结束
24116
+ if (ended) {
24117
+ if (this.playable.getPlayState() === PlayState.Playing) {
24118
+ this.playable.pause();
24119
+ }
24120
+ }
24121
+ };
24122
+ _create_class(RuntimeClip, [
24123
+ {
24124
+ key: "enable",
24125
+ set: function set(value) {
24126
+ if (value) {
24127
+ this.playable.play();
24128
+ } else {
24129
+ this.parentMixer.setClipWeight(this.playable, 0);
24130
+ this.playable.pause();
24131
+ }
24132
+ }
24133
+ }
24134
+ ]);
24135
+ return RuntimeClip;
24136
+ }();
24137
+
24138
+ var ActivationTrack = /*#__PURE__*/ function(TrackAsset) {
24139
+ _inherits(ActivationTrack, TrackAsset);
24140
+ function ActivationTrack() {
24141
+ return TrackAsset.apply(this, arguments);
24142
+ }
24143
+ var _proto = ActivationTrack.prototype;
24144
+ _proto.createTrackMixer = function createTrackMixer(graph) {
24145
+ return new ActivationMixerPlayable(graph);
24146
+ };
24147
+ return ActivationTrack;
24148
+ }(TrackAsset);
24149
+ ActivationTrack = __decorate([
24150
+ effectsClass(DataType.ActivationTrack)
24151
+ ], ActivationTrack);
24215
24152
 
24216
24153
  var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
24217
24154
  _inherits(PropertyTrack, TrackAsset);
@@ -24284,6 +24221,10 @@ var SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
24284
24221
  function SpriteColorTrack() {
24285
24222
  return TrackAsset.apply(this, arguments);
24286
24223
  }
24224
+ var _proto = SpriteColorTrack.prototype;
24225
+ _proto.createTrackMixer = function createTrackMixer(graph) {
24226
+ return new SpriteColorMixerPlayable(graph);
24227
+ };
24287
24228
  return SpriteColorTrack;
24288
24229
  }(TrackAsset);
24289
24230
  SpriteColorTrack = __decorate([
@@ -24316,6 +24257,10 @@ var TransformTrack = /*#__PURE__*/ function(TrackAsset) {
24316
24257
  function TransformTrack() {
24317
24258
  return TrackAsset.apply(this, arguments);
24318
24259
  }
24260
+ var _proto = TransformTrack.prototype;
24261
+ _proto.createTrackMixer = function createTrackMixer(graph) {
24262
+ return new TransformMixerPlayable(graph);
24263
+ };
24319
24264
  return TransformTrack;
24320
24265
  }(TrackAsset);
24321
24266
  TransformTrack = __decorate([
@@ -24344,6 +24289,18 @@ MaterialTrack = __decorate([
24344
24289
  effectsClass("MaterialTrack")
24345
24290
  ], MaterialTrack);
24346
24291
 
24292
+ var ParticleTrack = /*#__PURE__*/ function(TrackAsset) {
24293
+ _inherits(ParticleTrack, TrackAsset);
24294
+ function ParticleTrack() {
24295
+ return TrackAsset.apply(this, arguments);
24296
+ }
24297
+ var _proto = ParticleTrack.prototype;
24298
+ _proto.createTrackMixer = function createTrackMixer(graph) {
24299
+ return new ParticleMixerPlayable(graph);
24300
+ };
24301
+ return ParticleTrack;
24302
+ }(TrackAsset);
24303
+
24347
24304
  var Vector4PropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
24348
24305
  _inherits(Vector4PropertyTrack, PropertyTrack);
24349
24306
  function Vector4PropertyTrack() {
@@ -24472,7 +24429,6 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
24472
24429
  var _proto = TimelineAsset.prototype;
24473
24430
  _proto.createPlayable = function createPlayable(graph) {
24474
24431
  var timelinePlayable = new TimelinePlayable(graph);
24475
- timelinePlayable.setTraversalMode(PlayableTraversalMode.Passthrough);
24476
24432
  for(var _iterator = _create_for_of_iterator_helper_loose(this.tracks), _step; !(_step = _iterator()).done;){
24477
24433
  var track = _step.value;
24478
24434
  if (_instanceof1(track, ObjectBindingTrack)) {
@@ -24553,9 +24509,7 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
24553
24509
  return _this;
24554
24510
  }
24555
24511
  var _proto = TimelinePlayable.prototype;
24556
- _proto.prepareFrame = function prepareFrame(context) {
24557
- this.evaluate();
24558
- };
24512
+ _proto.prepareFrame = function prepareFrame(context) {};
24559
24513
  _proto.evaluate = function evaluate() {
24560
24514
  var time = this.getTime();
24561
24515
  // TODO search active clips
@@ -24572,11 +24526,10 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
24572
24526
  var track = _step.value;
24573
24527
  // create track mixer and track output
24574
24528
  var trackMixPlayable = track.createPlayableGraph(graph, this.clips);
24575
- this.addInput(trackMixPlayable, 0);
24576
24529
  var trackOutput = track.createOutput();
24577
24530
  trackOutput.setUserData(track.boundObject);
24578
24531
  graph.addOutput(trackOutput);
24579
- trackOutput.setSourcePlayable(this, this.getInputCount() - 1);
24532
+ trackOutput.setSourcePlayable(trackMixPlayable);
24580
24533
  // create track instance
24581
24534
  var trackInstance = new TrackInstance(track, trackMixPlayable, trackOutput);
24582
24535
  trackInstanceMap[track.getInstanceId()] = trackInstance;
@@ -24637,10 +24590,10 @@ Vector4PropertyPlayableAsset = __decorate([
24637
24590
  effectsClass("Vector4PropertyPlayableAsset")
24638
24591
  ], Vector4PropertyPlayableAsset);
24639
24592
 
24640
- var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
24641
- _inherits(ObjectBindingTrack, TrackAsset1);
24593
+ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset) {
24594
+ _inherits(ObjectBindingTrack, TrackAsset);
24642
24595
  function ObjectBindingTrack() {
24643
- return TrackAsset1.apply(this, arguments);
24596
+ return TrackAsset.apply(this, arguments);
24644
24597
  }
24645
24598
  var _proto = ObjectBindingTrack.prototype;
24646
24599
  _proto.updateAnimatedObject = function updateAnimatedObject() {};
@@ -24651,7 +24604,7 @@ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
24651
24604
  var boundItem = this.boundObject;
24652
24605
  // 添加粒子动画 clip // TODO 待移除
24653
24606
  if (boundItem.getComponent(ParticleSystem)) {
24654
- var particleTrack = timelineAsset.createTrack(TrackAsset, this, "ParticleTrack");
24607
+ var particleTrack = timelineAsset.createTrack(ParticleTrack, this, "ParticleTrack");
24655
24608
  particleTrack.boundObject = this.boundObject;
24656
24609
  var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
24657
24610
  particleClip.start = boundItem.start;
@@ -24674,14 +24627,14 @@ var TextLayout = /*#__PURE__*/ function() {
24674
24627
  function TextLayout(options) {
24675
24628
  this.width = 0;
24676
24629
  this.height = 0;
24677
- var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
24630
+ var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.clip : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
24678
24631
  var tempWidth = fontSize + letterSpace;
24679
24632
  this.autoWidth = autoWidth;
24680
24633
  this.maxTextWidth = text.length * tempWidth;
24681
24634
  this.width = textWidth;
24682
24635
  this.height = textHeight;
24683
24636
  this.letterSpace = letterSpace;
24684
- this.overFlow = textOverflow;
24637
+ this.overflow = textOverflow;
24685
24638
  this.textBaseline = textBaseline;
24686
24639
  this.textAlign = textAlign;
24687
24640
  this.lineHeight = lineHeight;
@@ -27671,11 +27624,11 @@ var seed$1 = 1;
27671
27624
  if (compressedTexture === void 0) compressedTexture = 0;
27672
27625
  var _this = this;
27673
27626
  return _async_to_generator(function() {
27674
- var _this_options, useCompressedTexture, variables, baseUrl, jobs, loadedImages;
27627
+ var _this_options, useCompressedTexture, variables, disableWebP, disableAVIF, baseUrl, jobs, loadedImages;
27675
27628
  return __generator(this, function(_state) {
27676
27629
  switch(_state.label){
27677
27630
  case 0:
27678
- _this_options = _this.options, useCompressedTexture = _this_options.useCompressedTexture, variables = _this_options.variables;
27631
+ _this_options = _this.options, useCompressedTexture = _this_options.useCompressedTexture, variables = _this_options.variables, disableWebP = _this_options.disableWebP, disableAVIF = _this_options.disableAVIF;
27679
27632
  baseUrl = _this.baseUrl;
27680
27633
  jobs = images.map(/*#__PURE__*/ _async_to_generator(function(img, idx) {
27681
27634
  var png, webp, avif, imageURL, webpURL, avifURL, id, template, background, url, isVideo, loadFn, resultImage, e, compressed, src, bufferURL, _ref, url1, image, _tmp;
@@ -27686,9 +27639,9 @@ var seed$1 = 1;
27686
27639
  // eslint-disable-next-line compat/compat
27687
27640
  imageURL = new URL(png, baseUrl).href;
27688
27641
  // eslint-disable-next-line compat/compat
27689
- webpURL = webp && new URL(webp, baseUrl).href;
27642
+ webpURL = !disableWebP && webp ? new URL(webp, baseUrl).href : undefined;
27690
27643
  // eslint-disable-next-line compat/compat
27691
- avifURL = avif && new URL(avif, baseUrl).href;
27644
+ avifURL = !disableAVIF && avif ? new URL(avif, baseUrl).href : undefined;
27692
27645
  id = img.id;
27693
27646
  if (!("template" in img)) return [
27694
27647
  3,
@@ -28377,7 +28330,6 @@ var tmpScale = new Vector3(1, 1, 1);
28377
28330
  return Camera;
28378
28331
  }();
28379
28332
 
28380
- var listOrder = 0;
28381
28333
  /**
28382
28334
  * 合成资源管理
28383
28335
  */ var CompositionSourceManager = /*#__PURE__*/ function() {
@@ -28410,7 +28362,6 @@ var listOrder = 0;
28410
28362
  this.pluginSystem = pluginSystem;
28411
28363
  this.totalTime = totalTime != null ? totalTime : 0;
28412
28364
  this.textures = cachedTextures;
28413
- listOrder = 0;
28414
28365
  this.sourceContent = this.getContent(this.composition);
28415
28366
  }
28416
28367
  var _proto = CompositionSourceManager.prototype;
@@ -28441,7 +28392,6 @@ var listOrder = 0;
28441
28392
  var sourceItemData = this.engine.jsonSceneData[itemDataPath.id];
28442
28393
  var itemProps = sourceItemData;
28443
28394
  if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
28444
- itemProps.listIndex = listOrder++;
28445
28395
  if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
28446
28396
  itemProps.type === ItemType.shape) {
28447
28397
  for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
@@ -28744,6 +28694,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28744
28694
  SerializationHelper.deserialize(sourceContent, _this.rootComposition);
28745
28695
  _this.rootComposition.createContent();
28746
28696
  _this.buildItemTree(_this.rootItem);
28697
+ _this.rootComposition.setChildrenRenderOrder(0);
28747
28698
  _this.pluginSystem.resetComposition(_assert_this_initialized(_this), _this.renderFrame);
28748
28699
  return _this;
28749
28700
  }
@@ -31383,7 +31334,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
31383
31334
  registerPlugin("particle", ParticleLoader, VFXItem, true);
31384
31335
  registerPlugin("cal", CalculateLoader, VFXItem, true);
31385
31336
  registerPlugin("interact", InteractLoader, VFXItem, true);
31386
- var version$1 = "2.1.5";
31337
+ var version$1 = "2.2.0";
31387
31338
  logger.info("Core version: " + version$1 + ".");
31388
31339
 
31389
31340
  var _obj;
@@ -31440,6 +31391,7 @@ var _obj3;
31440
31391
  /**
31441
31392
  * 储存 uniform 变量名及对应的 THREE uniform 对象
31442
31393
  */ _this.uniforms = {};
31394
+ _this.macrosDirty = true;
31443
31395
  var shader = props == null ? void 0 : props.shader;
31444
31396
  var level = engine.gpuCapability.level;
31445
31397
  _this.shader = new Shader(engine);
@@ -31679,15 +31631,20 @@ var _obj3;
31679
31631
  var uniform = new THREE.Uniform(value);
31680
31632
  this.uniforms[name] = this.material.uniforms[name] = uniform;
31681
31633
  };
31682
- // 下列三个方法暂时不需要实现
31683
- _proto.enableMacro = function enableMacro(keyword) {
31684
- throw new Error("Method not implemented.");
31634
+ _proto.enableMacro = function enableMacro(keyword, value) {
31635
+ if (!this.isMacroEnabled(keyword) || this.enabledMacros[keyword] !== value) {
31636
+ this.enabledMacros[keyword] = value != null ? value : true;
31637
+ this.macrosDirty = true;
31638
+ }
31685
31639
  };
31686
31640
  _proto.disableMacro = function disableMacro(keyword) {
31687
- throw new Error("Method not implemented.");
31641
+ if (this.isMacroEnabled(keyword)) {
31642
+ delete this.enabledMacros[keyword];
31643
+ this.macrosDirty = true;
31644
+ }
31688
31645
  };
31689
31646
  _proto.isMacroEnabled = function isMacroEnabled(keyword) {
31690
- throw new Error("Method not implemented.");
31647
+ return this.enabledMacros[keyword] !== undefined;
31691
31648
  };
31692
31649
  _proto.clone = function clone(props) {
31693
31650
  //FIXME: 暂时不实现
@@ -33010,8 +32967,8 @@ setMaxSpriteMeshItemCount(8);
33010
32967
  */ Mesh.create = function(engine, props) {
33011
32968
  return new ThreeMesh(engine, props);
33012
32969
  };
33013
- var version = "2.1.5";
32970
+ var version = "2.2.0";
33014
32971
  logger.info("THREEJS plugin version: " + version + ".");
33015
32972
 
33016
- export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
32973
+ export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
33017
32974
  //# sourceMappingURL=index.mjs.map