Class AlembicStreamPlayer
This component allows data streaming from Alembic files. It updates children nodes (Meshes, Transforms, Cameras, etc.) to reflect the Alembic data at the given time.
Namespace: UnityEngine.Formats.Alembic.Importer
Syntax
public class AlembicStreamPlayer : MonoBehaviour, ISerializationCallbackReceiver
Properties
CurrentTime
Get or set the current time relative to the Alembic file time range (scale in seconds). This is clamped between 0 and the alembic time duration.
Declaration
public float CurrentTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
Duration
Get the duration of the Alembic file (in seconds).
Declaration
public float Duration { get; }
Property Value
Type | Description |
---|---|
Single |
EndTime
Get or set the end timestamp of the streaming time window (scale in seconds). This is clamped to the time range of the Alembic source file.
Declaration
public float EndTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
MediaDuration
The duration of the Alembic file (in seconds).
Declaration
public float MediaDuration { get; }
Property Value
Type | Description |
---|---|
Single |
MediaEndTime
The end timestamp of the Alembic file (scale in seconds).
Declaration
public float MediaEndTime { get; }
Property Value
Type | Description |
---|---|
Single |
MediaStartTime
The start timestamp of the Alembic file (scale in seconds).
Declaration
public float MediaStartTime { get; }
Property Value
Type | Description |
---|---|
Single |
PathToAbc
The path to the Alembic asset. When in a standalone build, the returned path is prepended by the streamingAssets path.
Declaration
public string PathToAbc { get; }
Property Value
Type | Description |
---|---|
String |
Settings
The stream import options. NOTE: these options are shared between all instances of this asset.
Declaration
public AlembicStreamSettings Settings { get; set; }
Property Value
Type | Description |
---|---|
AlembicStreamSettings |
StartTime
Get or set the start timestamp of the streaming time window (scale in seconds). This is clamped to the time range of the Alembic source file.
Declaration
public float StartTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
VertexMotionScale
Get or set the scalar multiplier to the Alembic vertex speed (magnification factor for velocity). Default value is 1.
Declaration
public float VertexMotionScale { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
LoadFromFile(String)
Loads a different Alembic file.
Declaration
public bool LoadFromFile(string newPath)
Parameters
Type | Name | Description |
---|---|---|
String | newPath | Path to the new file. |
Returns
Type | Description |
---|---|
Boolean | True if the load succeeded, false otherwise. |
ReloadStream(Boolean)
Closes and reopens the Alembic stream. Use this method to apply the new stream settings.
Declaration
public bool ReloadStream(bool createMissingNodes = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | createMissingNodes | If true, it also recreates the missing GameObjects for the Alembic nodes. |
Returns
Type | Description |
---|---|
Boolean | True if the stream was successfully reopened, false otherwise. |
RemoveObsoleteGameObjects()
This function removes all child game objects that don't have a corresponding alembic node. Note that is the object is a part of a prefab, this call will fail. Please note that GameObjects that are a part of a Prefab cannot be deleted.
Declaration
public void RemoveObsoleteGameObjects()
UpdateImmediately(Single)
Update the child GameObject's data to the CurrentTime (The regular update happens during the LateUpdate phase).
Declaration
public void UpdateImmediately(float time)
Parameters
Type | Name | Description |
---|---|---|
Single | time | The timestamp to stream from the asset file. |