Client Controller¶
- class ClientController¶
[CLIENT]
Sends requests to the server
-
staticmethod SetFrame(frame:
integer)¶ Set to a
frameof the animationThis method also sends the (entity) settings.
-
staticmethod SelectEntity(entity:
Player|SMHEntity, enttable:Set<Entity>)¶ Select the
entityrecord keyframes.For multi-selection, this function gets called again, but with an accumulating
enttableargument which is usually comes from theSMH.State.Entityfield
-
staticmethod DeleteAudio(id:
integer, pointer:SMHAudioClipPointer)¶ Delete the audio clip from its
idand its associatedpointer
- staticmethod DeleteAllAudio()¶
Delete all audio clips
- staticmethod UpdateServerAudio()¶
Notify the server of changes to audio updates.
This must be called after any functions that add, delete, or trim audio
-
staticmethod Record(frame?:
integer)¶ Record a keyframe, either at a specified
frameor on the playhead (SMH.State.Frame)
-
staticmethod Stretch(
frames: {[1]:SMHFramePointer, [2]:integer}[],
amount:number
)¶ Modify the animation length, composed by the selected group of keyframes.
Two types of behavior happen with stretching / compression
If stretching, this will replace keyframes outside of the selected keyframes
If compressing, this will replace keyframes inside the selected keyframes
The stretching / compression pivot is the first frame.
-
staticmethod Smooth(frames:
integer[], maxPasses:integer)¶ Apply the arc trick (Eltorro64Rus’s smoothing method) to reduce the jerkiness of a motion
Smoothing is applied to the animator’s selected
frames. ThemaxPassesis the smoothing factor: higher results in a smoother result.
-
staticmethod UpdateKeyframe(
keyframeId:integer[],
updateData:any,
singledata:any
)¶ If internal
updateData`` for a keyframe of a specifickeyframeId` has been modified, then update the keyframe data on the server realm
-
staticmethod CopyKeyframe(keyframeId:
integer[], frame:table)¶ Copies an array of keyframe data and move them to a new place on the timeline
-
staticmethod DeleteKeyframe(keyframeId:
integer[])¶ Delete the keyframes of the specified
keyframeIds
-
staticmethod StartPlayback(startFrame:
integer)¶ Signal the playback manager to animate all entities owned by the client
- staticmethod StopPlayback()¶
Signal the playback manager to stop for the client
- staticmethod GetServerSaves()¶
Get all animation saves owned by the server
-
staticmethod GetModelList(path:
string, loadFromClient?:boolean)¶ Get a list of models for an animation save of the specified
path
- staticmethod GetServerEntities()¶
Get all animatable entities owned by the client from the server
-
staticmethod Load(
path:string,
modelName:string,
loadFromClient:boolean
)¶ Load an animation save from the
pathfor an entity specified by itsmodelName(usually the model or its name defined by the Properties menu)
-
staticmethod GetModelInfo(
path:string,
modelName:string,
loadFromClient:boolean
)¶ For an animation save defined by
path, get more information about the entity ofmodelName
-
staticmethod Save(path:
string, isAutoSave?:boolean)¶ Request the server to save an animation into the
path.If we are using the autosave feature,
isAutoSaveis set totrue, which lets the server handle the autosaved animation.
- staticmethod QuickSave()¶
Uses the
Savefunction to save an animation to the root
- staticmethod RequestUnpack()¶
Request the server to remove
SMHPackageinfo from every animatable entity
-
staticmethod RequestPack(path:
string)¶ Request the server to pack animation data into an
SMHPackagefor every animatable entityDepending on the value of
smh_packentity,pathgets stored in theSMHPackageof an entity
-
staticmethod DeleteSave(
path:string,
isFolder:boolean,
deleteFromClient:boolean
)¶ Request the server to delete the animation file. If
deleteFromClientistrue, then delete the animation file directly
-
staticmethod SaveAudioSeq(path:
string)¶ Save the audio clips on the timeline to an audio sequence file (defined as .txt)
-
staticmethod DeleteAudioSeq(path:
string)¶ Delete the audio sequence file
-
staticmethod LoadAudioSeq(path:
string, setFrameRate:boolean)¶ Load the audio sequence file from the
path.If
setFrameRateistrue, this also sets the frame count and FPS
-
staticmethod ToggleRendering(renderCmd:
string, StartFrame:integer)¶ Start or stop the rendering process, depending on
SMH.RendererstateThe
StartFramecan be specified to begin the render at a specific frame
- staticmethod OpenMenu()¶
Open the timeline
- staticmethod CloseMenu()¶
Close the timeline
-
staticmethod UpdateState(newState:
NewState, updatePlaybackControls:any)¶ Update
SMH.StatewithnewState
-
staticmethod UpdateSettings(newSettings:
any)¶ Update settings for the selected entities
-
staticmethod UpdateUISetting(setting:
any, value:any)¶ Update the
settingon the UI to avalue
-
staticmethod SetRendering(rendering:
boolean)¶ Notify the server about the new
renderingstate
- staticmethod UpdateGhostState()¶
Update the server ghost data
-
staticmethod ApplyEntityName(ent:
Entity, name:string)¶ Update the entity’s name from the Properties menu for the server
- staticmethod UpdateTimeline()¶
Update the timeline for selected entities
- staticmethod RequestModifiers()¶
Request new modifier data from the server
- staticmethod AddTimeline()¶
Add a timeline
- staticmethod RemoveTimeline()¶
Remove a timeline
-
staticmethod UpdateModifier(i:
integer, mod:string, check:boolean)¶ Notify the server of an updated modifier state
-
staticmethod UpdateKeyframeColor(color:
Color, timeline:integer)¶ Give a new keyframe
colorto the server, for a specifiedtimeline.
-
staticmethod SetPreviewEntity(path:
string, model:string, loadFromClient:boolean)¶ Show the preview entity of the first frame of an animation (specified by
path), with a givenmodel
-
staticmethod SpawnEntity(path:
string, model:string, loadFromClient:boolean)¶ Spawn an animated entity for an animation save specified by
pathand the animation specified bymodel
-
staticmethod SetTimeline(settings:
Properties, presetname:string)¶ Change the timeline to modify on the server
-
staticmethod RequestTimelineInfo(name:
string)¶ Get new timeline information of specified
namefrom the server
-
staticmethod RequestWorldData(frame:
integer)¶ Get world keyframe data from the server for a specified
frame
-
staticmethod UpdateWorld(str:
string, key:string)¶ Update world keyframe data on the server
-
staticmethod StartPhysicsRecord(
framecount:integer,
interval:integer,
entities:table<Entity,integer>
)¶ Tell the server to start its physics recorder
- staticmethod StopPhysicsRecord()¶
Tell the server to stop its physics recorder
- staticmethod RequestNewSession()¶
Begin a new slate. Also tell the server to remove everything
-
staticmethod SetFrame(frame: