Digital character skeleton animation generation method and device suitable for Unity development

By generating skeletal animation files in BVH format during Unity runtime and performing T-Pose difference compensation, the flexibility and resource usage issues of digital character animation generation are solved, and real-time skeletal animation adaptation and natural interaction are achieved in Unity.

CN120807727AActive Publication Date: 2025-10-172033 TECHNOLOGY (BEIJING) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510881605.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-10-17
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

Existing technologies are unable to instantly generate skeletal animation based on real-time interaction requirements during Unity runtime and adapt it to various digital character VRM models, resulting in insufficient flexibility in digital character animation generation, high resource usage, and inability to meet real-time interaction requirements.

Method used

This paper provides a method and device for generating skeletal animation of digital characters suitable for Unity development. By obtaining action requirement information, a skeletal animation file in BVH format is generated, and T-Pose difference compensation is performed. The file is adapted to the digital character VRM model to achieve real-time playback of the animation.

Benefits of technology

It improves dynamic generation capabilities, reduces resource usage, enhances general adaptability, supports multiple input methods, improves user experience and development efficiency, and achieves natural interaction and immersion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807727A_ABST
    Figure CN120807727A_ABST
Patent Text Reader

Abstract

The invention provides a bone animation generation method and device suitable for a digital character developed by Unity. The method comprises the steps of obtaining action demand information of the digital character and packaging the action demand information into a bone animation generation instruction of a specific data structure; converting the skeletal animation generation instruction into a structured skeletal animation generation cue word data packet; according to the skeletal animation generation cue word data packet, generating a skeletal animation file in a BVH format; analyzing the bone animation file in the BVH format to obtain a bone structure and animation data; t-Pose difference compensation is carried out between the T-Pose of the BVH format file and the Unity Avatar standard T-Pose, the skeletal structure of the skeletal animation file of the BVH format is matched with the skeletal structure of a digital character VRM model, and an Animation Clip object of the digital character VRM model is generated according to the matching result and the animation data; and controlling the skeleton animation to be played on the digital character VRM model according to an Animation Clip object of the generated digital character VRM model, and transforming the skeleton of each frame of animation by applying a rotation compensation matrix in the animation playing process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of games, and in particular to a method and device for generating skeletal animation of digital characters suitable for Unity development. BACKGROUND

[0002] In the field of computer graphics and virtual avatar interaction, digital character animation has always been a key element to improve user immersion and interactivity, especially with the rise of applications such as the metaverse, virtual social interaction, and AI assistants, digital characters with natural and smooth movements have become an integral part of these applications.

[0003] The current mainstream digital character animation generation scheme in the market mainly adopts the following technical routes:

[0004] 1. Pre-made animation library scheme: Traditional digital character animation production relies on professional artists using Maya, 3dsMax, or Blender, etc. three-dimensional modeling software to pre-produce skeletal animation, and export it as an FBX, OBJ, etc. format file. Developers need to bind these animation resources to the corresponding character model in the editor environment of Unity, etc. game engine, establish a clear correspondence between the model and the action, and then call these preset animations at runtime. This method generates high-quality animations, but lacks flexibility and cannot handle various unexpected scenarios in real-time interaction;

[0005] 2. Motion capture scheme: Record the skeletal motion data of a real performer using a motion capture device and map it to a digital character. This method requires professional equipment and performers, is costly, and is difficult to implement in real-time;

[0006] 3. Programmed animation scheme: Generate character animations through algorithms and physical simulations, such as IK (Inverse Kinematics) systems and physics-based animations. This method can generate animations in real-time, but the naturalness and diversity of complex movements are limited, and requires a lot of fine-tuning;

[0007] 4. Offline AI-generated animation scheme: Some recent solutions use AI technology to generate character animations, such as DeepMotion and Plask, etc. tools can generate animations based on text descriptions or reference videos. However, these tools are mainly designed for offline content creation processes, and the generated animations still need to be exported to standard formats and imported into game engines for use, which cannot support the dynamic generation requirements in real-time interaction scenarios.

[0008] In summary, there is currently no mature technology that can generate skeletal animations in real-time based on real-time interaction requirements and adapt to various digital character VRM models at Unity runtime, which is a key technical bottleneck that restricts the natural interaction experience of digital characters. SUMMARY

[0009] In view of the problems of the prior art, the application provides a digital character bone animation generation method and device suitable for Unity development, which realizes a complete technical link from real-time interaction to bone animation generation, to bone animation data analysis and digital character adaptation, to real-time animation playing of a final digital character VRM model.

