Virtual character animation overlay and blending method and system
Patent Information
- Application Number
- CN202610824067.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-10-20
AI Technical Summary
当多个叠加层在同一骨骼区域的权重累加值超过合理范围时,缺乏系统化的优先级仲裁与冲突消解机制,各叠加层的旋转增量直接累加到基础动作上,容易导致关节角度超出物理限位范围,产生骨骼过度扭曲等物理不合理姿态
[0009]本发明的有益效果在于:本发明通过响应叠加请求采集基础动作姿态,依据姿态快照与姿态类别从参考姿态池匹配或生成目标参考姿态,再基于目标参考姿态与叠加动画姿态计算骨骼变换差值集合。结合覆盖权重集合进行骨骼冲突处理得到目标覆盖权重集合,最终将基础动作姿态与骨骼变换差值集合按目标覆盖权重集合合成,并执行关节约束校验输出姿态。相比固定参考姿态方案,目标参考姿态动态匹配当前基础动作,避免因基础动作与参考姿态差异过大导致的骨骼扭曲和关节角度偏差,在奔跑、蹲伏等任意基础动作上均能保持叠加效果视觉一致性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graphics technology, and in particular to a method and system for overlaying and blending virtual character animations. Background Technology
[0002] Layered animation overlay and local skeletal overlay are important techniques in virtual character animation systems. They are used to superimpose multiple local corrections on top of basic movements to enrich the character's expressiveness. For example, aiming deviation can be superimposed on running, limping can be superimposed on walking, and holding posture can be superimposed on standing. With the rapid development of virtual content industries such as games, film and television, and digital humans, the demand for this technology is increasing, and the simultaneous presentation of multiple overlay effects on characters in complex states has become a common requirement.
[0003] Currently, most mainstream game engines use a fixed reference posture scheme to calculate the skeletal rotation difference for overlay animations. This scheme specifies a fixed reference posture (usually a T-shaped standing posture or a standard standing posture) during system initialization, extracts the skeletal rotation difference of the overlay animation relative to this reference posture, and then overlays this difference onto the skeletal posture of the current base action to achieve the animation overlay effect. However, when there is a significant difference between the base action and the reference posture, such as applying the aiming offset difference calculated based on the standing reference posture to the base action of running or crouching, the overlay skeletal rotation difference deviates from a reasonable range. This results in obvious skeletal distortion and joint angle deviations in areas such as the spine and shoulder joints. The overlay effect becomes significantly distorted with changes in the state of the base action, making it impossible to maintain visual consistency across any base action.
[0004] In controlling the skeletal coverage area, artists typically rely on manually configuring static skeletal mask presets for each overlay scene. This involves pre-specifying a set of bones and their corresponding coverage weight values, which are then directly read and applied at runtime. While this static preset approach is maintainable when there are few scenes, as game scene complexity increases and the number of combinations of different overlay types and character states grows dramatically, the number of mask configurations expands linearly, leading to extremely high maintenance costs. More importantly, static masks cannot automatically adjust the coverage area and weight distribution based on runtime context (such as the character's current movement speed, pose type, and interaction state). Furthermore, mask edges are usually processed using hard binary switching, meaning the bone coverage weight is either 0 or 1, resulting in noticeable blending breaks between covered and uncovered areas, leading to unnatural visual transitions.
[0005] In scenarios where multiple overlays act on the same skeleton simultaneously, a simple linear weight accumulation method is typically used to handle the influence of each overlay. However, when the accumulated weights of multiple overlays in the same bone region exceed a reasonable range, the lack of a systematic priority arbitration and conflict resolution mechanism means that the rotational increments of each overlay are directly added to the basic movement. This can easily lead to joint angles exceeding physical limits, resulting in physically unreasonable postures such as excessive bone distortion. In complex scenarios where multiple overlays are active simultaneously, such as aiming, injury, or holding objects, the integrity of the effects of high-priority overlays is difficult to guarantee, and the overlay quality becomes uncontrollable. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a method for superimposing and blending virtual character animations, so as to output physically reasonable skeletal postures when superimposing animations on basic action postures.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for overlaying and blending virtual character animations includes: responding to a received overlay request and obtaining the basic motion pose of the current frame; determining a target reference pose based on the pose snapshot and pose category in the basic motion pose; calculating a set of skeletal transformation differences for each overlay layer relative to the target reference pose based on the target reference pose and the overlay animation poses of each overlay layer; obtaining a set of coverage weights for each overlay layer based on runtime context parameters; performing skeletal conflict processing based on the set of skeletal transformation differences and the set of coverage weights to obtain a target coverage weight set; and synthesizing the basic motion pose and the set of skeletal transformation differences according to the target coverage weight set to output the final skeletal pose.
[0008] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A virtual character animation overlay and blending system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it performs the following steps: In response to the received overlay request, the system obtains the basic motion pose of the current frame; based on the pose snapshot and pose category in the basic motion pose, it determines the target reference pose; based on the target reference pose and the overlay animation pose of each overlay layer, it calculates the set of skeletal transformation differences of each overlay layer relative to the target reference pose; based on runtime context parameters, it obtains the set of coverage weights of each overlay layer; based on the set of skeletal transformation differences and the set of coverage weights, it performs skeletal conflict processing to obtain the target coverage weight set; it synthesizes the basic motion pose and the set of skeletal transformation differences according to the target coverage weight set, and outputs the final skeletal pose.
[0009] The beneficial effects of this invention are as follows: This invention acquires basic motion postures in response to overlay requests, matches or generates target reference postures from a reference posture pool based on posture snapshots and posture categories, and then calculates a set of skeletal transformation differences based on the target reference posture and the overlay animation posture. A target coverage weight set is obtained by handling skeletal conflicts using a coverage weight set, and finally, the basic motion postures and the set of skeletal transformation differences are synthesized according to the target coverage weight set, and joint constraint verification is performed to output the posture. Compared to a fixed reference posture scheme, the target reference posture dynamically matches the current basic motion, avoiding skeletal distortion and joint angle deviations caused by excessive differences between the basic motion and the reference posture, maintaining visual consistency in the overlay effect for any basic motion such as running and crouching. Attached Figure Description
[0010] Figure 1 A flowchart illustrating the steps of a virtual character animation overlay and blending method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a virtual character animation overlay and blending system provided in an embodiment of the present invention; Figure 3 A flowchart illustrating the main steps of a method for overlaying and blending virtual character animations provided in this embodiment of the invention; Figure 4 A flowchart illustrating the steps of receiving overlay requests and generating basic actions in a virtual character animation overlay and blending method provided in this embodiment of the invention; Figure 5 A flowchart illustrating the adaptive reference pose matching and difference calculation steps of a virtual character animation overlay and blending method provided in this embodiment of the invention; Figure 6 A flowchart illustrating the semantic skeletal mask dynamic generation steps of a virtual character animation overlay and blending method provided in an embodiment of the present invention; Figure 7 A flowchart of the multi-level priority arbitration and conflict detection steps of a virtual character animation overlay and blending method provided in an embodiment of the present invention; Figure 8 A flowchart of the conflict resolution and weight redistribution steps of a virtual character animation overlay and blending method provided in an embodiment of the present invention; Figure 9 A flowchart of the dynamic modulation of superposition weights and smooth transition steps in a virtual character animation superposition and blending method provided in an embodiment of the present invention; Figure 10 A flowchart illustrating the layered blending calculation and joint constraint verification steps of a virtual character animation overlay and blending method provided in this embodiment of the invention; Figure 11This is a flowchart illustrating the steps involved in outputting the final skeletal pose of a virtual character animation overlay and blending method provided in an embodiment of the present invention. Detailed Implementation
[0011] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0012] In existing technologies, when multiple layers of animation are overlaid, the lack of a conflict resolution mechanism leads to conflicts between the overlaid layers, ultimately resulting in physically unreasonable skeletal poses.
[0013] To at least address the aforementioned issues, this invention dynamically determines the target reference pose based on the pose snapshot and pose category of the basic action to calculate the bone transformation difference of each overlay layer. It also adaptively generates a set of coverage weights using runtime context parameters to handle bone conflicts and synthesize poses. In this way, it is possible to output physically reasonable bone poses when overlaying animations on any basic action.
[0014] The following describes in detail a method for overlaying and blending virtual character animations according to the present invention, with reference to the appendix. Figure 1 ,include: Step 101: Respond to the received overlay request and obtain the basic motion pose of the current frame. The overlay request refers to receiving requests from various overlay layers, including overlay animation data, semantic tags, priority weights, and the target bone set. The basic motion pose refers to the real-time state of the current basic motion, including bone pose snapshots, motion speed, motion phase, and pose category labels. The pose snapshot refers to the position, rotation, and scaling data of all bones. The motion phase refers to the phase value calculated through foot contact detection for periodic movements. The pose category label refers to the basic motion category automatically determined based on motion characteristics, including standing, walking, running, crouching, and jumping.
[0015] Step 102: Determine the target reference pose based on the pose snapshot and pose category in the basic motion pose; the target reference pose refers to the reference pose that is matched from the reference pose pool and has the smallest difference from the basic motion pose, or a continuous reference pose generated by interpolation between adjacent reference poses.
[0016] Step 103: Based on the target reference pose and the overlay animation poses of each overlay layer, calculate the set of skeletal transformation differences for each overlay layer relative to the target reference pose. An overlay layer refers to a locally modified animation layer superimposed on top of a basic motion, and during registration, it carries the overlay animation reference, semantic tags, priority weights, and the target bone set. The overlay animation pose refers to the skeletal transformation data of each frame of the animation within the overlay layer. The set of skeletal transformation differences refers to the merged set of skeletal transformation differences corresponding to all overlay frames of the overlay layer.
[0017] Step 104: Based on runtime context parameters, obtain the coverage weight set for each overlay layer. Based on the bone transformation difference set and the coverage weight set, perform bone conflict processing to obtain the target coverage weight set. Runtime context parameters include, for example, character speed, pose type, interaction target type, and overlay semantic labels. The coverage weight set refers to the weight array of each bone's basic coverage weights after transition band attenuation. Bone conflict processing refers to the process of redistributing the coverage weights of conflicting bones based on priority to resolve conflicts. The target coverage weight set refers to the final weight allocation for each overlay layer after conflict resolution.
[0018] Step 105: Synthesize the basic motion pose and the skeleton transformation difference set according to the target coverage weight set to output the final skeleton pose; As described above, after obtaining the basic motion posture, the target reference posture is determined based on the posture snapshot and posture category. Then, the set of skeletal transformation differences is calculated based on this reference posture and the animation postures of each overlay layer. A set of coverage weights is obtained by combining runtime context parameters for skeletal conflict handling. Finally, the final skeletal posture is synthesized and output according to the target coverage weights. This avoids skeletal conflicts between multiple overlay layers, eliminates the distortion problem of overlay differences caused by fixed reference postures, and ensures that overlay layers such as aiming offset and holding posture maintain a consistent visual effect across different basic actions, while reducing skeletal distortion rate.
[0019] In one embodiment of the present invention, step 102, determining the target reference posture based on the posture snapshot and posture category in the basic action posture, includes: Step 201: Extract the bone orientation vector and center of gravity distribution parameters from the pose snapshot; the bone orientation vector refers to the direction vector of key bones in the spine or thigh direction. The center of gravity distribution parameters refer to the offset data of the character's center of gravity.
[0020] Step 202: Based on the bone orientation vector and center of gravity distribution parameters, calculate the weighted distance between the pose and each reference pose in the preset reference pose pool, and select the reference pose with the smallest weighted distance as the candidate reference pose. The reference pose pool refers to a set of poses pre-extracted representative pose frames according to motion categories, constructed offline during system initialization and accessed in read-only mode during runtime. The weighted distance is a distance metric calculated by combining the quaternion angular distance of bone rotation differences and the center of gravity offset. The candidate reference pose is the reference pose with the smallest weighted distance in the reference pose pool.
[0021] Step 203: When the weighted distance is less than or equal to a preset threshold, the candidate reference pose is determined as the target reference pose; the preset threshold refers to the distance threshold for determining whether there is a perfectly matching reference pose.
[0022] Step 204: When the weighted distance is greater than a preset threshold, sort the reference poses in ascending order of weighted distance, take the top two reference poses as adjacent reference poses, and perform interpolation between adjacent reference poses to generate the target reference pose; adjacent reference poses refer to the two reference poses that are closest to each other. Interpolation refers to spherical linear interpolation performed between two reference poses according to the distance ratio.
[0023] As described above, compared to schemes that rely solely on a single-dimensional distance metric, this approach more accurately reflects the similarity between the current base motion pose and the reference pose, effectively reducing the matching deviation rate of the candidate reference pose. When the weighted distance between the candidate reference pose and the base motion pose exceeds a preset threshold, the target reference pose is generated through interpolation between adjacent reference poses, ensuring that the difference between the target reference pose and the base motion pose remains within a controllable range. This guarantees the accuracy of subsequent skeleton transformation difference calculations and avoids distortion of the superimposed difference caused by reference pose deviations.
[0024] In one embodiment of the present invention, step 103, based on the target reference pose and the superimposed animation pose of each superimposed layer, calculates the set of skeletal transformation differences of each superimposed layer relative to the target reference pose, including: Step 301: For each overlay frame of the overlay layer, calculate the difference between the local rotation quaternion of the target bone in the overlay frame and the inverse quaternion corresponding to the target reference pose. Perform normalization processing on the difference to obtain the bone transformation difference for each overlay frame. The inverse quaternion refers to the inverse transformation quaternion of the bone rotation in the target reference pose. The normalization processing refers to the processing performed on the difference quaternion to avoid ambiguity in the rotation path and ensure that the shortest rotation path is taken. The bone transformation difference refers to the difference between the rotation of the overlay frame and the inverse transformation of the rotation of the reference pose.
[0025] Step 302: Merge the skeletal transformation differences corresponding to all overlay frames of the overlay layer to obtain a set of skeletal transformation differences; As described above, by calculating the difference between the local rotation quaternion of the target bone in the overlay frame and the inverse quaternion corresponding to the target reference pose, and then normalizing the difference, the bone transformation difference for each overlay frame is obtained. Finally, the bone transformation differences of all overlay frames are merged into a set of bone transformation differences. The obtained set of bone transformation differences maintains a unit quaternion constraint numerically, eliminating the influence of floating-point accumulated errors on subsequent interpolation operations, ensuring the uniqueness and numerical stability of the rotation path; the frame-by-frame merged difference set completely preserves the temporal information of the overlay animation.
[0026] In one embodiment of the present invention, step 104, obtaining the coverage weight set of each overlay layer, includes: Step 401: Based on the skeletal function grouping of each overlay layer, match the preset skeletal chains to determine the initial skeletal coverage set. Here, skeletal function grouping refers to the semantic tags declared during overlay registration, including six standard semantic tags: aiming chain, holding chain, balance chain, expression chain, injury chain, and movement chain. A skeletal chain refers to the set of bones corresponding to the semantic tags: the aiming chain covers the spine to the neck to the head; the holding chain covers the target arm to the fingers; the balance chain covers the pelvis to the legs; the expression chain covers facial bones; the injury chain covers the spine to the corresponding limb; and the movement chain covers the whole body. The initial skeletal coverage set refers to the skeletal coverage area without attenuation determined after matching the skeletal chains.
[0027] Step 402: Obtain runtime context parameters, and calculate the basic coverage weight of each bone in the initial bone coverage set based on the runtime context parameters; where the basic coverage weight refers to the initial weight value of each bone calculated by the declarative rule engine according to the rule configuration.
[0028] Step 403: Identify the masking boundary bones of the initial bone coverage set. Starting from the masking boundary bones, extend outwards along the bone hierarchy for a preset number of layers as transition zone bones. Here, masking boundary bones refer to the bones at the boundary between the covered and uncovered areas. Bone hierarchy refers to the parent-child hierarchical structure of the bones. The preset number of layers indicates the number of bone layers to be extended outwards, defaulting to 2 layers. Transition zone bones refer to the bones used for smooth weight transitions extending outwards from the masking boundary bones.
[0029] Step 404: Apply an exponential decay function to the corresponding basic coverage weights of the transition zone bones, reducing the weights from the boundary weights to zero, to obtain a set of coverage weights; where the exponential decay function refers to a decay function based on the bone level distance, with the weights decreasing exponentially from the boundary weights to 0.
[0030] Among them, the boundary weight refers to the basic coverage weight of the boundary skeleton at the junction of the coverage area and the transition zone. The basic coverage weight is determined by the semantic label matching result and the runtime context parameters, and serves as the starting weight of the exponential decay function.
[0031] As described above, the maintenance cost of mask configuration is reduced from linearly increasing with the number of scenes to only requiring maintenance of grouping rule entries, supporting runtime hot updates; the basic coverage weight is dynamically calculated based on runtime context parameters and a weight adjustment factor is applied, so that the coverage area and weight distribution can automatically adapt to the character's state, avoiding the weight mismatch problem of static preset schemes in complex runtime scenarios; the transition band weight generated by the exponential decay function eliminates the hard cut edges between the covered and uncovered areas, making the boundary of the influence range of the overlay animation present a smooth visual transition effect.
[0032] In one embodiment of the present invention, step 104, based on the skeleton transformation difference set and the coverage weight set, performs skeleton conflict processing to obtain the target coverage weight set, including: Step 501: Perform bone conflict detection on each overlay layer based on the bone transformation difference set and the coverage weight set. If conflicting bones exist, redistribute the coverage weights of the conflicting bones based on the priority of each overlay layer to resolve the conflict, obtaining the target coverage weight set. Bone conflict detection refers to a dual detection method: calculating the sum of weights across all overlay layers for each bone and checking if joint angles exceed limits. Conflicting bones are those whose accumulated weights exceed the conflict tolerance threshold or whose joint angles exceed limits. Priority refers to the priority weight value carried during overlay layer registration; a larger value indicates higher priority. Redistribution refers to the operation of allocating weight quotas from high to low priority and reducing the weights of low-priority layers.
[0033] As described above, a dual detection mechanism is used to locate conflicting bones and perform weight redistribution based on priority values. This ensures that the visual integrity of high-priority overlays is not affected by low-priority layers, while avoiding joint angle overshooting caused by weight overflow in conflict areas, thus maintaining the physical plausibility of the final pose output in multi-layer overlay scenes.
[0034] In one embodiment of the present invention, step 501, which involves performing bone conflict detection on each overlay layer based on the bone transformation difference set and the coverage weight set, includes: Step 601: Traverse each bone and calculate the sum of the coverage weights of all overlay layers corresponding to the bone. When the sum of the coverage weights is greater than a preset conflict tolerance threshold, mark the bone as a weight conflict bone. The conflict tolerance threshold refers to the critical value that allows weight overflow, which defaults to 1.2. A weight conflict bone is a bone whose sum of coverage weights exceeds the conflict tolerance threshold.
[0035] Step 602: For bones with weight conflicts, calculate the total rotation increment after accumulating the set of bone transformation differences for each overlay layer according to the coverage weight; where the total rotation increment refers to the rotation amount after accumulating the differences of each layer according to the current weight.
[0036] The current weight refers to the immediate weight of a certain overlay layer on the current skeleton in the current frame. The immediate weight is obtained by combining the coverage weight of the overlay layer on the skeleton with the current weight modulation coefficient. The current weight modulation coefficient is the immediate modulation multiple calculated by the overlay layer in the current frame based on the target weight, transition curve progress and condition parameters. The total rotation increment is obtained by weighting and accumulating the skeleton transformation differences of each overlay layer on the skeleton to the same local skeleton coordinate system according to their respective current weights.
[0037] Step 603: If the total rotation increment causes the joint angle of the bone to exceed the preset physical limit range, then the corresponding bone is marked as a posture over-limit conflict bone; whereby the preset physical limit range refers to the pre-configured joint rotation angle limit value, including shoulder flexion not exceeding 180 degrees and spinal scoliosis not exceeding 45 degrees. Posture over-limit conflict bones refer to bones whose joint angles exceed the physical limit range due to the total rotation increment.
[0038] Step 604: Identify the weight conflict bones and pose over-limit conflict bones as conflict bones; As described above, this invention identifies conflicting skeletons through a dual detection mechanism. Compared with existing technologies that only perform weight accumulation detection, it adds posture physical rationality verification, which can distinguish between two different degrees of conflict: weight overflow but the angle is still reasonable, and weight overflow and the angle has exceeded the limit. This provides a more detailed conflict classification basis for subsequent resolution.
[0039] In one embodiment of the present invention, in step 501, if conflicting bones exist, the coverage weights of the conflicting bones are reallocated based on the priority of each overlay layer to resolve the conflict, including: Step 701: Sort the overlays acting on the conflict bones according to a preset priority from high to low; wherein, the priority is a level value pre-assigned by the game logic or configuration rules when the overlay is registered, loaded or updated, and the level value is used to perform weight quota allocation when multiple layers of competition for the same conflict bone are detected.
[0040] Step 702: Assign the coverage weight of the highest priority overlay on the conflict bone as a weight quota to the highest priority overlay; where the weight quota refers to the full request weight obtained by the highest priority overlay on the conflict bone.
[0041] Step 703: Subtract the weighted quota from the preset quota to obtain the remaining available quota, and allocate the remaining available quota to the next lower priority overlay layer proportionally; where the preset quota refers to the maximum total weighted allocation allowed by the system. The remaining available quota refers to the difference between the preset quota and the weighted quota of the highest priority layer.
[0042] Step 704: If the remaining available quota is less than the coverage weight of the low-priority overlay on the conflicting skeleton, then reduce the coverage weight of the low-priority overlay on the conflicting skeleton according to the proportion of the coverage weight of the low-priority overlay to the sum of the coverage weights of all overlays to be allocated; where low-priority overlays refer to overlays with priority weights lower than the highest and second-highest priorities. Overlays to be allocated refer to the second-highest and low-priority overlays participating in the allocation of the remaining quota.
[0043] As described above, the priority-driven, tiered quota allocation and proportional reduction mechanism achieves an orderly weight distribution from high to low on the conflict skeleton. This ensures that the highest priority overlay layer receives the full request weight, while the next and lower priority layers are allocated proportionally and fairly within the remaining available quota. This guarantees the dominance of the high-priority overlay effect while preventing the complete loss of the low-priority layer's effect.
[0044] In one embodiment of the present invention, step 501, which involves performing bone conflict detection on each overlay layer based on the bone transformation difference set and the coverage weight set, includes: Step 801: Determine the current effective weight based on the coverage weight and the current overlay intensity weight of each overlay layer. Perform conflict detection on each overlay layer based on the difference between the current effective weight and the skeleton transformation. The current overlay intensity weight is calculated using a preset transition curve. The current overlay intensity weight refers to the actual overlay intensity coefficient of the overlay layer in the current frame, calculated by the weight modulation module according to the transition curve. The current effective weight is the product of the coverage weight and the current overlay intensity weight. The preset transition curve refers to the interpolation curve that controls the weight transition rate, including linear curves, ease-in curves, ease-out curves, and custom Bézier curves.
[0045] As described above, by determining the current effective weight based on the coverage weight and the current superposition intensity weight, and by performing conflict detection on each superposition layer based on the difference between the current effective weight and the skeleton transformation, the detection intensity can be dynamically adjusted according to the transition curve, avoiding pose conflicts caused by weight abrupt changes during the skeleton transformation transition stage, and improving the smoothness and stability of the transformation between skeleton superposition layers.
[0046] In one embodiment of the present invention, step 105 involves synthesizing the basic motion pose and the skeleton transformation difference set according to the target coverage weight set to output the final skeleton pose, including: Step 901: Traverse each bone and collect the weighted difference values of all overlay layers on each bone to obtain a set of weighted difference values. The weighted difference value is the product of the bone transformation difference of the bone and the target coverage weight of the corresponding bone. Among them, the superimposed animation of the same overlay layer is stored frame by frame along the time axis. The system takes the target frame pose that is aligned with the time of the basic action or obtained by time interpolation in the current frame, first calculates the bone transformation difference between the target frame pose and the target reference pose, and then multiplies the difference with the target coverage weight corresponding to the bone to obtain the weighted difference of the bone in the current frame.
[0047] Step 902: The weighted difference set of each overlay layer is accumulated onto the basic motion pose in descending order of priority to obtain the composite pose; specifically, the weighted difference set is accumulated onto the basic motion pose in descending order of priority of each weighted difference.
[0048] Step 903: Check whether the joint angles of the synthesized posture exceed the preset physical limit range. If they exceed the preset physical limit range, change the joint angles to the legal boundary values. The legal boundary value refers to the boundary value within the preset physical limit range that is closest to the over-limit angle.
[0049] Step 904: Perform a full-body physical rationality check on the synthesized posture. If the full-body physical rationality check passes, output the final skeletal posture. The full-body physical rationality check refers to checking whether the center of gravity is within the support surface and whether there is any bone clipping.
[0050] As described above, by traversing the skeleton, accumulating weighted differences, performing limit checks, and verifying the physical plausibility of the entire body, the synthesis of the basic movement posture and the skeletal transformation difference is achieved. This method avoids joint angles exceeding physical limits and ensures that the synthesized posture has physical plausibility across the entire body. Therefore, the final skeletal posture, while ensuring the realistic and natural movement effect, improves the stability and safety of the synthesis result.
[0051] The virtual character animation overlay and blending method and system described above are applicable to virtual character animation processing, and will be explained below through specific embodiments.
[0052] The software architecture comprises six core modules: a stacking request reception and basic state acquisition module, a reference pose management and difference calculation module, a semantic skeleton mask generation module, a multi-layer arbitration and conflict resolution module, a weight modulation and transition control module, and a layered mixing and constraint output module. These six modules form a serial processing pipeline, executed sequentially from module 1 to module 6, with the output of each module serving as the input to the next. The specific data flow is as follows: Module 1 outputs a structured stacking task queue and a basic pose snapshot, which is then passed to module 2; Module 2 outputs the skeleton transformation difference data for each stacking layer, which is then passed to module 3; Module 3 outputs the dynamic skeleton mask weight array for each stacking layer, which is then passed to module 4; Module 4 outputs the final weight allocation for each stacking layer after conflict resolution, which is then passed to module 5; Module 5 outputs the actual stacking intensity coefficients for each stacking layer in the current frame, which is then passed to module 6; Module 6 outputs the final skeleton pose transformation data. (See also...) Figure 3 As shown, it illustrates the architectural relationships of the main process of the system in this application.
[0053] Based on the hardware and software architecture, the specific implementation process of the runtime computation method in this application embodiment is executed step by step according to the pipeline module, as follows: Step A: Overlay request reception and basic status acquisition The system receives overlay requests from various overlay layers and simultaneously collects the real-time state of the basic motion posture in the current frame, constructing a structured overlay task queue and a basic state context. (Corresponding to step 101 above) Specifically, the implementation process is as follows: 1. Receive overlay requests from various overlay layers (including overlay animation data, semantic tags, priority weights, and target bone set); 2. Parse overlay layer parameters: animation data, semantic tags, priority, and bone set; 3. Collect the current basic motion playback progress and posture snapshot; 4. Extract the motion speed and motion phase of the basic motion; 5. Determine the basic motion posture category label; 6. Determine if any overlay layer is marked as an immediate interruption: if so, skip the transition and directly enter the target state; 7. Add the overlay request to the task queue; 8. Output the structured overlay task queue and basic state. See also Figure 2 As shown, it illustrates the process of receiving overlay requests and basic action states.
[0054] The system maintains an overlay registry by listening to overlay registration / deregistration events and overlay parameter update events. Each overlay, upon registration, must include an overlay animation reference, semantic tags (such as "aiming," "injured," or "holding an object"), a priority weight (higher values indicate higher priority), and a target skeleton set. At the beginning of each frame update cycle, the system collects the playback progress of the current basic action, a snapshot of the skeleton posture (position, rotation, and scaling data of all bones), the character's movement speed, and motion phase (for periodic actions such as walking / running, the phase value is calculated through foot contact detection), and automatically determines the posture category label of the basic action (such as standing / walking / running / crouching / jumping) based on the motion characteristics. For overlay requests marked as immediately interrupted, the system skips the transition phase and directly enters the target state.
[0055] Step B: Refer to attitude management and difference calculation The system maintains a multi-reference pose pool, automatically selecting the most suitable reference pose based on the current basic pose characteristics, or interpolating between adjacent reference poses to generate a continuous reference, and using this reference pose as a benchmark to calculate the bone rotation / displacement difference for each stacked layer. It should be noted that traditional methods use a fixed single reference pose, which can lead to bone distortion when the basic movements differ significantly. This corresponds to step 102 above.
[0056] The reference pose pool is constructed as follows: representative poses are pre-extracted from the action library according to motion categories, and 1-3 representative pose frames are stored for each category, forming the reference pose pool. The reference pose pool is constructed offline during system initialization and accessed read-only at runtime. (Motion categories include standing, walking, running, crouching, jumping, etc.) The runtime nearest neighbor matching method is as follows: the system obtains the skeletal orientation vector and centroid distribution parameters of the current base pose, performs a weighted distance search in the reference pose pool, and selects the reference pose with the smallest distance. (The skeletal orientation vector includes the orientation vectors of key bones such as the spine and thigh.) The continuous reference attitude interpolation method is as follows: when the nearest neighbor distance exceeds a preset threshold, select the two closest reference attitudes and perform spherical linear interpolation between them according to the distance ratio to generate a continuous intermediate reference attitude.
[0057] Furthermore, the difference calculation and normalization method is as follows: using the selected / generated target reference pose as a baseline, the skeletal transformation difference is calculated for each frame of animation data in each overlay layer, resulting in a set of skeletal transformation differences for each overlay layer. The difference quaternions are then normalized to avoid ambiguity in the rotation path. See also... Figure 5 As shown, it illustrates the process of adaptive reference pose matching and difference calculation. This corresponds to step 103 above.
[0058] Step C: Semantic skeleton mask generation The system dynamically calculates the coverage weight of each bone based on the semantic tags and runtime context parameters of each overlay layer using a declarative rule engine, obtaining a set of coverage weights for each overlay layer. A distance decay function is then applied to the bones at the masking edge to generate a smooth transition band. For example, the semantic tag (bone function grouping) system includes aiming chain, holding chain, balance chain, expression chain, injury chain, and movement chain. Each overlay layer declares its corresponding semantic tag during registration. (Corresponding to step 104 above)
[0059] Context-driven weighting is adjusted as follows: The declarative rule engine receives runtime context parameters and calculates the basic coverage weights of each bone according to the rule configuration. For example, when the character's speed exceeds the running threshold, the spine weight of the aiming chain is automatically reduced; when the interaction target is a two-handed object, the holding chain is automatically expanded to cover both arms. Context parameters include character speed, pose type, interaction target type, and overlay semantic tags.
[0060] The distance decay transition zone is as follows: starting from the mask boundary bone, it expands outwards N layers along the bone hierarchy, with weights decreasing exponentially from the boundary weights to 0, ensuring no hard cut edges. Optionally, the masking rules are stored in JSON format, supporting runtime hot updates. See also... Figure 6 As shown, it demonstrates the process of dynamically generating semantic skeletal masks. The rule format is "condition → skeleton set → weight → decay parameter". Adding a new scene only requires adding rule entries without modifying the code.
[0061] Step D: Multi-level arbitration and conflict resolution (corresponding to step 104 above) The system accumulates and checks the weights of all superimposed layers on the same bone to determine whether the conflict tolerance threshold is exceeded or whether the joint angle exceeds the limit. When a conflict is detected, the weight quota is allocated in descending order of priority and the conflict is resolved.
[0062] Specifically, see Figure 7 As shown, the multi-level priority arbitration and conflict detection performs dual conflict detection: 1. Weight accumulation detection: Calculate the sum of weights of all stacked layers for each bone. If it exceeds the conflict tolerance threshold (default 1.2, which means that 20% weight overflow is allowed), the bone is marked as "weight conflict"; 2. Joint Angle Detection: For bones marked as having weight conflicts, calculate the total rotation increment after accumulating the differences between each layer according to the current weight, and check whether the increment causes the joint angle to exceed the pre-configured physical limit range. If it exceeds the limit, it is marked as "severe conflict".
[0063] Further, see Figure 8 As shown, the conflict resolution and weight reallocation process is performed on the skeletal regions marked as conflicting: 1. Sort all overlay layers from highest to lowest priority; 2. The highest priority layer obtains its full requested weight, and the remaining quota is allocated proportionally to the next highest priority layer; 3. When the remaining quota is insufficient to meet the needs of the lower priority layers, the weight of that layer in the conflicting region is reduced proportionally; 4. After resolution, joint angle constraints are applied to the final result; 5. Verify the physical rationality of the posture after resolution.
[0064] Step E: Weight Modulation and Transition Control The system provides dynamic weight modulation capabilities for each overlay layer, supporting a smooth transition of overlay intensity as time / conditions change. Specifically, each overlay layer maintains a current weight and a target weight. When the target weight changes, the system calculates the transition progress in each frame according to the configured interpolation curve, progressively advancing the current weight towards the target weight. Preset transition curve types include at least one of linear interpolation curves, ease-in / ease-out curves, and custom Bézier curves. Linear interpolation curves advance the overlay intensity weight transition at a constant rate, suitable for scenarios requiring uniform changes; ease-in / ease-out curves have a slower rate at the beginning and end of the transition and a faster rate in the middle, suitable for scenarios requiring natural acceleration and deceleration effects; custom Bézier curves achieve arbitrary transition rate curve shapes by configuring control point parameters, suitable for scenarios requiring fine control of the transition rhythm. For example, the intensity of the aiming offset overlay layer is directly proportional to the aiming angle, and the intensity of the injured / limping overlay layer is inversely proportional to the percentage of health points. When a new target weight change is received during the transition, the system restarts the transition (interruption redirection) starting from the current weight, ensuring the continuity of the transition.
[0065] It is understandable that there are three ways to obtain the target weight: (1) Declare the initial target weight value (range 0 to 1) when registering the overlay, which is specified by the game logic when creating the overlay request. For example, when registering the aiming offset overlay, declaring the target weight as 1.0 means that it is fully effective; (2) Dynamically set by the game logic, such as setting the target weight from 0 to the expected value to trigger a fade-in transition when the overlay is enabled, and setting the target weight to 0 to trigger a fade-out transition when the overlay is disabled; (3) Condition-driven continuous modulation binding, such as the target weight of the aiming offset overlay being proportional to the aiming angle, and the target weight of the injured limp overlay being inversely proportional to the percentage of the character's current health.
[0066] Furthermore, the criteria for determining transition completion are as follows: The system maintains a transition progress value for each overlay undergoing transition. When the transition progress value reaches 1.0, the transition is considered complete, the current weight is locked to the precise value of the target weight, and the transition status marker is cleared. If a new target weight change is received before the transition is complete, the system resets the transition progress to 0, starting with the currently interpolated weight and ending with the new target weight, ensuring transition continuity. See also... Figure 9 As shown, it illustrates the process of superimposed weight dynamic modulation and smooth transition.
[0067] Step F: Layered Blending and Constrained Output The system synthesizes the weighted differences between the basic motion pose and all overlay layers one by one according to the skeleton to generate the final skeletal pose, and performs joint constraint verification to ensure physical rationality. This corresponds to step 105 above.
[0068] See Figure 10 As shown, the layered hybrid calculation and joint constraint verification process is as follows: 1. Obtain the basic motion posture of the skeleton; 2. Collect the weighted difference values of all superimposed layers on the skeleton; 3. Accumulate the weighted difference values of each layer onto the basic posture in the order of rotation and superposition; 4. Check whether the accumulated joint angles exceed the limits: if they do, perform a minimization correction; 5. After traversing all skeletons, perform a full-body physical rationality verification; 6. If the full-body verification fails, perform a secondary correction on the non-compliant areas.
[0069] See Figure 11 As shown, the final skeletal pose is output through the following process: 1. Write the final skeletal transformation data to the character's skeletal buffer; 2. Trigger a skeletal transformation update notification; 3. Record the actual effective weights of each overlay layer in this frame; 4. Record detailed logs of conflict resolution and constraint correction; 5. Pass the pose data to the rendering pipeline for final rendering.
[0070] The present invention also provides an application example in a multi-layered overlay scene of a third-person shooter game.
[0071] In this scenario, the character is running, and the system simultaneously receives three overlay requests: an aiming offset overlay animation carrying an aiming chain skeleton function grouping identifier, with a priority weight of 8; a gun-holding posture overlay animation carrying an object-holding chain skeleton function grouping identifier, with a priority weight of 7; and an injured limp overlay animation carrying an injury chain skeleton function grouping identifier, with a priority weight of 5.
[0072] The system collects posture snapshots and motion parameters during running, determines the posture category as running, and matches a running reference posture from the reference posture pool as the target reference posture to avoid spinal distortion caused by using a standing reference posture.
[0073] The system calculates the skeletal transformation difference set of the three overlay layers respectively. Based on the runtime context parameter (running speed exceeds the threshold), it automatically reduces the basic coverage weight of the aiming chain on the spinal skeleton to maintain running dominance. The injury chain covers the lower limb skeletal chain, and the holding chain covers the right arm and hand skeletal chain. An exponential decay function is applied to the masking boundary of each skeletal chain to generate a smooth transition zone.
[0074] Conflict detection revealed that the sum of the coverage weights of the aiming chain and the injury chain in the spinal region exceeded the conflict tolerance threshold. The aiming chain was allocated its full weight quota according to priority (aiming chain 8 > injury chain 5), while the coverage weight of the injury chain in the spinal region was reduced proportionally to the remaining quota. The weight modulation module continuously adjusted the current superposition intensity weight of the aiming layer based on the aiming angle. The final synthesized skeletal posture resulted in a character whose upper body naturally leaned towards the aiming direction while running, whose right hand held the gun stably, and whose legs appeared slightly limping. The three-layer superposition exhibited no skeletal distortion or joint overshoot, maintaining a physically reasonable and visually natural posture at various movement speeds.
[0075] This invention also provides an application example in the scenario of superimposed emotion and environmental interaction in open-world RPGs (Role-Playing Games).
[0076] In this scenario, the NPC (Non-Player Character) is walking. The system detects that the current emotion is fatigue and that the character is in a rainy and windy environment. The system receives two overlay requests: a fatigue emotion overlay animation with a kinetic chain skeletal function grouping identifier, a priority weight of 4, and a slight overlay on the whole body; and a wind-resistant posture overlay animation with a balance chain skeletal function grouping identifier, a priority weight of 6, and an emphasis on the torso leaning forward.
[0077] The system matches a walking reference pose from the reference pose pool as the target reference pose and calculates the skeletal transformation difference set for the two overlay layers. Based on runtime context parameters, the system automatically reduces the leg bone coverage weight for the fatigue layer to avoid interfering with gait loops, and increases the torso bone coverage weight for the wind-resistant layer. Since the two overlay layers partially overlap in their areas of effect, but the sum of their coverage weights does not exceed the conflict tolerance threshold, conflict resolution is not required. The weight modulation module continuously modulates the current overlay intensity weight of the wind-resistant layer based on wind speed parameters and continuously modulates the current overlay intensity weight of the emotion layer based on fatigue values. The final output skeletal pose makes the NPC lean slightly forward to avoid the wind and droop slightly to express fatigue while walking, maintaining a natural gait, eliminating the need to create separate animation resources for each emotion and environment combination.
[0078] This invention also provides an application example in a dynamic hit-and-defense overlay scenario in a fighting game. In this scenario, the character is in a defensive stance and is hit by an enemy from the front. The system receives a hit-and-shock overlay request, carrying an injury chain skeletal function grouping identifier with a priority weight of 9, and an immediate interruption marker.
[0079] The system detects an immediate interruption marker, skips the fade-in transition phase, and directly sets the current superimposed intensity weight of the impacted layer to the target weight, achieving immediate activation. The system matches a crouching reference posture (defensive posture is usually a half-crouch) in the reference posture pool as the target reference posture and calculates the set of skeletal transformation differences of the impacted vibration layer.
[0080] Based on the attack direction (front), the system prioritizes the coverage weight set of the hit layer to the skeletal chains of the arms and upper body, and applies an exponential decay function to the mask boundary to generate a smooth transition zone. Since the hit layer has the highest priority (9), the integrity of the hit effect is guaranteed first during conflict resolution, and the coverage weight of the other overlay layers in the overlapping bone area is reduced proportionally to the remaining quota.
[0081] The weight modulation module sets the initial value of the current stacked intensity weight of the hit layer based on the attack intensity and configures a rapidly decaying transition curve so that the hit vibration fades out in about 0.3 seconds, after which the character returns to a normal defensive stance. The final output skeletal posture makes the character naturally present the hit vibration effect in the defensive action, with the arms shaking rapidly and then smoothly recovering. The hit effect can dynamically change according to the attack attribute, enhancing the realism of the hit feedback in fighting games.
[0082] Please refer to Figure 2 The present invention also provides a virtual character animation overlay and blending system 210, including a memory 211, a processor 212, and a computer program stored in the memory 211 and executable on the processor 212. When the processor 212 executes the computer program, it implements the various steps of the virtual character animation overlay and blending method described above.
[0083] The beneficial effects of the system of the present invention are the same as those of the method described above, and will not be repeated here.
[0084] In summary, this invention obtains the set of skeletal transformation differences and coverage weights for each overlay layer relative to the target reference pose, and redistributes the coverage weights of conflicting bones based on priority. These are then synthesized with the basic motion pose, and joint constraint verification is performed to finally output the final skeletal pose. Compared to existing technologies, this invention dynamically matches or generates the target reference pose based on the basic motion state, avoiding skeletal distortion and joint angle deviations caused by the overlay difference deviating from a reasonable range under a fixed reference pose. This ensures visual consistency of the overlay effect across any basic motion. Simultaneously, by dynamically calculating the basic coverage weights using runtime context parameters and applying an exponential decay function to the mask boundary bones to create a transition band, it overcomes the high maintenance cost, lack of adaptive adjustment, and visual discontinuity caused by hard binary switching of static mask configurations, achieving a smooth transition in the skeletal influence area. Furthermore, by identifying weight-conflicting bones and pose-exceeding conflicting bones through conflict detection and redistributing weights based on priority, it solves the problem of joint angle exceeding limits and excessive skeletal distortion caused by simple linear accumulation when multiple overlay layers act simultaneously. This ensures the integrity of the high-priority overlay effect and improves the stability and controllability of the overlay quality.
[0085] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for overlaying and blending virtual character animations, characterized in that, include: In response to the received overlay request, obtain the basic motion pose of the current frame; Based on the posture snapshot and posture category in the basic action posture, determine the target reference posture; Based on the target reference pose and the superimposed animation pose of each superimposed layer, calculate the set of skeletal transformation differences of each superimposed layer relative to the target reference pose; Based on runtime context parameters, the coverage weight set of each overlay layer is obtained. Based on the skeleton transformation difference set and the coverage weight set, skeleton conflict processing is performed to obtain the target coverage weight set. The basic motion pose and the skeleton transformation difference set are synthesized according to the target coverage weight set to output the final skeleton pose.
2. The method according to claim 1, characterized in that, The step of determining the target reference posture based on the posture snapshot and posture category in the basic action posture includes: Extract the bone orientation vector and centroid distribution parameters from the pose snapshot; Based on the bone orientation vector and the centroid distribution parameters, the weighted distance with each reference pose in the preset reference pose pool is calculated, and the reference pose with the smallest weighted distance is obtained as the candidate reference pose. When the weighted distance is less than or equal to a preset threshold, the candidate reference pose is determined as the target reference pose; When the weighted distance is greater than a preset threshold, the reference poses are sorted in ascending order according to the weighted distance, and the top two reference poses are taken as adjacent reference poses. Interpolation is performed between the adjacent reference poses to generate the target reference pose.
3. The method according to claim 1, characterized in that, The step of calculating the set of skeletal transformation differences of each overlay layer relative to the target reference pose, based on the target reference pose and the overlay animation pose of each overlay layer, includes: For each overlay frame of the overlay layer, calculate the difference between the local rotation quaternion of the target bone in the overlay frame and the inverse quaternion corresponding to the target reference pose, and perform normalization processing on the difference to obtain the bone transformation difference corresponding to each overlay frame. The skeleton transformation difference values corresponding to all overlay frames of the overlay layer are merged to obtain the skeleton transformation difference value set.
4. The method according to claim 1, characterized in that, The process of obtaining the coverage weight set for each overlay layer includes: Based on the skeletal function grouping of each superimposed layer, a preset skeletal chain is matched to determine the initial skeletal coverage set; Obtain runtime context parameters, and calculate the basic coverage weight of each bone in the initial bone coverage set based on the runtime context parameters; Identify the masking boundary bones of the initial bone coverage set, and start from the masking boundary bones, extend outward along the bone hierarchy to a predetermined number of layers of bones as transition zone bones; An exponential decay function is applied to the corresponding base coverage weights of the transition zone bones, reducing the weights from the boundary weights to zero, thus obtaining a set of coverage weights.
5. The method according to claim 1, characterized in that, The process of performing bone conflict processing based on the bone transformation difference set and the coverage weight set to obtain the target coverage weight set includes: Based on the set of bone transformation differences and the set of coverage weights, bone conflict detection is performed on each overlay layer. If there are conflicting bones, the coverage weights of the conflicting bones are reallocated based on the priority of each overlay layer to resolve the conflict, thereby obtaining the target coverage weight set.
6. The method according to claim 5, characterized in that, The step of performing bone conflict detection on each overlay layer based on the bone transformation difference set and the coverage weight set includes: Traverse each bone and calculate the sum of the coverage weights of all overlay layers corresponding to the bone. When the sum of the coverage weights is greater than a preset conflict tolerance threshold, mark the bone as a weight conflict bone. For the weighted conflict bones, calculate the total rotation increment after accumulating the set of bone transformation differences for each overlay layer according to the coverage weight; If the total rotation increment causes the joint angle of the bone to exceed the preset physical limit range, the corresponding bone will be marked as a posture over-limit conflict bone. The weighted conflict bone and the pose over-limit conflict bone are identified as conflict bones.
7. The method according to claim 6, characterized in that, If conflicting bones exist, the coverage weights of the conflicting bones are reallocated based on the priority of each overlay layer to resolve the conflict, including: The superimposed layers acting on the conflicting bones are sorted from high to low according to a preset priority. Assign a coverage weight of the highest priority overlay on the conflict skeleton as a weight quota to the highest priority overlay; The remaining available quota is obtained by subtracting the weighted quota from the preset quota, and the remaining available quota is allocated to the secondary priority overlay layer in proportion. If the remaining available quota is less than the coverage weight of the low-priority overlay on the conflict bone, then the coverage weight of the low-priority overlay on the conflict bone is reduced according to the proportion of the coverage weight of the low-priority overlay to the sum of the coverage weights of all unallocated overlays.
8. The method according to claim 5, characterized in that, The step of performing bone conflict detection on each overlay layer based on the bone transformation difference set and the coverage weight set includes: The current effective weight is determined based on the coverage weight and the current overlay intensity weight of each overlay layer. Conflict detection is performed on each overlay layer based on the current effective weight and the difference in bone transformation. The current overlay intensity weight is calculated using a preset transition curve.
9. The method according to claim 1, characterized in that, The step of synthesizing the basic motion pose and the skeleton transformation difference set according to the target coverage weight set to output the final skeleton pose includes: Traverse each bone and collect the weighted difference values of all the superimposed layers on each bone to obtain a set of weighted difference values. The weighted difference value is the product of the bone transformation difference of each bone and the target coverage weight corresponding to each bone. The weighted difference set of each overlay layer is accumulated onto the basic action pose in descending order of the priority of the weighted difference to obtain the synthesized pose; Check whether the joint angle of the synthesized posture exceeds the preset physical limit range. If it exceeds the preset physical limit range, change the joint angle to a legal boundary value. Perform a full-body physical plausibility check on the synthesized pose. If the full-body physical plausibility check passes, output the final skeletal pose.
10. A virtual character animation overlay and blending system, characterized in that, include: A processor and a memory storing a computer program, wherein the processor, when executing the computer program, implements the virtual character animation overlay and blending method according to any one of claims 1 to 9.