Editor.Model.IModel
ClassCore plugin component interface providing access to the current Lens Studio project and its lifecycle events.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
console.log('IModel.interfaceId:', Editor.Model.IModel.interfaceId);
console.log('project:', model.project);
// Listen for project lifecycle signals.
// onProjectChanged fires when switching projects (open/new), not for
// in-project edits. onProjectSaving fires after a save completes, so
// it's the place to react to "Save As" landing at a new path.
const c1 = model.onProjectChanged.connect(() => {
console.log('Switched to a new project');
});
this.connections.push(c1);
const c2 = model.onMetaInfoChanged.connect(() => {
console.log('Meta info changed');
});
this.connections.push(c2);
const c3 = model.onProjectAboutToBeChanged.connect(() => {
console.log('Project about to change');
});
this.connections.push(c3);
const c4 = model.onProjectSaving.connect((saveMode: Editor.Model.ProjectSaveMode, path: Editor.Path) => {
console.log('Project saved, mode:', saveMode, 'path:', path);
});
this.connections.push(c4);
Extends
Properties
interfaceId
staticinterfaceId:InterfaceId
Unique identifier for this interface, used when resolving it via the plugin system.
onMetaInfoChanged
readonlyonMetaInfoChanged:signal0<void>
Signal fired when project meta information changes.
onProjectAboutToBeChanged
readonlyonProjectAboutToBeChanged:signal0<void>
Signal fired just before the active project is replaced.
onProjectChanged
readonlyonProjectChanged:signal0<void>
Signal fired after a new project has been loaded and is ready.
onProjectLocationChanged
readonlyonProjectLocationChanged:signal0<void>
Signal fired when the on-disk location of the current project changes, for example after Save As.
onProjectSaving
readonlyonProjectSaving:signal2<ProjectSaveMode,Path,void>
Signal fired when the project is about to be saved.
project
readonlyproject:Project
The currently loaded project instance, providing access to its scene and asset manager.
Methods
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
openProject()
openProject(
path):void
Opens a project at the given file system path.
Parameters
| Parameter | Type |
|---|---|
path | Path |
Returns
void
setDefaultProject()
setDefaultProject():
void
Loads the default template project.
Returns
void
setEmptyProject()
setEmptyProject():
void
Loads a blank empty project.
Returns
void