Editor.Model.ObjectContext
ClassContext scoped to a set of scene objects, providing access to the current object selection.
Index
Properties
Methods
Example
// Register a context action that inspects the ObjectContext selection.
const registry = this.pluginSystem.findInterface(
Editor.IContextActionRegistry.interfaceId
) as Editor.IContextActionRegistry;
if (Editor.isNull(registry)) {
console.log('IContextActionRegistry not available');
return;
}
const guard = registry.registerAction((ctx: Editor.IContext) => {
const objCtx = ctx as Editor.Model.ObjectContext;
for (const obj of objCtx.selection) {
console.log('Selected SceneObject:', obj.name);
}
return undefined as unknown as Editor;
});
this.guards.push(guard);
console.log('Object context action registered');
Extends
Properties
selection
readonlyselection:SceneObject[]
Read-only array of currently selected SceneObjects in this context.
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