@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/loader.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';
@@ -972,7 +972,6 @@ var objectIndex = 1;
972
972
  */ _proto.update = function update(modelMatrix, viewProjMatrix, positions, lineColor) {
973
973
  var material = this.mesh.material;
974
974
  material.setMatrix("effects_ObjectToWorld", modelMatrix);
975
- material.setMatrix("effects_MatrixVP", viewProjMatrix);
976
975
  for(var i = 0; i < positions.length; i += 3){
977
976
  material.setVector3("_PositionList[" + i / 3 + "]", Vector3.fromArray(positions, i));
978
977
  }
@@ -1576,6 +1575,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
1576
1575
  * 组件初始化,初始化场景管理器并更新合成相机
1577
1576
  * @param sceneParams - 场景参数
1578
1577
  */ _proto.initial = function initial(sceneParams) {
1578
+ var _this_item_composition;
1579
1579
  var _sceneParams_runtimeEnv;
1580
1580
  this.runtimeEnv = (_sceneParams_runtimeEnv = sceneParams["runtimeEnv"]) != null ? _sceneParams_runtimeEnv : this.runtimeEnv;
1581
1581
  var _sceneParams_compatibleMode;
@@ -1593,6 +1593,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
1593
1593
  var _sceneParams_renderMode3DUVGridSize;
1594
1594
  this.renderMode3DUVGridSize = (_sceneParams_renderMode3DUVGridSize = sceneParams["renderMode3DUVGridSize"]) != null ? _sceneParams_renderMode3DUVGridSize : this.renderMode3DUVGridSize;
1595
1595
  var component = this.item.composition;
1596
+ var _this_item_composition_items;
1596
1597
  this.scene.initial({
1597
1598
  componentName: "" + component.id,
1598
1599
  renderer: this.engine.renderer,
@@ -1605,7 +1606,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
1605
1606
  renderMode3DUVGridSize: this.renderMode3DUVGridSize,
1606
1607
  renderSkybox: this.renderSkybox,
1607
1608
  lightItemCount: this.getLightItemCount(),
1608
- maxJointCount: this.getMaxJointCount()
1609
+ 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 : [])
1609
1610
  });
1610
1611
  this.updateSceneCamera(component);
1611
1612
  };
@@ -1629,11 +1630,9 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
1629
1630
  });
1630
1631
  return lightItemCount;
1631
1632
  };
1632
- _proto.getMaxJointCount = function getMaxJointCount() {
1633
- var _this_item_composition;
1633
+ _proto.getMaxJointCount = function getMaxJointCount(items) {
1634
+ var _this = this;
1634
1635
  var maxJointCount = 0;
1635
- var _this_item_composition_items;
1636
- var items = (_this_item_composition_items = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.items) != null ? _this_item_composition_items : [];
1637
1636
  items.forEach(function(item) {
1638
1637
  var meshComp = item.getComponent(ModelMeshComponent);
1639
1638
  if (meshComp && meshComp.data) {
@@ -1645,6 +1644,9 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
1645
1644
  }
1646
1645
  }
1647
1646
  }
1647
+ if (item.children.length !== 0) {
1648
+ maxJointCount = Math.max(_this.getMaxJointCount(item.children), maxJointCount);
1649
+ }
1648
1650
  });
1649
1651
  return maxJointCount;
1650
1652
  };
@@ -2096,7 +2098,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
2096
2098
  registerPlugin("model", ModelPlugin, VFXItem);
2097
2099
  /**
2098
2100
  * 插件版本号
2099
- */ var version = "2.2.4";
2101
+ */ var version = "2.2.6";
2100
2102
  logger.info("Plugin model version: " + version + ".");
2101
2103
  if (version !== EFFECTS.version) {
2102
2104
  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!");
@@ -8889,7 +8891,6 @@ function _assert_this_initialized(self) {
8889
8891
  };
8890
8892
  _proto.updateUniformsByScene = function updateUniformsByScene(sceneStates) {
8891
8893
  var material = this.getEffectsMaterial();
8892
- material.setMatrix("effects_MatrixVP", sceneStates.viewProjectionMatrix);
8893
8894
  material.setVector3("_Camera", sceneStates.cameraPosition);
8894
8895
  //
8895
8896
  if (!this.isUnlitMaterial()) {