[0010] In the first aspect, the application provides a digital character bone animation generation method suitable for Unity development, which is executed in Unity runtime and includes the following steps:

[0011] Obtaining action requirement information of a digital character and encapsulating the action requirement information into a bone animation generation instruction of a specific data structure, wherein the bone animation generation instruction includes instruction type, instruction content, character ID, interactive object, instruction priority and timestamp;

[0012] Converting the bone animation generation instruction into a structured bone animation generation prompt word data packet;

[0013] Generating a BVH format bone animation file according to the bone animation generation prompt word data packet;

[0014] Analyzing the BVH format bone animation file to obtain bone structure and animation data;

[0015] Compensating the T-Pose difference between a T-Pose of a BVH format file and a Unity Avatar standard T-Pose, adapting the bone structure of the BVH format bone animation file to the bone structure of a digital character VRM model, and generating an AnimationClip object of the digital character VRM model according to the adaptation result and the animation data;

[0016] Controlling bone animation to play on the digital character VRM model according to the generated AnimationClip object of the digital character VRM model, and applying a rotation compensation matrix to transform the bone of each frame of animation during the animation playing process.

[0017] Optionally, the action requirement information of the digital character includes:

[0018] Obtaining the action requirement information of the digital character through user voice input and user text input;

[0019] Obtaining the action requirement information of the digital character generated by system interaction logic, specifically including: listening to system internal events to generate the action requirement information of the digital character, generating the action requirement information of the digital character based on current context and interactive object attributes, and mapping interactive behaviors defined by scene scripts to the action requirement information of the digital character.

[0020] Optionally, the skeletal animation generation instruction is converted into a structured skeletal animation generation prompt word data packet, including:

[0021] If the skeletal animation generation instruction is a composite action instruction, the composite action is decomposed into a basic action unit that can be independently generated;

[0022] The large language model is called to extract action keywords from the instruction content corresponding to the basic action unit, and the action keywords are semantically completed;

[0023] The extracted action keywords are filled into the preset action generation prompt word template as template parameters to obtain a skeletal animation generation prompt word data packet;

[0024] A transition description of a new action and the current state of the digital character is added in the skeletal animation generation prompt word data packet to ensure the coherence of the new action and the current state of the digital character.

[0025] Optionally, a BVH format skeletal animation file is generated according to the skeletal animation generation prompt word data packet, including:

[0026] A Momask action generation model is called to generate a skeletal animation file of a digital character according to the skeletal animation generation prompt word data packet;

[0027] The generated skeletal animation file of the digital character is converted into a BVH format skeletal animation file, wherein the BVH format skeletal animation file includes skeletal definition data and skeletal animation frame data of a standard T-Pose.

[0028] Optionally, the BVH format skeletal animation file is parsed to obtain skeletal structure and animation data, including:

[0029] Skeletal hierarchy information and skeletal initial pose information are parsed from the skeletal definition data of the BVH format skeletal animation file, a skeletal node tree is constructed according to the skeletal hierarchy information, and the skeletal naming is preprocessed;

[0030] Skeletal transformation information and animation metadata of each frame of animation are parsed from the skeletal animation frame data of the BVH format skeletal animation file, and the skeletal transformation information of each frame of animation is converted from the BVH coordinate system to the Unity coordinate system.

[0031] Optionally, T-Pose difference compensation is performed between the T-Pose of the BVH format file and the Unity Avatar standard T-Pose, the skeletal structure of the BVH format skeletal animation file is adapted to the skeletal structure of the digital character VRM model, and an AnimationClip object of the digital character VRM model is generated according to the adaptation result and the animation data, including:

[0032] Calculate the rotation difference between T-Pose in BVH file and Unity Avatar standard T-Pose, and generate a rotation compensation matrix for each bone;

[0033] Use the Humanoid skeleton definition of the VRM model as an intermediate mapping layer to establish a mapping from the bone names in the BVH format skeleton animation file to the Humanoid skeleton, and then from the Humanoid skeleton to the actual bone names of the digital character VRM model;

[0034] According to the correspondence between the bones in the BVH format skeleton animation file and the actual bones of the digital character VRM model, and the bone transformation information of each frame of animation, create and configure the AnimationClip object.

[0035] In the second aspect, the application provides a digital character skeleton animation generation device suitable for Unity development, which includes an instruction input module, an instruction analysis module, an AI action generation module, a data analysis module, an action data adaptation module, and an action playing module;

