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
Old | New |
---|---|
Animation | AnimationPlayer |
AnimationLayer | AnimationAsset |
AnimationMixer | AnimationPlayer |
AnimationMixer.getLayers() | AnimationPlayer.clips |
AnimationMixer.speedRatio | AnimationClip.playbackSpeed |
AnimationMixer.start(name: string, offset: number, cycles: number) | AnimationPlayer.playClipAt(name: string, time: number) |
AnimationMixerLayer | AnimationAsset |
AnimationMixerLayer.name | AnimationTrack.name |
AnimationMixerLayer.speedRatio | AnimationClip.playbackSpeed |
BlendShapes | RenderMeshVisual.blendShapesEnabled |
Camera.enableClearColor | ColorRenderTarget.clearColorOption |
Camera.supportedColorRenderTargetCount | Camera.getSupportedColorRenderTargetCount() |
DepthStencilRenderTarget.clearDepth | DepthStencilRenderTarget.clearDepthValue |
Head.getLandmark(index: number) | Head.onLandmarksUpdate: event1<vec2[], void> |
ImagePickerTextureProvider | MediaPickerTextureProvider |
ImagePickerTextureProvider.setImageChangedCallback(callback: () => void): void | MediaPickerTextureProvider.setFilePickedCallback(callback: () => void): void |
OutputBuilder.setShape(shape: vec3) | OutputBuilder.setShape(shape: vec3) |
Pass.frustumCull | Pass.frustumCullMode |
quat.quatFromEuler(x: number, y: number, z: number) | quat.fromEulerAngle(x: number, y: number, z: number) |
RenderTargetProvider.clearColorEnabled | RenderTargetProvider.clearColorOption |
RenderTargetProvider.fxaa | fxaa |
RenderTargetProvider.msaa | RenderTargetProvider.antialiasingMode |
SceneEvent.TurnOnEvent | OnStartEvent |
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.api | api |
VideoTextureProvider.getStatus() | VideoTextureProvider.status |
VideoTextureProvider.setOnReady(onReadyCallback: () => void) | VideoTextureProvider.onPlaybackReady: event0<void> |