@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.mjs 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
  import * as EFFECTS from '@galacean/effects';
@@ -3490,86 +3490,6 @@ var normal = new Vector3();
3490
3490
  }
3491
3491
  };
3492
3492
  /**
3493
- * 设置 3D 元素参数,在播放器创建 3D 元素前
3494
- * @param scene - 场景
3495
- * @param cache - 缓存
3496
- * @param composition - 合成
3497
- * @returns
3498
- */ PluginHelper.setupItem3DOptions = function setupItem3DOptions(scene, cache, composition) {
3499
- var _this = this;
3500
- if (scene === undefined || scene.bins.length <= 0) {
3501
- return;
3502
- }
3503
- var jsonScene = scene.jsonScene;
3504
- var compIndexSet = new Set();
3505
- if (jsonScene.compositionId === undefined) {
3506
- compIndexSet.add(0);
3507
- }
3508
- jsonScene.compositions.forEach(function(comp, index) {
3509
- if (comp.id === jsonScene.compositionId || composition.refCompositionProps.has(comp.id)) {
3510
- compIndexSet.add(index);
3511
- }
3512
- });
3513
- compIndexSet.forEach(function(compIndex) {
3514
- var sceneComp = jsonScene.compositions[compIndex];
3515
- sceneComp.items.forEach(function(data) {
3516
- var itemId = data.id;
3517
- var item = composition.getEngine().jsonSceneData[itemId];
3518
- if (item.type === spec.ItemType.mesh) {
3519
- var meshItem = item;
3520
- var skin = meshItem.content.options.skin;
3521
- var primitives = meshItem.content.options.primitives;
3522
- primitives.forEach(function(prim, primId) {
3523
- if (_instanceof1(prim.geometry, Geometry)) {
3524
- // 可能已经创建,直接返回
3525
- return;
3526
- }
3527
- var name = "Geom_C" + compIndex + "_I" + itemId + "_P" + primId;
3528
- var riGeometry = cache.getOrCreateGeometry(name, prim.geometry, scene.bins);
3529
- var studioPrim = prim;
3530
- studioPrim.geometry = riGeometry;
3531
- var material = prim.material;
3532
- if (material.type === spec.MaterialType.pbr) {
3533
- var studioMat = studioPrim.material;
3534
- studioMat.baseColorTexture = _this.getTextureObj(composition.textures, material.baseColorTexture);
3535
- studioMat.metallicRoughnessTexture = _this.getTextureObj(composition.textures, material.metallicRoughnessTexture);
3536
- studioMat.normalTexture = _this.getTextureObj(composition.textures, material.normalTexture);
3537
- studioMat.occlusionTexture = _this.getTextureObj(composition.textures, material.occlusionTexture);
3538
- studioMat.emissiveTexture = _this.getTextureObj(composition.textures, material.emissiveTexture);
3539
- } else {
3540
- var studioMat1 = studioPrim.material;
3541
- studioMat1.baseColorTexture = _this.getTextureObj(composition.textures, material.baseColorTexture);
3542
- }
3543
- });
3544
- if (skin !== undefined && skin.inverseBindMatrices !== undefined) {
3545
- var studioSkin = skin;
3546
- var inverseBindMatrices = typedArrayFromBinary(scene.bins, skin.inverseBindMatrices);
3547
- if (_instanceof1(inverseBindMatrices, Float32Array)) {
3548
- studioSkin.inverseBindMatrices = inverseBindMatrices;
3549
- } else {
3550
- console.error("setupItem3DOptions: Invalid inverseBindMatrices type, " + inverseBindMatrices + ".");
3551
- }
3552
- }
3553
- } else if (item.type === spec.ItemType.skybox) {
3554
- var skybox = item;
3555
- var studioSkybox = item;
3556
- var options = skybox.content.options;
3557
- var studioOptions = studioSkybox.content.options;
3558
- var specularImage = _this.getTextureObj(composition.textures, options.specularImage);
3559
- if (specularImage === undefined) {
3560
- console.error("setupItem3DOptions: skybox specualrImage is undefined, " + CheckerHelper.stringify(options) + ".");
3561
- }
3562
- studioOptions.specularImage = specularImage;
3563
- //
3564
- var diffuseImage = _this.getTextureObj(composition.textures, options.diffuseImage);
3565
- if (diffuseImage !== undefined) {
3566
- studioOptions.diffuseImage = diffuseImage;
3567
- }
3568
- }
3569
- });
3570
- });
3571
- };
3572
- /**
3573
3493
  * 创建几何体,根据几何参数描述 JSON 和数据数组
3574
3494
  * @param engine - 引擎
3575
3495
  * @param geomJson - 几何参数描述 JSON
@@ -9315,8 +9235,6 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
9315
9235
  var engine = composition.renderer.engine;
9316
9236
  this.cache = new CompositionCache(engine);
9317
9237
  this.cache.setup(false);
9318
- // FIXME: 先注释元素参数的配置
9319
- //PluginHelper.setupItem3DOptions(scene, this.cache, composition);
9320
9238
  };
9321
9239
  /**
9322
9240
  * 每次播放都会执行,包括重播,所以这里执行“小的销毁”和新的初始化
@@ -13272,7 +13190,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13272
13190
  registerPlugin("model", ModelPlugin, VFXItem);
13273
13191
  /**
13274
13192
  * 插件版本号
13275
- */ var version = "2.3.0-alpha.2";
13193
+ */ var version = "2.3.0-beta.0";
13276
13194
  logger.info("Plugin model version: " + version + ".");
13277
13195
  if (version !== EFFECTS.version) {
13278
13196
  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!");