Material Molecule

Add a material store.

Summary
Material Molecule
Preference Dialog
CommentsThe scriptable path to each material has the following formats,
Properties
typestring, ( r )
pref.namestring, ( r )
needsUpdatemixed, ( w )
Functions
attach
detach
delete
rename
clone
serialize
loadTexture

Preference Dialog

Comments

The scriptable path to each material has the following formats,

  • this.materialMoleculeName.materialName from within the same droplet or
  • app.dropletName.materialMoleculeName.materialName from outside the droplet.
For Example,
  this.mesh.setMaterialName(this.Material0.Lef1);
  this.mesh.setMaterialName(app.aDroplet.Material0.brk1);

You can create multi-layered material by adding additional layers of maps, specularMaps, normalMaps, or bumpMaps, each with its own repeat and offset.  Multi-layered materials allow you to,

  • Age an existing 3D model by adding scratch marks, dents, dull patches, etc.
  • Add product labels, embroideries, etc.
  • Mix multiple textures with alpha transparencies.

Properties

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 function dynamically.

needsUpdate

mixed, ( w )

If the input is a material name (string), all textures of that material are updated.  If input is true (boolean), all materials’ textures are updated.

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

rename

rename(name);

Rename this molecule.

Parameters

name(string) a new name.

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

loadTexture

loadTexture(url);

Create a texture from the given url.

Parameters

url(string) a valid http URL or a private vault URL that begins with //.

Returns

(object) a texture object.

Close