[0036] The instruction input module is used to obtain the action requirement information of the digital character and encapsulate it into a specific data structure of the skeleton animation generation instruction, wherein the skeleton animation generation instruction includes instruction type, instruction content, character ID, interactive object, instruction priority, and timestamp;

[0037] The instruction analysis module is used to convert the skeleton animation generation instruction into a structured skeleton animation generation prompt word data packet;

[0038] The AI action generation module is used to generate a BVH format skeleton animation file according to the skeleton animation generation prompt word data packet;

[0039] The data analysis module is used to analyze the BVH format skeleton animation file to obtain the bone structure and animation data;

[0040] The action data adaptation module is used to compensate for the T-Pose difference between the T-Pose of the BVH format file and the Unity Avatar standard T-Pose, adapt the bone structure of the BVH format skeleton animation file to the bone structure of the digital character VRM model, and generate the AnimationClip object of the digital character VRM model according to the adaptation result and the animation data;

[0041] The action playing module is used to control the playback of the skeleton animation on the digital character VRM model according to the generated AnimationClip object of the digital character VRM model, and apply a rotation compensation matrix to transform the bone of each frame of animation during the animation playback process.

[0042] By adopting the technical scheme, the application has at least the following beneficial effects:

[0043] 1) Improve dynamic generation capability:

[0044] 1. No need to pre-produce and store a large number of animation resources, significantly reducing the application size;

[0045] 2. Can respond to any natural language description of action demand, greatly expanding the possibility of interaction;

[0046] 3. Support dynamic adaptation in unexpected scenarios, improve the naturalness of AI character interaction;

[0047] 2) Enhance general adaptability:

[0048] 1. Can be used for any VRM model, without the need for customization for specific models;

[0049] 2. Through the Humanoid skeleton of the VRM model as an intermediate layer, the problem of different model skeleton naming differences is solved;

[0050] 3. T-Pose difference compensation mechanism ensures correct presentation of animation on various models;

[0051] 3) Reduce resource occupancy:

[0052] 1. BVH format file is small in size (usually only a few tens of KB), suitable for network transmission and runtime processing;

[0053] 2. Generate animation on demand, avoid loading redundant resources, optimize memory usage;

[0054] 3. Animation caching mechanism reduces repeated requests and improves response speed;

[0055] 4) Application flexibility:

[0056] 1. Support multiple input methods to adapt to different interactive scenario needs;

[0057] 2. Can dynamically adjust animation accuracy according to device performance, balancing quality and performance;

[0058] 3. Easy to integrate into existing Unity projects, extending the functionality of existing animation systems;

[0059] 5) Improve user experience:

[0060] 1. Realize natural interaction between digital characters and the environment, enhance immersion;

[0061] 2. Support UGC content creation, users can upload custom VRM models and obtain matching animations;

[0062] 3. Animation transition is smooth, avoiding mechanical feeling and improving character performance;

[0063] 6) Improve development efficiency:

[0064] 1. No need for developers to make a large number of animation assets in advance, reducing development cost;

[0065] 2. Simplify the animation workflow and reduce manual adaptation work;

[0066] 3. Strong system scalability, easy to meet the needs of new interactive scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0068] Figure 1 A flowchart of a digital character bone animation generation method suitable for Unity development is provided for the first embodiment of the present application.

[0069] Figure 2 An architecture diagram of a digital character bone animation generation device suitable for Unity development is provided for the second embodiment of the present application. DETAILED DESCRIPTION

[0070] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0071] The inventor has found that in AI interactive products developed based on Unity, the digital character animation generation scheme has the following problems:

[0072] 1. Limitation of pre-made animation resources: Traditional animation resources need to be made in advance and imported into Unity, which cannot meet the needs of dynamic generation of digital character animation in AI interaction process. No matter how large the pre-made animation library is, it cannot cover all possible scenarios and action needs in AI and user interaction. Preparing animation for each possible interactive scenario will result in a large resource library, increasing application size and reducing loading speed;

[0073] 2. Runtime animation adaptation problem: The VRM model skeleton structure and naming uploaded by users are different, and it is not possible to directly use unified animation resources. The existing animation system requires that the animation strictly matches the bone name of the VRM model, otherwise it cannot be played correctly;

[0074] 3. Skeleton coordinate system difference problem: There is a rotation difference between the T-Pose in the AI model output animation file and the T-Pose in Unity Avatar. This difference will cause unnatural distortion and angle offset when directly applying BVH data;

