codetaylor / JoisePlugin-TMLConverter

Convert Joise module chains to and from TML.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

##JoisePlugin-TMLConverter Convert Joise module chains to and from TML. ##Dependencies This code assumes you have the following libs on your classpath:

##Example ###Convert To TML

// create a Joise module chain
ModuleBasisFunction basis = new ModuleBasisFunction();
basis.setType(BasisType.GRADIENT);
basis.setSeed(648);

ModuleAutoCorrect auto = new ModuleAutoCorrect();
auto.setSource(basis);
auto.calculate();

// create a converter instance and convert to TML
JoiseTMLConverter converter = new JoiseTMLConverter();
String tml = converter.toTML(auto.getModuleMap());
[
    [func_1 | 
        [module | ModuleBasisFunction]
        [basis | gradient]
        [interpolation | quintic]
        [seed | 648]
    ]
    [func_2 | 
        [module | ModuleAutoCorrect]
        [low | 0.0]
        [high | 1.0]
        [samples | 100]
        [sampleScale | 1.0]
        [locked | false]
        [source | func_1]
    ]
]

###Convert From TML

// convert from TML to a Joise instance
Joise j = new Joise(converter.fromTML(tml));

##License

Copyright (C) 2013 Jason Taylor. Released as open-source under Apache License, Version 2.0.

About

Convert Joise module chains to and from TML.

License:Other


Languages

Language:Java 100.0%