three-stdlib 2.8.9 → 2.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (318) hide show
  1. package/Nodes-607e9ed8.js +471 -0
  2. package/Nodes-627a8bdf.js +1 -0
  3. package/index.cjs.js +1 -1
  4. package/index.d.ts +0 -75
  5. package/index.js +70 -76
  6. package/loaders/NodeMaterialLoader.cjs.js +1 -1
  7. package/loaders/NodeMaterialLoader.js +2 -136
  8. package/nodes/Nodes.cjs.js +1 -1
  9. package/nodes/Nodes.js +203 -76
  10. package/nodes/ShaderNode.cjs.js +1 -0
  11. package/nodes/ShaderNode.js +308 -0
  12. package/nodes/accessors/BufferNode.cjs.js +1 -0
  13. package/nodes/accessors/BufferNode.js +18 -0
  14. package/nodes/accessors/CameraNode.cjs.js +1 -1
  15. package/nodes/accessors/CameraNode.js +32 -138
  16. package/nodes/accessors/CubeTextureNode.cjs.js +1 -0
  17. package/nodes/accessors/CubeTextureNode.js +53 -0
  18. package/nodes/accessors/MaterialNode.cjs.js +1 -0
  19. package/nodes/accessors/MaterialNode.js +80 -0
  20. package/nodes/accessors/MaterialReferenceNode.cjs.js +1 -0
  21. package/nodes/accessors/MaterialReferenceNode.js +16 -0
  22. package/nodes/accessors/ModelNode.cjs.js +1 -0
  23. package/nodes/accessors/ModelNode.js +10 -0
  24. package/nodes/accessors/ModelViewProjectionNode.cjs.js +1 -0
  25. package/nodes/accessors/ModelViewProjectionNode.js +22 -0
  26. package/nodes/accessors/NormalNode.cjs.js +1 -1
  27. package/nodes/accessors/NormalNode.js +48 -78
  28. package/nodes/accessors/Object3DNode.cjs.js +1 -0
  29. package/nodes/accessors/Object3DNode.js +85 -0
  30. package/nodes/accessors/PointUVNode.cjs.js +1 -0
  31. package/nodes/accessors/PointUVNode.js +16 -0
  32. package/nodes/accessors/PositionNode.cjs.js +1 -1
  33. package/nodes/accessors/PositionNode.js +49 -87
  34. package/nodes/accessors/ReferenceNode.cjs.js +1 -0
  35. package/nodes/accessors/ReferenceNode.js +43 -0
  36. package/nodes/accessors/ReflectNode.cjs.js +1 -1
  37. package/nodes/accessors/ReflectNode.js +35 -98
  38. package/nodes/accessors/SkinningNode.cjs.js +1 -0
  39. package/nodes/accessors/SkinningNode.js +59 -0
  40. package/nodes/accessors/TextureNode.cjs.js +1 -0
  41. package/nodes/accessors/TextureNode.js +68 -0
  42. package/nodes/accessors/UVNode.cjs.js +1 -1
  43. package/nodes/accessors/UVNode.js +20 -38
  44. package/nodes/core/ArrayUniformNode.cjs.js +1 -0
  45. package/nodes/core/ArrayUniformNode.js +17 -0
  46. package/nodes/core/AttributeNode.cjs.js +1 -1
  47. package/nodes/core/AttributeNode.js +31 -40
  48. package/nodes/core/BypassNode.cjs.js +1 -0
  49. package/nodes/core/BypassNode.js +28 -0
  50. package/nodes/core/CodeNode.cjs.js +1 -0
  51. package/nodes/core/CodeNode.js +35 -0
  52. package/nodes/core/ConstNode.cjs.js +1 -1
  53. package/nodes/core/ConstNode.js +10 -78
  54. package/nodes/core/ContextNode.cjs.js +1 -0
  55. package/nodes/core/ContextNode.js +26 -0
  56. package/nodes/core/ExpressionNode.cjs.js +1 -1
  57. package/nodes/core/ExpressionNode.js +19 -8
  58. package/nodes/core/FunctionCallNode.cjs.js +1 -1
  59. package/nodes/core/FunctionCallNode.js +31 -60
  60. package/nodes/core/FunctionNode.cjs.js +1 -1
  61. package/nodes/core/FunctionNode.js +45 -166
  62. package/nodes/core/InputNode.cjs.js +1 -1
  63. package/nodes/core/InputNode.js +43 -57
  64. package/nodes/core/Node.cjs.js +1 -1
  65. package/nodes/core/Node.js +155 -113
  66. package/nodes/core/NodeAttribute.cjs.js +1 -0
  67. package/nodes/core/NodeAttribute.js +11 -0
  68. package/nodes/core/NodeBuilder.cjs.js +1 -1
  69. package/nodes/core/NodeBuilder.js +422 -548
  70. package/nodes/core/NodeCode.cjs.js +1 -0
  71. package/nodes/core/NodeCode.js +13 -0
  72. package/nodes/core/NodeFrame.cjs.js +1 -1
  73. package/nodes/core/NodeFrame.js +34 -27
  74. package/nodes/core/NodeFunction.cjs.js +1 -0
  75. package/nodes/core/NodeFunction.js +17 -0
  76. package/nodes/core/NodeFunctionInput.cjs.js +1 -0
  77. package/nodes/core/NodeFunctionInput.js +14 -0
  78. package/nodes/core/NodeKeywords.cjs.js +1 -0
  79. package/nodes/core/NodeKeywords.js +54 -0
  80. package/nodes/core/NodeParser.cjs.js +1 -0
  81. package/nodes/core/NodeParser.js +8 -0
  82. package/nodes/core/NodeUniform.cjs.js +1 -1
  83. package/nodes/core/NodeUniform.js +18 -17
  84. package/nodes/core/NodeUtils.cjs.js +1 -1
  85. package/nodes/core/NodeUtils.js +55 -35
  86. package/nodes/core/NodeVar.cjs.js +1 -0
  87. package/nodes/core/NodeVar.js +11 -0
  88. package/nodes/core/NodeVary.cjs.js +1 -0
  89. package/nodes/core/NodeVary.js +11 -0
  90. package/nodes/core/PropertyNode.cjs.js +1 -0
  91. package/nodes/core/PropertyNode.js +26 -0
  92. package/nodes/core/TempNode.cjs.js +1 -1
  93. package/nodes/core/TempNode.js +21 -88
  94. package/nodes/core/UniformNode.cjs.js +1 -0
  95. package/nodes/core/UniformNode.js +28 -0
  96. package/nodes/core/VarNode.cjs.js +1 -1
  97. package/nodes/core/VarNode.js +28 -35
  98. package/nodes/core/VaryNode.cjs.js +1 -0
  99. package/nodes/core/VaryNode.js +38 -0
  100. package/nodes/core/constants.cjs.js +1 -0
  101. package/nodes/core/constants.js +11 -0
  102. package/nodes/display/ColorSpaceNode.cjs.js +1 -0
  103. package/nodes/display/ColorSpaceNode.js +67 -0
  104. package/nodes/display/NormalMapNode.cjs.js +1 -0
  105. package/nodes/display/NormalMapNode.js +71 -0
  106. package/nodes/fog/FogNode.cjs.js +1 -0
  107. package/nodes/fog/FogNode.js +18 -0
  108. package/nodes/fog/FogRangeNode.cjs.js +1 -0
  109. package/nodes/fog/FogRangeNode.js +20 -0
  110. package/nodes/functions/BSDFs.cjs.js +1 -0
  111. package/nodes/functions/BSDFs.js +121 -0
  112. package/nodes/functions/PhysicalMaterialFunctions.cjs.js +1 -0
  113. package/nodes/functions/PhysicalMaterialFunctions.js +57 -0
  114. package/nodes/lights/LightContextNode.cjs.js +1 -0
  115. package/nodes/lights/LightContextNode.js +43 -0
  116. package/nodes/lights/LightNode.cjs.js +1 -0
  117. package/nodes/lights/LightNode.js +61 -0
  118. package/nodes/lights/LightsNode.cjs.js +1 -0
  119. package/nodes/lights/LightsNode.js +77 -0
  120. package/nodes/loaders/NodeLoader.cjs.js +1 -0
  121. package/nodes/loaders/NodeLoader.js +80 -0
  122. package/nodes/loaders/NodeMaterialLoader.cjs.js +1 -0
  123. package/nodes/loaders/NodeMaterialLoader.js +29 -0
  124. package/nodes/loaders/NodeObjectLoader.cjs.js +1 -0
  125. package/nodes/loaders/NodeObjectLoader.js +49 -0
  126. package/nodes/materials/LineBasicNodeMaterial.cjs.js +1 -0
  127. package/nodes/materials/LineBasicNodeMaterial.js +31 -0
  128. package/nodes/materials/Materials.cjs.js +1 -0
  129. package/nodes/materials/Materials.js +27 -0
  130. package/nodes/materials/MeshBasicNodeMaterial.cjs.js +1 -0
  131. package/nodes/materials/MeshBasicNodeMaterial.js +32 -0
  132. package/nodes/materials/MeshStandardNodeMaterial.cjs.js +1 -1
  133. package/nodes/materials/MeshStandardNodeMaterial.js +41 -13
  134. package/nodes/materials/NodeMaterial.cjs.js +1 -1
  135. package/nodes/materials/NodeMaterial.js +67 -140
  136. package/nodes/materials/PointsNodeMaterial.cjs.js +1 -0
  137. package/nodes/materials/PointsNodeMaterial.js +34 -0
  138. package/nodes/math/CondNode.cjs.js +1 -1
  139. package/nodes/math/CondNode.js +33 -74
  140. package/nodes/math/MathNode.cjs.js +1 -1
  141. package/nodes/math/MathNode.js +193 -193
  142. package/nodes/math/OperatorNode.cjs.js +1 -1
  143. package/nodes/math/OperatorNode.js +116 -52
  144. package/nodes/parsers/GLSLNodeFunction.cjs.js +1 -0
  145. package/nodes/parsers/GLSLNodeFunction.js +101 -0
  146. package/nodes/parsers/GLSLNodeParser.cjs.js +1 -0
  147. package/nodes/parsers/GLSLNodeParser.js +13 -0
  148. package/nodes/parsers/WGSLNodeFunction.cjs.js +1 -0
  149. package/nodes/parsers/WGSLNodeFunction.js +71 -0
  150. package/nodes/parsers/WGSLNodeParser.cjs.js +1 -0
  151. package/nodes/parsers/WGSLNodeParser.js +13 -0
  152. package/nodes/procedural/CheckerNode.cjs.js +1 -1
  153. package/nodes/procedural/CheckerNode.js +22 -40
  154. package/nodes/utils/ArrayElementNode.cjs.js +1 -0
  155. package/nodes/utils/ArrayElementNode.js +22 -0
  156. package/nodes/utils/ConvertNode.cjs.js +1 -0
  157. package/nodes/utils/ConvertNode.js +29 -0
  158. package/nodes/utils/JoinNode.cjs.js +1 -1
  159. package/nodes/utils/JoinNode.js +19 -69
  160. package/nodes/utils/MatcapUVNode.cjs.js +1 -0
  161. package/nodes/utils/MatcapUVNode.js +18 -0
  162. package/nodes/utils/OscNode.cjs.js +1 -0
  163. package/nodes/utils/OscNode.js +55 -0
  164. package/nodes/utils/SplitNode.cjs.js +1 -0
  165. package/nodes/utils/SplitNode.js +58 -0
  166. package/nodes/utils/SpriteSheetUVNode.cjs.js +1 -0
  167. package/nodes/utils/SpriteSheetUVNode.js +39 -0
  168. package/nodes/utils/TimerNode.cjs.js +1 -1
  169. package/nodes/utils/TimerNode.js +38 -56
  170. package/package.json +1 -1
  171. package/Nodes-894ac9dc.js +0 -1
  172. package/Nodes-af575af7.js +0 -157
  173. package/nodes/accessors/ColorsNode.cjs.js +0 -1
  174. package/nodes/accessors/ColorsNode.d.ts +0 -10
  175. package/nodes/accessors/ColorsNode.js +0 -40
  176. package/nodes/accessors/LightNode.cjs.js +0 -1
  177. package/nodes/accessors/LightNode.d.ts +0 -12
  178. package/nodes/accessors/LightNode.js +0 -41
  179. package/nodes/accessors/ResolutionNode.cjs.js +0 -1
  180. package/nodes/accessors/ResolutionNode.d.ts +0 -14
  181. package/nodes/accessors/ResolutionNode.js +0 -41
  182. package/nodes/accessors/ScreenUVNode.cjs.js +0 -1
  183. package/nodes/accessors/ScreenUVNode.d.ts +0 -11
  184. package/nodes/accessors/ScreenUVNode.js +0 -43
  185. package/nodes/core/NodeLib.cjs.js +0 -1
  186. package/nodes/core/NodeLib.d.ts +0 -22
  187. package/nodes/core/NodeLib.js +0 -37
  188. package/nodes/core/StructNode.cjs.js +0 -1
  189. package/nodes/core/StructNode.d.ts +0 -19
  190. package/nodes/core/StructNode.js +0 -72
  191. package/nodes/effects/BlurNode.cjs.js +0 -1
  192. package/nodes/effects/BlurNode.d.ts +0 -31
  193. package/nodes/effects/BlurNode.js +0 -100
  194. package/nodes/effects/ColorAdjustmentNode.cjs.js +0 -1
  195. package/nodes/effects/ColorAdjustmentNode.d.ts +0 -27
  196. package/nodes/effects/ColorAdjustmentNode.js +0 -73
  197. package/nodes/effects/LuminanceNode.cjs.js +0 -1
  198. package/nodes/effects/LuminanceNode.d.ts +0 -18
  199. package/nodes/effects/LuminanceNode.js +0 -46
  200. package/nodes/inputs/BoolNode.cjs.js +0 -1
  201. package/nodes/inputs/BoolNode.d.ts +0 -19
  202. package/nodes/inputs/BoolNode.js +0 -36
  203. package/nodes/inputs/ColorNode.cjs.js +0 -1
  204. package/nodes/inputs/ColorNode.d.ts +0 -21
  205. package/nodes/inputs/ColorNode.js +0 -41
  206. package/nodes/inputs/CubeTextureNode.cjs.js +0 -1
  207. package/nodes/inputs/CubeTextureNode.d.ts +0 -17
  208. package/nodes/inputs/CubeTextureNode.js +0 -79
  209. package/nodes/inputs/FloatNode.cjs.js +0 -1
  210. package/nodes/inputs/FloatNode.d.ts +0 -19
  211. package/nodes/inputs/FloatNode.js +0 -36
  212. package/nodes/inputs/IntNode.cjs.js +0 -1
  213. package/nodes/inputs/IntNode.d.ts +0 -19
  214. package/nodes/inputs/IntNode.js +0 -36
  215. package/nodes/inputs/Matrix3Node.cjs.js +0 -1
  216. package/nodes/inputs/Matrix3Node.d.ts +0 -22
  217. package/nodes/inputs/Matrix3Node.js +0 -46
  218. package/nodes/inputs/Matrix4Node.cjs.js +0 -1
  219. package/nodes/inputs/Matrix4Node.d.ts +0 -22
  220. package/nodes/inputs/Matrix4Node.js +0 -46
  221. package/nodes/inputs/PropertyNode.cjs.js +0 -1
  222. package/nodes/inputs/PropertyNode.d.ts +0 -10
  223. package/nodes/inputs/PropertyNode.js +0 -35
  224. package/nodes/inputs/RTTNode.cjs.js +0 -1
  225. package/nodes/inputs/RTTNode.d.ts +0 -27
  226. package/nodes/inputs/RTTNode.js +0 -103
  227. package/nodes/inputs/ReflectorNode.cjs.js +0 -1
  228. package/nodes/inputs/ReflectorNode.d.ts +0 -21
  229. package/nodes/inputs/ReflectorNode.js +0 -60
  230. package/nodes/inputs/ScreenNode.cjs.js +0 -1
  231. package/nodes/inputs/ScreenNode.d.ts +0 -11
  232. package/nodes/inputs/ScreenNode.js +0 -20
  233. package/nodes/inputs/TextureNode.cjs.js +0 -1
  234. package/nodes/inputs/TextureNode.d.ts +0 -20
  235. package/nodes/inputs/TextureNode.js +0 -83
  236. package/nodes/inputs/Vector2Node.cjs.js +0 -1
  237. package/nodes/inputs/Vector2Node.d.ts +0 -21
  238. package/nodes/inputs/Vector2Node.js +0 -40
  239. package/nodes/inputs/Vector3Node.cjs.js +0 -1
  240. package/nodes/inputs/Vector3Node.d.ts +0 -21
  241. package/nodes/inputs/Vector3Node.js +0 -41
  242. package/nodes/inputs/Vector4Node.cjs.js +0 -1
  243. package/nodes/inputs/Vector4Node.d.ts +0 -21
  244. package/nodes/inputs/Vector4Node.js +0 -42
  245. package/nodes/materials/BasicNodeMaterial.cjs.js +0 -1
  246. package/nodes/materials/BasicNodeMaterial.d.ts +0 -11
  247. package/nodes/materials/BasicNodeMaterial.js +0 -15
  248. package/nodes/materials/PhongNodeMaterial.cjs.js +0 -1
  249. package/nodes/materials/PhongNodeMaterial.d.ts +0 -21
  250. package/nodes/materials/PhongNodeMaterial.js +0 -15
  251. package/nodes/materials/SpriteNodeMaterial.cjs.js +0 -1
  252. package/nodes/materials/SpriteNodeMaterial.d.ts +0 -12
  253. package/nodes/materials/SpriteNodeMaterial.js +0 -15
  254. package/nodes/materials/StandardNodeMaterial.cjs.js +0 -1
  255. package/nodes/materials/StandardNodeMaterial.d.ts +0 -25
  256. package/nodes/materials/StandardNodeMaterial.js +0 -15
  257. package/nodes/materials/nodes/BasicNode.cjs.js +0 -1
  258. package/nodes/materials/nodes/BasicNode.d.ts +0 -15
  259. package/nodes/materials/nodes/BasicNode.js +0 -91
  260. package/nodes/materials/nodes/MeshStandardNode.cjs.js +0 -1
  261. package/nodes/materials/nodes/MeshStandardNode.d.ts +0 -25
  262. package/nodes/materials/nodes/MeshStandardNode.js +0 -81
  263. package/nodes/materials/nodes/PhongNode.cjs.js +0 -1
  264. package/nodes/materials/nodes/PhongNode.d.ts +0 -14
  265. package/nodes/materials/nodes/PhongNode.js +0 -212
  266. package/nodes/materials/nodes/RawNode.cjs.js +0 -1
  267. package/nodes/materials/nodes/RawNode.d.ts +0 -10
  268. package/nodes/materials/nodes/RawNode.js +0 -42
  269. package/nodes/materials/nodes/SpriteNode.cjs.js +0 -1
  270. package/nodes/materials/nodes/SpriteNode.d.ts +0 -13
  271. package/nodes/materials/nodes/SpriteNode.js +0 -113
  272. package/nodes/materials/nodes/StandardNode.cjs.js +0 -1
  273. package/nodes/materials/nodes/StandardNode.d.ts +0 -15
  274. package/nodes/materials/nodes/StandardNode.js +0 -336
  275. package/nodes/misc/BumpMapNode.cjs.js +0 -1
  276. package/nodes/misc/BumpMapNode.d.ts +0 -21
  277. package/nodes/misc/BumpMapNode.js +0 -80
  278. package/nodes/misc/NormalMapNode.cjs.js +0 -1
  279. package/nodes/misc/NormalMapNode.d.ts +0 -19
  280. package/nodes/misc/NormalMapNode.js +0 -102
  281. package/nodes/misc/TextureCubeNode.cjs.js +0 -1
  282. package/nodes/misc/TextureCubeNode.d.ts +0 -21
  283. package/nodes/misc/TextureCubeNode.js +0 -52
  284. package/nodes/misc/TextureCubeUVNode.cjs.js +0 -1
  285. package/nodes/misc/TextureCubeUVNode.d.ts +0 -18
  286. package/nodes/misc/TextureCubeUVNode.js +0 -229
  287. package/nodes/postprocessing/NodePass.cjs.js +0 -1
  288. package/nodes/postprocessing/NodePass.d.ts +0 -15
  289. package/nodes/postprocessing/NodePass.js +0 -61
  290. package/nodes/postprocessing/NodePostProcessing.cjs.js +0 -1
  291. package/nodes/postprocessing/NodePostProcessing.d.ts +0 -26
  292. package/nodes/postprocessing/NodePostProcessing.js +0 -91
  293. package/nodes/procedural/NoiseNode.cjs.js +0 -1
  294. package/nodes/procedural/NoiseNode.d.ts +0 -17
  295. package/nodes/procedural/NoiseNode.js +0 -43
  296. package/nodes/utils/BypassNode.cjs.js +0 -1
  297. package/nodes/utils/BypassNode.d.ts +0 -11
  298. package/nodes/utils/BypassNode.js +0 -55
  299. package/nodes/utils/ColorSpaceNode.cjs.js +0 -1
  300. package/nodes/utils/ColorSpaceNode.d.ts +0 -55
  301. package/nodes/utils/ColorSpaceNode.js +0 -106
  302. package/nodes/utils/MaxMIPLevelNode.cjs.js +0 -1
  303. package/nodes/utils/MaxMIPLevelNode.d.ts +0 -11
  304. package/nodes/utils/MaxMIPLevelNode.js +0 -38
  305. package/nodes/utils/SpecularMIPLevelNode.cjs.js +0 -1
  306. package/nodes/utils/SpecularMIPLevelNode.d.ts +0 -17
  307. package/nodes/utils/SpecularMIPLevelNode.js +0 -61
  308. package/nodes/utils/SubSlotNode.cjs.js +0 -1
  309. package/nodes/utils/SubSlotNode.js +0 -53
  310. package/nodes/utils/SwitchNode.cjs.js +0 -1
  311. package/nodes/utils/SwitchNode.d.ts +0 -11
  312. package/nodes/utils/SwitchNode.js +0 -69
  313. package/nodes/utils/UVTransformNode.cjs.js +0 -1
  314. package/nodes/utils/UVTransformNode.d.ts +0 -15
  315. package/nodes/utils/UVTransformNode.js +0 -46
  316. package/nodes/utils/VelocityNode.cjs.js +0 -1
  317. package/nodes/utils/VelocityNode.d.ts +0 -28
  318. package/nodes/utils/VelocityNode.js +0 -115
