EditorInteractionProfile
ClassDeclares how stock Scene Editor Move / Rotate / Scale manipulators may interact with a SceneObject.
- Available on all platforms
Since Lens Scripting v378
Declares how stock Scene Editor Move / Rotate / Scale manipulators may interact with a SceneObject.
Attach via SceneObject.createComponent in @runInEditor scripts (gate with ScriptScene.isEditorViewport),
or via Studio Scene Editor Handles helpers.
Studio fires EditorInteractionProfile#onManipulationStarted, EditorInteractionProfile#onManipulationUpdated, and EditorInteractionProfile#onManipulationFinished while stock gizmos drag this object.
Index
Properties
Methods
Example
if (global.scene.isEditorViewport()) {
const eip = handle.createComponent(EditorInteractionProfile.getTypeName());
eip.allowMove = true;
eip.allowRotate = false;
eip.allowScale = false;
eip.constrainToPlane = true;
eip.planeNormal = new vec3(0, 0, 1);
eip.onManipulationFinished.add(function () {
// sync @inputs / requestPersistInput
});
}
Extends
Properties
allowMove
allowMove:
boolean
When false, stock Move manipulator is disabled.
Since
Lens Scripting Version 378
Default Value
true
allowRotate
allowRotate:
boolean
When false, stock Rotate manipulator is disabled.
Since
Lens Scripting Version 378
Default Value
true
allowScale
allowScale:
boolean
When false, stock Scale manipulator is disabled.
Since
Lens Scripting Version 378
Default Value
true
constrainToPlane
constrainToPlane:
boolean
When true, Move keeps the object on the plane through the parent origin with parent-local normal EditorInteractionProfile#planeNormal.
Since
Lens Scripting Version 378
Default Value
false
enabled
enabled:
boolean
If disabled, the Component will stop enacting its behavior.
Default Value
true
Inherited from
isBeingDestroyed
readonlyisBeingDestroyed:boolean
Returns true if this Component is currently being destroyed. Becomes true as soon as
destruction begins via Component#destroy or destruction of its owning SceneObject,
before any OnDestroyEvent callbacks fire.
Since
Lens Scripting Version 364
Example
if (!script.isBeingDestroyed) {
// Component is still fully alive
}
Inherited from
isEnabledInHierarchy
readonlyisEnabledInHierarchy:boolean
Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.
Inherited from
Component.isEnabledInHierarchy
onManipulationFinished
readonlyonManipulationFinished:event0<void>
Fired when a stock Scene Editor Move / Rotate / Scale drag ends on this object.
Since
Lens Scripting Version 378
onManipulationStarted
readonlyonManipulationStarted:event0<void>
Fired when a stock Scene Editor Move / Rotate / Scale drag begins on this object.
Since
Lens Scripting Version 378
onManipulationUpdated
readonlyonManipulationUpdated:event0<void>
Fired each time a stock Scene Editor gizmo updates this object's transform during a drag.
Since
Lens Scripting Version 378
planeNormal
planeNormal:
vec3
Parent-local plane normal used when EditorInteractionProfile#constrainToPlane is true.
Default (0, 0, 1) is the parent local XY plane. Normalized on use; near-zero falls back to (0, 0, 1).
Since
Lens Scripting Version 378
sceneObject
readonlysceneObject:SceneObject
The SceneObject this component is on.
Inherited from
uniqueIdentifier
readonlyuniqueIdentifier:string
Since
Lens Scripting Version 176
Inherited from
Methods
destroy()
destroy():
void
Destroys the component.
Returns
void
Inherited from
getSceneObject()
getSceneObject():
SceneObject
Returns the SceneObject the component is attached to.
Returns
Inherited from
getTransform()
getTransform():
Transform
Returns the Transform this component is attached to.
Returns
Inherited from
getTypeName()
staticgetTypeName():TypeName<EditorInteractionProfile>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<EditorInteractionProfile>
Since
Lens Scripting Version 378
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 matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean