Skip to main content

InputBuilder

Class

Builds InputPlaceHolders for MLComponent.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Example

//@input vec2 inputSize = {64, 64}
//@input string inputName = "input"

var inputChannels = 3;

var inputBuilder = MachineLearning.createInputBuilder();
inputBuilder.setName(script.inputName);
inputBuilder.setShape(new vec3(script.inputSize.x, script.inputSize.y, inputChannels));

var inputPlaceholder = inputBuilder.build();

Extends

Methods

build()

build(): InputPlaceholder

Builds and returns a new InputPlaceholder.

Returns

InputPlaceholder

Since

Lens Scripting Version 145


getTypeName()

static getTypeName(): TypeName<InputBuilder>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<InputBuilder>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame


setInputTexture()

setInputTexture(texture): InputBuilder

Sets the input texture of the InputPlaceholder to be built.

Parameters

ParameterType
textureTexture

Returns

InputBuilder


setName()

setName(name): InputBuilder

Sets the name of the InputPlaceholder to be built.

Parameters

ParameterType
namestring

Returns

InputBuilder


setSampler()

setSampler(sampler): InputBuilder

Sets sampler for input placeholder builder.

Parameters

ParameterType
samplerSampler

Returns

InputBuilder

Since

Lens Scripting Version 210


setShape()

setShape(shape): InputBuilder

Sets the shape of the InputPlaceholder to be built.

Parameters

ParameterType
shapevec3

Returns

InputBuilder

Since

Lens Scripting Version 310


setTransformer()

setTransformer(transformer): InputBuilder

Sets the Transformer of the InputPlaceholder to be built.

Parameters

ParameterType
transformerTransformer

Returns

InputBuilder