@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.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: v1.4.0-beta.1
6
+ * Version: v1.4.0
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -684,7 +684,7 @@ function asserts(condition, msg) {
684
684
  * Name: @galacean/effects-specification
685
685
  * Description: Galacean Effects JSON Specification
686
686
  * Author: Ant Group CO., Ltd.
687
- * Version: v1.2.0-beta.0
687
+ * Version: v1.2.0
688
688
  */
689
689
 
690
690
  /*********************************************/
@@ -8195,19 +8195,19 @@ var BezierCurvePath = /** @class */ (function (_super) {
8195
8195
  var perc = 0, point = new Vector3();
8196
8196
  var keyTimeData = Object.keys(this.curveSegments);
8197
8197
  if (!keyTimeData.length) {
8198
- return point;
8198
+ return point.toArray();
8199
8199
  }
8200
8200
  var keyTimeStart = Number(keyTimeData[0].split('&')[0]);
8201
8201
  var keyTimeEnd = Number(keyTimeData[keyTimeData.length - 1].split('&')[1]);
8202
8202
  if (t <= keyTimeStart) {
8203
8203
  var pathCurve = this.curveSegments[keyTimeData[0]].pathCurve;
8204
8204
  point = pathCurve.getPointInPercent(0);
8205
- return point;
8205
+ return point.toArray();
8206
8206
  }
8207
8207
  if (t >= keyTimeEnd) {
8208
8208
  var pathCurve = this.curveSegments[keyTimeData[keyTimeData.length - 1]].pathCurve;
8209
8209
  point = pathCurve.getPointInPercent(1);
8210
- return point;
8210
+ return point.toArray();
8211
8211
  }
8212
8212
  for (var i = 0; i < keyTimeData.length; i++) {
8213
8213
  var _a = __read$3(keyTimeData[i].split('&'), 2), xMin = _a[0], xMax = _a[1];
@@ -8217,7 +8217,7 @@ var BezierCurvePath = /** @class */ (function (_super) {
8217
8217
  point = bezierPath.getPointInPercent(perc);
8218
8218
  }
8219
8219
  }
8220
- return point;
8220
+ return point.toArray();
8221
8221
  };
8222
8222
  BezierCurvePath.prototype.getPercValue = function (curveKey, time) {
8223
8223
  var curveInfo = this.curveSegments[curveKey];
@@ -21866,7 +21866,7 @@ var filters = {
21866
21866
  * Name: @galacean/effects-specification
21867
21867
  * Description: Galacean Effects JSON Specification
21868
21868
  * Author: Ant Group CO., Ltd.
21869
- * Version: v1.2.0-beta.0
21869
+ * Version: v1.2.0
21870
21870
  */
21871
21871
 
21872
21872
  /*********************************************/
@@ -23355,6 +23355,9 @@ function version24Migration(json) {
23355
23355
  }
23356
23356
  function convertParam(content) {
23357
23357
  var e_2, _a;
23358
+ if (!content) {
23359
+ return;
23360
+ }
23358
23361
  try {
23359
23362
  for (var _b = __values(Object.keys(content)), _c = _b.next(); !_c.done; _c = _b.next()) {
23360
23363
  var key = _c.value;
@@ -24525,18 +24528,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24525
24528
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24526
24529
  if (Item.isComposition(itemProps)) {
24527
24530
  var refId = itemProps.content.options.refId;
24528
- var props = this.composition.refCompositionProps.get(refId);
24529
- if (!props) {
24530
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24531
- }
24532
- props.content = itemProps.content;
24533
- 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);
24531
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24534
24532
  item.contentProps = itemProps.content;
24535
24533
  item.transform.parentTransform = this.transform;
24536
24534
  this.composition.refContent.push(item);
24537
24535
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24538
24536
  this.composition.autoRefTex = false;
24539
24537
  }
24538
+ item.createContent();
24540
24539
  }
24541
24540
  else {
24542
24541
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24668,6 +24667,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24668
24667
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24669
24668
  this.items.forEach(function (item) { return item.setVisible(visible); });
24670
24669
  };
24670
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24671
+ if (this.content) {
24672
+ this.content.startSize = new Vector3(x, y, z);
24673
+ }
24674
+ };
24675
+ CompVFXItem.prototype.scale = function (x, y, z) {
24676
+ if (this.content) {
24677
+ var startSize = this.content.startSize.clone();
24678
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24679
+ }
24680
+ };
24671
24681
  CompVFXItem.prototype.getUpdateTime = function (t) {
24672
24682
  var startTime = this.startTimeInms;
24673
24683
  var now = this.timeInms;
@@ -27369,7 +27379,7 @@ Geometry.create = function (engine, options) {
27369
27379
  Mesh.create = function (engine, props) {
27370
27380
  return new ThreeMesh(engine, props);
27371
27381
  };
27372
- var version = "1.4.0-beta.1";
27382
+ var version = "1.4.0";
27373
27383
  logger.info('THREEJS plugin version: ' + version);
27374
27384
 
27375
27385
  export { AbstractPlugin, AssetManager, BYTES_TYPE_MAP, BezierCurve, BezierCurvePath, 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, CalculateItem, CalculateLoader, CalculateVFXItem, Camera, CameraController, CameraVFXItem, CameraVFXItemLoader, Composition, CompositionSourceManager, DEFAULT_FONTS, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, Engine, EventSystem, FILTER_NAME_NONE, FilterMode, FilterSpriteVFXItem, Float16ArrayWrapper, FrameBuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractBehavior$1 as InteractBehavior, InteractItem, InteractLoader, InteractMesh, InteractVFXItem, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleLoader, ParticleMesh, ParticleSystem, ParticleVFXItem, PassTextureCache, PluginSystem, QCanvasViewer, QText, QTextWrapMode, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderBuffer, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderer, 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, SemanticMap, Shader, ShaderCompileResultStatus, ShaderType, SpriteItem, SpriteLoader, SpriteMesh, SpriteVFXItem, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextItem, TextLoader, TextMesh, TextVFXItem, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeMaterial, ThreeTexture, Ticker, TimelineComponent, Transform, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, alphaFrameFrag, alphaMaskFrag, assertExist, asserts, blend, bloomMixVert, bloomThresholdVert, calculateTranslation, cameraMove_frag as cameraMoveFrag, cameraMoveVert, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, combineImageTemplate1, combineImageTemplate1Async, combineImageTemplate2, combineImageTemplate2Async, combineImageTemplateAsync, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, convertAnchor, copyFrag, createCopyShader, createFilter, createFilterShaders, createGLContext, createKeyFrameMeta, createShaderWithMarcos, createShape, createVFXItem, createValueGetter, decimalEqual, deepClone, defaultGlobalVolume, defaultPlugins, delayFrag, deserializeMipmapTexture, distortionFrag, distortionVert, earcut, enlargeBuffer, ensureVec3, filters, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateHalfFloatTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAndroid, isArray, isFunction, isIOS, isObject, isScene, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isWebGL2, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, maxSpriteTextureCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, pointOnLine, random, registerFilter, registerFilters, registerPlugin, removeItem, requestAsync, rotateVec2, screenMeshVert, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxFragmentTextures, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version };