Base class for all script-accessible Lens Studio objects.
Example
// ScriptObject is the base class for all native editor objects. // Use getTypeName() to identify type and Editor.isNull() to check validity. constmodel = this.pluginSystem.findInterface(Editor.Model.IModel) asEditor.Model.IModel; constscene = model.project.scene; constso = scene.addSceneObject(scene.rootSceneObjects[0]); so.name = 'ScriptObjectDemo';
// getTypeName() returns the native type name console.log('Type name:', so.getTypeName());
// isOfType() checks type hierarchy console.log('Is SceneObject:', so.isOfType('SceneObject'));
// Editor.isNull() checks if the native object is still valid console.log('Is valid:', !Editor.isNull(so)); so.destroy(); console.log('After destroy, isNull:', Editor.isNull(so));
Base class for all script-accessible Lens Studio objects.
Example