Loads and returns a specific object in the scene source.
- iOS 8.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
- Xcode 7.1+
The unique identifier of an object in the scene source.
The class of object to load.
A new SceneKit object (of the specified class) containing the requested scene source entry, or
nil if no such object exists in the scene source.
SceneKit recognizes objects of the following classes in scene files:
Each object in a scene file has an identifier that is unique for its class. These identifiers are determined by the software that created the scene file—for example, they may be descriptive names assigned by an artist using 3D authoring tools. For SceneKit classes with a name property (such as nodes and geometries), the name of an object loaded from a scene file is based on its identifier in the scene file.
If you don’t have the identifier for an object you want to load, use the
identifiers method to find the identifiers for objects in a scene file. You can also see the identifier for each object in a scene file when viewing it in Xcode’s scene editor.
Calling this method instantiates an object of the specified SceneKit class and loads all content from the scene file corresponding to the requested entry. Keep in mind that loading one SceneKit object may also load other objects and their contents, such as the lights, cameras, or geometries attached to a node.
For example, the following method finds the identifier for a geometry and then loads it (and any animations or materials attached to it):