Real-time bone data synchronization method between Unity and MotionBuilder
By establishing UDP communication between Unity and MotionBuilder, real-time synchronization of bone data is achieved and corrected using machine learning algorithms, the problem of bone data synchronization is solved, and the efficiency and quality of game development and post-production is improved.
Patent Information
- Application Number
- CN202411299544.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-24
AI Technical Summary
It is difficult to achieve real-time synchronization of bone data between Unity and MotionBuilder, which affects the efficiency and quality of game development and post-production.
By creating a UDP client in MotionBuilder and a UDP server in the Unity engine, real-time transmission and synchronization of bone data is realized, and data correction and optimization of transmission parameters are used to ensure data accuracy and stability.
Real-time transmission of character model bone data in Unity to MotionBuilder, improves the accuracy and consistency of motion capture, enhances game quality and fidelity, and improves the efficiency of post-production special effects.
Smart Images

Figure CN119182788A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional modeling, and in particular to a real-time synchronization method of skeleton data between Unity and MotionBuilder. Background Art
[0002] Unity is a powerful cross-platform game engine that is often used to develop various types of games. Among them, motion capture technology plays an important role in game development. Motion capture technology refers to recording human movements through sensors or cameras, converting them into digital data, and replaying them in a virtual environment or game. It can make character movements more realistic and enhance the immersion of the game.
[0003] MotionBuilder is a professional 3D character animation and motion capture software, mainly used in film and television, games, virtual reality and augmented reality. It provides a variety of functions to help animators create high-quality character animation and motion capture data.
[0004] Therefore, how to synchronize skeleton data between Unity and MotionBuilder in real time to improve the quality and realism of the game and the efficiency of post-production special effects is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The invention proposes a real-time synchronization method of skeleton data between Unity and MotionBuilder to solve the technical problem of real-time synchronization of skeleton data between Unity and MotionBuilder.
[0006] To solve the above technical problems, the present invention provides a real-time synchronization method of skeleton data between Unity and MotionBuilder, comprising the following steps:
[0007] Step S1: Create a UDP client in MotionBuilder;
[0008] Step S2: Create a UDP server in the Unity engine;
[0009] Step S3: the UDP client sends a data packet to the UDP server;
[0010] Step S4: After receiving the data packet, the Unity engine decodes it to obtain the skeleton and camera data;
[0011] Step S5: The Unity engine reconstructs based on the skeleton and camera data, and relocates it to the character in MotionBuilder to complete the binding of the skeleton data;
[0012] Step S6: After the skeleton data binding is completed, the UDP server sends the data to the UDP client in real time for synchronization.
[0013] Preferably, the data packet in step S1 includes: the names, hierarchical relationships, positions, rotations, scales and BlendShapes of all bones and cameras.
[0014] Preferably, in step S6, when the UDP server sends data to the UDP client in real time, only the selected skeletal motion data is sent.
[0015] Preferably, the skeletal motion data is selected by the following method: when the skeletal data is produced, the data structure of the skeleton is formulated and named; when selecting, the skeleton name is screened by string matching.
[0016] Preferably, in step S6, when synchronization is performed, when the numerical difference between two synchronization data is greater than a set threshold, a machine learning algorithm is combined to obtain a predicted average value of the two synchronization data, and the synchronization data is corrected.
[0017] Preferably, in step S6, during synchronization, data transmission is optimized by adjusting synchronization parameters.
[0018] Preferably, the synchronization parameters include synchronization frequency and accuracy.
[0019] The present invention also provides a data synchronization plug-in, in which a computer program is stored. When the computer program is executed by a processor, the real-time synchronization method of skeleton data between Unity and MotionBuilder is implemented.
[0020] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above-mentioned method for real-time synchronization of skeleton data between Unity and MotionBuilder.
[0021] The beneficial effects of the present invention include at least: the real-time transmission of the skeleton data of the character model in Unity to MotionBuilder is realized to achieve the purpose of real-time monitoring and adjustment of the character's action. The user can easily and quickly synchronize the real-time motion capture skeleton data between Unity and MotionBuilder, which provides convenience for the user's work and creation. Game developers can use the plug-in to monitor and adjust the character actions in the game in real time to improve the quality and realism of the game. Film and television production personnel can use the plug-in to monitor and adjust the actions of virtual characters in real time to improve the production efficiency of post-production special effects. Motion capture workers can use the plug-in to transmit skeleton data to MotionBuilder in real time for capture and analysis, thereby improving work efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 The figure is a schematic diagram of a method flow of an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0024] like Figure 1 The embodiment of the present invention provides a real-time synchronization method of skeleton data between Unity and MotionBuilder, comprising the following steps:
[0025] Step S1: Create a UDP client when MotionBuilder starts.
[0026] Step S2: Encode the information into a binary data stream and send the data packet via the UDP protocol.
[0027] Specifically, in each frame of information sent, the names, hierarchical relationships, positions, rotations, scales, and BlendShapes of all bones and cameras in the scene are collected.
[0028] Step S3: A synchronization manager script is written in Unity. When the script starts, a UDP server is created, a new thread is started to listen to the port sent by the MotionBuilder plug-in to obtain the data stream, decode the skeleton and camera data, and reconstruct it in the viewport.
[0029] Step S4: Use the bone synchronization script to redirect the reconstructed bones to the MotionBuilder character, so as to synchronize the motion of the character in the game engine with the character in MotionBuilder. This script can be run in both edit mode and run mode.
[0030] In the embodiment of the present invention, a character model that needs to be synchronized with motion capture is selected in Unity, and the skeleton data of the selected model is filtered out through an algorithm to ensure that only the required data is transmitted, thereby reducing the transmission volume and the calculation burden.
[0031] Specifically, the data structure and name are used for screening, and the specific implementation of the algorithm is to formulate the data structure of the skeleton in the early stage of production and screen according to the name. The embodiment of the present invention also supports the user to automatically screen out the skeleton data of the selected model according to the specified naming rules, without manually selecting each skeleton.
[0032] Through the real-time data screening algorithm, the model data that needs to be synchronized for motion capture can be selected more quickly, thereby speeding up the entire motion capture process and enabling production staff to capture and analyze motion faster.
[0033] After the data screening is completed, the system will automatically add the required material node data for the subsequent motion capture steps, providing the necessary basic data for posture recognition and correction during the motion capture process, effectively improving the accuracy and stability of data processing.
[0034] Furthermore, the skeletal motion data of the selected character model in Unity is received in real time in MotionBuilder, and applied to the corresponding character model to achieve real-time motion synchronization and adjustment.
[0035] Parameter setting and optimization: Users can set synchronization parameters in the interface, including synchronization frequency, accuracy, etc., to meet the needs of different scenarios and optimize data transmission. Specifically, users can monitor the action performance of the character model in MotionBuilder in real time, and adjust the synchronization parameters when necessary, provide real-time feedback and adjustments, and improve the quality and realism of the action.
[0036] Furthermore, because the data transmission between the two is real-time, the difference between the two actions can be easily seen. The difficulty lies in the real-time data synchronization, that is, the transmission rate. The embodiment of the present invention combines machine learning technology to perform real-time posture estimation and correction on the transmitted skeletal motion data to improve the accuracy and stability of the data.
[0037] Specifically, the plug-ins are opened in the two software respectively to exchange data, and then compared before and after the action in the implementation software. For data with too large values or too large actions, when it is sent back for comparison and is greater than the set threshold, the predicted average value is taken according to the previous and next frames through the machine learning algorithm to achieve the correction effect, reduce the posture inconsistency caused by time difference, and improve the accuracy and consistency of motion capture.
[0038] Furthermore, the embodiment of the present invention splits the data template into convenient templates for various parts in advance, so that production personnel can conveniently divide and call the skeleton data into regional blocks in MotionBuilder, which is convenient for independent adjustment and optimization of the movements of different parts, thereby improving the management efficiency of motion capture data.
[0039] Through the method of the embodiment of the present invention, the production staff can adjust the rendering effect of the motion capture data in MotionBuilder in real time according to actual needs, including parameters such as motion direction, frequency, and interval, so as to achieve the desired motion performance effect, thereby improving the controllability and adjustability of the motion capture data. The captured motion data is displayed in MotionBuilder in real time, so that the production staff can observe and evaluate the motion effect in real time, providing intuitive feedback for motion design and adjustment, and improving the efficiency and quality of motion capture work.
[0040] The present invention also provides a data synchronization plug-in, in which a computer program is stored. When the computer program is executed by a processor, the real-time synchronization method of skeleton data between Unity and MotionBuilder is implemented.
[0041] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above-mentioned method for real-time synchronization of skeleton data between Unity and MotionBuilder.
[0042] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is more specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. As long as there is no contradiction in the combination of these technical features, they should be considered as the scope recorded in this specification.
[0043] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A real-time synchronization method of skeleton data between Unity and MotionBuilder, characterized by: The following steps are involved: Step S1: Create a UDP client in MotionBuilder; Step S2: Create a UDP server in the Unity engine; Step S3: the UDP client sends a data packet to the UDP server; Step S4: After receiving the data packet, the Unity engine decodes it to obtain the skeleton and camera data; Step S5: The Unity engine reconstructs based on the skeleton and camera data, and relocates it to the character in MotionBuilder to complete the binding of the skeleton data; Step S6: After the skeleton data binding is completed, the UDP server sends the data to the UDP client in real time for synchronization.
2. The method for real-time synchronization of skeleton data between Unity and MotionBuilder according to claim 1, characterized in that: The data packet in step S1 includes: the names, hierarchical relationships, positions, rotations, scales and BlendShapes of all bones and cameras.
3. The method for real-time synchronization of skeleton data between Unity and MotionBuilder according to claim 1, characterized in that: In step S6, when the UDP server sends data to the UDP client in real time, only the selected skeletal motion data is sent.
4. The method for real-time synchronization of skeleton data between Unity and MotionBuilder according to claim 3, characterized in that: The skeleton action data is selected by the following method: when the skeleton data is produced, the skeleton data structure is formulated and named; when selecting, the skeleton name is filtered by string matching.
5. The method for real-time synchronization of skeleton data between Unity and MotionBuilder according to claim 1, characterized in that: In step S6, when synchronization is performed, when the numerical difference between two synchronization data is greater than a set threshold, a machine learning algorithm is combined to obtain a predicted average value of the two synchronization data and correct the synchronization data.
6. The method for real-time synchronization of skeleton data between Unity and MotionBuilder according to claim 1, characterized in that: In step S6, during synchronization, the data transmission is optimized by adjusting the synchronization parameters.
7. The method for real-time synchronization of skeleton data between Unity and MotionBuilder according to claim 6, characterized in that: The synchronization parameters include synchronization frequency and accuracy.
8. A data synchronization plug-in, characterized in that: The plug-in stores a computer program, and when the computer program is executed by a processor, the real-time synchronization method of skeleton data between Unity and MotionBuilder described in any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the real-time synchronization method of skeleton data between Unity and MotionBuilder as described in any one of claims 1 to 7.
