@galacean/effects-plugin-model 2.8.9 → 2.9.0-alpha.1

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.js 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.8.9
6
+ * Version: v2.9.0-alpha.1
7
7
  */
8
8
 
9
9
  'use strict';
@@ -1844,6 +1844,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
1844
1844
  /**
1845
1845
  * morph 动画权重
1846
1846
  */ _this.morphWeights = [];
1847
+ _this.firstUpdate = true;
1847
1848
  /**
1848
1849
  * 获取点击测试参数,根据元素包围盒进行相交测试,Mesh 对象会进行更加精确的点击测试
1849
1850
  * @param force - 是否强制进行点击测试
@@ -1921,6 +1922,12 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
1921
1922
  */ _proto.onUpdate = function onUpdate(dt) {
1922
1923
  if (this.sceneManager) {
1923
1924
  this.content.build(this.sceneManager);
1925
+ if (this.firstUpdate) {
1926
+ this.materials = this.content.subMeshes.map(function(subMesh) {
1927
+ return subMesh.getEffectsMaterial();
1928
+ });
1929
+ this.firstUpdate = false;
1930
+ }
1924
1931
  }
1925
1932
  this.content.update();
1926
1933
  };
@@ -1938,6 +1945,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
1938
1945
  if (!this.getVisible() || !this.sceneManager) {
1939
1946
  return;
1940
1947
  }
1948
+ this.maskManager.drawStencilMask(renderer, this);
1941
1949
  this.content.render(this.sceneManager, renderer);
1942
1950
  };
1943
1951
  /**
@@ -2042,6 +2050,11 @@ exports.ModelSkyboxComponent = /*#__PURE__*/ function(RendererComponent) {
2042
2050
  this.sceneManager = getSceneManager(this);
2043
2051
  (_this_sceneManager = this.sceneManager) == null ? void 0 : _this_sceneManager.addItem(this.content);
2044
2052
  this.setVisible(true);
2053
+ if (this.content.skyboxMesh) {
2054
+ this.materials = [
2055
+ this.content.skyboxMesh.material
2056
+ ];
2057
+ }
2045
2058
  };
2046
2059
  /**
2047
2060
  * 组件渲染,需要检查可见性
@@ -2051,6 +2064,7 @@ exports.ModelSkyboxComponent = /*#__PURE__*/ function(RendererComponent) {
2051
2064
  if (!this.getVisible() || !this.sceneManager) {
2052
2065
  return;
2053
2066
  }
2067
+ this.maskManager.drawStencilMask(renderer, this);
2054
2068
  this.content.render(this.sceneManager, renderer);
2055
2069
  };
2056
2070
  /**
@@ -9340,7 +9354,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
9340
9354
  duration: 9999999,
9341
9355
  endBehavior: EFFECTS.spec.END_BEHAVIOR_FORWARD
9342
9356
  };
9343
- var item = new EFFECTS.VFXItem(composition.getEngine(), props);
9357
+ var item = new EFFECTS.VFXItem(composition.engine, props);
9344
9358
  composition.addItem(item);
9345
9359
  var modelPluginComponent = item.addComponent(exports.ModelPluginComponent);
9346
9360
  modelPluginComponent.sceneParams = scene.storage;
@@ -13197,7 +13211,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13197
13211
  EFFECTS.registerPlugin("model", ModelPlugin);
13198
13212
  /**
13199
13213
  * 插件版本号
13200
- */ var version = "2.8.9";
13214
+ */ var version = "2.9.0-alpha.1";
13201
13215
  EFFECTS.logger.info("Plugin model version: " + version + ".");
13202
13216
  if (version !== EFFECTS__namespace.version) {
13203
13217
  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!");