@@ -1,46 +1,28 @@
1
- import { TempNode } from '../core/TempNode.js';
2
- import { NodeLib } from '../core/NodeLib.js';
1
+ import AttributeNode from '../core/AttributeNode.js';
3
2
 
4
- function UVNode(index) {
5
- TempNode.call(this, 'v2', {
6
- shared: false
7
- });
8
- this.index = index || 0;
9
- }
10
-
11
- UVNode.prototype = Object.create(TempNode.prototype);
12
- UVNode.prototype.constructor = UVNode;
13
- UVNode.prototype.nodeType = 'UV';
14
-
15
- UVNode.prototype.generate = function (builder, output) {
16
- builder.requires.uv[this.index] = true;
17
- var uvIndex = this.index > 0 ? this.index + 1 : '';
18
- var result = builder.isShader('vertex') ? 'uv' + uvIndex : 'vUv' + uvIndex;
19
- return builder.format(result, this.getType(builder), output);
20
- };
21
-
22
- UVNode.prototype.copy = function (source) {
23
- TempNode.prototype.copy.call(this, source);
24
- this.index = source.index;
25
- return this;
26
- };
3
+ class UVNode extends AttributeNode {
4
+ constructor(index = 0) {
5
+ super(null, 'vec2');
6
+ this.index = index;
7
+ }
27
8
 
28
- UVNode.prototype.toJSON = function (meta) {
29
- var data = this.getJSONNode(meta);
9
+ getAttributeName() {
10
+ const index = this.index;
11
+ return 'uv' + (index > 0 ? index + 1 : '');
12
+ }
30
13
 
31
- if (!data) {
32
- data = this.createJSONNode(meta);
14
+ serialize(data) {
15
+ super.serialize(data);
33
16
  data.index = this.index;
34
17
  }
35
18
 
36
- return data;
37
- };
19
+ deserialize(data) {
20
+ super.deserialize(data);
21
+ this.index = data.index;
22
+ }
23
+
24
+ }
38
25
 
39
- NodeLib.addKeyword('uv', function () {
40
- return new UVNode();
41
- });
42
- NodeLib.addKeyword('uv2', function () {
43
- return new UVNode(1);
44
- });
26
+ UVNode.prototype.isUVNode = true;
45
27
 
46
- export { UVNode };
28
+ export default UVNode;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./UniformNode.cjs.js");require("./InputNode.cjs.js"),require("./Node.cjs.js"),require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class r extends e{constructor(e=[]){super(),this.nodes=e}getNodeType(e){return this.nodes[0].getNodeType(e)}}r.prototype.isArrayUniformNode=!0,module.exports=r;
@@ -0,0 +1,17 @@
1
+ import UniformNode from './UniformNode.js';
2
+
3
+ class ArrayUniformNode extends UniformNode {
4
+ constructor(nodes = []) {
5
+ super();
6
+ this.nodes = nodes;
7
+ }
8
+
9
+ getNodeType(builder) {
10
+ return this.nodes[0].getNodeType(builder);
11
+ }
12
+
13
+ }
14
+
15
+ ArrayUniformNode.prototype.isArrayUniformNode = true;
16
+
17
+ export default ArrayUniformNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./Node.cjs.js");function e(e,r){t.Node.call(this,r),this.name=e}require("three"),e.prototype=Object.create(t.Node.prototype),e.prototype.constructor=e,e.prototype.nodeType="Attribute",e.prototype.getAttributeType=function(t){return"number"==typeof this.type?t.getConstructorFromLength(this.type):this.type},e.prototype.getType=function(t){var e=this.getAttributeType(t);return t.getTypeByFormat(e)},e.prototype.generate=function(t,e){var r=this.getAttributeType(t),o=t.getAttribute(this.name,r),p=t.isShader("vertex")?this.name:o.varying.name;return t.format(p,this.getType(t),e)},e.prototype.copy=function(e){return t.Node.prototype.copy.call(this,e),this.type=e.type,this},e.prototype.toJSON=function(t){var e=this.getJSONNode(t);return e||((e=this.createJSONNode(t)).type=this.type),e},exports.AttributeNode=e;
1
+ "use strict";var e=require("./Node.cjs.js"),t=require("./VaryNode.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");module.exports=class extends e{constructor(e,t){super(t),this._attributeName=e}getHash(e){return this.getAttributeName(e)}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const r=e.getAttribute(this.getAttributeName(e),this.getNodeType(e));if(e.isShaderStage("vertex"))return r.name;return new t(this).build(e,r.type)}};
@@ -1,45 +1,36 @@
1
- import { Node } from './Node.js';
1
+ import Node from './Node.js';
2
+ import VaryNode from './VaryNode.js';
2
3
 
