Local Overrides Sample: Automatically enable 3D Positioning mode - bp2008/ui3 GitHub Wiki

This script makes it so that 3D Positioning mode gets enabled automatically whenever switching to a PTZ camera that supports it.

Bugfix 2024-07-06: This script no longer enables 3D positioning for group streams (which interfered with opening PTZ cameras by left or right clicking).

To learn more about ui3-local-overrides, see: Local Overrides Scripts and Styles

ui3-local-overrides.js

BI_CustomEvent.AddListener("OpenVideo", function (loading)
{
	if (loading && (!loading.isGroup || loading.isFakeGroup))
		relativePTZ.enable3dPositioning();
});