Editor.Model.MetaInfo
ClassMetadata of the current project's Lens.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const metaInfo = model.project.metaInfo;
console.log(`Lens name: ${metaInfo.lensName}`);
console.log(`Is lens name valid: ${Editor.Model.MetaInfo.isLensNameValid(metaInfo.lensName)}`);
console.log(`Icon path: ${metaInfo.iconPath.toString()}`);
console.log(`Is icon set: ${metaInfo.isIconSet}`);
console.log(`Activation camera: ${metaInfo.activationCamera}`);
const applicability: Editor.Model.LensApplicability[] = metaInfo.lensApplicability;
console.log(`Lens applicability count: ${applicability.length}`);
for (const a of applicability) {
console.log(` Applicability value: ${a}`);
}
Properties
activationCamera
activationCamera:
LensActivationCamera
The camera which will be activated when this Lens is turned on.
buildVersion
buildVersion:
string
Build version string of the Lens in major.minor.patch format, for example 1.0.2, shown as Build Version in the Spectacles project settings.
iconPath
readonlyiconPath:Path
The absolute path to the Lens Icon.
isIconSet
readonlyisIconSet:boolean
Whether an Lens icon has been set.
lensApplicability
lensApplicability:
LensApplicability[]
Where the Lens can be used.
lensClientCompatibilities
lensClientCompatibilities:
LensClientCompatibility[]
Client surfaces this Lens declares compatibility with.
lensName
lensName:
string
The publicly visible name of the Lens.
lensNameLocalizations
readonlylensNameLocalizations:Path
Absolute path to the project's copy of the Lens name localizations file, or an empty path if none is set.
packageId
packageId:
string
Package identifier of the Lens, such as com.specs.whiteboard, shown as Package ID in the Spectacles project settings.
videoPreviewPath
readonlyvideoPreviewPath:Path
Absolute path to the Lens video preview file.
Methods
isLensNameValid()
staticisLensNameValid(lensName):boolean
Checks whether the Lens Name is valid. See Project Info guide to learn more.
Parameters
| Parameter | Type |
|---|---|
lensName | string |
Returns
boolean
setIcon()
setIcon(
externalPath):void
Sets the icon as the Lens' icon.
Parameters
| Parameter | Type |
|---|---|
externalPath | Path |
Returns
void
setLensNameLocalizations()
setLensNameLocalizations(
externalPath):void
Sets the JSON file of localized Lens names by copying it into the project; an empty path removes the current file. Paths without a .json extension are ignored.
Parameters
| Parameter | Type |
|---|---|
externalPath | Path |
Returns
void
setVideoPreview()
setVideoPreview(
externalPath):void
Sets the video preview shown for the Lens from the given external file.
Parameters
| Parameter | Type |
|---|---|
externalPath | Path |
Returns
void