[0075] 4. Runtime performance and timeliness problem: Generating animation usually requires a large amount of computing resources and time, which is difficult to meet the response requirements of real-time interaction. The animation data structure is complex, and there are performance bottlenecks in runtime parsing and application. The existing scheme lacks a lightweight animation representation format and an efficient processing mechanism;

[0076] 5. User experience continuity problem: During the process of waiting for AI-generated animation, the digital character may be in a static state, disrupting the continuity of interaction. The transition between the generated animation and the current state of the character is complex and prone to unnatural jumps.

[0077] Therefore, the main difficulties in developing digital character animation generation technology for Unity runtime include: how to ensure animation quality while maintaining real-time response; how to establish a general skeleton mapping mechanism to adapt to different VRM models; how to handle conversion and compensation between different coordinate systems; and how to optimize AI animation generation and processing flow to meet the needs of resource-constrained platforms such as mobile devices.

[0078] Reference Figure 1 The embodiment one of the present application provides a skeleton animation generation method for digital characters suitable for Unity development, which is executed in Unity runtime, including the following steps:

[0079] Step 1: Obtain the action requirement information of the digital character and encapsulate it into a specific data structure of skeleton animation generation instruction;

[0080] For step 1, the animation requirements generated by user intention or system interaction logic are obtained as the action requirement information of the digital character, providing input for subsequent AI animation generation.

[0081] In this embodiment, there are multiple methods to obtain the action requirement information of the digital character, as follows:

[0082] Action requirement information of the digital character is obtained through user voice input, for example, user voice is collected through a microphone interface of Unity or a third-party voice recognition SDK, noise reduction and signal enhancement processing are performed on the collected voice to improve recognition quality, the processed voice is converted into text form as semantic description for animation generation.

[0083] Action requirement information of the digital character is obtained through user text input, for example, a text input interface is used to allow the user to directly input action description, and shortcut selection of preset common action instructions is supported, and the text input supports multi-language processing to adapt to internationalization requirements.

[0084] Action requirement information of the digital character is obtained through system interaction logic, including: listening to system internal events to generate action requirement information of the digital character, generating action requirement information of the digital character based on current context and interaction object attributes, and mapping interaction behaviors defined by scene scripts to action requirement information of the digital character.

[0085] For step 1, different sources of action requirement information are encapsulated through a unified instruction data structure to ensure consistency of subsequent processing procedures, and the encapsulated skeletal animation generation instruction includes instruction type, instruction content, character ID, interaction object, instruction priority and timestamp.

[0086] Step 2: Convert the skeletal animation generation instruction into a structured skeletal animation generation prompt word data packet.

[0087] For step 2, the skeletal animation generation instruction is converted into a standardized AI animation generation prompt word data packet, including: main prompt word (describing core action requirement), auxiliary condition (action style, speed, intensity, etc.), constraint condition (explicitly not desired action features), time length parameter (expected action duration), and continuity description (transition requirements from previous action).

[0088] In this embodiment, the conversion process is as follows:

[0089] If the skeletal animation generation instruction is a composite action instruction, the composite action is decomposed into basic action units that can be independently generated.

[0090] A large language model is called to extract action keywords from the instruction content corresponding to the basic action unit, and the action keywords are semantically completed to enhance the specificity and executability of the description.

[0091] The extracted action keywords are filled into a preset action generation prompt word template as template parameters, the action generation prompt word template is from a pre-designed prompt word template library dedicated to action generation, and contains categories such as basic actions, emotional expressions, and interactive behaviors, the action generation prompt word template supports dynamic filling of action attributes, intensity, duration and other parameters, and an action generation prompt word data packet is obtained;

[0092] A transition description of a new action and a current state of the digital character is added in the action generation prompt word data packet to ensure the continuity of the new action and the current state of the digital character.

[0093] Step 3: generating a BVH format skeleton animation file according to the action generation prompt word data packet;

[0094] For step 3, an AI action generation model is used to convert the action text description into the action of the digital character, and a BVH format skeleton animation file is saved.

[0095] The BVH format skeleton animation file has the following characteristics: it contains a standard T-Pose skeleton definition; it contains complete skeleton animation frame data, each frame containing transformation information of each skeleton; the file size is small (usually tens of KB), facilitating network transmission; the format is standardized, facilitating cross-platform parsing and use.

[0096] In this embodiment, a Momask action generation model is called to generate a skeleton animation file of the digital character according to the action generation prompt word data packet; and the generated skeleton animation file of the digital character is converted into a BVH format skeleton animation file.

