@galacean/effects-plugin-model 2.2.4 → 2.2.6

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.2.4
6
+ * Version: v2.2.6
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -1299,7 +1299,6 @@ function GetNum2GLName(ctx) {
1299
1299
  */ _proto.update = function update(modelMatrix, viewProjMatrix, positions, lineColor) {
1300
1300
  var material = this.mesh.material;
1301
1301
  material.setMatrix("effects_ObjectToWorld", modelMatrix);
1302
- material.setMatrix("effects_MatrixVP", viewProjMatrix);
1303
1302
  for(var i = 0; i < positions.length; i += 3){
1304
1303
  material.setVector3("_PositionList[" + i / 3 + "]", Vector3.fromArray(positions, i));
1305
1304
  }
@@ -8634,7 +8633,6 @@ function _assert_this_initialized(self) {
8634
8633
  };
8635
8634
  _proto.updateUniformsByScene = function updateUniformsByScene(sceneStates) {
8636
8635
  var material = this.getEffectsMaterial();
8637
- material.setMatrix("effects_MatrixVP", sceneStates.viewProjectionMatrix);
8638
8636
  material.setVector3("_Camera", sceneStates.cameraPosition);
8639
8637
  //
8640
8638
  if (!this.isUnlitMaterial()) {
@@ -9522,6 +9520,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9522
9520
  * 组件初始化,初始化场景管理器并更新合成相机
9523
9521
  * @param sceneParams - 场景参数
9524
9522
  */ _proto.initial = function initial(sceneParams) {
9523
+ var _this_item_composition;
9525
9524
  var _sceneParams_runtimeEnv;
9526
9525
  this.runtimeEnv = (_sceneParams_runtimeEnv = sceneParams["runtimeEnv"]) != null ? _sceneParams_runtimeEnv : this.runtimeEnv;
9527
9526
  var _sceneParams_compatibleMode;
@@ -9539,6 +9538,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9539
9538
  var _sceneParams_renderMode3DUVGridSize;
9540
9539
  this.renderMode3DUVGridSize = (_sceneParams_renderMode3DUVGridSize = sceneParams["renderMode3DUVGridSize"]) != null ? _sceneParams_renderMode3DUVGridSize : this.renderMode3DUVGridSize;
9541
9540
  var component = this.item.composition;
9541
+ var _this_item_composition_items;
9542
9542
  this.scene.initial({
9543
9543
  componentName: "" + component.id,
9544
9544
  renderer: this.engine.renderer,
@@ -9551,7 +9551,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9551
9551
  renderMode3DUVGridSize: this.renderMode3DUVGridSize,
9552
9552
  renderSkybox: this.renderSkybox,
9553
9553
  lightItemCount: this.getLightItemCount(),
9554
- maxJointCount: this.getMaxJointCount()
9554
+ maxJointCount: this.getMaxJointCount((_this_item_composition_items = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.items) != null ? _this_item_composition_items : [])
9555
9555
  });
9556
9556
  this.updateSceneCamera(component);
9557
9557
  };
@@ -9575,11 +9575,9 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9575
9575
  });
9576
9576
  return lightItemCount;
9577
9577
  };
9578
- _proto.getMaxJointCount = function getMaxJointCount() {
9579
- var _this_item_composition;
9578
+ _proto.getMaxJointCount = function getMaxJointCount(items) {
9579
+ var _this = this;
9580
9580
  var maxJointCount = 0;
9581
- var _this_item_composition_items;
9582
- var items = (_this_item_composition_items = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.items) != null ? _this_item_composition_items : [];
9583
9581
  items.forEach(function(item) {
9584
9582
  var meshComp = item.getComponent(ModelMeshComponent);
9585
9583
  if (meshComp && meshComp.data) {
@@ -9591,6 +9589,9 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9591
9589
  }
9592
9590
  }
9593
9591
  }
9592
+ if (item.children.length !== 0) {
9593
+ maxJointCount = Math.max(_this.getMaxJointCount(item.children), maxJointCount);
9594
+ }
9594
9595
  });
9595
9596
  return maxJointCount;
9596
9597
  };
@@ -13271,7 +13272,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13271
13272
  registerPlugin("model", ModelPlugin, VFXItem);
13272
13273
  /**
13273
13274
  * 插件版本号
13274
- */ var version = "2.2.4";
13275
+ */ var version = "2.2.6";
13275
13276
  logger.info("Plugin model version: " + version + ".");
13276
13277
  if (version !== EFFECTS.version) {
13277
13278
  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!");