GDVTubeStudio is a project designed for use with Godot 4, serving as an API wrapper for the software VTubeStudio by Denchisoft. By instantiating an instance of GDVtubeStudio and calling its member functions, you can easily interact with VTubeStudio's features.
-
Installation: To get started, Ensure you have Godot 4 installed and configured. Import the GDVtubeStudio scene into your Godot project and instantiate an instance of the scene as a node.
-
Initialization: Call the
start()
function to initialize the GDVTubeStudio client. You can specify whether it should auto-connect to the VTubeStudio API. The function, start(), by itself, just spins up a WebsocketPeer. If you decide to enable auto-connect, then make sure you have supplied an authentication token to GDVTubeStudio, first.
#It is up to your implementation to determine how to save and
#retrieve existing tokens. Please refer to the demo app for an example.
var some_token = "123412341324134134"
$GDVtubeStudio.authentication_token = some_token;
# Start GDVTubeStudio client
GDVtubeStudio.start(should_auto_connect)
- Authentication: You can request an authentication token or session to interact with VTubeStudio. Use the following functions:
request_authentication_token()
: Request an authentication token.request_authentication()
: Request an authentication session. You cannot request a authenticated session without an authentication token.
# Request authentication token
#This function will automatically assign a value to $GDVtubeStudio.authentication_token
GDVtubeStudio.request_authentication_token()
# Request authentication session
GDVtubeStudio.request_authentication()
Here's a list of available functions in GDVTubeStudio and references to the Denchisoft API Documentation. Please refer to their documenation for more information about each request type:
request_api_state()
: https://github.com/DenchiSoft/VTubeStudio#api-detailsrequest_vts_folder_info()
: https://github.com/DenchiSoft/VTubeStudio#getting-list-of-vts-foldersrequest_current_model()
: https://github.com/DenchiSoft/VTubeStudio#getting-the-currently-loaded-modelrequest_available_models()
: https://github.com/DenchiSoft/VTubeStudio#getting-a-list-of-available-vts-modelsrequest_model_load(arguments)
: https://github.com/DenchiSoft/VTubeStudio#loading-a-vts-model-by-its-idrequest_move_model(arguments)
: https://github.com/DenchiSoft/VTubeStudio#moving-the-currently-loaded-vts-modelrequest_hotkeys_in_current_model(arguments)
: https://github.com/DenchiSoft/VTubeStudio#requesting-list-of-hotkeys-available-in-current-or-other-vts-modelrequest_hotkey_trigger(arguments)
: https://github.com/DenchiSoft/VTubeStudio#requesting-execution-of-hotkeysrequest_expression_state(arguments)
: https://github.com/DenchiSoft/VTubeStudio#requesting-current-expression-state-listrequest_expression_activation(arguments)
: https://github.com/DenchiSoft/VTubeStudio#requesting-activation-or-deactivation-of-expressionsrequest_art_mesh_list(arguments)
: https://github.com/DenchiSoft/VTubeStudio#requesting-list-of-artmeshes-in-current-modelrequest_color_tint(arguments)
: https://github.com/DenchiSoft/VTubeStudio#tint-artmeshes-with-colorrequest_scene_color_overlay_info()
: https://github.com/DenchiSoft/VTubeStudio#getting-scene-lighting-overlay-colorrequest_face_found()
: https://github.com/DenchiSoft/VTubeStudio#checking-if-face-is-currently-found-by-trackerrequest_input_parameter_list()
: https://github.com/DenchiSoft/VTubeStudio#requesting-list-of-available-tracking-parametersrequest_parameter_value(arguments)
: https://github.com/DenchiSoft/VTubeStudio#get-the-value-for-one-specific-parameter-default-or-customrequest_live2d_parameter_list()
: https://github.com/DenchiSoft/VTubeStudio#get-the-value-for-all-live2d-parameters-in-the-current-modelrequest_parameter_creation(arguments)
: https://github.com/DenchiSoft/VTubeStudio#adding-new-tracking-parameters-custom-parametersrequest_parameter_deletion(arguments)
: https://github.com/DenchiSoft/VTubeStudio#delete-custom-parametersrequest_inject_parameter_data(arguments)
: https://github.com/DenchiSoft/VTubeStudio#feeding-in-data-for-default-or-custom-parametersrequest_get_current_model_physics()
: https://github.com/DenchiSoft/VTubeStudio#getting-physics-settings-of-currently-loaded-vts-modelrequest_set_current_model_physics(arguments)
: https://github.com/DenchiSoft/VTubeStudio#overriding-physics-settings-of-currently-loaded-vts-modelrequest_ndi_config(arguments)
: https://github.com/DenchiSoft/VTubeStudio#get-and-set-ndi-settingsrequest_item_list(arguments)
: https://github.com/DenchiSoft/VTubeStudio#requesting-list-of-available-items-or-items-in-scenerequest_item_load(arguments)
: https://github.com/DenchiSoft/VTubeStudio#loading-item-into-the-scenerequest_item_unload(arguments)
: https://github.com/DenchiSoft/VTubeStudio#removing-item-from-the-scenerequest_item_animation_control(arguments)
: https://github.com/DenchiSoft/VTubeStudio#controling-items-and-item-animationsrequest_item_move(arguments)
: https://github.com/DenchiSoft/VTubeStudio#moving-items-in-the-scenerequest_art_mesh_selection(arguments)
: https://github.com/DenchiSoft/VTubeStudio#asking-user-to-select-artmeshesrequest_vtubestudio_api_state_broadcast()
: https://github.com/DenchiSoft/VTubeStudio#api-server-discovery-udp
You can utilize the event system in VTubeStudio by calling
request_event_subscription(arguments)
: https://github.com/DenchiSoft/VTubeStudio#event-api
# Example usage of request_event_subscription
var request = RequestTypes.EventSubscriptionRequestArguments;
request.eventName = "ModelMovedEvent"
request.subscribe = true
$GDVtubeStudio.request_event_subscription(request)
Afterwards, GDVtubeStudio will start receiving events via client_response signal. Please refer to the model_move demo scene for an example of how you would use this.
Valid eventName values are:
- TestEvent
- ModelLoadedEvent
- TrackingStatusChangedEvent
- BackgroundChangedEvent
- ModelConfigChangedEvent
- ModelMovedEvent
- ModelOutlineEvent
- HotkeyTriggeredEvent
- ModelAnimationEvent
Please refer to Denchisoft's documentation on how to configure some of these requests: https://github.com/DenchiSoft/VTubeStudio#event-api
You can call these functions in your Godot project by including the GDVtubeStudio node and invoking the respective functions as needed.
# Example usage of GDVTubeStudio functions
GDVtubeStudio.request_current_model()
None of the functions return a value. If the API returns a response, it will be returned with the signal "client_response"
...
GDVtubeStudio.client_response.connect(_on_gd_vtube_studio_server_response);
...
func _on_gd_vtube_studio_server_response(message):
#message is the contents of the response object
Contributions to GDVTubeStudio are welcome. Feel free to open issues or submit pull requests to improve and expand its functionality.
GDVTubeStudio is licensed under the GNU GENERAL PUBLIC LICENSE.