MohoLayer:ScriptData()
Version added: 11.0
Return value:
example use cases are below.
Note that it is good practice to identify data items by the script that creates them. Consider the keys to be Globals and prefix them with a unique identifier MyScriptID -- e.g. for the hayasidist utility function the prefix might be HS_Utility_ and keys named such as HS_Utility_Int Value.
Note that it is good practice to identify data items by the script that creates them. Consider the keys to be Globals and prefix them with a unique identifier MyScriptID -- e.g. for the hayasidist utility function the prefix might be HS_Utility_ and keys named such as HS_Utility_Int Value.
local ScriptInfo = moho.layer:ScriptData()
ScriptInfo:Set("MyScriptID_Int Value", 42)
ScriptInfo:Set("MyScriptID_Bool Value", true)
ScriptInfo:Set("MyScriptID_StringName", "This is a saved string.")
local v = LM.Vector2:new_local()
v:Set(5.6, 7.8)
ScriptInfo:Set("MyScriptID_Saved Vector2", v)
local v = LM.Vector3:new_local()
v:Set(3.4, 5.6, 7.8)
ScriptInfo:Set("MyScriptID_Saved Vector3", v)
if (ScriptInfo:HasKey("MyScriptID_Saved Vector3")) then
local v = ScriptInfo:GetVector3("MyScriptID_Saved Vector3")
print(v.x, v.y, v.z)
end
print("Layer Script Data")
for i = 0, ScriptInfo:CountKeys() - 1 do
local keyName = ScriptInfo:GetKeyName(i)
print(keyName, ScriptInfo:GetString(keyName))
end
Search results
Usage of 'ScriptData' is found in the following scripts:
AE Meshinstance (Original Edition) by A.Evseeva
View Code
MR Guides (Original Edition) by eugenebabich
View Code
MR Overlay (Moho 13.5 Edition) by eugenebabich
View Code
MR Overlay (Moho 14.1+ Edition) by eugenebabich
View Code
Switch hands organizer (Original Edition) by A.Evseeva
View Code
MR Path (Original Edition) by eugenebabich
View Code
MR Pose Tool (Original Edition) by eugenebabich
View Code