List of External API Integration Functions

Updated: 06/25/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.

VersionRequestResponseErrorType
ResponseName:String,
Token?:String,
Icon?:String,
Path?:String
Token:StringInvalidData
Name:StringApplication name (optional):
Give it a unique name.
Even if another application uses the same name, the operation is not affected.
Token?:StringToken:
If omitted or unregistered, RegisterPlugin returns a new token.
If the specified token has already been registered, it is returned as is.
Icon?:StringBASE64 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?:StringDisplays 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.

GetIsApprove

Get whether the user has allowed communication with this app.
It is linked to the “Allow” checkbox in the settings dialog box.

VersionRequestResponseErrorType
0.9.0Result:BooleanInvalidData

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.

VersionRequestResponseErrorType
0.9.0ModelUID: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.

VersionRequestResponseErrorType
0.9.1ModelUID: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.

VersionRequestResponseErrorType
0.9.0ModelUID: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.

VersionRequestResponseErrorType
0.9.1ModelUID:String,
Parameters:Array<{
  Id:String,
  Value:Number
}>
InvalidData
InvalidModel
InvalidParameter

GetParameters

Id:StringParameter ID
Name:StringParameter name
GroupUID:StringUID of the parameter group to which it belongs
Default:NumberDefault value
Max,Max:NumberMaximum and minimum values
Repeat:BooleanRepeat
Type:NumberParameter 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.

VersionRequestResponseErrorType
0.9.0ModelUID?: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.

VersionRequestResponseErrorType
0.9.1ModelUID?: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.

VersionRequestResponseErrorType
0.9.0ModelUID?: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.

VersionRequestResponseErrorType
0.9.1ModelUID?: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.

VersionRequestResponseErrorType
0.9.0PhysicsDocuments: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.

VersionRequestResponseErrorType
0.9.1PhysicsDocuments: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.

VersionRequestResponseErrorType
0.9.3DocumentUID:StringPhysicsDocuments?: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.

VersionRequestResponseErrorType
0.9.3DocumentUID:StringDocumentUID:StringInvalidData
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.

VersionRequestResponseErrorType
0.9.0ModelUID:StringInvalidData
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.

VersionRequestResponseErrorType
0.9.1ModelUID:StringInvalidData
InvalidModel

GetCurrentEditMode

Version 0.9.0

Returns the current edit mode in the Editor.

VersionRequestResponseErrorType
0.9.0EditMode:StringInvalidData
EditMode:StringEdit 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.

VersionRequestResponseErrorType
0.9.1Version?:StringInvalidData

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.

VersionRequestResponseErrorType
0.9.1ModelUID:StringInvalidData

GetPhysicsInfo

Version 0.9.2

Gets the calculated FPS in the Physics Settings Editor.

VersionRequestResponseErrorType
0.9.2ModelUID: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.

VersionRequestResponseErrorType
0.9.3Type?: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.

VersionRequestResponseEventErrorType
0.9.0Enabled:BooleanAccepted:BooleanPath: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.

VersionRequestResponseEventErrorType
0.9.3Enabled:BooleanAccepted:BooleanPath: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.

VersionRequestResponseEventErrorType
0.9.0Enabled:BooleanAccepted:BooleanPath:String,
ModelFilePath:String
InvalidData

NotifyMotionFileExported

Version 0.9.0

Sets the notification settings for exporting motion files.

VersionRequestResponseEventErrorType
0.9.0Enabled:BooleanAccepted:BooleanPath:String,
ModelFilePath:String
InvalidData

NotifyMotionSyncFileExported

Version 0.9.0

Sets the notification settings for exporting motion-sync settings files.

VersionRequestResponseEventErrorType
0.9.0Enabled:BooleanAccepted:BooleanPath: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.”

VersionRequestResponseEventErrorType
0.9.0Enabled:BooleanAccepted:BooleanEditMode:StringInvalidData

Error type

NameDescriptionSince
InvalidJsonThe JSON structure is incorrect.0.9.0
UnsupportedVersionIncompatible versions.0.9.0
MethodNotFoundThe specified instruction cannot be found.0.9.0
InvalidTypeThe Type setting is incorrect.0.9.0
InvalidDataOne 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
PluginNotRegisteredPlug-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
InvalidParameterThe specified Live2D parameter does not exist.0.9.0
InvalidModelThe specified Live2D model does not exist.0.9.0
InvalidDocumentThe specified document does not exist in the Editor.0.9.0
InvalidViewThe specified View does not exist.0.9.0
Was this article helpful?
YesNo
Please let us know what you think about this article.