[0097] Step 4: parsing the BVH format skeleton animation file to obtain skeleton structure and animation data;

[0098] For step 4, its role is to receive and parse the BVH animation file at the Unity runtime, and convert it into a data structure that Unity can process, including a skeleton node tree (describing the hierarchical relationship of the skeleton), initial pose information of the skeleton (initial position and rotation under T-Pose), skeleton transformation information of each frame of animation (position and rotation information of each skeleton in each frame), and animation metadata (frame rate, total frame number, duration, etc.).

[0099] In this embodiment, the skeleton hierarchy information and the initial pose information of the skeleton are parsed from the skeleton definition data of the BVH format skeleton animation file, the skeleton node tree is constructed according to the skeleton hierarchy information, and the skeleton naming is preprocessed; the skeleton transformation information of each frame of animation and the animation metadata are parsed from the skeleton animation frame data of the BVH format skeleton animation file, and the skeleton transformation information of each frame of animation is converted from the BVH coordinate system to the Unity coordinate system.

[0100] Step 5: T-Pose difference compensation between the T-Pose of the BVH format file and the Unity Avatar standard T-Pose, adapt the bone structure of the BVH format bone animation file to the bone structure of the digital character VRM model, and generate the AnimationClip object of the digital character VRM model according to the adaptation result and the animation data;

[0101] For step 5, there is a rotation difference between the T-Pose in the output BVH file and the T-Pose of the Avatar in Unity, which can cause unnatural distortion and angle offset when directly applying BVH data. The T-Pose difference compensation mechanism innovatively solves the rotation difference problem between the AI-generated BVH file T-Pose and the Unity Avatar T-Pose, and designs a double-layer mapping mechanism with the Humanoid skeleton definition of the VRM model as the intermediate layer, realizing the general conversion from BVH bones to specific VRM model bones, and solving the problem of inconsistent bone naming of different models. Its role is to solve the adaptation problem between AI-generated general animation data and specific digital character VRM models.

[0102] In this embodiment, the rotation difference between the T-Pose in the BVH file and the Unity Avatar standard T-Pose is calculated, and a rotation compensation matrix is generated for each bone. The Humanoid skeleton definition of the VRM model is used as an intermediate mapping layer to establish a mapping from the bone name in the BVH format bone animation file to the Humanoid bone, and then from the Humanoid bone to the actual bone name of the digital character VRM model. According to the correspondence between the bones in the BVH format bone animation file and the actual bones of the digital character VRM model and the bone transformation information of each frame of animation, the AnimationClip object is created and configured, which can be directly used for animation playback.

[0103] Step 6: According to the generated AnimationClip object of the digital character VRM model, control the bone animation to play on the digital character VRM model, and apply the rotation compensation matrix to transform the bones of each frame of animation during the animation playback process.

[0104] Through the above steps, the natural and smooth playback of the animation on the digital character is finally realized, and the whole process from user intention or system logic to visual presentation of digital character action is completed.

[0105] Reference Figure 2The embodiment two of the present application provides a skeleton animation generation device for a digital character suitable for Unity development, which comprises an instruction input module, an instruction analysis module, an AI action generation module, a data analysis module, an action data adaptation module and an action playing module.

[0106] 1. The instruction input module

[0107] The instruction input module is responsible for obtaining action requirement information of the digital character and encapsulating the skeleton animation generation instruction into a specific data structure.

[0108] 1.1 User voice input

[0109] 1) The user voice is collected through the microphone interface of Unity or a third-party voice recognition SDK, and noise reduction and signal enhancement processing are performed on the collected voice to improve the recognition quality;

[0110] 2) The processed voice is converted into text form as the semantic description of animation generation.

[0111] 1.2 User text input

[0112] 1) A text input interface is provided to allow the user to directly input action description;

[0113] 2) The quick selection of preset common action instructions is supported;

[0114] 3) The text input supports multilingual processing to adapt to internationalization requirements.

[0115] 1.3 System interaction logic trigger input

[0116] 1) The system internal events are listened to to automatically generate action requirements;

[0117] 2) The action requirements are automatically generated based on the current context and the attributes of the interactive object;

[0118] 3) The special interaction behaviors defined by the scene script are supported to be mapped to the action requirements.

[0119] The module encapsulates inputs of different sources through a unified instruction data structure to ensure the consistency of the subsequent processing flow, and the instruction data includes instruction type, instruction content, character ID, interactive object, instruction priority and timestamp;

[0120] 2. The instruction analysis module

