Editor.Model.Project
ClassRepresents the open Lens Studio project, providing access to the scene, asset manager, and project settings.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const project = model.project;
console.log(`Project file: ${project.projectFile}`);
console.log(`Project directory: ${project.projectDirectory}`);
console.log(`Assets directory: ${project.assetsDirectory}`);
console.log(`Cache directory: ${project.cacheDirectory}`);
const scene = project.scene;
const rootObjects = scene.rootSceneObjects;
console.log(`Scene root objects: ${rootObjects.length}`);
const assetManager = project.assetManager;
console.log(`Total assets: ${assetManager.assets.length}`);
const metaInfo = project.metaInfo;
console.log(`Project meta info: ${metaInfo}`);
// Listen for entity additions (SceneObject type as example)
const conn = project.onEntityAdded('SceneObject').connect((entity) => {
console.log(`Entity added: ${entity.type}`);
});
this.connections.push(conn);
Extends
Properties
assetManager
readonlyassetManager:AssetManager
The asset manager for this project, used to create, find, and manage all project assets.
assetsDirectory
readonlyassetsDirectory:Path
Path to the project's assets directory on disk.
cacheDirectory
readonlycacheDirectory:Path
Path to the project's cache directory on disk.
history
readonlyhistory:any
The undo/redo history stack for this project.
metaInfo
metaInfo:
MetaInfo
Metadata associated with the project, such as name and version info.
projectDirectory
readonlyprojectDirectory:Path
Root directory path of the project on disk.
projectFile
readonlyprojectFile:Path
Path to the project's main file on disk.
scene
readonlyscene:Scene
The active scene for this project, containing all scene objects and cameras.
targetPlatform
targetPlatform:
TargetPlatform
Target platform (Snapchat or Spectacles) currently selected for the project.
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
onEntityAdded()
Returns a signal that fires after an entity of the given type name has been added to the project.
Parameters
| Parameter | Type |
|---|---|
typeName | string |
Returns
onEntityAdding()
Returns a signal that fires just before an entity of the given type name is added to the project.
Parameters
| Parameter | Type |
|---|---|
typeName | string |
Returns
onEntityRemoved()
Returns a signal that fires after an entity of the given type name has been removed, providing its UUID.
Parameters
| Parameter | Type |
|---|---|
typeName | string |
Returns
onEntityUpdated()
Returns a signal that fires after an entity of the given type name has been updated.
Parameters
| Parameter | Type |
|---|---|
typeName | string |
Returns
onEntityUpdating()
Returns a signal that fires just before an entity of the given type name is updated.
Parameters
| Parameter | Type |
|---|---|
typeName | string |
Returns
save()
save():
void
Saves the project to its current file location.
Returns
void
saveTo()
saveTo(
absoluteFilePath):void
Saves the project to a specified file path.
Parameters
| Parameter | Type |
|---|---|
absoluteFilePath | Path |
Returns
void