Developer
Overview
ML MasterVideo gives client exports to read scenes, start playback and reach the editor modules, two server exports, and one editable hook in open/client.lua.
Client Exports
1local sceneManager = exports.ml_mastervideo:GetSceneManager()
2local playback = exports.ml_mastervideo:GetPlaybackModule()
3local scene = exports.ml_mastervideo:GetSceneById(sceneId)
4local current = exports.ml_mastervideo:GetCurrentSceneData()
5local synced = exports.ml_mastervideo:GetSyncedScenesModule()GetSceneManager(): the SceneManager module, for direct control of scene entitiesGetPlaybackModule(): the Playback module, to start scenes from codeGetSceneById(sceneId): scene data by IDGetCurrentSceneData(): the scene loaded in the editorGetSyncedScenesModule(): the SyncedScenes module
Editor Modules
1local freecam = exports.ml_mastervideo:GetFreecamModule()
2exports.ml_mastervideo:StartCameraPlacement(coords, rotation, onSave)StartCameraPlacement(coords?, rotation?, onSave?): opens the free camera to place a shot.onSaveruns when the player saves itMLAdminOpen(),MLAdminPanel(): open the editor and give its label and icon, for a staff menu that lists admin toolsGetFreecamModule(),GetAppearanceModule(),GetAutoDriveModule(),GetPlacementModule(),GetPossessionModule(),GetPreviewModule(),GetRecordingModule(),GetWorldRecorderModule(): the module tables used by the editor
Server Exports
1local ready = exports.ml_mastervideo:IsInitialized()
2local count = exports.ml_mastervideo:GetSceneCount()IsInitialized():truewhen the database is readyGetSceneCount(): number of stored scenes
Client Hook
Located in open/client.lua.
1function OpenClient.OnSceneAmbiance(active, data)
2endFires when a scene takes over or releases the time of day and weather. active is true when the scene sets them and false when it lets go. When active is true, data holds weather, hour and minute, each nil when the scene does not set it. On release data is nil.
A weather or time sync resource keeps writing its own values and fights the scene. Pause it here while a scene is active and resume it when the scene ends. The file has commented examples for common sync resources.
Scene Data Structure
Each scene holds entities, camera tracks and a timeline:
- Entities: peds, vehicles and props with position, appearance and behavior (idle, animation, scenario, driving, recorded path)
- Camera tracks: named tracks with keyframes for position, rotation, FOV and interpolation
- Timeline: clips per entity with start time, duration and the animation, scenario or recording they play
Examples
1local playback = exports.ml_mastervideo:GetPlaybackModule()
2playback.StartScene('my_scene_id', { countdown = 0 })Options: countdown in seconds before the scene starts (3 by default), loop, startWithCam and startTime in seconds.