3
- function AttributeNode(name, type) {
4
- Node.call(this, type);
5
- this.name = name;
6
- }
4
+ class AttributeNode extends Node {
5
+ constructor(attributeName, nodeType) {
6
+ super(nodeType);
7
+ this._attributeName = attributeName;
8
+ }
9
+
10
+ getHash(builder) {
11
+ return this.getAttributeName(builder);
12
+ }
13
+
14
+ setAttributeName(attributeName) {
15
+ this._attributeName = attributeName;
16
+ return this;
17
+ }
7
18
 
8
- AttributeNode.prototype = Object.create(Node.prototype);
9
- AttributeNode.prototype.constructor = AttributeNode;
10
- AttributeNode.prototype.nodeType = 'Attribute';
11
-
12
- AttributeNode.prototype.getAttributeType = function (builder) {
13
- return typeof this.type === 'number' ? builder.getConstructorFromLength(this.type) : this.type;
14
- };
15
-
16
- AttributeNode.prototype.getType = function (builder) {
17
- var type = this.getAttributeType(builder);
18
- return builder.getTypeByFormat(type);
19
- };
20
-
21
- AttributeNode.prototype.generate = function (builder, output) {
22
- var type = this.getAttributeType(builder);
23
- var attribute = builder.getAttribute(this.name, type),
24
- name = builder.isShader('vertex') ? this.name : attribute.varying.name;
25
- return builder.format(name, this.getType(builder), output);
26
- };
27
-
28
- AttributeNode.prototype.copy = function (source) {
29
- Node.prototype.copy.call(this, source);
30
- this.type = source.type;
31
- return this;
32
- };
33
-
34
- AttributeNode.prototype.toJSON = function (meta) {
35
- var data = this.getJSONNode(meta);
36
-
37
- if (!data) {
38
- data = this.createJSONNode(meta);
39
- data.type = this.type;
19
+ getAttributeName() {
20
+ return this._attributeName;
40
21
  }
41
22
 
42
- return data;
43
- };
23
+ generate(builder) {
24
+ const attribute = builder.getAttribute(this.getAttributeName(builder), this.getNodeType(builder));
25
+
26
+ if (builder.isShaderStage('vertex')) {
27
+ return attribute.name;
28
+ } else {
29
+ const nodeVary = new VaryNode(this);
30
+ return nodeVary.build(builder, attribute.type);
31
+ }
32
+ }
33
+
34
+ }
44
35
 
45
- export { AttributeNode };
36
+ export default AttributeNode;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./Node.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class t extends e{constructor(e,t){super(),this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e,t){const s=this.callNode.build(e,"void");return""!==s&&e.addFlowCode(s),this.outputNode.build(e,t)}}t.prototype.isBypassNode=!0,module.exports=t;
@@ -0,0 +1,28 @@
1
+ import Node from './Node.js';
2
+
3
+ class BypassNode extends Node {
4
+ constructor(returnNode, callNode) {
5
+ super();
6
+ this.outputNode = returnNode;
7
+ this.callNode = callNode;
8
+ }
9
+
10
+ getNodeType(builder) {
11
+ return this.outputNode.getNodeType(builder);
12
+ }
13
+
14
+ generate(builder, output) {
15
+ const snippet = this.callNode.build(builder, 'void');
16
+
17
+ if (snippet !== '') {
18
+ builder.addFlowCode(snippet);
19
+ }
20
+
21
+ return this.outputNode.build(builder, output);
22
+ }
23
+
24
+ }
25
+
26
+ BypassNode.prototype.isBypassNode = true;
27
+
28
+ export default BypassNode;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./Node.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class s extends e{constructor(e="",s="code"){super(s),this.code=e,this._includes=[]}setIncludes(e){return this._includes=e,this}getIncludes(){return this._includes}generate(e){const s=this.getIncludes(e);for(const t of s)t.build(e);const t=e.getCodeFromNode(this,this.getNodeType(e));return t.code=this.code,t.code}}s.prototype.isCodeNode=!0,module.exports=s;
@@ -0,0 +1,35 @@
1
+ import Node from './Node.js';
2
+
3
+ class CodeNode extends Node {
4
+ constructor(code = '', nodeType = 'code') {
5
+ super(nodeType);
6
+ this.code = code;
7
+ this._includes = [];
8
+ }
9
+
10
+ setIncludes(includes) {
11
+ this._includes = includes;
12
+ return this;
13
+ }
14
+
15
+ getIncludes() {
16
+ return this._includes;
17
+ }
18
+
19
+ generate(builder) {
20
+ const includes = this.getIncludes(builder);
21
+
22
+ for (const include of includes) {
23
+ include.build(builder);
24
+ }
25
+
26
+ const nodeCode = builder.getCodeFromNode(this, this.getNodeType(builder));
27
+ nodeCode.code = this.code;
28
+ return nodeCode.code;
29
+ }
30
+
31
+ }
32
+
33
+ CodeNode.prototype.isCodeNode = true;
34
+
35
+ export default CodeNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./TempNode.cjs.js");require("three"),require("./Node.cjs.js");var t=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i;function s(t,r){e.TempNode.call(this),this.parse(t||s.PI,r)}s.PI="PI",s.PI2="PI2",s.RECIPROCAL_PI="RECIPROCAL_PI",s.RECIPROCAL_PI2="RECIPROCAL_PI2",s.LOG2="LOG2",s.EPSILON="EPSILON",s.prototype=Object.create(e.TempNode.prototype),s.prototype.constructor=s,s.prototype.nodeType="Const",s.prototype.getType=function(e){return e.getTypeByFormat(this.type)},s.prototype.parse=function(e,s){this.src=e||"";var r,o,i="",p=this.src.match(t);this.useDefine=s||"#"===this.src.charAt(0),p&&p.length>1?(o=p[1],r=p[2],i=p[3]):(r=this.src,o="f"),this.name=r,this.type=o,this.value=i},s.prototype.build=function(e,t){return"source"!==t?(e.include(this),e.format(this.name,this.getType(e),t)):this.value?this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";":this.useDefine?this.src:void 0},s.prototype.generate=function(e,t){return e.format(this.name,this.getType(e),t)},s.prototype.copy=function(t){return e.TempNode.prototype.copy.call(this,t),this.parse(t.src,t.useDefine),this},s.prototype.toJSON=function(e){var t=this.getJSONNode(e);return t||((t=this.createJSONNode(e)).src=this.src,!0===t.useDefine&&(t.useDefine=!0)),t},exports.ConstNode=s;
1
+ "use strict";var e=require("./InputNode.cjs.js");require("./Node.cjs.js"),require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class t extends e{generateConst(e){return e.getConst(this.getNodeType(e),this.value)}generate(e,t){const s=this.getNodeType(e);return e.format(this.generateConst(e),s,t)}}t.prototype.isConstNode=!0,module.exports=t;
@@ -1,85 +1,17 @@
1
- import { TempNode } from './TempNode.js';
1
+ import InputNode from './InputNode.js';
2
2
 
3
- var declarationRegexp = /^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i;
4
-
5
- function ConstNode(src, useDefine) {
6
- TempNode.call(this);
7
- this.parse(src || ConstNode.PI, useDefine);
8
- }
9
-
10
- ConstNode.PI = 'PI';
11
- ConstNode.PI2 = 'PI2';
12
- ConstNode.RECIPROCAL_PI = 'RECIPROCAL_PI';
13
- ConstNode.RECIPROCAL_PI2 = 'RECIPROCAL_PI2';
14
- ConstNode.LOG2 = 'LOG2';
15
- ConstNode.EPSILON = 'EPSILON';
16
- ConstNode.prototype = Object.create(TempNode.prototype);
17
- ConstNode.prototype.constructor = ConstNode;
18
- ConstNode.prototype.nodeType = 'Const';
19
-
20
- ConstNode.prototype.getType = function (builder) {
21
- return builder.getTypeByFormat(this.type);
22
- };
23
-
24
- ConstNode.prototype.parse = function (src, useDefine) {
25
- this.src = src || '';
26
- var name,
27
- type,
28
- value = '';
29
- var match = this.src.match(declarationRegexp);
30
- this.useDefine = useDefine || this.src.charAt(0) === '#';
31
-
32
- if (match && match.length > 1) {
33
- type = match[1];
34
- name = match[2];
35
- value = match[3];
36
- } else {
37
- name = this.src;
38
- type = 'f';
3
+ class ConstNode extends InputNode {
4
+ generateConst(builder) {
5
+ return builder.getConst(this.getNodeType(builder), this.value);
39
6
  }
40
7
 
41
- this.name = name;
42
- this.type = type;
43
- this.value = value;
44
- };
45
-
46
- ConstNode.prototype.build = function (builder, output) {
47
- if (output === 'source') {
48
- if (this.value) {
49
- if (this.useDefine) {
50
- return '#define ' + this.name + ' ' + this.value;
51
- }
52
-
53
- return 'const ' + this.type + ' ' + this.name + ' = ' + this.value + ';';
54
- } else if (this.useDefine) {
55
- return this.src;
56
- }
57
- } else {
58
- builder.include(this);
59
- return builder.format(this.name, this.getType(builder), output);
8
+ generate(builder, output) {
9
+ const type = this.getNodeType(builder);
10
+ return builder.format(this.generateConst(builder), type, output);
60
11
  }
61
- };
62
-
63
- ConstNode.prototype.generate = function (builder, output) {
64
- return builder.format(this.name, this.getType(builder), output);
65
- };
66
-
67
- ConstNode.prototype.copy = function (source) {
68
- TempNode.prototype.copy.call(this, source);
69
- this.parse(source.src, source.useDefine);
70
- return this;
71
- };
72
12
 
73
- ConstNode.prototype.toJSON = function (meta) {
74
- var data = this.getJSONNode(meta);
75
-
76
- if (!data) {
77
- data = this.createJSONNode(meta);
78
- data.src = this.src;
79
- if (data.useDefine === true) data.useDefine = true;
80
- }
13
+ }
81
14
 
82
- return data;
83
- };
15
+ ConstNode.prototype.isConstNode = true;
84
16
 
85
- export { ConstNode };
17
+ export default ConstNode;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./Node.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class t extends e{constructor(e,t={}){super(),this.node=e,this.context=t}getNodeType(e){return this.node.getNodeType(e)}generate(e,t){const s=e.getContext();e.setContext(Object.assign({},e.context,this.context));const o=this.node.build(e,t);return e.setContext(s),o}}t.prototype.isContextNode=!0,module.exports=t;
@@ -0,0 +1,26 @@
1
+ import Node from './Node.js';
2
+
3
+ class ContextNode extends Node {
4
+ constructor(node, context = {}) {
5
+ super();
6
+ this.node = node;
7
+ this.context = context;
8
+ }
9
+
10
+ getNodeType(builder) {
11
+ return this.node.getNodeType(builder);
12
+ }
13
+
14
+ generate(builder, output) {
15
+ const previousContext = builder.getContext();
16
+ builder.setContext(Object.assign({}, builder.context, this.context));
17
+ const snippet = this.node.build(builder, output);
18
+ builder.setContext(previousContext);
19
+ return snippet;
20
+ }
21
+
22
+ }
23
+
24
+ ContextNode.prototype.isContextNode = true;
25
+
26
+ export default ContextNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./FunctionNode.cjs.js");function o(o,r,t,s,c){e.FunctionNode.call(this,o,c,s,t,r)}require("./TempNode.cjs.js"),require("three"),require("./Node.cjs.js"),require("./NodeLib.cjs.js"),o.prototype=Object.create(e.FunctionNode.prototype),o.prototype.constructor=o,o.prototype.nodeType="Expression",exports.ExpressionNode=o;
1
+ "use strict";var e=require("./TempNode.cjs.js");require("./Node.cjs.js"),require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");module.exports=class extends e{constructor(e="",s="void"){super(s),this.snipped=e}generate(e){const s=this.getNodeType(e),r=this.snipped;if("void"!==s)return`( ${r} )`;e.addFlowCode(r)}};
@@ -1,11 +1,22 @@
1
- import { FunctionNode } from './FunctionNode.js';
1
+ import TempNode from './TempNode.js';
2
2
 
3
- function ExpressionNode(src, type, keywords, extensions, includes) {
4
- FunctionNode.call(this, src, includes, extensions, keywords, type);
5
- }
3
+ class ExpressionNode extends TempNode {
4
+ constructor(snipped = '', nodeType = 'void') {
5
+ super(nodeType);
6
+ this.snipped = snipped;
7
+ }
8
+
9
+ generate(builder) {
10
+ const type = this.getNodeType(builder);
11
+ const snipped = this.snipped;
6
12
 
7
- ExpressionNode.prototype = Object.create(FunctionNode.prototype);
8
- ExpressionNode.prototype.constructor = ExpressionNode;
9
- ExpressionNode.prototype.nodeType = 'Expression';
13
+ if (type === 'void') {
14
+ builder.addFlowCode(snipped);
15
+ } else {
16
+ return `( ${snipped} )`;
17
+ }
18
+ }
19
+
20
+ }
10
21
 
11
- export { ExpressionNode };
22
+ export default ExpressionNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./TempNode.cjs.js");function e(e,i){t.TempNode.call(this),this.setFunction(e,i)}require("three"),require("./Node.cjs.js"),e.prototype=Object.create(t.TempNode.prototype),e.prototype.constructor=e,e.prototype.nodeType="FunctionCall",e.prototype.setFunction=function(t,e){this.value=t,this.inputs=e||[]},e.prototype.getFunction=function(){return this.value},e.prototype.getType=function(t){return this.value.getType(t)},e.prototype.generate=function(t,e){var i=this.getType(t),o=this.value,n=o.build(t,e)+"( ",u=[];for(let e=0;e<o.inputs.length;e++){var p=o.inputs[e],r=this.inputs[e]||this.inputs[p.name];u.push(r.build(t,t.getTypeByFormat(p.type)))}return n+=u.join(", ")+" )",t.format(n,i,e)},e.prototype.copy=function(e){t.TempNode.prototype.copy.call(this,e);for(let t in e.inputs)this.inputs[t]=e.inputs[t];return this.value=e.value,this},e.prototype.toJSON=function(t){var e=this.getJSONNode(t);if(!e){var i=this.value;if((e=this.createJSONNode(t)).value=this.value.toJSON(t).uuid,i.inputs.length){e.inputs={};for(let u=0;u<i.inputs.length;u++){var o=i.inputs[u],n=this.inputs[u]||this.inputs[o.name];e.inputs[o.name]=n.toJSON(t).uuid}}}return e},exports.FunctionCallNode=e;
1
+ "use strict";var e=require("./TempNode.cjs.js");require("./Node.cjs.js"),require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");module.exports=class extends e{constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],r=this.functionNode,s=r.getInputs(e),n=this.parameters;for(const r of s){const s=n[r.name];if(void 0===s)throw new Error(`FunctionCallNode: Input '${r.name}' not found in FunctionNode.`);t.push(s.build(e,r.type))}return`${r.build(e,"property")}( ${t.join(", ")} )`}};
@@ -1,74 +1,45 @@
1
- import { TempNode } from './TempNode.js';
1
+ import TempNode from './TempNode.js';
2
2
 
3
- function FunctionCallNode(func, inputs) {
4
- TempNode.call(this);
5
- this.setFunction(func, inputs);
6
- }
7
-
8
- FunctionCallNode.prototype = Object.create(TempNode.prototype);
9
- FunctionCallNode.prototype.constructor = FunctionCallNode;
10
- FunctionCallNode.prototype.nodeType = 'FunctionCall';
11
-
12
- FunctionCallNode.prototype.setFunction = function (func, inputs) {
13
- this.value = func;
14
- this.inputs = inputs || [];
15
- };
16
-
17
- FunctionCallNode.prototype.getFunction = function () {
18
- return this.value;
19
- };
20
-
21
- FunctionCallNode.prototype.getType = function (builder) {
22
- return this.value.getType(builder);
23
- };
24
-
25
- FunctionCallNode.prototype.generate = function (builder, output) {
26
- var type = this.getType(builder),
27
- func = this.value;
28
- var code = func.build(builder, output) + '( ',
29
- params = [];
30
-
31
- for (let i = 0; i < func.inputs.length; i++) {
32
- var inpt = func.inputs[i],
33
- param = this.inputs[i] || this.inputs[inpt.name];
34
- params.push(param.build(builder, builder.getTypeByFormat(inpt.type)));
3
+ class FunctionCallNode extends TempNode {
4
+ constructor(functionNode = null, parameters = {}) {
5
+ super();
6
+ this.functionNode = functionNode;
7
+ this.parameters = parameters;
35
8
  }
36
9
 
37
- code += params.join(', ') + ' )';
38
- return builder.format(code, type, output);
39
- };
40
-
41
- FunctionCallNode.prototype.copy = function (source) {
42
- TempNode.prototype.copy.call(this, source);
43
-
44
- for (let prop in source.inputs) {
45
- this.inputs[prop] = source.inputs[prop];
10
+ setParameters(parameters) {
11
+ this.parameters = parameters;
12
+ return this;
46
13
  }
47
14
 
48
- this.value = source.value;
49
- return this;
50
- };
15
+ getParameters() {
16
+ return this.parameters;
17
+ }
51
18
 
52
- FunctionCallNode.prototype.toJSON = function (meta) {
53
- var data = this.getJSONNode(meta);
19
+ getNodeType(builder) {
20
+ return this.functionNode.getNodeType(builder);
21
+ }
54
22
 
55
- if (!data) {
56
- var func = this.value;
57
- data = this.createJSONNode(meta);
58
- data.value = this.value.toJSON(meta).uuid;
23
+ generate(builder) {
24
+ const params = [];
25
+ const functionNode = this.functionNode;
26
+ const inputs = functionNode.getInputs(builder);
27
+ const parameters = this.parameters;
59
28
 
60
- if (func.inputs.length) {
61
- data.inputs = {};
29
+ for (const inputNode of inputs) {
30
+ const node = parameters[inputNode.name];
62
31
 
63
- for (let i = 0; i < func.inputs.length; i++) {
64
- var inpt = func.inputs[i],
65
- node = this.inputs[i] || this.inputs[inpt.name];
66
- data.inputs[inpt.name] = node.toJSON(meta).uuid;
32
+ if (node !== undefined) {
33
+ params.push(node.build(builder, inputNode.type));
34
+ } else {
35
+ throw new Error(`FunctionCallNode: Input '${inputNode.name}' not found in FunctionNode.`);
67
36
  }
68
37
  }
38
+
39
+ const functionName = functionNode.build(builder, 'property');
40
+ return `${functionName}( ${params.join(', ')} )`;
69
41
  }
70
42
 
71
- return data;
72
- };
43
+ }
73
44
 
74
- export { FunctionCallNode };
45
+ export default FunctionCallNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./TempNode.cjs.js"),t=require("./NodeLib.cjs.js");require("three"),require("./Node.cjs.js");var s=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,i=/[a-z_0-9]+/gi;function o(t,s,i,o,r){this.isMethod=void 0===r,this.isInterface=!1,e.TempNode.call(this,r),this.parse(t,s,i,o)}o.prototype=Object.create(e.TempNode.prototype),o.prototype.constructor=o,o.prototype.nodeType="Function",o.prototype.useKeywords=!0,o.prototype.getShared=function(){return!this.isMethod},o.prototype.getType=function(e){return e.getTypeByFormat(this.type)},o.prototype.getInputByName=function(e){for(var t=this.inputs.length;t--;)if(this.inputs[t].name===e)return this.inputs[t]},o.prototype.getIncludeByName=function(e){for(var t=this.includes.length;t--;)if(this.includes[t].name===e)return this.includes[t]},o.prototype.generate=function(e,s){var o=0,r=this.src;for(let t=0;t<this.includes.length;t++)e.include(this.includes[t],this);for(let t in this.extensions)e.extensions[t]=!0;for(var n=[];h=i.exec(this.src);)n.push(h);for(let s=0;s<n.length;s++){var h,d=(h=n[s])[0],u=!this.isMethod||!this.getInputByName(d),p=d;if(this.keywords[d]||this.useKeywords&&u&&t.NodeLib.containsKeyword(d)){var c=this.keywords[d];if(!c){var y=t.NodeLib.getKeywordData(d);y.cache&&(c=e.keywords[d]),c=c||t.NodeLib.getKeyword(d,e),y.cache&&(e.keywords[d]=c)}p=c.build(e)}d!==p&&(r=r.substring(0,h.index+o)+p+r.substring(h.index+d.length+o),o+=p.length-d.length),void 0===this.getIncludeByName(p)&&t.NodeLib.contains(p)&&e.include(t.NodeLib.get(p))}return"source"===s?r:this.isMethod?(this.isInterface||e.include(this,!1,r),this.name):e.format("( "+r+" )",this.getType(e),s)},o.prototype.parse=function(e,t,o,r){if(this.src=e||"",this.includes=t||[],this.extensions=o||{},this.keywords=r||{},this.isMethod){var n=this.src.match(s);if(this.inputs=[],n&&4==n.length){this.type=n[1],this.name=n[2];var h=n[3].match(i);if(h)for(var d=0;d<h.length;){var u,p,c=h[d++];"in"===c||"out"===c||"inout"===c?u=h[d++]:(u=c,c=""),p=h[d++],this.inputs.push({name:p,type:u,qualifier:c})}this.isInterface=-1===this.src.indexOf("{")}else this.type="",this.name=""}},o.prototype.copy=function(t){return e.TempNode.prototype.copy.call(this,t),this.isMethod=t.isMethod,this.useKeywords=t.useKeywords,this.parse(t.src,t.includes,t.extensions,t.keywords),void 0!==t.type&&(this.type=t.type),this},o.prototype.toJSON=function(e){var t=this.getJSONNode(e);if(!t){(t=this.createJSONNode(e)).src=this.src,t.isMethod=this.isMethod,t.useKeywords=this.useKeywords,this.isMethod||(t.type=this.type),t.extensions=JSON.parse(JSON.stringify(this.extensions)),t.keywords={};for(let s in this.keywords)t.keywords[s]=this.keywords[s].toJSON(e).uuid;if(this.includes.length){t.includes=[];for(let s=0;s<this.includes.length;s++)t.includes.push(this.includes[s].toJSON(e).uuid)}}return t},exports.FunctionNode=o;
1
+ "use strict";var e=require("./CodeNode.cjs.js"),t=require("./FunctionCallNode.cjs.js");require("./Node.cjs.js"),require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three"),require("./TempNode.cjs.js");module.exports=class extends e{constructor(e=""){super(e),this.keywords={}}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let o=t.nodeFunction;return void 0===o&&(o=e.parser.parseFunction(this.code),t.nodeFunction=o),o}call(e={}){return new t(this,e)}generate(e,t){super.generate(e);const o=this.getNodeFunction(e),r=o.name,s=o.type,n=e.getCodeFromNode(this,s);""!==r&&(n.name=r);const i=e.getPropertyName(n);let c=this.getNodeFunction(e).getCode(i);const u=this.keywords,d=Object.keys(u);if(d.length>0)for(const t of d){const o=new RegExp(`\\b${t}\\b`,"g"),r=u[t].build(e,"property");c=c.replace(o,r)}return n.code=c,"property"===t?i:e.format(`${i}()`,s,t)}};