Material Molecule

From oWiki

Jump to: navigation, search

Contents


Preference Dialog

File:Material_pref.png

Attributes

type

string  ( r )
Type of this molecule, 'material'.

pref.name

string  ( r )
The scriptable name for this molecule. This name can be set using rename method dynamically.


Methods

rename(n)

n: string

Rename this molecule.

clone()

Return: a molecule

Create a clone of this molecule.

attach(droplet)

droplet: a droplet object (e.g. app.box.droplet)

Attach this molecule to a droplet.

detach()

Remove this molecule from its droplet.

deleteMod()

Delete this molecule.

serialize()

Return: string

Serialize this molecule into its JSON representation.

numMaterials()

Return: int

Returns the number of materials this molecule currently holds.

getMaterialName( i )

i: int
Return: string

Returns the name of material at index i.

numTechniques( m )

m: string
Return: int

Returns the number of techniques the material given by name m uses.

numPasses( m, t )

m: string
t: int
Return: int

Returns the number of passes the technique at index t of the material given by name m uses.

numTextureUnits( m, t, p )

m: string
t: int
p: int
Return: int

Returns the number of texture units the pass at index p of a technique at index t and the material given by name m uses.

getPass( m, t, p )

m: string
t: int
p: int
Return: a Pass object

Returns the Pass at index p of the technique at index t and the material given by name m.

createPass( m, t )

m: string
t: int
Return: a Pass object

Create a Pass and append to the end of the existing passes associated with the technique at index t and the material given by name m.

removePass( m, t, p )

m: string
t: int
p: int

Remove the Pass at index p of the technique at index t and the material given by name m.

removeAllPasses( m, t )

m: string
t: int

Remove all Passes of the technique at index t and the material given by name m.

movePass( m, t, s, d )

m: string
t: int
s: int
d: int

Move the Pass at index s to a different index d of the technique at index t and the material given by name m.

getTextureUnit( m, t, p, i )

m: string
t: int
p: int
i: int
Return: a TextureUnit object

Returns the TextureUnit at index i of the Pass at index p, the technique at index t, and the material given by name m.

reload( m )

m: string

Reloads the material given by name m.

loadImage( url )

url: string

Preloads an image from location url.
Personal tools