[0121] The instruction analysis module is responsible for converting the skeleton animation generation instruction into a structured skeleton animation generation prompt word data packet.

[0122] 2.1 Semantic understanding processing

[0123] 1) Call large language model analysis instruction data, extract key action description, degree, speed, etc. (such as "sit down" "quickly wave hands");

[0124] 2) Semantic completion of ambiguous instructions, enhance the specificity and executability of the description, analyze action objects (such as "red tea cup"), interaction methods (such as "pick up") and other context information;

[0125] 3) Process multi-language input and convert it into a language format supported by AI models.

[0126] 2.2 Prompt word template system

[0127] 1) Designed a prompt word template library specifically for action generation, including basic actions, emotional expression, interactive behavior, etc.

[0128] 2) Realize template parameterization, support dynamic filling of action attributes, intensity, duration, etc.

[0129] 3) Provide a prompt word optimization mechanism to automatically adjust the prompt word structure based on historical generation results.

[0130] 2.3 Context association processing

[0131] 1) Maintain the current state and historical action sequence information of the digital character;

[0132] 2) Analyze the coherence requirements of new actions and the current state, and add transition descriptions in the prompt words;

[0133] 3) Process compound action instructions and decompose them into independent basic action units.

[0134] This module outputs structured skeletal animation generation prompt word data packets, including: main prompt words (describe core action requirements), auxiliary conditions (action style, speed, intensity, etc. Attributes), constraint conditions (explicitly do not want to appear action features), duration parameters (expected action duration), coherence description (explain the transition requirements with the previous action).

[0135] 3. AI action generation module

[0136] The AI action generation module is the core technical link of the invention, responsible for generating BVH format skeletal animation files according to the skeletal animation generation prompt word data packet.

[0137] 3.1 AI service call interface

[0138] 1) Implement HTTP / HTTPS communication interface with Momask and other AI action generation services;

[0139] 2) Designed request retry and failover mechanism to improve service reliability;

[0140] 3) Support asynchronous calling mode in Unity side to avoid main thread blocking.

[0141] 3.2 Action generation parameter optimization

[0142] 1) Dynamically adjust generation parameters according to prompt word features and target action types;

[0143] 2) Support specifying generation model variant selection to adapt to different action style requirements.

[0144] 3.3 BVH format animation output

[0145] 1) Convert AI-generated skeletal animation files into standard BVH format skeletal animation files;

[0146] 2) BVH files contain standard T-Pose skeletal definition data and skeletal animation frame data;

[0147] 3) Optimize BVH data structure to reduce redundant information, reduce transmission and storage overhead.

[0148] 3.4 Result caching mechanism

[0149] 1) Implement animation result caching system, same or similar prompt words can directly return cached results;

[0150] 2) Designed cache eviction policy, using LRU algorithm to balance memory usage and hit rate;

[0151] 3) Support background pre-generation of common actions to improve response speed.

[0152] The output of this module is a standard BVH format skeletal animation file, which has the following characteristics:

[0153] (1) Contains standard T-Pose skeleton definition;

[0154] (2) Contains complete skeletal animation frame data, each frame contains skeletal transformation information and animation metadata for each bone;

[0155] (3) Small file size (usually tens of KB), easy for network transmission;

[0156] (4) Format standardization, easy for cross-platform parsing and use.

[0157] 4. Data parsing module

[0158] The data parsing module is responsible for receiving and parsing BVH format skeletal animation files in Unity runtime, converting them into Unity processable data structures.

[0159] 4.1 BVH File Parser

[0160] 1) Implement an efficient BVH file syntax analyzer that supports runtime parsing;

[0161] 2) Extract both the skeletal hierarchy and motion data;

[0162] 3) Handle different BVH file format variants to ensure compatibility.

[0163] 4.2 Skeleton Structure Extraction

[0164] 1) Parse the skeletal hierarchy definition in the BVH file;

[0165] 2) Construct the skeleton node tree, preserving parent-child relationships and initial pose information;

[0166] 3) Preprocess BVH file skeleton naming to prepare for subsequent adaptation.

[0167] 4.3 Animation Data Extraction

[0168] 1) Parse skeletal animation frame data, including animation metadata and per-frame skeletal transformation information

[0169] 2) Convert the BVH coordinate system (usually right-handed) to the Unity coordinate system (left-handed);

[0170] 3) Optimize memory usage by using compressed storage formats to reduce runtime memory consumption.

[0171] The module outputs the parsed intermediate data structure, which includes:

