@galacean/effects-plugin-model 2.2.3 → 2.2.5

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/alipay.js CHANGED
@@ -1314,7 +1314,6 @@ function GetNum2GLName(ctx) {
1314
1314
  */ _proto.update = function update(modelMatrix, viewProjMatrix, positions, lineColor) {
1315
1315
  var material = this.mesh.material;
1316
1316
  material.setMatrix("effects_ObjectToWorld", modelMatrix);
1317
- material.setMatrix("effects_MatrixVP", viewProjMatrix);
1318
1317
  for(var i = 0; i < positions.length; i += 3){
1319
1318
  material.setVector3("_PositionList[" + i / 3 + "]", Vector3.fromArray(positions, i));
1320
1319
  }
@@ -8649,7 +8648,6 @@ function _assert_this_initialized(self) {
8649
8648
  };
8650
8649
  _proto.updateUniformsByScene = function updateUniformsByScene(sceneStates) {
8651
8650
  var material = this.getEffectsMaterial();
8652
- material.setMatrix("effects_MatrixVP", sceneStates.viewProjectionMatrix);
8653
8651
  material.setVector3("_Camera", sceneStates.cameraPosition);
8654
8652
  //
8655
8653
  if (!this.isUnlitMaterial()) {
@@ -9537,6 +9535,7 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9537
9535
  * 组件初始化,初始化场景管理器并更新合成相机
9538
9536
  * @param sceneParams - 场景参数
9539
9537
  */ _proto.initial = function initial(sceneParams) {
9538
+ var _this_item_composition;
9540
9539
  var _sceneParams_runtimeEnv;
9541
9540
  this.runtimeEnv = (_sceneParams_runtimeEnv = sceneParams["runtimeEnv"]) != null ? _sceneParams_runtimeEnv : this.runtimeEnv;
9542
9541
  var _sceneParams_compatibleMode;
@@ -9554,6 +9553,7 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9554
9553
  var _sceneParams_renderMode3DUVGridSize;
9555
9554
  this.renderMode3DUVGridSize = (_sceneParams_renderMode3DUVGridSize = sceneParams["renderMode3DUVGridSize"]) != null ? _sceneParams_renderMode3DUVGridSize : this.renderMode3DUVGridSize;
9556
9555
  var component = this.item.composition;
9556
+ var _this_item_composition_items;
9557
9557
  this.scene.initial({
9558
9558
  componentName: "" + component.id,
9559
9559
  renderer: this.engine.renderer,
@@ -9566,7 +9566,7 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9566
9566
  renderMode3DUVGridSize: this.renderMode3DUVGridSize,
9567
9567
  renderSkybox: this.renderSkybox,
9568
9568
  lightItemCount: this.getLightItemCount(),
9569
- maxJointCount: this.getMaxJointCount()
9569
+ 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 : [])
9570
9570
  });
9571
9571
  this.updateSceneCamera(component);
9572
9572
  };
@@ -9590,11 +9590,9 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9590
9590
  });
9591
9591
  return lightItemCount;
9592
9592
  };
9593
- _proto.getMaxJointCount = function getMaxJointCount() {
9594
- var _this_item_composition;
9593
+ _proto.getMaxJointCount = function getMaxJointCount(items) {
9594
+ var _this = this;
9595
9595
  var maxJointCount = 0;
9596
- var _this_item_composition_items;
9597
- var items = (_this_item_composition_items = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.items) != null ? _this_item_composition_items : [];
9598
9596
  items.forEach(function(item) {
9599
9597
  var meshComp = item.getComponent(exports.ModelMeshComponent);
9600
9598
  if (meshComp && meshComp.data) {
@@ -9606,6 +9604,9 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9606
9604
  }
9607
9605
  }
9608
9606
  }
9607
+ if (item.children.length !== 0) {
9608
+ maxJointCount = Math.max(_this.getMaxJointCount(item.children), maxJointCount);
9609
+ }
9609
9610
  });
9610
9611
  return maxJointCount;
9611
9612
  };
@@ -13286,7 +13287,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13286
13287
  EFFECTS.registerPlugin("model", ModelPlugin, EFFECTS.VFXItem);
13287
13288
  /**
13288
13289
  * 插件版本号
13289
- */ var version = "2.2.3";
13290
+ */ var version = "2.2.5";
13290
13291
  EFFECTS.logger.info("Plugin model version: " + version + ".");
13291
13292
  if (version !== EFFECTS__namespace.version) {
13292
13293
  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!");