-
Notifications
You must be signed in to change notification settings - Fork 3
functions
Quick message: Never remove or change websocket in the functions.
List of functions:
- Get Model Information
- Get Token and Authenticate
- Get Get Traking Parameters
- Get VtubeStudio statistics
- Get Api state
- Get VtubeStudio directory's
- Get Hotkeys
- Get List of all Models
- Get Item list
- Get Expression State
- Get scene lighting overlay color
- Change Current Model
- List all Current Model Art Mesh data
- Move Model
- Change Model Color
- Check if face is detected
- Asking user to select ArtMeshes
- Request execution of hotkeys
- Set Expression State
- Load Item
- Remove Item
- Control Item and Item Animation
- Move Item
token(websocket) and authen(websocket,authtoken)
The function returns a token when called.
Data the function handles page
authtoken = await token(websocket)#gets token
authen(websocket,authtoken)#uses token to authenticate session
gettrackparam(websocket)
I have not used this parameter, so I do not have an example.
Data the function handles page
getmd(websocket)
You can use the code below to get specific data about the model.
Data the function handles page
model1 = await getmd(websocket)
model1id = model1["data"]["modelID"]#note this can also be used in the other fuctions
print(model1id)
getstat(websocket)
You can use getstat to get statistics about your VTube Studio session, for example, uptime (how long the program has been running).
The data that the function handles can be found on this page
stat = await getstat(websocket)
statistic = stat["data"]["uptime"]
print(statistic)
getapi(websocket)
This function will give you relevant information about the API.
The data that the function handles can be found on this page
print(await getapi(websocket))
getvtsfolder(websocket)
If you use this function, the console will print out all information about the VTube Studio directory. You can also use the code below to get specific data.
The data that the function handles can be found on this page
stat = await getvtsfolder(websocket)
bg = stat["data"]["backgrounds"]
items = stat["data"]["items"]
models = stat["data"]["models"]
print(bg)
print(items)
print(models)
gethotkeys(websocket,mdid)
I have not used this parameter, so I do not have an example.
The data that the function handles can be found on this page
getloc(websocket)
Returns scene color information
Data the function handles page)<br/
print(await getloc(websocket))
getexstate(websocket,expressionfile,detail)
Data the function handles page
print(await getexstate(websocket,"mycooolexp.json",true))
getitem(websocket,includeAvailableSpots,includeItemInstancesInScene,includeAvailableItemFiles,onlyItemsWithFileName,onlyItemsWithInstanceID)
Data the function handles page
print(await getitem(websocket,False,False,True,"",""))
or
payload1 = [itemname,item2name]
payload2 = [instanceid,instanceid]
getitem(websocket,False,False,True,payload1,payload2)
facecheck(websocket)
Data the function handles page
print(await facecheck(websocket))
listvtsmodel(websocket)
If you use this function, the console will print out data about all models loaded in VTube Studio. You can also use the code below to get specific data.
The data that the function handles can be found on this page
md = await listvtsmodel(websocket)
num = md['data']['numberOfModels']
for i in range(num):
print(md['data']['availableModels'][i]['modelName'])
print(md["data"]["availableModels"][i]["modelID"])
ExpresState(websocket,expressionFile,state)
Data the function handles page
ExpresState(websocket,"ligma.json",True)
ExHotkey(websocket,hotkeyid,itemInstanceID)
Executes hotkeys.
Data the function handles page
ExHotkey(websocket,5675uj643,"")
mdch(websocket,modelid)
This function loads a new model when called. Note that you need to get an ID first using getmd or listvtsmodel
how to use
await mdch(websocket,"a5a3mjka3ja3jj3jjj3")
listArtM(websocket,modeldid)
if you use this the console will print out data about all artmeshes in a loaded model
you can also do the code below to get specific data
data the function handels page
md = await listArtM(websocket,"modeldid")
meshnamenumber = md["data"]["numberOfArtMeshNames"]
meshtagnumber = md["data"]["numberOfArtMeshTags"]
artMeshNames = md["data"]["artMeshNames"]
artMeshTags = md["data"]["artMeshTags"]
print(meshnamenumber)
print(meshtagnumber)
print(artMeshNames)
print(artMeshTags)
AskMeshSelect(websocket,textOverride,helpOverride,requestedArtMeshCount,activeArtMeshes)
The function shows pop up text.
Data the function handles page
AskMeshSelect(websocket,"This text is shown over the ArtMesh selection list.","This text is shown when the user presses the ? button.",5,"artmesh")
or
payload = [artmesh,armesh2]
AskMeshSelect(websocket,"This text is shown over the ArtMesh selection list.","This text is shown when the user presses the ? button.",5,payload)
mdmv(websocket,time,revelance,xp,yp,rot,size)
this function moves the currently loaded model
data the function handles page
await mdmv(websocket,0.2,False,0.1,0.1,300,-22.5)
loaditem(websocket,fileName,X,Y,Size,Rotation,fadeTime0-2,order/layer,failIfOrderTaken,smoothing,censored,flipped,locked,unloadWhenPluginDisconnects)
Data the function handles page
await loaditem(websocket,"b_woozy (@denchisoft).png",0,0,0,0,0.5,4,0,False,False,False,False,True)
rmitem(websocket,unloadAllInScene,unloadAllLoadedByThisPlugin,allowUnloadingItemsLoadedByUserOrOtherPlugins,instanceIDs,fileNames)
removes items from scene, can deleat multiple at once
Data the function handles page
await rmitem(websocket,False,False,True,itemid,"b_woozy (@denchisoft).png")
or for multiple
payload1 = [itemid,itemid2]
payload2 = [itemname,item2name]
await rmitem(websocket,False,False,True,payload1,payload2)
conitem(websocket,itemInstanceID,FPS,frame,brightness,ALPHA,setAutoStopFrames,autoStopFrames,setAnimationPlayState,animationPlayState)
Data the function handles page
conitem(websocket,itemid,12,3,1,1,True,[0, 7, 26],True,True)
mvitem(websocket,itemarray)
mv item passes on a array, due to this you can actually move multiple items at the same time.
Data the function handles page
payload = [
{
"itemInstanceID": itemid,
"timeInSeconds": 1,
"fadeMode": "easeOut",
"positionX": 0.2,
"positionY": -0.8,
"size": 0.6,
"rotation": 180,
"order": -1000,
"setFlip": True,
"flip": False,
"userCanStop": True
},
{
"itemInstanceID": item2id,
"timeInSeconds": 0.5,
"fadeMode": "zip",
"positionX": 1,
"positionY": 1,
"size": 0.3,
"rotation": 0,
"order": 25,
"setFlip": False,
"flip": False,
"userCanStop": False
}
]
await mvitem(websocket,payload)
TintArtM(websocket,r,g,b,a,tintall,num,exactarray,conarray,tagexactarray,tagconarray)
tintall is a bool that checks is you want to color all art meshes, if True all settings that aren't rgb and alpha can be left as "", if False you need to define those slots using mesh information you get from listArtM
data the function handles page
await TintArtM(websocket,255,150,0,255,True,"","","","","")