@galacean/effects-plugin-model 2.3.0-alpha.2 → 2.3.0-beta.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 player model plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.3.0-alpha.2
6
+ * Version: v2.3.0-beta.0
7
7
  */
8
8
 
9
9
  'use strict';
@@ -3513,86 +3513,6 @@ var normal = new Vector3();
3513
3513
  }
3514
3514
  };
3515
3515
  /**
3516
- * 设置 3D 元素参数,在播放器创建 3D 元素前
3517
- * @param scene - 场景
3518
- * @param cache - 缓存
3519
- * @param composition - 合成
3520
- * @returns
3521
- */ PluginHelper.setupItem3DOptions = function setupItem3DOptions(scene, cache, composition) {
3522
- var _this = this;
3523
- if (scene === undefined || scene.bins.length <= 0) {
3524
- return;
3525
- }
3526
- var jsonScene = scene.jsonScene;
3527
- var compIndexSet = new Set();
3528
- if (jsonScene.compositionId === undefined) {
3529
- compIndexSet.add(0);
3530
- }
3531
- jsonScene.compositions.forEach(function(comp, index) {
3532
- if (comp.id === jsonScene.compositionId || composition.refCompositionProps.has(comp.id)) {
3533
- compIndexSet.add(index);
3534
- }
3535
- });
3536
- compIndexSet.forEach(function(compIndex) {
3537
- var sceneComp = jsonScene.compositions[compIndex];
3538
- sceneComp.items.forEach(function(data) {
3539
- var itemId = data.id;
3540
- var item = composition.getEngine().jsonSceneData[itemId];
3541
- if (item.type === EFFECTS.spec.ItemType.mesh) {
3542
- var meshItem = item;
3543
- var skin = meshItem.content.options.skin;
3544
- var primitives = meshItem.content.options.primitives;
3545
- primitives.forEach(function(prim, primId) {
3546
- if (_instanceof1(prim.geometry, EFFECTS.Geometry)) {
3547
- // 可能已经创建,直接返回
3548
- return;
3549
- }
3550
- var name = "Geom_C" + compIndex + "_I" + itemId + "_P" + primId;
3551
- var riGeometry = cache.getOrCreateGeometry(name, prim.geometry, scene.bins);
3552
- var studioPrim = prim;
3553
- studioPrim.geometry = riGeometry;
3554
- var material = prim.material;
3555
- if (material.type === EFFECTS.spec.MaterialType.pbr) {
3556
- var studioMat = studioPrim.material;
3557
- studioMat.baseColorTexture = _this.getTextureObj(composition.textures, material.baseColorTexture);
3558
- studioMat.metallicRoughnessTexture = _this.getTextureObj(composition.textures, material.metallicRoughnessTexture);
3559
- studioMat.normalTexture = _this.getTextureObj(composition.textures, material.normalTexture);
3560
- studioMat.occlusionTexture = _this.getTextureObj(composition.textures, material.occlusionTexture);
3561
- studioMat.emissiveTexture = _this.getTextureObj(composition.textures, material.emissiveTexture);
3562
- } else {
3563
- var studioMat1 = studioPrim.material;
3564
- studioMat1.baseColorTexture = _this.getTextureObj(composition.textures, material.baseColorTexture);
3565
- }
3566
- });
3567
- if (skin !== undefined && skin.inverseBindMatrices !== undefined) {
3568
- var studioSkin = skin;
3569
- var inverseBindMatrices = typedArrayFromBinary(scene.bins, skin.inverseBindMatrices);
3570
- if (_instanceof1(inverseBindMatrices, Float32Array)) {
3571
- studioSkin.inverseBindMatrices = inverseBindMatrices;
3572
- } else {
3573
- console.error("setupItem3DOptions: Invalid inverseBindMatrices type, " + inverseBindMatrices + ".");
3574
- }
3575
- }
3576
- } else if (item.type === EFFECTS.spec.ItemType.skybox) {
3577
- var skybox = item;
3578
- var studioSkybox = item;
3579
- var options = skybox.content.options;
3580
- var studioOptions = studioSkybox.content.options;
3581
- var specularImage = _this.getTextureObj(composition.textures, options.specularImage);
3582
- if (specularImage === undefined) {
3583
- console.error("setupItem3DOptions: skybox specualrImage is undefined, " + CheckerHelper.stringify(options) + ".");
3584
- }
3585
- studioOptions.specularImage = specularImage;
3586
- //
3587
- var diffuseImage = _this.getTextureObj(composition.textures, options.diffuseImage);
3588
- if (diffuseImage !== undefined) {
3589
- studioOptions.diffuseImage = diffuseImage;
3590
- }
3591
- }
3592
- });
3593
- });
3594
- };
3595
- /**
3596
3516
  * 创建几何体,根据几何参数描述 JSON 和数据数组
3597
3517
  * @param engine - 引擎
3598
3518
  * @param geomJson - 几何参数描述 JSON
@@ -9338,8 +9258,6 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
9338
9258
  var engine = composition.renderer.engine;
9339
9259
  this.cache = new CompositionCache(engine);
9340
9260
  this.cache.setup(false);
9341
- // FIXME: 先注释元素参数的配置
9342
- //PluginHelper.setupItem3DOptions(scene, this.cache, composition);
9343
9261
  };
9344
9262
  /**
9345
9263
  * 每次播放都会执行,包括重播,所以这里执行“小的销毁”和新的初始化
@@ -13295,7 +13213,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13295
13213
  EFFECTS.registerPlugin("model", ModelPlugin, EFFECTS.VFXItem);
13296
13214
  /**
13297
13215
  * 插件版本号
13298
- */ var version = "2.3.0-alpha.2";
13216
+ */ var version = "2.3.0-beta.0";
13299
13217
  EFFECTS.logger.info("Plugin model version: " + version + ".");
13300
13218
  if (version !== EFFECTS__namespace.version) {
13301
13219
  console.error("注意:请统一 Model 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Model plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");