SetOnProjectStateChanged

Called when the stage that the web client is at has changed.

Event callback

OnProjectStateChanged(state: int)

Parameters

  • state (int): state value.
    • Sym3EngineState.Uninitialized = Sym3 engine is uninitialized.
    • Sym3EngineState.AwaitingConnection = Sym3 engine is awaiting connection.
    • Sym3EngineState.AwaitingConnectionParameters = Sym3 engine is awaiting connection parameters.
    • Sym3EngineState.AwaitingProjectCleared = Sym3 engine is awaiting ProjectCleared.
    • Sym3EngineState.AwaitingProjectParts = Sym3 engine is awaiting ProjectParts.
    • Sym3EngineState.AwaitingProjectValidation = Sym3 engine is awaiting ProjectValidation.
    • Sym3EngineState.AwaitingProjectInitialization = Sym3 engine is awaiting ProjectInitialisation.
    • Sym3EngineState.AwaitingProjectLoadComplete = Sym3 engine is awaiting ProjectLoadComplete.
    • Sym3EngineState.Active = Sym3 engine is active
    • Sym3EngineState.MaxConnectionsExceeded = Connection was rejected by the server, as all available web client connections that your license allows are in use.
    • Sym3EngineState.ActiveAndRendering = Sym3 engine is active and rendering.

Examples

Subscribes to this event.

SYM3.SetOnProjectStateChanged(onProjectStateChanged);

function onProjectStateChanged(state)
{
	let info = "";
	switch (state)
	{
	case Sym3EngineState.Uninitialized:
		info = "Initializing...";
		break;
	case Sym3EngineState.AwaitingConnection:
		info = "Connecting to server...";
		break;
	case Sym3EngineState.AwaitingConnectionParameters:
		info = "Establishing connection parameters...";
		break;
	case Sym3EngineState.AwaitingProjectCleared:
		info = "Clearing old project...";
		break;
	case Sym3EngineState.AwaitingProjectParts:
		info = "Retrieving project parts...";
		break;
	case Sym3EngineState.AwaitingProjectValidation:
		info = "Validating project...";
		break;
	case Sym3EngineState.AwaitingProjectInitialization:
		info = "Initializing project...";
		break;
	case Sym3EngineState.MaxConnectionsExceeded:
		info = "Max connections exceeded!";
		break;
	case Sym3EngineState.AwaitingProjectLoadComplete:
		info = "Performing final project load...";
		break;
	case Sym3EngineState.Active:
	case Sym3EngineState.ActiveAndRendering:
	default:
		break;
	}
	if (info)
		{
		console.log(info);
		}
}