NodeBuilder.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. import { NodeUniform } from './NodeUniform.js';
  5. import { NodeUtils } from './NodeUtils.js';
  6. import { NodeLib } from './NodeLib.js';
  7. import { FunctionNode } from './FunctionNode.js';
  8. import { ConstNode } from './ConstNode.js';
  9. import { StructNode } from './StructNode.js';
  10. import { Vector2Node } from '../inputs/Vector2Node.js';
  11. import { Vector3Node } from '../inputs/Vector3Node.js';
  12. import { Vector4Node } from '../inputs/Vector4Node.js';
  13. import { TextureNode } from '../inputs/TextureNode.js';
  14. import { CubeTextureNode } from '../inputs/CubeTextureNode.js';
  15. import { TextureCubeNode } from '../misc/TextureCubeNode.js';
  16. var elements = NodeUtils.elements,
  17. constructors = [ 'float', 'vec2', 'vec3', 'vec4' ],
  18. convertFormatToType = {
  19. float: 'f',
  20. vec2: 'v2',
  21. vec3: 'v3',
  22. vec4: 'v4',
  23. mat4: 'v4',
  24. int: 'i',
  25. bool: 'b'
  26. },
  27. convertTypeToFormat = {
  28. t: 'sampler2D',
  29. tc: 'samplerCube',
  30. b: 'bool',
  31. i: 'int',
  32. f: 'float',
  33. c: 'vec3',
  34. v2: 'vec2',
  35. v3: 'vec3',
  36. v4: 'vec4',
  37. m3: 'mat3',
  38. m4: 'mat4'
  39. };
  40. function NodeBuilder() {
  41. this.slots = [];
  42. this.caches = [];
  43. this.contexts = [];
  44. this.keywords = {};
  45. this.nodeData = {};
  46. this.requires = {
  47. uv: [],
  48. color: [],
  49. lights: false,
  50. fog: false
  51. };
  52. this.includes = {
  53. consts: [],
  54. functions: [],
  55. structs: []
  56. };
  57. this.attributes = {};
  58. this.prefixCode = [
  59. "#ifdef TEXTURE_LOD_EXT",
  60. " #define texCube(a, b) textureCube(a, b)",
  61. " #define texCubeBias(a, b, c) textureCubeLodEXT(a, b, c)",
  62. " #define tex2D(a, b) texture2D(a, b)",
  63. " #define tex2DBias(a, b, c) texture2DLodEXT(a, b, c)",
  64. "#else",
  65. " #define texCube(a, b) textureCube(a, b)",
  66. " #define texCubeBias(a, b, c) textureCube(a, b, c)",
  67. " #define tex2D(a, b) texture2D(a, b)",
  68. " #define tex2DBias(a, b, c) texture2D(a, b, c)",
  69. "#endif",
  70. "#include <packing>",
  71. "#include <common>"
  72. ].join( "\n" );
  73. this.parsCode = {
  74. vertex: '',
  75. fragment: ''
  76. };
  77. this.code = {
  78. vertex: '',
  79. fragment: ''
  80. };
  81. this.nodeCode = {
  82. vertex: '',
  83. fragment: ''
  84. };
  85. this.resultCode = {
  86. vertex: '',
  87. fragment: ''
  88. };
  89. this.finalCode = {
  90. vertex: '',
  91. fragment: ''
  92. };
  93. this.inputs = {
  94. uniforms: {
  95. list: [],
  96. vertex: [],
  97. fragment: []
  98. },
  99. vars: {
  100. varying: [],
  101. vertex: [],
  102. fragment: []
  103. }
  104. };
  105. // send to material
  106. this.defines = {};
  107. this.uniforms = {};
  108. this.extensions = {};
  109. this.updaters = [];
  110. this.nodes = [];
  111. // --
  112. this.parsing = false;
  113. this.optimize = true;
  114. }
  115. NodeBuilder.prototype = {
  116. constructor: NodeBuilder,
  117. build: function ( vertex, fragment ) {
  118. this.buildShader( 'vertex', vertex );
  119. this.buildShader( 'fragment', fragment );
  120. if ( this.requires.uv[ 0 ] ) {
  121. this.addVaryCode( 'varying vec2 vUv;' );
  122. this.addVertexFinalCode( 'vUv = uv;' );
  123. }
  124. if ( this.requires.uv[ 1 ] ) {
  125. this.addVaryCode( 'varying vec2 vUv2;' );
  126. this.addVertexParsCode( 'attribute vec2 uv2;' );
  127. this.addVertexFinalCode( 'vUv2 = uv2;' );
  128. }
  129. if ( this.requires.color[ 0 ] ) {
  130. this.addVaryCode( 'varying vec4 vColor;' );
  131. this.addVertexParsCode( 'attribute vec4 color;' );
  132. this.addVertexFinalCode( 'vColor = color;' );
  133. }
  134. if ( this.requires.color[ 1 ] ) {
  135. this.addVaryCode( 'varying vec4 vColor2;' );
  136. this.addVertexParsCode( 'attribute vec4 color2;' );
  137. this.addVertexFinalCode( 'vColor2 = color2;' );
  138. }
  139. if ( this.requires.position ) {
  140. this.addVaryCode( 'varying vec3 vPosition;' );
  141. this.addVertexFinalCode( 'vPosition = transformed;' );
  142. }
  143. if ( this.requires.worldPosition ) {
  144. this.addVaryCode( 'varying vec3 vWPosition;' );
  145. this.addVertexFinalCode( 'vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;' );
  146. }
  147. if ( this.requires.normal ) {
  148. this.addVaryCode( 'varying vec3 vObjectNormal;' );
  149. this.addVertexFinalCode( 'vObjectNormal = normal;' );
  150. }
  151. if ( this.requires.worldNormal ) {
  152. this.addVaryCode( 'varying vec3 vWNormal;' );
  153. this.addVertexFinalCode( 'vWNormal = ( modelMatrix * vec4( objectNormal, 0.0 ) ).xyz;' );
  154. }
  155. return this;
  156. },
  157. buildShader: function ( shader, node ) {
  158. this.resultCode[ shader ] = node.build( this.setShader( shader ), 'v4' );
  159. },
  160. setMaterial: function ( material, renderer ) {
  161. this.material = material;
  162. this.renderer = renderer;
  163. this.requires.lights = material.lights;
  164. this.requires.fog = material.fog;
  165. this.mergeDefines( material.defines );
  166. return this;
  167. },
  168. addFlow: function ( slot, cache, context ) {
  169. return this.addSlot( slot ).addCache( cache ).addContext( context );
  170. },
  171. removeFlow: function () {
  172. return this.removeSlot().removeCache().removeContext();
  173. },
  174. addCache: function ( name ) {
  175. this.cache = name || '';
  176. this.caches.push( this.cache );
  177. return this;
  178. },
  179. removeCache: function () {
  180. this.caches.pop();
  181. this.cache = this.caches[ this.caches.length - 1 ] || '';
  182. return this;
  183. },
  184. addContext: function ( context ) {
  185. this.context = Object.assign( {}, this.context, context );
  186. this.context.extra = this.context.extra || {};
  187. this.contexts.push( this.context );
  188. return this;
  189. },
  190. removeContext: function () {
  191. this.contexts.pop();
  192. this.context = this.contexts[ this.contexts.length - 1 ] || {};
  193. return this;
  194. },
  195. addSlot: function ( name ) {
  196. this.slot = name || '';
  197. this.slots.push( this.slot );
  198. return this;
  199. },
  200. removeSlot: function () {
  201. this.slots.pop();
  202. this.slot = this.slots[ this.slots.length - 1 ] || '';
  203. return this;
  204. },
  205. addVertexCode: function ( code ) {
  206. this.addCode( code, 'vertex' );
  207. },
  208. addFragmentCode: function ( code ) {
  209. this.addCode( code, 'fragment' );
  210. },
  211. addCode: function ( code, shader ) {
  212. this.code[ shader || this.shader ] += code + '\n';
  213. },
  214. addVertexNodeCode: function ( code ) {
  215. this.addNodeCode( code, 'vertex' );
  216. },
  217. addFragmentNodeCode: function ( code ) {
  218. this.addNodeCode( code, 'fragment' );
  219. },
  220. addNodeCode: function ( code, shader ) {
  221. this.nodeCode[ shader || this.shader ] += code + '\n';
  222. },
  223. clearNodeCode: function ( shader ) {
  224. shader = shader || this.shader;
  225. var code = this.nodeCode[ shader ];
  226. this.nodeCode[ shader ] = '';
  227. return code;
  228. },
  229. clearVertexNodeCode: function ( ) {
  230. return this.clearNodeCode( 'vertex' );
  231. },
  232. clearFragmentNodeCode: function ( ) {
  233. return this.clearNodeCode( 'fragment' );
  234. },
  235. addVertexFinalCode: function ( code ) {
  236. this.addFinalCode( code, 'vertex' );
  237. },
  238. addFragmentFinalCode: function ( code ) {
  239. this.addFinalCode( code, 'fragment' );
  240. },
  241. addFinalCode: function ( code, shader ) {
  242. this.finalCode[ shader || this.shader ] += code + '\n';
  243. },
  244. addVertexParsCode: function ( code ) {
  245. this.addParsCode( code, 'vertex' );
  246. },
  247. addFragmentParsCode: function ( code ) {
  248. this.addParsCode( code, 'fragment' );
  249. },
  250. addParsCode: function ( code, shader ) {
  251. this.parsCode[ shader || this.shader ] += code + '\n';
  252. },
  253. addVaryCode: function ( code ) {
  254. this.addVertexParsCode( code );
  255. this.addFragmentParsCode( code );
  256. },
  257. isCache: function ( name ) {
  258. return this.caches.indexOf( name ) !== - 1;
  259. },
  260. isSlot: function ( name ) {
  261. return this.slots.indexOf( name ) !== - 1;
  262. },
  263. define: function ( name, value ) {
  264. this.defines[ name ] = value === undefined ? 1 : value;
  265. },
  266. isDefined: function ( name ) {
  267. return this.defines[ name ] !== undefined;
  268. },
  269. getVar: function ( uuid, type, ns, shader = 'varying', prefix = 'V', label = '' ) {
  270. var vars = this.getVars( shader ),
  271. data = vars[ uuid ];
  272. if ( ! data ) {
  273. var index = vars.length,
  274. name = ns ? ns : 'node' + prefix + index + ( label ? '_' + label : '' );
  275. data = { name: name, type: type };
  276. vars.push( data );
  277. vars[ uuid ] = data;
  278. }
  279. return data;
  280. },
  281. getTempVar: function ( uuid, type, ns, label ) {
  282. return this.getVar( uuid, type, ns, this.shader, 'T', label );
  283. },
  284. getAttribute: function ( name, type ) {
  285. if ( ! this.attributes[ name ] ) {
  286. var varying = this.getVar( name, type );
  287. this.addVertexParsCode( 'attribute ' + type + ' ' + name + ';' );
  288. this.addVertexFinalCode( varying.name + ' = ' + name + ';' );
  289. this.attributes[ name ] = { varying: varying, name: name, type: type };
  290. }
  291. return this.attributes[ name ];
  292. },
  293. getCode: function ( shader ) {
  294. return [
  295. this.prefixCode,
  296. this.parsCode[ shader ],
  297. this.getVarListCode( this.getVars( 'varying' ), 'varying' ),
  298. this.getVarListCode( this.inputs.uniforms[ shader ], 'uniform' ),
  299. this.getIncludesCode( 'consts', shader ),
  300. this.getIncludesCode( 'structs', shader ),
  301. this.getIncludesCode( 'functions', shader ),
  302. 'void main() {',
  303. this.getVarListCode( this.getVars( shader ) ),
  304. this.code[ shader ],
  305. this.resultCode[ shader ],
  306. this.finalCode[ shader ],
  307. '}'
  308. ].join( "\n" );
  309. },
  310. getVarListCode: function ( vars, prefix ) {
  311. prefix = prefix || '';
  312. var code = '';
  313. for ( var i = 0, l = vars.length; i < l; ++ i ) {
  314. var nVar = vars[ i ],
  315. type = nVar.type,
  316. name = nVar.name;
  317. var formatType = this.getFormatByType( type );
  318. if ( formatType === undefined ) {
  319. throw new Error( "Node pars " + formatType + " not found." );
  320. }
  321. code += prefix + ' ' + formatType + ' ' + name + ';\n';
  322. }
  323. return code;
  324. },
  325. getVars: function ( shader ) {
  326. return this.inputs.vars[ shader || this.shader ];
  327. },
  328. getNodeData: function ( node ) {
  329. var uuid = node.isNode ? node.uuid : node;
  330. return this.nodeData[ uuid ] = this.nodeData[ uuid ] || {};
  331. },
  332. createUniform: function ( shader, type, node, ns, needsUpdate, label ) {
  333. var uniforms = this.inputs.uniforms,
  334. index = uniforms.list.length;
  335. var uniform = new NodeUniform( {
  336. type: type,
  337. name: ns ? ns : 'nodeU' + index + ( label ? '_' + label : '' ),
  338. node: node,
  339. needsUpdate: needsUpdate
  340. } );
  341. uniforms.list.push( uniform );
  342. uniforms[ shader ].push( uniform );
  343. uniforms[ shader ][ uniform.name ] = uniform;
  344. this.uniforms[ uniform.name ] = uniform;
  345. return uniform;
  346. },
  347. createVertexUniform: function ( type, node, ns, needsUpdate, label ) {
  348. return this.createUniform( 'vertex', type, node, ns, needsUpdate, label );
  349. },
  350. createFragmentUniform: function ( type, node, ns, needsUpdate, label ) {
  351. return this.createUniform( 'fragment', type, node, ns, needsUpdate, label );
  352. },
  353. include: function ( node, parent, source ) {
  354. var includesStruct;
  355. node = typeof node === 'string' ? NodeLib.get( node ) : node;
  356. if ( this.context.include === false ) {
  357. return node.name;
  358. }
  359. if ( node instanceof FunctionNode ) {
  360. includesStruct = this.includes.functions;
  361. } else if ( node instanceof ConstNode ) {
  362. includesStruct = this.includes.consts;
  363. } else if ( node instanceof StructNode ) {
  364. includesStruct = this.includes.structs;
  365. }
  366. var includes = includesStruct[ this.shader ] = includesStruct[ this.shader ] || [];
  367. if ( node ) {
  368. var included = includes[ node.name ];
  369. if ( ! included ) {
  370. included = includes[ node.name ] = {
  371. node: node,
  372. deps: []
  373. };
  374. includes.push( included );
  375. included.src = node.build( this, 'source' );
  376. }
  377. if ( node instanceof FunctionNode && parent && includes[ parent.name ] && includes[ parent.name ].deps.indexOf( node ) == - 1 ) {
  378. includes[ parent.name ].deps.push( node );
  379. if ( node.includes && node.includes.length ) {
  380. var i = 0;
  381. do {
  382. this.include( node.includes[ i ++ ], parent );
  383. } while ( i < node.includes.length );
  384. }
  385. }
  386. if ( source ) {
  387. included.src = source;
  388. }
  389. return node.name;
  390. } else {
  391. throw new Error( "Include not found." );
  392. }
  393. },
  394. colorToVectorProperties: function ( color ) {
  395. return color.replace( 'r', 'x' ).replace( 'g', 'y' ).replace( 'b', 'z' ).replace( 'a', 'w' );
  396. },
  397. colorToVector: function ( color ) {
  398. return color.replace( /c/g, 'v3' );
  399. },
  400. getIncludes: function ( type, shader ) {
  401. return this.includes[ type ][ shader || this.shader ];
  402. },
  403. getIncludesCode: function () {
  404. function sortByPosition( a, b ) {
  405. return a.deps.length - b.deps.length;
  406. }
  407. return function getIncludesCode( type, shader ) {
  408. var includes = this.getIncludes( type, shader );
  409. if ( ! includes ) return '';
  410. var code = '',
  411. includes = includes.sort( sortByPosition );
  412. for ( var i = 0; i < includes.length; i ++ ) {
  413. if ( includes[ i ].src ) code += includes[ i ].src + '\n';
  414. }
  415. return code;
  416. };
  417. }(),
  418. getConstructorFromLength: function ( len ) {
  419. return constructors[ len - 1 ];
  420. },
  421. isTypeMatrix: function ( format ) {
  422. return /^m/.test( format );
  423. },
  424. getTypeLength: function ( type ) {
  425. if ( type === 'f' ) return 1;
  426. return parseInt( this.colorToVector( type ).substr( 1 ) );
  427. },
  428. getTypeFromLength: function ( len ) {
  429. if ( len === 1 ) return 'f';
  430. return 'v' + len;
  431. },
  432. findNode: function () {
  433. for ( var i = 0; i < arguments.length; i ++ ) {
  434. var nodeCandidate = arguments[ i ];
  435. if ( nodeCandidate !== undefined && nodeCandidate.isNode ) {
  436. return nodeCandidate;
  437. }
  438. }
  439. },
  440. resolve: function () {
  441. for ( var i = 0; i < arguments.length; i ++ ) {
  442. var nodeCandidate = arguments[ i ];
  443. if ( nodeCandidate !== undefined ) {
  444. if ( nodeCandidate.isNode ) {
  445. return nodeCandidate;
  446. } else if ( nodeCandidate.isTexture ) {
  447. switch ( nodeCandidate.mapping ) {
  448. case THREE.CubeReflectionMapping:
  449. case THREE.CubeRefractionMapping:
  450. return new CubeTextureNode( nodeCandidate );
  451. break;
  452. case THREE.CubeUVReflectionMapping:
  453. case THREE.CubeUVRefractionMapping:
  454. return new TextureCubeNode( new TextureNode( nodeCandidate ) );
  455. break;
  456. default:
  457. return new TextureNode( nodeCandidate );
  458. }
  459. } else if ( nodeCandidate.isVector2 ) {
  460. return new Vector2Node( nodeCandidate );
  461. } else if ( nodeCandidate.isVector3 ) {
  462. return new Vector3Node( nodeCandidate );
  463. } else if ( nodeCandidate.isVector4 ) {
  464. return new Vector4Node( nodeCandidate );
  465. }
  466. }
  467. }
  468. },
  469. format: function ( code, from, to ) {
  470. var typeToType = this.colorToVector( to + ' <- ' + from );
  471. switch ( typeToType ) {
  472. case 'f <- v2' : return code + '.x';
  473. case 'f <- v3' : return code + '.x';
  474. case 'f <- v4' : return code + '.x';
  475. case 'f <- i' :
  476. case 'f <- b' : return 'float( ' + code + ' )';
  477. case 'v2 <- f' : return 'vec2( ' + code + ' )';
  478. case 'v2 <- v3': return code + '.xy';
  479. case 'v2 <- v4': return code + '.xy';
  480. case 'v2 <- i' :
  481. case 'v2 <- b' : return 'vec2( float( ' + code + ' ) )';
  482. case 'v3 <- f' : return 'vec3( ' + code + ' )';
  483. case 'v3 <- v2': return 'vec3( ' + code + ', 0.0 )';
  484. case 'v3 <- v4': return code + '.xyz';
  485. case 'v3 <- i' :
  486. case 'v3 <- b' : return 'vec2( float( ' + code + ' ) )';
  487. case 'v4 <- f' : return 'vec4( ' + code + ' )';
  488. case 'v4 <- v2': return 'vec4( ' + code + ', 0.0, 1.0 )';
  489. case 'v4 <- v3': return 'vec4( ' + code + ', 1.0 )';
  490. case 'v4 <- i' :
  491. case 'v4 <- b' : return 'vec4( float( ' + code + ' ) )';
  492. case 'i <- f' :
  493. case 'i <- b' : return 'int( ' + code + ' )';
  494. case 'i <- v2' : return 'int( ' + code + '.x )';
  495. case 'i <- v3' : return 'int( ' + code + '.x )';
  496. case 'i <- v4' : return 'int( ' + code + '.x )';
  497. case 'b <- f' : return '( ' + code + ' != 0.0 )';
  498. case 'b <- v2' : return '( ' + code + ' != vec2( 0.0 ) )';
  499. case 'b <- v3' : return '( ' + code + ' != vec3( 0.0 ) )';
  500. case 'b <- v4' : return '( ' + code + ' != vec4( 0.0 ) )';
  501. case 'b <- i' : return '( ' + code + ' != 0 )';
  502. }
  503. return code;
  504. },
  505. getTypeByFormat: function ( format ) {
  506. return convertFormatToType[ format ] || format;
  507. },
  508. getFormatByType: function ( type ) {
  509. return convertTypeToFormat[ type ] || type;
  510. },
  511. getUuid: function ( uuid, useCache ) {
  512. useCache = useCache !== undefined ? useCache : true;
  513. if ( useCache && this.cache ) uuid = this.cache + '-' + uuid;
  514. return uuid;
  515. },
  516. getElementByIndex: function ( index ) {
  517. return elements[ index ];
  518. },
  519. getIndexByElement: function ( elm ) {
  520. return elements.indexOf( elm );
  521. },
  522. isShader: function ( shader ) {
  523. return this.shader === shader;
  524. },
  525. setShader: function ( shader ) {
  526. this.shader = shader;
  527. return this;
  528. },
  529. mergeDefines: function ( defines ) {
  530. for ( var name in defines ) {
  531. this.defines[ name ] = defines[ name ];
  532. }
  533. return this.defines;
  534. },
  535. mergeUniform: function ( uniforms ) {
  536. for ( var name in uniforms ) {
  537. this.uniforms[ name ] = uniforms[ name ];
  538. }
  539. return this.uniforms;
  540. },
  541. getTextureEncodingFromMap: function ( map, gammaOverrideLinear ) {
  542. gammaOverrideLinear = gammaOverrideLinear !== undefined ? gammaOverrideLinear : this.context.gamma && ( this.renderer ? this.renderer.gammaInput : false );
  543. var encoding;
  544. if ( ! map ) {
  545. encoding = THREE.LinearEncoding;
  546. } else if ( map.isTexture ) {
  547. encoding = map.encoding;
  548. } else if ( map.isWebGLRenderTarget ) {
  549. console.warn( "THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead." );
  550. encoding = map.texture.encoding;
  551. }
  552. // add backwards compatibility for WebGLRenderer.gammaInput/gammaOutput parameter, should probably be removed at some point.
  553. if ( encoding === THREE.LinearEncoding && gammaOverrideLinear ) {
  554. encoding = THREE.GammaEncoding;
  555. }
  556. return encoding;
  557. }
  558. };
  559. export { NodeBuilder };