@galacean/effects-threejs 2.4.1-alpha.1 → 2.4.2

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 runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.4.1-alpha.1
6
+ * Version: v2.4.2
7
7
  */
8
8
 
9
9
  'use strict';
@@ -891,7 +891,7 @@ function unregisterPlugin(name) {
891
891
  removeItem(defaultPlugins, name);
892
892
  }
893
893
  var PluginSystem = /*#__PURE__*/ function() {
894
- function PluginSystem() {
894
+ function PluginSystem(pluginNames) {
895
895
  var loaders = {};
896
896
  var loaded = [];
897
897
  var addLoader = function(name) {
@@ -902,12 +902,15 @@ var PluginSystem = /*#__PURE__*/ function() {
902
902
  }
903
903
  };
904
904
  defaultPlugins.forEach(addLoader);
905
- this.plugins = Object.keys(loaders).map(function(name) {
906
- var CTRL = pluginLoaderMap[name];
907
- if (!CTRL) {
908
- throw new Error("The plugin '" + name + "' not found." + getPluginUsageInfo(name));
905
+ for(var _iterator = _create_for_of_iterator_helper_loose(pluginNames), _step; !(_step = _iterator()).done;){
906
+ var customPluginName = _step.value;
907
+ if (!pluginLoaderMap[customPluginName]) {
908
+ throw new Error("The plugin '" + customPluginName + "' not found." + getPluginUsageInfo(customPluginName));
909
909
  }
910
- var loader = new CTRL();
910
+ }
911
+ this.plugins = Object.keys(loaders).map(function(name) {
912
+ var pluginConstructor = pluginLoaderMap[name];
913
+ var loader = new pluginConstructor();
911
914
  loader.name = name;
912
915
  return loader;
913
916
  }).sort(function(a, b) {
@@ -7646,6 +7649,7 @@ exports.MaterialRenderType = void 0;
7646
7649
  var MaskProcessor = /*#__PURE__*/ function() {
7647
7650
  function MaskProcessor(engine) {
7648
7651
  this.engine = engine;
7652
+ this.maskable = null;
7649
7653
  this.stencilClearAction = {
7650
7654
  stencilAction: exports.TextureLoadAction.clear
7651
7655
  };
@@ -7662,7 +7666,9 @@ var MaskProcessor = /*#__PURE__*/ function() {
7662
7666
  maskMode = exports.MaskMode.MASK;
7663
7667
  } else if (mode === ObscuredMode.OBSCURED || mode === ObscuredMode.REVERSE_OBSCURED) {
7664
7668
  maskMode = mode === ObscuredMode.OBSCURED ? exports.MaskMode.OBSCURED : exports.MaskMode.REVERSE_OBSCURED;
7665
- this.maskable = ref;
7669
+ if (ref) {
7670
+ this.maskable = ref;
7671
+ }
7666
7672
  }
7667
7673
  }
7668
7674
  return maskMode;
@@ -12585,6 +12591,9 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
12585
12591
  /**
12586
12592
  * @internal
12587
12593
  */ _proto.drawStencilMask = function drawStencilMask(renderer) {
12594
+ if (!this.isActiveAndEnabled) {
12595
+ return;
12596
+ }
12588
12597
  var previousColorMask = this.material.colorMask;
12589
12598
  this.material.colorMask = false;
12590
12599
  this.draw(renderer);
@@ -27409,13 +27418,6 @@ var refCompositions = new Map();
27409
27418
  * 3.1 版本数据适配
27410
27419
  * - 富文本插件名称的适配
27411
27420
  */ function version31Migration(json) {
27412
- var // 修正老版本数据中,富文本插件名称的问题
27413
- _json_plugins;
27414
- (_json_plugins = json.plugins) == null ? void 0 : _json_plugins.forEach(function(plugin, index) {
27415
- if (plugin === "richtext") {
27416
- json.plugins[index] = "rich-text";
27417
- }
27418
- });
27419
27421
  // Custom shape fill 属性位置迁移
27420
27422
  for(var _iterator = _create_for_of_iterator_helper_loose(json.components), _step; !(_step = _iterator()).done;){
27421
27423
  var component = _step.value;
@@ -27483,6 +27485,13 @@ function version32Migration(json) {
27483
27485
  return json;
27484
27486
  }
27485
27487
  function version33Migration(json) {
27488
+ var // 修正老版本数据中,富文本插件名称的问题
27489
+ _json_plugins;
27490
+ (_json_plugins = json.plugins) == null ? void 0 : _json_plugins.forEach(function(plugin, index) {
27491
+ if (plugin === "richtext") {
27492
+ json.plugins[index] = "rich-text";
27493
+ }
27494
+ });
27486
27495
  // 老 shape 数据兼容
27487
27496
  for(var _iterator = _create_for_of_iterator_helper_loose(json.items), _step; !(_step = _iterator()).done;){
27488
27497
  var item = _step.value;
@@ -29093,12 +29102,13 @@ var seed$1 = 1;
29093
29102
  _proto.processJSON = function processJSON(json) {
29094
29103
  var _this = this;
29095
29104
  return _async_to_generator(function() {
29096
- var jsonScene, pluginSystem;
29105
+ var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
29097
29106
  return __generator(this, function(_state) {
29098
29107
  switch(_state.label){
29099
29108
  case 0:
29100
29109
  jsonScene = getStandardJSON(json);
29101
- pluginSystem = new PluginSystem();
29110
+ _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
29111
+ pluginSystem = new PluginSystem(plugins);
29102
29112
  return [
29103
29113
  4,
29104
29114
  pluginSystem.processRawJSON(jsonScene, _this.options)
@@ -31649,7 +31659,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
31649
31659
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
31650
31660
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
31651
31661
  registerPlugin("interact", InteractLoader, exports.VFXItem);
31652
- var version$1 = "2.4.1-alpha.1";
31662
+ var version$1 = "2.4.2";
31653
31663
  logger.info("Core version: " + version$1 + ".");
31654
31664
 
31655
31665
  var _obj;
@@ -33251,7 +33261,7 @@ setMaxSpriteMeshItemCount(8);
33251
33261
  */ Mesh.create = function(engine, props) {
33252
33262
  return new ThreeMesh(engine, props);
33253
33263
  };
33254
- var version = "2.4.1-alpha.1";
33264
+ var version = "2.4.2";
33255
33265
  logger.info("THREEJS plugin version: " + version + ".");
33256
33266
 
33257
33267
  exports.AbstractPlugin = AbstractPlugin;