ARKit and Scenekit Utilities
generateNode()
Generates a SCNNode for a SvrfMedia with a type _3d. This method can used to generate the whole 3D model, but is not recommended for face filters.
Face Filters
If you want to generate face filters for ARKit, use the generateFaceFilter() method.
Declaration
Parameters
| Parameter | Description | 
|---|---|
| media | The SvrfMediato generate the SCNNode from. The type must be_3d. | 
| success | Success closure. | 
| -- node | The SCNNodegenerated from theSvrfMedia. | 
| failure | Error closure. | 
| -- error | A SvrfError. | 
Return Value
On success, it generates and returns a SCNNode from the SvrfMedia provided. The SCNNode can then be added to a SCNView.
generateFaceFilter()
The Svrf API allows you to access all of Svrf's ARKit compatible face filters and stream them directly to your app. Use the generateFaceFilter method to stream a face filter to your app and convert it into a SCNNode in runtime. You can then add the face filter to SceneKit.
Declaration
Parameters
| Parameter | Description | 
|---|---|
| media | The SvrfMediato generate the face filter from. The type must be_3d. | 
| useOccluder | Use the occluder provided with the 3D model, otherwise it will be removed. | 
| success | Success closure. | 
| -- faceFilter | A class that contains the face filter SCNNode, ability to manage face filter animations, and optional scene overlays. See SvrfFaceFilter. | 
failure | Error closure.
-- error | A SvrfError.
Return Value
On success, it generates and returns a SvrfFaceFilter.
SvrfFaceFilter
The class SvrfFaceFilter contains the face filter SCNNode, ability to manage face filter animations, and optional scene overlays.
Blend Shapes
The 3D animation terms "blend shapes", "morph targets", and "pose morphs" are often used interchangeably.
setBlendShapes()
This function enumerates through the node's hierarchy. Any children nodes with morph targets that follow the ARKit blend shape naming conventions will be affected.
Declaration
Properties
| Property | Description | 
|---|---|
| looping | When set to true(default), face filter animations are repeated indefinitely. Note: If set tofalsewhile an animation is playing, animation will play through to completion. | 
| animating | Whether animations should play. Set to falseto pause the animation. | 
| sceneOverlay | 2D face filter overlay included with this SvrfFaceFilter. Some filters provide a 2D component to be overlaid on theSCNScene. Set this as your scene'soverlaySKScene. | 
| node | The root node for the face filter. | 
| animations | |
| setBlendShapes | Blend shape mapping allows Svrf's ARKit compatible face filters to have animations that are activated by your user's facial expressions. | 
| animationDidStop | |
| addAnimation |