@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/weapp.mjs CHANGED
@@ -1291,7 +1291,6 @@ function GetNum2GLName(ctx) {
1291
1291
  */ _proto.update = function update(modelMatrix, viewProjMatrix, positions, lineColor) {
1292
1292
  var material = this.mesh.material;
1293
1293
  material.setMatrix("effects_ObjectToWorld", modelMatrix);
1294
- material.setMatrix("effects_MatrixVP", viewProjMatrix);
1295
1294
  for(var i = 0; i < positions.length; i += 3){
1296
1295
  material.setVector3("_PositionList[" + i / 3 + "]", Vector3.fromArray(positions, i));
1297
1296
  }
@@ -8626,7 +8625,6 @@ function _assert_this_initialized(self) {
8626
8625
  };
8627
8626
  _proto.updateUniformsByScene = function updateUniformsByScene(sceneStates) {
8628
8627
  var material = this.getEffectsMaterial();
8629
- material.setMatrix("effects_MatrixVP", sceneStates.viewProjectionMatrix);
8630
8628
  material.setVector3("_Camera", sceneStates.cameraPosition);
8631
8629
  //
8632
8630
  if (!this.isUnlitMaterial()) {
@@ -9514,6 +9512,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9514
9512
  * 组件初始化,初始化场景管理器并更新合成相机
9515
9513
  * @param sceneParams - 场景参数
9516
9514
  */ _proto.initial = function initial(sceneParams) {
9515
+ var _this_item_composition;
9517
9516
  var _sceneParams_runtimeEnv;
9518
9517
  this.runtimeEnv = (_sceneParams_runtimeEnv = sceneParams["runtimeEnv"]) != null ? _sceneParams_runtimeEnv : this.runtimeEnv;
9519
9518
  var _sceneParams_compatibleMode;
@@ -9531,6 +9530,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9531
9530
  var _sceneParams_renderMode3DUVGridSize;
9532
9531
  this.renderMode3DUVGridSize = (_sceneParams_renderMode3DUVGridSize = sceneParams["renderMode3DUVGridSize"]) != null ? _sceneParams_renderMode3DUVGridSize : this.renderMode3DUVGridSize;
9533
9532
  var component = this.item.composition;
9533
+ var _this_item_composition_items;
9534
9534
  this.scene.initial({
9535
9535
  componentName: "" + component.id,
9536
9536
  renderer: this.engine.renderer,
@@ -9543,7 +9543,7 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9543
9543
  renderMode3DUVGridSize: this.renderMode3DUVGridSize,
9544
9544
  renderSkybox: this.renderSkybox,
9545
9545
  lightItemCount: this.getLightItemCount(),
9546
- maxJointCount: this.getMaxJointCount()
9546
+ 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 : [])
9547
9547
  });
9548
9548
  this.updateSceneCamera(component);
9549
9549
  };
@@ -9567,11 +9567,9 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9567
9567
  });
9568
9568
  return lightItemCount;
9569
9569
  };
9570
- _proto.getMaxJointCount = function getMaxJointCount() {
9571
- var _this_item_composition;
9570
+ _proto.getMaxJointCount = function getMaxJointCount(items) {
9571
+ var _this = this;
9572
9572
  var maxJointCount = 0;
9573
- var _this_item_composition_items;
9574
- var items = (_this_item_composition_items = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.items) != null ? _this_item_composition_items : [];
9575
9573
  items.forEach(function(item) {
9576
9574
  var meshComp = item.getComponent(ModelMeshComponent);
9577
9575
  if (meshComp && meshComp.data) {
@@ -9583,6 +9581,9 @@ var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9583
9581
  }
9584
9582
  }
9585
9583
  }
9584
+ if (item.children.length !== 0) {
9585
+ maxJointCount = Math.max(_this.getMaxJointCount(item.children), maxJointCount);
9586
+ }
9586
9587
  });
9587
9588
  return maxJointCount;
9588
9589
  };
@@ -13263,7 +13264,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13263
13264
  registerPlugin("model", ModelPlugin, VFXItem);
13264
13265
  /**
13265
13266
  * 插件版本号
13266
- */ var version = "2.2.3";
13267
+ */ var version = "2.2.5";
13267
13268
  logger.info("Plugin model version: " + version + ".");
13268
13269
  if (version !== EFFECTS.version) {
13269
13270
  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!");