MCPcopy
hub / github.com/mrdoob/texgen.js / generatorSelected

Function generatorSelected

editor/main.js:378–409  ·  view source on GitHub ↗
( id )

Source from the content-addressed store, hash-verified

376}
377
378function generatorSelected( id ) {
379
380 if ( currentGenerator != null ) {
381 generatorPanels[ currentGenerator.type ].dom.style.display = "none";
382 }
383
384 var step = texture.getStepById( id );
385
386 if ( step.index == -1 )
387 return;
388
389 currentGenerator = step.value;
390 var type = currentGenerator.type;
391 generatorPanels[ type ].dom.style.display = "block";
392
393 for ( var idParam in TGUI.GeneratorDefinitions[ type ].parameters ) {
394
395 param = TGUI.GeneratorDefinitions[ type ].uiparameters[ idParam ];
396
397 if ( param.length > 1 ) {
398
399 for ( var i = 0; i < param.length; i ++ )
400 param[ i ].setValue( currentGenerator.params[ idParam ][ i ] );
401
402 } else {
403
404 param[ 0 ].setValue( currentGenerator.params[ idParam ] );
405 }
406
407 }
408
409}
410
411function init() {
412

Callers 2

main.jsFile · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected