List of External API Integration Functions
Updated: 10/24/2024
This page introduces instructions, events, and error types for setting and retrieving information in the Editor through the external API integration functions from UIDs, parameter IDs, etc.
Instructions
RegisterPlugin
Register an external application with the Editor.
After registration is complete, a token is returned.
This token is tied to the application and can be specified at the next connection to carry over the user’s permission status.
See “Token authentication” for details.
Version | Request | Response | ErrorType |
---|---|---|---|
Response | Name:String, Token?:String, Icon?:String, Path?:String | Token:String | InvalidData |
Name:String | Application name (optional): Give it a unique name. Even if another application uses the same name, the operation is not affected. |
Token?:String | Token: If omitted or unregistered, RegisterPlugin returns a new token. If the specified token has already been registered, it is returned as is. |
Icon?:String | BASE64 string of icon PNG image: The size should be no smaller than 32 x 32, no larger than 256 x 256 square, and no larger than 0.5 MB. |
Path?:String | Displays application path information. |
Precautions
Almost all of the following instructions will return a PluginNotRegistered error and will not accept any operations through the API unless RegisterPlugin is completed first and permission is obtained from the user.
GetIsApproval
Get whether the user has allowed communication with this app.
It is linked to the “Allow” checkbox in the settings dialog box.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | Result:Boolean | InvalidData |
GetParameterValues
Version 0.9.0
Get the current Parameter ID and value of the model by specifying the Parameter ID.
If no Parameter ID is specified, all Parameter IDs and values of the model are retrieved.
Animation information is not included.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | ModelUID:String, Ids?:Array<String> | Parameters:Array<{ Id:String, Value:Number }> | InvalidData InvalidModel |
Version 0.9.1
Get the current Parameter ID and value of the model by specifying the Parameter ID.
If no Parameter ID is specified, all Parameter IDs and values of the model are retrieved.
Information on physics, model editing, and animation can be obtained.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | ModelUID:String, Ids?:Array<String> | Parameters:Array<{ Id:String, Value:Number }> | InvalidData InvalidModel |
SetParameterValues
Version 0.9.0
Set the specified Parameter ID and value.
Parameters cannot be sent to the model in the animation file.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | ModelUID:String, Parameters:Array<{ Id:String, Value:Number }> | InvalidData InvalidModel InvalidParameter |
Version 0.9.1
Set the specified Parameter ID and value.
To send parameters to a model in an animation file, a model track must be selected.
In the case of the physics editor and animated models, parameters are not reflected immediately but are retained in temporary storage.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | ModelUID:String, Parameters:Array<{ Id:String, Value:Number }> | InvalidData InvalidModel InvalidParameter |
GetParameters
Id:String | Parameter ID |
Name:String | Parameter name |
GroupUID:String | UID of the parameter group to which it belongs |
Default:Number | Default value |
Max,Max:Number | Maximum and minimum values |
Repeat:Boolean | Repeat |
Type:Number | Parameter type 0: Normal 1: Blend Shape |
Version 0.9.0
Obtains a list of the model’s parameters.
Either ModelUID or DocumentUID can be omitted, but at least one is required.
Type is ‘0’ for Normal and ‘1’ for Blend Shape.
The list of the model’s parameters in the animation file (.can3) cannot be retrieved.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | ModelUID?:String, DocumentUID?:String | Parameters:Array<{ Id:String, Name:String, GroupUID:String, Default:Number, Max:Number, Min:Number, Repeat:Boolean Type:Number }> | InvalidData InvalidModel |
Version 0.9.1
Obtains a list of the model’s parameters.
Either ModelUID or DocumentUID can be omitted, but at least one is required.
Type is ‘0’ for Normal and ‘1’ for Blend Shape.
To get a list of parameters for a model contained in an animation file, a model track must be selected.
If the model is a runtime model track, GroupUID returns an empty string.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | ModelUID?:String, DocumentUID?:String | Parameters:Array<{ Id:String, Name:String, GroupUID:String, Default:Number, Max:Number, Min:Number, Repeat:Boolean Type:Number }> | InvalidData InvalidModel |
GetParameterGroups
Version 0.9.0
Obtains a list of the model’s parameter groups.
Either ModelUID or DocumentUID can be omitted, but at least one is required.
The list of the model’s parameters in the animation file (.can3) cannot be retrieved.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | ModelUID?:String, DocumentUID?:String | Groups:Array<{ GroupUID:String, GroupName:String, }> | InvalidData InvalidModel |
Version 0.9.1
Obtains a list of the model’s parameter groups.
Either ModelUID or DocumentUID can be omitted, but at least one is required.
To get a list of groups of models in the animation file, a model track must be selected.
If the model is a runtime model track, GroupUID returns an empty string.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | ModelUID?:String, DocumentUID?:String | Groups:Array<{ GroupUID:String, GroupName:String, }> | InvalidData InvalidModel |
GetDocuments
Version 0.9.0
Returns document information.
It is separated by type, physics, model editing, and returns an array of 0 documents if not present.
Views will increase if a single model is displayed in a split view.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | PhysicsDocuments:Array<{ DocumentUID:String, DocumentFilePath:String, ModelUID:String }>, ModelingDocuments:Array<{ DocumentUID:String, DocumentFilePath:String, Views:Array<{ ModelUID:String }> }> | InvalidData InvalidDocument |
Version 0.9.1
Returns document information.
It is separated by type, physics, model editing, and returns an array of 0 documents if not present.
Views will increase if a single model is displayed in a split view.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | PhysicsDocuments:Array<{ DocumentUID:String, DocumentFilePath:String ModelUID:String, }> ModelingDocuments:Array<{ DocumentUID:String, DocumentFilePath:String Views:Array<{ ModelUID:String }> }> AnimationDocuments:Array<{ DocumentUID:String, DocumentFilePath:String Views:Array<{ ModelUID:String, ModelFilePath:String }> }> | InvalidData InvalidDocument |
GetDocument
Version 0.9.3
Returns information about a document by specifying the UID of the document.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.3 | DocumentUID:String | PhysicsDocuments?:Array<{ DocumentFilePath:String ModelUID:String, }> ModelingDocuments?:Array<{ DocumentFilePath:String Views:Array<{ ModelUID:String }> }> AnimationDocuments?: Array<{ DocumentFilePath:String Views : Array<{ ModelUID:String, ModelFilePath:String }> }> | InvalidData InvalidDocument |
GetCurrentDocumentUID
Version 0.9.3
Returns the UID of the document currently current in the Editor.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.3 | DocumentUID:String | DocumentUID:String | InvalidData InvalidDocument |
GetCurrentModelUID
Version 0.9.0
Returns the UID of the model currently current in the Editor.
The UID of the model contained in the animation file cannot be retrieved.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | ModelUID:String | InvalidData InvalidModel |
Version 0.9.1
Returns the UID of the model currently current in the Editor.
To get the UID of a model contained in an animation file, the model track must be selected.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | ModelUID:String | InvalidData InvalidModel |
GetCurrentEditMode
Version 0.9.0
Returns the current edit mode in the Editor.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.0 | EditMode:String | InvalidData |
EditMode:String | Edit mode Physics: Physics Settings Editor Modeling: Model editing Animation: Animation editing ModelingMeshEdit: Mesh editing FormAnimation: Form animation editing *5.1 beta1 or later |
SetGlobalVersion
Version 0.9.1
You can set the API version to be used.
This allows you to fix the API version to be used by external applications.
If not specified, it can be set back to no specification.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | Version?:String | InvalidData |
ClearParameterValues
Version 0.9.1
Clears parameters sent to the target model.
The parameters sent by SetParameterValue are held in temporary storage by the Editor.
In the case of the physics editor and animations, parameters may continue to be retained in temporary storage due to model updates.
Use this API when you want to explicitly clear parameters held in temporary storage.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.1 | ModelUID:String | InvalidData |
GetPhysicsInfo
Version 0.9.2
Gets the calculated FPS in the Physics Settings Editor.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.2 | ModelUID:String, Fps?:Number | InvalidData InvalidModel |
SendCubismLog
Version 0.9.3
Sends a string as the Editor’s log.
Type can be “info” or “warning”; the default value is “info.”
The maximum length of a Message is 5000 characters.
Display is whether or not to display the log in the log palette. If omitted, the default value true is displayed in the log palette.
Version | Request | Response | ErrorType |
---|---|---|---|
0.9.3 | Type?:String, Message:String, Display?:Boolean | InvalidData InvalidModel |
Events
When handling events, the client must first enable the permission flag for the server.
{ (Omitted) "Type": "Request", "Method": "NotifyMocFileExported", "Data": { "Enable" : true } }
Then, when the server performs a specific process (event), it sends JSON data regardless of the request from the client.
Note that if the model file has never been saved, an empty string will be input in the ModelFilePath field.
{ (Omitted) "Type": "Response", "Method": "NotifyMocFileExported", "Data": { "Path" : "c:\\temp\\export.moc3", "ModelFilePath" : "c:\\models\\hoge03.cmo3" } }
NotifyPhysicsFileExported
Version 0.9.0
Sets the notification settings for exporting physics settings files.
Version | Request | Response | Event | ErrorType |
---|---|---|---|---|
0.9.0 | Enabled:Boolean | Accepted:Boolean | Path:String, ModelFilePath:String | InvalidData |
NotifyMocFileExported
Version 0.9.3
Sets the notification settings for exporting MOC3 files.
If the setting is enabled, information on MOC3 files and related files is notified.
Version | Request | Response | Event | ErrorType |
---|---|---|---|---|
0.9.3 | Enabled:Boolean | Accepted:Boolean | Path:String, ModelFilePath:String, Files:Array<String> | InvalidData |
Version 0.9.0
Sets the notification settings for exporting MOC3 files.
If the setting is enabled, MOC3 file information is notified.
Version | Request | Response | Event | ErrorType |
---|---|---|---|---|
0.9.0 | Enabled:Boolean | Accepted:Boolean | Path:String, ModelFilePath:String | InvalidData |
NotifyMotionFileExported
Version 0.9.0
Sets the notification settings for exporting motion files.
Version | Request | Response | Event | ErrorType |
---|---|---|---|---|
0.9.0 | Enabled:Boolean | Accepted:Boolean | Path:String, ModelFilePath:String | InvalidData |
NotifyMotionSyncFileExported
Version 0.9.0
Sets the notification settings for exporting motion-sync settings files.
Version | Request | Response | Event | ErrorType |
---|---|---|---|---|
0.9.0 | Enabled:Boolean | Accepted:Boolean | Path:String, ModelFilePath:String | InvalidData |
NotifyChangeEditMode
Version 0.9.0
Sets the notification settings for when the Edit mode is switched.
For more information about EditMode, see “GetCurrentEditMode.”
Version | Request | Response | Event | ErrorType |
---|---|---|---|---|
0.9.0 | Enabled:Boolean | Accepted:Boolean | EditMode:String | InvalidData |
Error type
Name | Description | Since |
---|---|---|
InvalidJson | The JSON structure is incorrect. | 0.9.0 |
UnsupportedVersion | Incompatible versions. | 0.9.0 |
MethodNotFound | The specified instruction cannot be found. | 0.9.0 |
InvalidType | The Type setting is incorrect. | 0.9.0 |
InvalidData | One or more instruction arguments are incorrect. This error is returned if there are not enough arguments or if a different type of argument is specified. | 0.9.0 |
PluginNotRegistered | Plug-in registration is not complete. This error is returned when sending an instruction request without first registering the plugin (RegisterPlugin) and receiving authorization from the user. | 0.9.0 |
InvalidParameter | The specified Live2D parameter does not exist. | 0.9.0 |
InvalidModel | The specified Live2D model does not exist. | 0.9.0 |
InvalidDocument | The specified document does not exist in the Editor. | 0.9.0 |
InvalidView | The specified View does not exist. | 0.9.0 |