Description

Represents a GLTF 3D Model.

Example

// @input Asset.BitmojiModule bitmojiModule
// @input Asset.RemoteMediaModule remoteMediaModule
// @input Asset.Material pbrMaterialHolder

script.bitmojiModule.requestBitmoji3DResource(
function (bitmoji3DResource) {
script.remoteMediaModule.loadResourceAsGltfAsset(
bitmoji3DResource,
onDownloaded,
onFail
)
}
)

function onDownloaded (gltfAsset){
var root = scene.createSceneObject("BitmojiAvatar");
var gltfSettings = GltfSettings.create();
gltfSettings.convertMetersToCentimeters = true;
var avatar = gltfAsset.tryInstantiateWithSetting(root, script.pbrMaterialHolder, gltfSettings);
}

function onFail (e){
print(e);
}
interface GltfAsset {
    extras: string;
    name: string;
    uniqueIdentifier: string;
    getTypeName(): string;
    isOfType(type): boolean;
    isSame(other): boolean;
    tryInstantiate(parent, material): SceneObject;
    tryInstantiateWithSetting(parent, material, gltfSettings): SceneObject;
}

Hierarchy (view full)

Properties

extras: string
name: string

Description

The name of the Asset in Lens Studio.

uniqueIdentifier: string

Methods

  • Returns string

    Description

    Returns the name of this object's type.

  • Parameters

    • type: string

    Returns boolean

    Description

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

  • Parameters

    Returns boolean

    Description

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

Generated using TypeDoc