Skip to main content

Lens API Deprecation

Throughout the history of Lens Studio we’ve occasionally deprecated APIs or systems, usually because we’ve replaced them with a newer more powerful version. For instance we recently deprecated AnimationMixer in favor of AnimationPlayer to make it easier to build animated Bitmoji lenses. In these cases while we deprecated the previous API, it was just a suggestion and nothing prevented continued use of the deprecated API. Going forward though, new Lens Studio versions will not allow publishing lenses using deprecated APIs. This will allow us to continue growing the platform in a sustainable way.

Starting from Lens Studio 5.8.0, Lens Studio will warn you anytime you use a deprecated API call, create a deprecated Component, or use a deprecated asset type in your project. These warnings are intended to smooth the transition and give you time to adjust your workflows to use the modern replacements. In a later Lens Studio version still to be determined, those warnings will turn to errors and prevent usage of the APIs, Components, or Assets.

Once deprecated APIs are blocked, it will still be possible to use an earlier Lens Studio version, or one where the API you’re interested in was not yet deprecated, in order to publish your lens.

Deprecated API replacements

OldNew
AnimationAnimationPlayer
AnimationLayerAnimationAsset
AnimationMixerAnimationPlayer
AnimationMixer.getLayers()AnimationPlayer.clips
AnimationMixer.speedRatioAnimationClip.playbackSpeed
AnimationMixer.start(name: string, offset: number, cycles: number)AnimationPlayer.playClipAt(name: string, time: number)
AnimationMixerLayerAnimationAsset
AnimationMixerLayer.nameAnimationTrack.name
AnimationMixerLayer.speedRatioAnimationClip.playbackSpeed
BlendShapesRenderMeshVisual.blendShapesEnabled
Camera.enableClearColorColorRenderTarget.clearColorOption
Camera.supportedColorRenderTargetCountCamera.getSupportedColorRenderTargetCount()
DepthStencilRenderTarget.clearDepthDepthStencilRenderTarget.clearDepthValue
Head.getLandmark(index: number)Head.onLandmarksUpdate: event1<vec2[], void>
ImagePickerTextureProviderMediaPickerTextureProvider
ImagePickerTextureProvider.setImageChangedCallback(callback: () => void): voidMediaPickerTextureProvider.setFilePickedCallback(callback: () => void): void
OutputBuilder.setShape(shape: vec3)OutputBuilder.setShape(shape: vec3)
Pass.frustumCullPass.frustumCullMode
quat.quatFromEuler(x: number, y: number, z: number)quat.fromEulerAngle(x: number, y: number, z: number)
RenderTargetProvider.clearColorEnabledRenderTargetProvider.clearColorOption
RenderTargetProvider.fxaafxaa
RenderTargetProvider.msaaRenderTargetProvider.antialiasingMode
SceneEvent.TurnOnEventOnStartEvent
SceneObject.getAllComponents()SceneObject.getComponents(componentType : ComponentNameMap)
SceneObject.getComponentByIndex(componentType : ComponentNameMap,index: number)SceneObject.getComponents(componentType : ComponentNameMap)[index: number]
SceneObject.getComponentCount(componentType)getComponents(componentType).length
SceneObject.getFirstComponent(componentType : ComponentNameMap)SceneObject.getComponent(componentType : ComponentNameMap)
SceneObject.getRenderLayer()layer
SceneObject.setRenderLayer()layer
ScriptComponent.apiapi
VideoTextureProvider.getStatus()VideoTextureProvider.status
VideoTextureProvider.setOnReady(onReadyCallback: () => void)VideoTextureProvider.onPlaybackReady: event0<void>
Was this page helpful?
Yes
No