[0172] (1) Skeleton Node Tree: Describes the hierarchical relationship of the skeleton;

[0173] (2) Skeleton Initial Pose: Initial position and rotation information of the skeleton in T-Pose;

[0174] (3) Animation Sequence Data: Position and rotation information of each bone in each frame;

[0175] (4) Animation Metadata: Frame rate, total frame count, duration, etc.

[0176] 5. Action Data Adaptation Module

[0177] The action data adaptation module is responsible for adapting the bone structure of the BVH format skeleton animation file to the bone structure of the digital character VRM model, and generating the AnimationClip object of the digital character VRM model according to the adaptation result and the animation data, solving the adaptation problem between the general animation data generated by AI and the specific VRM model.

[0178] 5.1 T-Pose difference compensation

[0179] 1) Calculate the rotation difference between T-Pose in BVH file and Unity Avatar standard T-Pose;

[0180] 2) Generate a rotation compensation matrix for each bone;

[0181] 3) Apply the rotation compensation matrix to each frame of animation data during animation playback.

[0182] 5.2 Skeleton name mapping system

[0183] 1) Use the Humanoid skeleton definition of the VRM model as an intermediate mapping layer;

[0184] 2) Establish a mapping table from BVH bone names to Humanoid bones;

[0185] 3) And then map from Humanoid bones to the actual bone names of the specific VRM model.

[0186] 5.3 Dynamic AnimationClip generation

[0187] 1) Based on the parsed and adapted data, dynamically create Unity AnimationClip objects at runtime;

[0188] 2) Set appropriate animation curves (AnimationCurve) for each bone

[0189] 3) Handle rotation representation conversion (such as conversion between quaternions and Euler angles)

[0190] The output of this module is the Unity AnimationClip object fully adapted to the current VRM model, which can be directly used for animation playback.

[0191] 6. Action playback module

[0192] The action playback module is responsible for controlling the playback of skeleton animation on the digital character VRM model according to the generated AnimationClip object of the digital character VRM model.

[0193] 6.1 Animation controller management

[0194] 1) Dynamically create Animation Manager object;

[0195] 2) Manage animation state machine, support multi-layer animation blending and transition, implement animation switching;

[0196] 3) Implement animation playback queue, handle continuous or parallel animation requests.

[0197] 6.2 Smooth transition processing

[0198] 1) Create a natural transition between the current pose and the new animation;

[0199] 2) Support configurable transition time and curve.

[0200] 6.3 Animation event system

[0201] 1) Trigger predefined events at animation key points;

[0202] 2) Support animation completion callbacks for continuous action coordination.

[0203] 6.4 Performance optimization mechanism:

[0204] 1) Support animation instance sharing, multiple identical models can reuse animation resources;

[0205] 2) Provide frame rate control options to balance quality and performance.

[0206] This module realizes the natural and smooth playback of generated animation on VRM model, and completes the whole process from user intention to visual presentation.

[0207] Although the present application has been disclosed as above with examples, it is not intended to limit the present application, and any person skilled in the art can make some changes and modifications without departing from the spirit and scope of the present application, therefore the protection scope of the present application shall be subject to the definition of the claims.

Claims

1. A method for generating skeletal animation of a digital character developed in Unity, characterized in that: This method is executed during the Unity runtime and includes the following steps: Obtaining the action requirement information of the digital character and encapsulating it into a skeletal animation generation instruction of a specific data structure, wherein the skeletal animation generation instruction includes an instruction type, instruction content, character ID, interactive object, instruction priority, and a timestamp; Converting skeletal animation generation instructions into a structured skeletal animation generation prompt word data packet; Generate a skeletal animation file in BVH format according to the skeletal animation generation prompt word data package; Parse the skeletal animation file in BVH format to obtain the skeletal structure and animation data; Compensate for T-Pose differences between the BVH format file's T-Pose and the Unity Avatar standard T-Pose, adapt the skeletal structure of the BVH format skeletal animation file to the skeletal structure of the digital character VRM model, and generate an AnimationClip object for the digital character VRM model based on the adaptation results and animation data. The skeleton animation is played on the digital character VRM model according to the generated AnimationClip object of the digital character VRM model, and the rotation compensation matrix is ​​applied to the skeleton of each frame of the animation for transformation during the animation playback.

2. A method for generating skeletal animation of a digital character suitable for Unity development according to claim 1, characterized in that: Obtain the action requirement information of the digital character, including: Acquire action requirement information of the digital character through user voice input and user text input; Obtain the action requirement information of the digital character generated by the system interaction logic, specifically including: monitoring the internal events of the system to generate the action requirement information of the digital character, generating the action requirement information of the digital character based on the current context and the properties of the interaction object, and mapping the interaction behavior defined by the scene script to the action requirement information of the digital character.

3. A method for generating skeletal animation of a digital character suitable for Unity development according to claim 2, characterized in that: Convert the skeletal animation generation instructions into a structured skeletal animation generation prompt word data package, including: If the skeletal animation generation instruction is a compound action instruction, the compound action is decomposed into basic action units that can be generated independently; The large language model is used to extract action keywords from the instruction content corresponding to the basic action unit and perform semantic completion on the action keywords. Fill the extracted action keywords as template parameters into the preset action generation prompt word template to obtain the skeletal animation generation prompt word data packet; Add a transition description between the new action and the current state of the digital character in the skeletal animation generation prompt word data packet to ensure the consistency between the new action and the current state of the digital character.

4. A method for generating skeletal animation of a digital character suitable for Unity development according to claim 3, characterized in that: Generate a skeletal animation file in BVH format based on the skeletal animation prompt word data package, including: Call the Momask action generation model to generate the digital character's skeletal animation file based on the skeletal animation prompt word data package; The generated skeletal animation file of the digital character is converted into a skeletal animation file in a BVH format, wherein the skeletal animation file in the BVH format includes skeletal definition data and skeletal animation frame data of a standard T-Pose.

5. The method for generating skeletal animation of a digital character suitable for Unity development according to claim 4, characterized in that: Parse the BVH format skeletal animation file to obtain the skeletal structure and animation data, including: Parse the bone hierarchy information and initial bone pose information from the bone definition data in the BVH format skeletal animation file, build a bone node tree based on the bone hierarchy information, and pre-process the bone naming; Parse the bone transformation information and animation metadata of each frame of animation from the bone animation frame data of the BVH format bone animation file, and convert the bone transformation information of each frame of animation from the BVH coordinate system to the Unity coordinate system.

6. The method for generating skeletal animation of a digital character suitable for Unity development according to claim 5, characterized in that: Compensate for T-Pose differences between the BVH format file's T-Pose and the Unity Avatar standard T-Pose, adapt the skeletal structure of the BVH format skeletal animation file to the skeletal structure of the digital character VRM model, and generate an AnimationClip object for the digital character VRM model based on the adaptation results and animation data, including: Calculate the rotation difference between the T-Pose in the BVH file and the Unity Avatar standard T-Pose, and generate a rotation compensation matrix for each bone; Using the Humanoid skeleton definition of the VRM model as an intermediate mapping layer, establish a mapping from the bone names in the BVH format skeletal animation file to the Humanoid bones, and then map from the Humanoid bones to the actual bone names of the digital character VRM model; Create and configure AnimationClip objects based on the correspondence between the bones in the BVH format skeletal animation file and the actual bones of the digital character VRM model and the bone transformation information of each frame of animation.

7. A skeletal animation generation device for digital characters developed by Unity, characterized in that: It includes instruction input module, instruction parsing module, AI action generation module, data parsing module, action data adaptation module and action playback module; An instruction input module is used to obtain the action requirement information of the digital character and encapsulate it into a skeletal animation generation instruction of a specific data structure, wherein the skeletal animation generation instruction includes instruction type, instruction content, character ID, interactive object, instruction priority and timestamp; An instruction parsing module, used to convert skeletal animation generation instructions into a structured skeletal animation generation prompt word data packet; AI action generation module, used to generate BVH format skeleton animation files based on skeleton animation prompt word data packets; Data parsing module, used to parse the skeletal animation file in BVH format to obtain the skeletal structure and animation data; The motion data adaptation module is used to adapt the skeletal structure of the BVH format skeletal animation file to the skeletal structure of the digital character VRM model, and generate the AnimationClip object of the digital character VRM model based on the adaptation result and animation data; The action playback module is used to control the skeleton animation to play on the digital character VRM model according to the generated AnimationClip object of the digital character VRM model.

Citation Information

Patent Citations

  • AR animation generation method and device based on unity3d, and medium

    CN110458928A

  • Method, device and system for generating skinned skeleton animation and method, device and system for editing skinned skeleton animation

    CN116416348A

  • Animation generation method and device and electronic equipment

    CN117132687A

  • Skeletal animation generation method and system based on AI drive

    CN117557693A

  • Character feature extraction-based combat action skeletal animation generation method and system

    CN118967895A