Fashionable dress adaptation method and device for virtual character, equipment, medium and program product
By establishing a dynamic constraint relationship between the main skeleton and the fashion skeleton in the virtual character, and using the motion parameters of the main skeleton to drive the movement of the fashion skeleton, the problems of motion distortion and high cost under the traditional skinning method are solved, achieving more realistic fashion performance and lower resource consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2025-11-21
- Publication Date
- 2026-05-01
AI Technical Summary
Traditional skinning methods suffer from motion distortion and high costs in virtual character fashion animation. In particular, when the character's body shape changes, the fashion skeleton cannot adapt and adjust, resulting in stretching or distortion of clothing parts. Furthermore, in multi-player scenarios, physical simulation calculations increase the game's computational load.
By establishing a dynamic constraint relationship between the main skeleton of the virtual character and the costume skeleton, the motion parameters of the main skeleton are used to drive the movement of the costume skeleton in real time, avoiding the need to create separate animation resources and achieving adaptive adjustment of the costume skeleton.
It enhances the realism of fashion animations, reduces the development cost of animation resources, improves the compatibility of the character customization system, and reduces the computational load of the game system in multiplayer scenarios.
Smart Images

Figure CN121962370A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game technology, specifically to methods, devices, equipment, media, and program products for adapting costumes to virtual characters. Background Technology
[0002] Game costumes are an important part of video games, allowing players to customize their characters' appearance according to their preferences, enhancing the personalized experience and enabling players to express themselves within the game. With the development of game technology, players' demands for the realism and diversity of costume adaptations are constantly increasing.
[0003] Currently, the animation of in-game costumes mainly uses the traditional skinning method, which has many limitations. Traditional skinning drives the model through the movement of the skeleton, but its data is static, which can lead to unnatural deformations in some cases, resulting in a lack of realism in the movement effects. Summary of the Invention
[0004] In view of this, this disclosure provides a method, apparatus, device, medium, and program product for adapting clothing to virtual characters, in order to solve the problem of the lack of realism in the clothing and movement performance of virtual characters.
[0005] In a first aspect, this disclosure provides a method for adapting clothing to a virtual character. The method includes: obtaining the constraint relationship between the main skeleton of the virtual character and the clothing skeleton; and, when the main skeleton moves, driving the clothing skeleton to perform corresponding movements based on the constraint relationship and the motion parameters of the main skeleton.
[0006] Secondly, this disclosure provides a fashion adaptation device for virtual characters, which includes: an acquisition module for acquiring the constraint relationship between the main skeleton of the virtual character and the fashion skeleton; and an acquisition module for driving the fashion skeleton to perform corresponding movements based on the constraint relationship and the motion parameters of the main skeleton when the main skeleton moves.
[0007] Thirdly, this disclosure provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the virtual character fashion adaptation method of the first aspect or any corresponding embodiment described above.
[0008] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute the virtual character fashion adaptation method of the first aspect or any corresponding embodiment described above.
[0009] Fifthly, this disclosure provides a computer program product, including computer instructions for causing a computer to execute the fashion adaptation method for a virtual character in the first aspect or any of its corresponding embodiments.
[0010] The virtual character fashion adaptation method provided in this embodiment achieves dynamic driving by establishing a constraint relationship between the main skeleton and the fashion skeleton. The fashion skeleton inherits the motion parameters of the main skeleton, avoiding the need to create separate animation resources for the fashion skeleton and solving the motion distortion problem caused by traditional skinning methods. It has the advantages of improving the realism of fashion action performance, reducing the development cost of animation resources, and adapting to changes in character body shape. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this disclosure, the accompanying drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic diagram illustrating an application scenario according to an embodiment of this disclosure; Figure 2 A first flowchart illustrating a method for fashion adaptation of virtual characters according to an embodiment of the present disclosure; Figure 3 A second flowchart illustrating a method for adapting clothing for virtual characters according to an embodiment of the present disclosure; Figure 4 Comparison of single-end fixed ribbons of virtual characters according to embodiments of the present disclosure; Figure 5 A third flowchart illustrating the virtual character fashion adaptation method according to an embodiment of the present disclosure; Figure 6 According to the schematic diagram of the double-ended fixed ribbon in this implementation; Figure 7 A fourth flowchart illustrating the virtual character fashion adaptation method according to an embodiment of the present disclosure; Figure 8 Based on the schematic diagram of hard surface material fashion in this disclosure; Figure 9 A fifth flowchart illustrating the method for adapting virtual characters to clothing according to embodiments of the present disclosure; Figure 10 A schematic diagram of a soft surface material fashion item in this disclosure; Figure 11 A sixth flowchart illustrating the method for adapting virtual characters to clothing according to embodiments of the present disclosure; Figure 12 This is a schematic diagram of the fashion skirt display in the implementation of this disclosure; Figure 13 A schematic diagram of a fashion adaptation device for a virtual character according to an embodiment of the present disclosure; Figure 14 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0014] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0015] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise expressly specified.
[0016] As one optional application scenario of this disclosure embodiment, such as Figure 1 As shown, the system may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.
[0017] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.
[0018] In related technologies, game costumes typically employ skinning to achieve dynamic character appearance. Traditional skinning techniques drive costume movement through a static skeleton-model binding relationship. When the character's body shape changes, the costume skeleton cannot adaptively adjust, resulting in unnatural deformations such as stretching or twisting of clothing parts. Since the main character skeleton may contain massive amounts of animation resources, creating separate animation data for the costume skeleton would incur high production costs. Furthermore, in multi-player simultaneous scenes, the performance pressure from physics simulation calculations can significantly impact game performance.
[0019] To address the aforementioned issues, the inventors observed that traditional skinning techniques lacked adaptability to changes in body shape, stemming from the lack of dynamic correlation between motion parameters between bones. By analyzing the motion correlation between the character's main skeleton and the costume skeleton, they discovered that establishing a real-time parameter transfer mechanism could avoid creating separate animation resources. Further research revealed that by establishing a dynamic constraint relationship between the motion logic of the costume skeleton and the main skeleton, both the animation data of the main skeleton and adaptive adjustments during body shape changes could be achieved. This approach overcomes the limitation of independent bone movements in traditional skinning techniques.
[0020] Therefore, this disclosure proposes to obtain the constraint relationship between the main skeleton and the costume skeleton of the virtual character, and to drive the costume skeleton to perform corresponding movements based on the motion parameters of the main skeleton when the main skeleton moves.
[0021] According to an embodiment of this disclosure, a method for adapting fashion to virtual characters is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0022] This embodiment provides a method for adapting virtual characters' outfits, which can be used on the aforementioned mobile terminals, such as mobile phones and tablets. Figure 2This is a schematic flowchart of a first method for adapting virtual character outfits according to an embodiment of the present disclosure, as shown below. Figure 2 As shown, the process includes the following steps: Step S210: Obtain the constraint relationship between the main skeleton of the virtual character and the costume skeleton.
[0023] Among them, the constraint relationship refers to the dynamic parameter transfer rules established between the main skeleton and the fashion skeleton. Specifically, it can be implemented through skeleton hierarchy binding or spatial transformation matrix. It is used to define the position, rotation and scaling relationship of the fashion skeleton relative to the main skeleton. This constraint relationship ensures that the fashion skeleton can respond to the changes in the motion state of the main skeleton in real time.
[0024] The fashion skeleton includes a first fashion skeleton and a second fashion skeleton, and the constraint relationships include a first constraint relationship and a second constraint relationship. The constraint relationship between the main skeleton and the fashion skeleton of the virtual character is obtained, including: if the first fashion skeleton and the second fashion skeleton have different types, then the first constraint relationship between the main skeleton and the first fashion skeleton is obtained, and the second constraint relationship between the main skeleton and the second fashion skeleton is obtained; if the first fashion skeleton and the second fashion skeleton have the same type, then the first constraint relationship between the main skeleton and the first fashion skeleton is obtained, and the second constraint relationship between the main skeleton and the second fashion skeleton is a reuse of the first constraint relationship. That is, different types of fashion skeletons have different constraint relationships, and for fashion skeletons of the same type, the constraint relationships are the same. When the constraint relationships are the same, there is no need to recalculate; the established constraint relationships can be directly reused, thereby optimizing resources and improving processing efficiency.
[0025] The establishment of constraint relationships lies in clearly defining the dependence of the fashion skeleton on the main skeleton in three dimensions: position, rotation angle, and scaling ratio. This ensures that when the main skeleton to which the fashion skeleton is attached undergoes changes in motion, such as walking, running, or posture adjustment, the fashion skeleton can automatically respond synchronously according to preset rules, maintaining a visually natural fit. Constraint relationships are categorized based on the function and structural type of the fashion skeleton: for skeletons with similar physical properties (such as skirt skeletons and cape skeletons), a unified constraint template is used to ensure consistency in dynamic effects and facilitate mass production and subsequent maintenance of similar fashion resources; while for fashion components with special structures, independent constraint logic is designed to adapt to their unique dynamic performance requirements, ensuring the coordination and realism of the motion logic of different fashions when interacting with the character.
[0026] Step S220: When the main skeleton moves, based on the constraint relationship, the fashion skeleton is driven to perform corresponding movements using the motion parameters of the main skeleton.
[0027] In this method, motion parameter-driven motion refers to using the position coordinates, rotation angle, and scaling ratio of the main skeleton as input variables. This can be achieved through skeleton transformation matrix multiplication, mathematically converting the motion of the main skeleton into the motion of the costume skeleton. This method allows the costume skeleton to achieve motion synchronization without requiring independent animation data.
[0028] The movement of the fashion skeleton is driven by the motion parameters of the main skeleton. This includes calculating the variation parameters of the fashion skeleton corresponding to the main skeleton based on the motion parameters of the main skeleton, and then using these variation parameters to drive the fashion skeleton to move accordingly. In practice, firstly, based on the motion parameters of the main skeleton (including position, rotation, scaling, etc.), the required variation parameters of the corresponding fashion skeleton are calculated using preset mapping rules or kinematic calculations. Then, these calculated variation parameters are used to drive each joint node of the fashion skeleton in real time, enabling it to follow the main skeleton in a coordinated or preset dynamic response, thereby ensuring that virtual fashion items such as clothing and accessories can naturally and realistically adapt to the main animation.
[0029] Specifically, when the character's size scales, the scaling factor of the main skeleton is captured in real time. This scaling factor is then passed to the corresponding transformation node of the costume skeleton via a predefined constraint matrix. For example, when the virtual character's height increases, the costume skeleton extends proportionally along the vertical axis according to the scaling factor defined in the constraints. When the character performs an arm-swinging motion, the rotation angle of the main skeleton is used to drive the costume skeleton to rotate synchronously around a specified axis using the Euler angle transformation formula in the constraints. The entire process eliminates the need to calculate separate animation keyframes for the costume skeleton; it directly inherits the motion parameters of the main skeleton to achieve real-time driving.
[0030] Compared to related technologies, traditional skinning relies on fixed skeletal binding relationships, which cannot dynamically adjust the position of the costume bones when the body shape changes, resulting in model deformation and distortion. This solution, however, achieves real-time transmission of skeletal parameters through dynamic constraints, enabling the costume bones to adapt to changes in the shape of the main skeleton. Related technologies require creating separate animation data for each costume bone to match the main body's movements; this solution directly uses the motion parameters of the main skeleton to drive the costume bones, significantly reducing the amount of animation resources required.
[0031] Through the above technical solution, this disclosure achieves real-time synchronization between the movement of the fashion skeleton and the main skeleton of the character, effectively solving the problem of clothing deformation distortion. By inheriting the motion parameters of the main skeleton, the need to create separate animation resources for the fashion skeleton is avoided, significantly reducing development costs. The establishment of dynamic constraint relationships allows the fashion to adapt to different body shape parameters, improving the compatibility of the character customization system. In multi-player simultaneous screen scenarios, this solution uses parameter-driven methods to replace physical simulation calculations, effectively reducing the computational load on the game system.
[0032] In some embodiments, the motion parameters of the main skeleton include the scaling factor of the main skeleton; the constraint relationship includes a preset inheritance relationship between the fashion skeleton and the main skeleton, wherein the preset inheritance relationship indicates that the fashion skeleton inherits the motion parameters of the main skeleton; based on the constraint relationship, according to the motion parameters of the main skeleton, the change parameters of the fashion skeleton corresponding to the main skeleton are calculated, and the change parameters are used to drive the fashion skeleton to perform corresponding movements, including: based on the preset inheritance relationship between the fashion skeleton and the main skeleton, according to the scaling factor of the main skeleton, the displacement variation of the skeleton is calculated, and the displacement variation is applied to the fashion skeleton.
[0033] The movement of the main skeleton can be further reflected in changes to the overall body shape of the virtual character, such as adjustments to the character's weight in a specific state. To ensure that fashion items (such as clothing, accessories, and other accessory models) can naturally follow changes in the character's body shape, it is necessary to calculate the corresponding parameter changes of the fashion skeleton in real time based on the motion parameters of the main skeleton. In practice, based on the pre-established inheritance relationship between the fashion skeleton and the main skeleton, when a change in the virtual character's body shape is detected, the fashion skeleton is simultaneously adjusted with corresponding displacement or deformation. The pre-defined inheritance relationship defines the dependency and inheritance logic of the fashion skeleton on the main skeleton in terms of motion parameters such as position, rotation, or scaling, thereby ensuring that the fashion item can conform to the body surface without clipping or distortion during the character's body expansion, contraction, or posture changes.
[0034] In some embodiments, the displacement variation of the fashion skeleton is calculated based on the scaling factor of the main skeleton, including: obtaining the scaling factor of the main skeleton; calculating the displacement variation of the fashion skeleton based on the original position and the scaling factor; and then applying the displacement variation to the fashion skeleton.
[0035] In specific implementation, such as Figure 3 The diagram shown is a second flowchart illustrating a method for adapting clothing to a virtual character according to an embodiment of this disclosure. When the virtual character's body shape changes, the process involves displacement and adjustment of the clothing skeleton. Step S310: Obtain the scaling factor of the main skeleton. The scaling factor refers to the scaling ratio parameter along each axis when the character's body shape changes. Specifically, it can be extracted through the skeleton transformation matrix and used to quantify the degree of body shape change.
[0036] Step S320: Based on the preset inheritance relationship, calculate the displacement change of the fashion skeleton according to the original position and scaling factor of the fashion skeleton.
[0037] Based on the original positioning coordinates of the fashion skeleton in the model, combined with a preset scaling factor, and through a corresponding spatial transformation algorithm, the displacement of the fashion skeleton in three-dimensional space is accurately calculated. In one example, the displacement of the fashion skeleton includes the displacement of the fashion skeleton in width, but does not follow the corresponding displacement of the main skeleton in length.
[0038] After obtaining the displacement change, it is applied to the fashion skeleton. Specifically, based on the initial position information of the fashion skeleton and the preset scaling parameters, the actual displacement change of the skeleton in the width direction needs to be calculated first. This process must ensure that the skeleton remains unchanged in the length dimension, and only the width dimension is adjusted accordingly. By extracting the original coordinates of the skeleton and applying the scaling factor, its deformation value in the horizontal direction can be accurately obtained, thus achieving accurate acquisition of the width change.
[0039] In one example, the fashion skeleton includes a single-ended fixed ribbon skeleton. Obtaining the constraint relationship between the main skeleton of the virtual character and the fashion skeleton includes: determining that the main skeleton where the fixed end of the single-ended fixed ribbon skeleton is located is the parent skeleton of the single-ended fixed ribbon skeleton; obtaining the preset inheritance relationship between the single-ended fixed ribbon skeleton and the parent skeleton of the single-ended fixed ribbon skeleton.
[0040] Among them, the single-end fixed ribbon skeleton refers to a linear fashion skeleton structure that connects to the main skeleton at only one end. Specifically, it can use skeletal binding technology to fix one end of the ribbon to the character's torso, simulating the effect of flowing fabric. This structure achieves a balance between physical simulation and the movement of the main skeleton through single-point fixation.
[0041] The skeletons of virtual characters are tree-like structures, with each bone having a parent bone and multiple child bones. Changes to the parent bone (position, rotation, scaling) affect the child bones, but changes to the child bones do not affect the parent bone. When the protagonist's physique in a game can be edited to a certain extent, it's necessary to handle the adaptation of costume skeletons to the body shape.
[0042] The virtual character's body shape changes by scaling the main skeleton to achieve variations in the protagonist's weight. At this time, the fashion ribbon skeleton, as a sub-bone of the main skeleton, will change in both scaling and position. This disclosure uses control binding to ensure that the fashion skeleton only inherits the displacement resulting from the scaling of the parent bone. Specifically, it involves first obtaining the transformation of the parent bone, then applying the obtained scaling of the parent bone to the original position of the sub-bone to calculate the new position. This is achieved by multiplying the original position of the sub-bone by the scaling factor of the parent bone. Afterwards, the transformation of the sub-bone is set, where the position of the sub-bone uses the new position calculated above, and rotation and scaling use the original rotation and scaling of the sub-bone. In this way, the fashion skeleton only follows the scaling displacement of the main skeleton, but does not scale along with it, ensuring that the fashion fits the body without excessive stretching or stretching.
[0043] Specifically, the transformation of the main bone (parent bone) corresponding to the single-ended fixed ribbon bone is first obtained. Then, the scaling of the parent bone is applied to the original position of the child bone (the single-ended fixed ribbon bone) to calculate the new position. This is achieved by multiplying the original position of the child bone by the scaling factor of the parent bone. Next, the transformation of the child bone is set, where the position of the child bone uses the new position calculated above, and the rotation and scaling use the original rotation and scaling of the child bone. At this point, the fashion bone only follows the scaling displacement of the main bone, but does not scale along with it, ensuring that the fashion fits the main body without excessive stretching or shrinking.
[0044] In one example, when character size scaling is detected, the scaling matrix parameters of the current size change are first parsed. The position of the parent bone of the ribbon skeleton is traced through the skeletal hierarchy, and the reference position of the fixed end of the ribbon is calculated based on the current scaling state of the parent bone. The original local coordinates of the ribbon skeleton are then matrix-multiplied with the scaling factor to generate the displacement compensation amount that adapts to the size change. For example... Figure 4 The image shows a comparison of a single-end fixed ribbon on a virtual character. This process replaces preset animation data with real-time calculations, ensuring that the ribbon skeleton automatically extends a fixed distance when the character's size increases and shortens the connection length accordingly when the size decreases, maintaining the proportional harmony between the ribbon and the character's body. The control rigging system translates the calculation results into bone displacement commands, driving the ribbon skeleton to adjust its axial position while keeping the end fixed.
[0045] Compared to related technologies, traditional methods rely on static skeleton binding, which leads to abnormal ribbon stretching when the body shape changes. This solution achieves bone self-adaptation through a dynamic displacement compensation mechanism. In related technologies, the ribbon skeleton only responds to animation data and cannot perceive changes in body shape parameters. This solution constructs a mathematical mapping relationship between the bone scaling factor and displacement variation. Existing solutions require creating separate ribbon animations for different body shapes; this solution eliminates additional animation production costs through procedural calculations.
[0046] Through the above technical solution, this disclosure effectively solves the problem of ribbon bone misalignment caused by character body editing, maintaining a natural connection between the ribbon and the body during body scaling. It avoids model tearing or non-physical deformation caused by changes in body parameters, ensuring visual consistency of fashion elements across characters of different body types. Simultaneously, it reduces reliance on pre-set animation resources, enabling real-time synchronous calculation of skeletal motion parameters and body shape changes.
[0047] In some embodiments, such as Figure 5The diagram illustrates a third flowchart of a virtual character fashion adaptation method according to an embodiment of this disclosure, used for double-ended fixed ribbon bones, wherein the double-ended fixed ribbon bones include a first end of the ribbon bone and a second end of the ribbon bone. The constraint relationship includes a first position constraint between the double-ended fixed ribbon bones and a first positioning bone; wherein the first positioning bone is used to provide a positioning reference for the second end of the ribbon bone. The first positioning bone refers to a newly added bone node in the main bone level for establishing a dynamic positioning reference. Specifically, it can be implemented by creating a new bone node under the parent bone level. This bone inherits the scaling parameters of the parent bone and serves as the positioning reference for the second end of the ribbon bone.
[0048] Based on positional constraints, the second end of the ribbon skeleton is constrained to the first positioning bone. For ribbon skeletons with fixed ends, a first positioning bone needs to be added. Positional constraints refer to establishing a positional relationship between the second end of the ribbon skeleton and the first positioning bone through the bone space coordinate system. This constraint forces the position coordinates of the second end of the ribbon skeleton to remain synchronized with the first positioning bone. Adaptation methods for ribbon skeletons with fixed ends include: Step S510: Based on the preset inheritance relationship between the double-ended fixed ribbon skeleton and the corresponding main skeleton and the first position constraint, calculate the displacement change of the double-ended fixed ribbon skeleton according to the motion parameters of the main skeleton and the first positioning skeleton.
[0049] Specifically, when the virtual character's body size changes, the first positioning bone, acting as the parent node of the second end of the ribbon bone, dynamically adjusts its position coordinates according to the scaling factor of the parent bone. Through the forced association of position constraints, the position coordinates of the second end of the ribbon bone will follow the position changes of the first positioning bone in real time, while the position of the first end of the ribbon bone is controlled by the original single-end fixing mechanism. This two-way constraint mechanism allows the relative positions of the two fixed points of the double-end fixed ribbon bone to automatically maintain a proportional relationship with the main skeleton during body size changes, without the need to adjust the skeletal animation data separately for different body sizes.
[0050] Step S520: Apply the displacement change to the double-ended fixed ribbon skeleton.
[0051] In one example, such as Figure 6 As shown, because the skeleton has a tree-like structure, a child bone can only have one parent. Therefore, the ribbon skeleton of a fashion item can only have one end (end A) whose parent is the main skeleton (…). Figure 6 (within the square frame) When the main skeleton is scaled, the rules mentioned above are applied. End A follows the scaling and displacement of the main skeleton and can fit correctly on the surface of the fashion. End B, the tail end of the ribbon skeleton, is not affected by the scaling of the main skeleton because its parent is the ribbon skeleton (chain) itself, and will be brought into the body.
[0052] This disclosure adds a first positioning skeleton ( Figure 6 (Medium-thick arrow) To address this issue, the parent of the auxiliary positioning bone is selected based on the bone whose skin weights surround the B-end bone of the ribbon. This parent bone doesn't have to be the same as the A-end parent bone; the selection depends on the specific situation. The parent of this auxiliary bone is the main bone, and it can be set to respond by scaling and shifting with the main bone. The position of the B-end bone is constrained to this auxiliary bone, and the target position is specified as the spatial position of the auxiliary bone, ensuring that the B-end bone and the auxiliary bone position completely overlap in real-time. Both ends A and B can correctly scale and fit in the correct position.
[0053] This solution introduces a collaborative mechanism between the first positioning skeleton and position constraints to achieve automated dynamic calculation of the positions of the two-end skeletons, which significantly reduces resource consumption while ensuring the naturalness of skeleton movement.
[0054] Through the above technical solution, this disclosure effectively solves the problem of positioning offset of the double-ended fixed ribbon skeleton when the body shape changes, ensuring that the fixed points at both ends of the ribbon skeleton always maintain the correct spatial relationship with the main skeleton, and realizing zero-cost reuse of animation resources while improving the realism of movement.
[0055] In some embodiments, the fashion skeleton also includes a hard-surface material fashion skeleton. The constraint relationship for the hard-surface material fashion skeleton includes a second positional constraint between the hard-surface material fashion skeleton and a second positioning bone, wherein the second positioning bone provides a positioning reference for the hard-surface material fashion skeleton. Taking the scapula fashion skeleton as an example, a scapula bone (second positioning bone) is added below the shoulder bone, and the fashion scapula bone is completely skinned by this bone. In one example, a separate scapula bone is created below the shoulder bone level as the skinning base, and the fashion scapula bone is completely controlled by this bone through skinning binding.
[0056] like Figure 7 The diagram shown is a fourth flowchart of a virtual character fashion adaptation method according to an embodiment of this disclosure, used to realize the representation of fashion skeletons made of hard surface materials. Figure 7 As shown, the process includes the following steps: Step S710: Based on the preset inheritance relationship and second position constraint between the fashion skeleton and the corresponding main skeleton of the hard surface material, calculate the amount of change of the second positioning skeleton in the preset direction according to the motion parameters of the main skeleton and the second positioning skeleton.
[0057] Furthermore, based on the motion parameters of the main skeleton and the second positioning skeleton in the preset position coordinate system, the motion parameters of the second positioning skeleton in the preset position coordinate system and the plane perpendicular to the first preset axis are calculated, and the motion parameters are applied to the fashion skeleton of the hard surface material. The preset position coordinate system is established based on the positional relationship between the second positioning skeleton and the preset main skeleton.
[0058] The hard surface material fashion skeleton includes a fashion scapula skeleton, and the second positioning skeleton includes a scapula skeleton. The first preset axis is the first direction axis where the fashion scapula skeleton points to the forearm skeleton. The motion parameters of the second positioning skeleton in the preset position coordinate system and the plane perpendicular to the first preset axis are calculated, including: calculating the motion rotation value of the scapula skeleton in the plane perpendicular to the first direction axis; and applying the motion rotation value to the fashion scapula skeleton.
[0059] When the shoulder bone, which serves as the main skeleton, undergoes rotation, translation, or other movements, the associated scapula bone (the second positioning bone) will follow suit in a specific direction (such as along the tangent or normal direction) according to preset association rules. This allows the scapula to naturally coordinate with the main movements of the shoulder while maintaining the rigid body motion characteristics that a hard surface component should have, avoiding unreasonable insertion or deformation.
[0060] Specifically, a position coordinate system is established based on the location of the skeleton according to the hard surface material. This can be achieved based on aiming constraints. Aiming constraints refer to the technique of achieving dynamic linkage by establishing spatial pointing relationships between bones. This can be implemented using three-dimensional spatial vector calculations combined with bone rotation interpolation algorithms to establish the motion relationship between the scapula and forearm bones.
[0061] Step S720: Apply the variable to the fashion skeleton of the hard surface material.
[0062] refer to Figure 8 Taking the scapula skeleton as an example, the scapula skeleton applies aiming constraints, with the forearm skeleton as the parent of the aiming target. A direction vector from the current position of the scapula skeleton to the current position of the forearm skeleton is calculated, and the x-axis of this vector is filtered. The rotation calculated using the filtered direction vector is applied to the scapula skeleton, ensuring it points towards the forearm skeleton in the yz plane and is unaffected by x-axis differences. When the upper arm swings, the scapula aligns with it, but it does not rotate when the upper arm twists. Axial filtering refers to the technique of selectively removing specific components of a 3D vector, which can be implemented using component masking techniques in matrix operations to eliminate x-axis rotation interference caused by upper arm twisting. Rotation value calculation refers to the process of determining the skeleton's rotation angle based on the filtered vector and the reference axis, which can be implemented using a quaternion dot product combined with Euler angle transformation algorithms to ensure the scapula skeleton's precise pointing in the yz plane.
[0063] When the main skeleton corresponding to the second positioning skeleton moves, the second positioning skeleton performs associated movement in a preset direction, which also includes: in the vertical plane where the first preset axis of the position coordinate system is located, the hard surface material of the fashion skeleton and the main skeleton establishes a motion association.
[0064] The aiming constraint system calculates the spatial vector relationship between the scapula and forearm bones in real time. After generating an initial direction vector, the x-axis component is removed using axial filtering. The filtered two-dimensional vector and the upward axial direction of the scapula are input into a quaternion calculation module to generate a rotation matrix containing only y-axis and z-axis rotational components. This rotation matrix drives the pointing motion of the scapula in space, keeping it synchronized with the forearm during arm swings. However, when the upper arm twists around the x-axis, the scapula does not rotate as a result because the x-axis component has been filtered.
[0065] In one example, the plane perpendicular to the first direction axis includes the plane composed of the second direction axis and the third direction axis, wherein the first direction axis, the second direction axis and the third direction axis are perpendicular to each other. In the plane perpendicular to the first direction axis, the motion rotation value of the main skeleton where the fashion scapula is located is obtained, including: performing vector operation on the motion value of the second direction axis and the motion value of the third direction axis to obtain the motion rotation value.
[0066] Specifically, in one example, such as Figure 8 As shown, traditional methods of creating shoulder armor involve attaching the skin to either the upper arm bone or the shoulder bone. With the former, any movement of the upper arm can move the shoulder armor, which doesn't align with the structure of shoulder armor in clothing. With the latter, because the parent is the shoulder, the movement of the upper arm cannot move the shoulder armor, and movements in certain directions may intersect with the shoulder armor (such as horizontal upward movement). Constraints are used to establish the correct driving relationship between the upper arm and the shoulder armor to solve this problem. The parent of the upper arm bone is the shoulder bone. A shoulder armor bone is added below the shoulder bone, and the scapula bone is 100% skinned onto this bone during costume. The shoulder armor bone and the upper arm bone are at the same level, ensuring that the initial position and rotation of the scapula bone are exactly the same as those of the upper arm bone, and their orientation is consistent for easy subsequent constraints.
[0067] The scapula skeleton applies an aiming constraint, with the forearm skeleton as the parent of the aiming target. A direction vector is calculated from the current position of the scapula skeleton to the current position of the forearm skeleton. The x-axis (roll axis) of this vector is then filtered. This means that the difference between the two skeletons on the x-axis is completely ignored; they are positioned on the same x-axis coordinate. The filtered direction vector is then used in conjunction with the upper axial direction of the scapula skeleton and a reference axis. Figure 8 Calculate a rotation value that will align the target axis of the scapula bone, i.e., the axis in the same direction as the upper arm pointing towards the forearm, generally the -x axis of the scapula bone, with the filtered direction as closely as possible.
[0068] The final calculated rotation value is applied to the scapula bone, so that it is perfectly aligned with the forearm bone in the yz plane, but its rotation is not affected by the difference between the two x-axis. That is, when the upper arm swings, the scapula is aligned with it, and when the upper arm twists, the scapula does not rotate with it, which is consistent with the movement of the scapula in real clothing.
[0069] Compared to related technologies, traditional skinning methods directly inherit the full degrees of freedom of rotation of the scapula skeleton from the upper arm skeleton, resulting in non-physical deformation of the hard surface material during torsional motion. This solution establishes an independent skeleton system and an axial filtering mechanism to confine the rotational degrees of freedom of the scapula skeleton to a specific plane, thus preserving necessary motion synchronization while eliminating unnecessary rotational interference.
[0070] Through the above technical solution, this disclosure solves the technical problem of unnatural deformation of hard surface material shoulder armor caused by upper arm torsion movement, and realizes that the shoulder armor maintains coordination with the arm swing during human movement, while avoiding structural stability by following the upper arm torsion, so that the physical performance of virtual clothing is more in line with the motion characteristics of rigid materials in the real world.
[0071] In some embodiments, the fashion skeleton also includes a soft surface material fashion skeleton, and the constraint relationship based on the soft surface material fashion skeleton also includes a distance constraint between the first reference skeleton and the second reference skeleton, wherein the distance constraint is used to characterize the distance relationship between the first reference skeleton and the second reference skeleton.
[0072] In one example, such as Figure 9 The diagram shown is a fifth flowchart illustrating a method for adapting virtual characters to clothing according to an embodiment of this disclosure; this process includes: Step S910: Determine the constraint weight of the soft surface material fashion skeleton in the second preset axis based on the difference between the initial distance and the current distance between the first reference skeleton and the second reference skeleton, wherein the first reference skeleton and the second reference skeleton are used to characterize the motion state of the main skeleton corresponding to the soft surface material fashion skeleton.
[0073] Soft-surface material fashion skeletons include right-angle shoulder skeletons. Taking a fashion right-angle shoulder as an example, a right-angle shoulder skeleton is added below the shoulder skeleton of the main skeleton, and the skin weight originally assigned to the upper arm in the right-angle shoulder area is allocated to this skeleton. For example... Figure 10 As shown, a reference bone p1 (first reference bone) is set below the neck bone, and a reference bone p2 (second reference bone) is set on the upper arm bone. These two reference bones serve as positional references to describe the movement state of the upper arm. The initial distance between p1 and p2 and their real-time updated current distance are obtained. When the current distance is less than the initial distance, it indicates that the upper arm is undergoing upward rotational movements such as raising. Using a custom expression, the difference between the two distances is calculated when the current distance is less than the initial distance. The distance between p1 and p2 when the arm is raised is taken as the maximum value, and the initial distance is taken as the minimum value. This difference is normalized to obtain a value in the interval (0,1) (denoted as f1).
[0074] In step S920, on the second preset axis, based on constraint weights, the soft surface material fashion skeleton moves synchronously with the main skeleton where the soft surface material fashion skeleton is located.
[0075] In step S930, on the vertical plane where the second preset axis is located, the soft surface material fashion skeleton and the main skeleton where the soft surface material fashion skeleton is located move synchronously.
[0076] Specifically, taking the right-angled shoulder as an example, two rotational constraints are set: the first constraint assigns the x and z axes of the right-angled shoulder bone to the xz rotation of the upper arm bone; the second constraint assigns the y axis of the right-angled shoulder bone to the y rotation of the upper arm bone. The weight of this constraint is the variable value f, i.e., the constraint weight. At this time, the right-angled shoulder maintains its shape without collapsing when the arm moves downward, and curls up with the arm when it moves upward. The arm's movements in other axes also follow the arm's movements.
[0077] In one example, such as Figure 10 As shown, reference bones p1 and p2 are positioning markers used to measure distance changes. These can be implemented by attaching virtual bone nodes to the neck and upper arm bones, generating dynamic constraint weights through real-time calculation of the distance changes between them. The custom expression is a mathematical function that maps distance differences to constraint weights; this can be implemented using linear interpolation or piecewise functions, and is used to dynamically adjust the rotational constraint strength based on the arm's position. Rotational constraint separation control refers to applying differentiated constraints to different rotation axes of the bones. This can be achieved using the axial filtering function in a game engine, synchronizing upper arm movement with fixed x and z axis rotations, and dynamically adjusting the y-axis rotation weights to maintain a stable shape.
[0078] Specifically, by adding a right-angle shoulder bone under the shoulder skeleton, the original upper arm skin weight is transferred to this bone, allowing it to independently control the deformation of the right-angle shoulder section. Reference bones p1 and p2 are added to the neck and upper arm skeletons respectively, and the changes in the distance between them are measured in real time. When the arm hangs down, causing the distance between p1 and p2 to decrease, a custom expression normalizes the distance difference to a variable f less than 1. The first constraint forces the x and z axis rotation of the right-angle shoulder bone to be synchronized with the upper arm bone, ensuring consistency in basic movement; the second constraint binds the y-axis rotation to the upper arm bone, but the constraint weight uses the variable f. When the arm moves downward, the distance decreases, causing f to approach 0, the y-axis constraint is invalidated, and the right-angle shoulder bone maintains its original rotation angle to avoid collapse; when the arm is raised, the distance increases, causing f to approach 1, the y-axis constraint takes effect, and the right-angle shoulder naturally curls. Through an axial separation control mechanism, while maintaining the synchronization of x and z axis movements, the y-axis following strength is dynamically adjusted to achieve a balance between the vertical shape stability and movement following of soft surface material clothing.
[0079] This solution, by adding independent bone separation and skinning control, combined with a distance-based dynamic constraint mechanism, blocks the y-axis rotation transmission path when the arm is hanging down and restores the y-axis motion association when the arm is raised. This maintains the structural integrity of the garment design while preserving the conditions for the formation of natural folds. Compared to multi-bone solutions with fixed weights, the dynamic constraint weight mechanism avoids the performance loss caused by the increase in the number of additional bones, and solves the problem that a single constraint cannot adapt to multiple motion states.
[0080] Through the above technical solution, this disclosure effectively solves the problem of shape collapse caused by the direct drive of the upper arm bones in right-angle shoulder clothing made of soft surface materials. When the arm is hanging down, unnecessary rotation transmission is blocked through dynamic constraints, maintaining the rigidity of the right-angle shoulder contour; when the arm is raised, the natural deformation of clothing folds is achieved by increasing the constraint weight. The axial separation control strategy takes into account the deformation requirements under different movement directions, enabling soft surface clothing to maintain the design shape in static postures and present fold changes that conform to physical laws in dynamic movements, while avoiding the impact of adding too many bones on game performance.
[0081] In some embodiments, the fashion skeleton also includes a fashion skirt skeleton, the corresponding main skeleton covered by the fashion skirt skeleton is a leg bone, and the constraint relationship applied to the fashion skirt skeleton also includes a distance constraint between the leg bone and the fashion skirt skeleton, wherein the distance constraint is used to characterize the distance relationship between the leg bone and the fashion skirt skeleton.
[0082] Based on constraints, and according to the motion parameters of the main skeleton, the changing parameters of the fashion skeleton corresponding to the main skeleton are calculated, and the changing parameters are used to drive the fashion skeleton to perform corresponding movements. For example... Figure 11 As shown, this specifically includes: assigning a preset weight to the initial distance between the fashion skirt bone and the corresponding leg bone based on the movement parameters of the leg bone, and then applying it to the fashion skirt bone.
[0083] In some embodiments, the initial distance between the fashion skirt bone and the corresponding leg bone is assigned a preset weight and applied to the fashion skirt bone based on the leg bone's motion parameters. For example... Figure 11 As shown, a sixth flowchart of a virtual character fashion adaptation method according to an embodiment of this disclosure is illustrated. The process includes: Step S1110: Calculate the initial distance between the fashion skirt bone and the leg bone and the unit vector of the leg bone pointing to the initial position of the fashion skirt bone, where the unit vector is used to represent the positional relationship between the fashion skirt bone and the leg bone. The initial distance refers to the spatial distance between the skirt bones and their corresponding leg bones in the initial posture. This can be calculated using Euclidean distance in a three-dimensional coordinate system, establishing the original spatial relationship benchmark between the bones. The unit vector is the standardized direction from the leg bone to the initial position of the skirt bones, generated using a vector normalization algorithm to maintain the directional benchmark during bone movement. Distance constraint weights are the intensity coefficients of the influence of leg movement on different bones (chains), implemented using a position weight allocation algorithm based on bone hierarchy to achieve differentiated motion following effects.
[0084] In the basic skinned pose, each bone has an initial distance from the leg bone. Calculate the vector pointing from the leg bone to the initial position of the skirt bone. Convert this vector to a unit vector (i.e., a direction vector of length 1). Multiply this unit vector by the initial distance to obtain a new vector with the same length. Add this vector to the current position of the leg bone to obtain the target position of the skirt bone in the current frame during movement. This is called distance constraint, which constrains the skirt bone distance to the leg bone. The distance constraint weight between different bones (chains) and the legs depends on the chain's position. For example, a chain between two legs has 50% distance weight for the left leg and 50% for the right leg, while a chain belonging to only one side has 100% distance weight on the same side leg. This results in an effect similar to directly skinning the skirt onto the leg bone. When performance pressure is high, the skirt bone effect for secondary client players (players other than the main character) switches from a physics simulation to a distance constraint effect, with the skirt completely following the bending and swaying of the legs. This is a downgraded effect that still provides a relatively reasonable visual experience for the player.
[0085] Step S1120: Based on the unit vector and the current position of the leg bone, obtain the target position of the fashion skirt bone during the movement.
[0086] Based on the direction guidance of the unit vector and the actual position of the leg bone, the target position that the fashion skirt bone needs to reach in each frame during the character's movement can be dynamically calculated through preset calculation rules and kinematic constraints.
[0087] Step S1130: Obtain the constraint weights between the fashion skirt bones and the leg bones based on the current position and target position of the leg bones.
[0088] Based on the current position of the leg bone in three-dimensional space and the preset target position, the dynamic constraint weight value between the fashion skirt bone and the corresponding leg bone is obtained by querying the constraint data in the skeleton binding system.
[0089] Step S1140: Apply constraint weights to the fashion skirt skeleton to follow the movement of the corresponding leg bones.
[0090] Specifically, such as Figure 12As shown, during the initialization phase, the baseline positional relationship between the skirt skeleton and the legs is established through spatial geometric calculations. When the legs move, the target position of the skirt skeleton is dynamically generated by real-time superposition of the initial vector and the leg bone displacement, maintaining the motion correlation between the two. The constraint weight allocation mechanism sets three levels of constraint strength—high, medium, and low—based on the position of the skirt chain—whether it is on the front, back, or side. For example, the weight of the front chain is set to 0.8, the weight of the back chain to 0.5, and the weight of the side chain to 0.3. When the system detects that the frame rate is lower than a set threshold or the number of characters on screen exceeds a critical value, the physics simulation module is automatically shut down, and the movement of the skirt skeleton is completely driven by distance constraints. At this time, the skirt skeleton only follows the leg bones for linear displacement, eliminating the performance consumption caused by physics collision calculations.
[0091] A position generation mechanism based on vector operations is established by pre-recording the initial spatial relationship between the skirt and leg bones. During each frame's calculation, the initial vector is superimposed on the real-time leg position to generate a target position that conforms to the original spatial relationship, avoiding complex physical simulation calculations. Differentiated weight allocation gives bones (chains) closer to the legs stronger following constraints, while bones (chains) farther from the legs retain appropriate degrees of freedom, creating a natural swaying effect. When system resource usage exceeds a preset threshold, the physical simulation mode is automatically switched to constraint following mode, reducing computational load by simplifying the position calculation logic. This dynamic mode switching mechanism effectively alleviates the computational pressure when multiple characters are on screen simultaneously, while ensuring basic visual effects.
[0092] This solution significantly reduces computational complexity while maintaining reasonable visual effects by establishing a constraint mechanism based on initial spatial relationships. It effectively solves the performance consumption problem caused by skeletal physics simulation. Under normal conditions, the skirt skeleton maintains natural movement through vector calculations; when the system detects high load, it automatically switches to constraint-following mode, allowing the skirt skeleton to completely follow leg movements without requiring physics simulation calculations. This dynamic adjustment mechanism significantly optimizes the computational load in multi-character scenes on the same screen, while avoiding the model stiffness and distortion defects of traditional degradation solutions, ensuring that players always observe skirt animation effects that conform to the laws of motion.
[0093] This embodiment also provides a fashion adaptation device for virtual characters, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0094] This embodiment also provides a fashion adaptation device for virtual characters, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0095] This embodiment provides a fashion adaptation device for virtual characters, such as... Figure 13 As shown, it includes: The acquisition module 1310 is used to acquire the constraint relationship between the main skeleton and the costume skeleton of the virtual character.
[0096] The drive module 1320 is used to drive the fashion skeleton to perform corresponding movements based on the constraints and the motion parameters of the main skeleton when the main skeleton is moving.
[0097] In some optional implementations, the acquisition module 1310 includes: The first acquisition unit is used to acquire a first constraint relationship between the main body skeleton and the first fashion skeleton if the first fashion skeleton and the second fashion skeleton have different types, and to acquire a second constraint relationship between the main body skeleton and the second fashion skeleton.
[0098] The second acquisition unit is used to acquire the first constraint relationship between the main body skeleton and the first fashion skeleton if the first fashion skeleton and the second fashion skeleton have the same type, and the second constraint relationship between the main body skeleton and the second fashion skeleton is a reuse of the first constraint relationship.
[0099] In some alternative implementations, the driver module 1320 includes: The first driving module is used to calculate the change parameters of the fashion skeleton corresponding to the main skeleton based on the constraint relationship and the motion parameters of the main skeleton, and to drive the fashion skeleton to perform corresponding movements using the change parameters.
[0100] In some optional implementations, the first driving module is used to calculate the displacement variation of the fashion skeleton based on the preset inheritance relationship between the fashion skeleton and the main skeleton and according to the scaling factor of the main skeleton, and apply the displacement variation to the fashion skeleton; wherein, the preset inheritance relationship means that the fashion skeleton inherits the motion parameters of the main skeleton.
[0101] In some optional implementations, the first driving module is further configured to calculate the displacement variation of the double-ended fixed ribbon skeleton based on the preset inheritance relationship and the corresponding main skeleton and the first position constraint, according to the motion parameters of the main skeleton and the first positioning skeleton, and apply the displacement variation to the double-ended fixed ribbon skeleton.
[0102] In some optional implementations, the first driving module is also used to calculate the amount of change of the second positioning bone in a preset direction based on the preset inheritance relationship and second position constraint between the hard surface material fashion skeleton and the corresponding main body skeleton, according to the motion parameters of the main body skeleton and the second positioning bone, and apply the amount of change to the hard surface material fashion skeleton.
[0103] In some optional implementations, the first driving module is further configured to determine the constraint weight of the soft surface material fashion skeleton in a second preset axis based on the difference between the initial distance and the current distance between the first reference skeleton and the second reference skeleton, wherein the first reference skeleton and the second reference skeleton are used to characterize the motion state of the main skeleton corresponding to the soft surface material fashion skeleton; in the second preset axis, based on the constraint weight, the soft surface material fashion skeleton moves synchronously with the main skeleton where the soft surface material fashion skeleton is located; in the vertical plane where the second preset axis is located, the soft surface material fashion skeleton and the main skeleton where the soft surface material fashion skeleton is located move synchronously.
[0104] In some optional implementations, the first driving module is also used to apply a preset weight to the initial distance between the fashion skirt bone and the corresponding leg bone based on distance constraints and the motion parameters of the leg bone.
[0105] The virtual character fashion adaptation device provided in this disclosure can execute the virtual character fashion adaptation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0106] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.
[0107] The following is a detailed reference. Figure 14 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1402 or a program loaded from memory 1408 into random access memory (RAM) 1403. The RAM 1403 also stores various programs and data required for the operation of the electronic device. The processor 1401, ROM 1402, and RAM 1403 are interconnected via a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.
[0108] Typically, the following devices can be connected to I / O interface 1405: input devices 1406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1409. Communication device 1409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 14 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0109] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1409, or installed from memory 1408, or installed from ROM 1402. When the computer program is executed by processor 1401, it performs the functions defined in the virtual character fashion adaptation method of embodiments of this disclosure.
[0110] Figure 14 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0111] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the costume adaptation method for virtual characters shown in the above embodiments.
[0112] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0113] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for fashion adaptation for virtual characters, characterized in that, The method includes: Obtain the constraint relationship between the main skeleton and the costume skeleton of the virtual character; When the main skeleton moves, based on the constraint relationship, the fashion skeleton is driven to perform corresponding movements using the motion parameters of the main skeleton.
2. The method for adapting virtual character outfits according to claim 1, characterized in that, The fashion skeleton includes a first fashion skeleton and a second fashion skeleton, and the constraint relationship includes a first constraint relationship and a second constraint relationship; obtaining the constraint relationship between the main skeleton and the fashion skeleton of the virtual character includes: If the first fashion skeleton and the second fashion skeleton have different types, then obtain the first constraint relationship between the main skeleton and the first fashion skeleton, and obtain the second constraint relationship between the main skeleton and the second fashion skeleton; If the first fashion skeleton and the second fashion skeleton have the same type, then the first constraint relationship between the main skeleton and the first fashion skeleton is obtained, and the second constraint relationship between the main skeleton and the second fashion skeleton is a reuse of the first constraint relationship.
3. The method for adapting virtual character outfits according to claim 1 or 2, characterized in that, The process of driving the fashion skeleton to perform corresponding movements based on the constraints and the motion parameters of the main skeleton includes: Based on the constraints, according to the motion parameters of the main skeleton, the change parameters of the fashion skeleton corresponding to the main skeleton are calculated, and the change parameters are used to drive the fashion skeleton to perform corresponding movements.
4. The method for adapting virtual character outfits according to claim 3, characterized in that, The motion parameters of the main skeleton include the scaling factor of the main skeleton; the constraint relationship includes the preset inheritance relationship between the fashion skeleton and the main skeleton; Based on the constraint relationship, and according to the motion parameters of the main skeleton, the step of calculating the variation parameters of the fashion skeleton corresponding to the main skeleton, and using the variation parameters to drive the fashion skeleton to perform corresponding movements, includes: Based on the preset inheritance relationship between the fashion skeleton and the main skeleton, the displacement change of the fashion skeleton is calculated according to the scaling factor of the main skeleton, and the displacement change is applied to the fashion skeleton; wherein, the preset inheritance relationship represents the inheritance of the motion parameters of the fashion skeleton from the main skeleton.
5. The method for adapting virtual character outfits according to claim 4, characterized in that, The step of calculating the displacement variation of the fashion skeleton based on the preset inheritance relationship between the fashion skeleton and the main skeleton, according to the scaling factor of the main skeleton, includes: Obtain the scaling factor of the main skeleton; Based on the preset inheritance relationship, the displacement change of the fashion skeleton is calculated according to the original position of the fashion skeleton and the scaling factor.
6. The method for adapting virtual character outfits according to claim 1, characterized in that, The fashion skeleton includes a single-end fixed ribbon skeleton. The process of obtaining the constraint relationship between the main skeleton and the costume skeleton of the virtual character includes: The main skeleton where the fixed end of the single-end fixed ribbon skeleton is located is determined to be the parent skeleton of the single-end fixed ribbon skeleton; Obtain the preset inheritance relationship between the single-end fixed ribbon bone and the parent bone of the single-end fixed ribbon bone.
7. The method for adapting virtual character outfits according to claim 4, characterized in that, The fashion skeleton includes a double-ended fixed ribbon skeleton, wherein the double-ended fixed ribbon skeleton includes a first end of the ribbon skeleton and a second end of the ribbon skeleton; the constraint relationship also includes a first position constraint between the double-ended fixed ribbon skeleton and the first positioning skeleton; Based on the constraint relationship, and according to the motion parameters of the main skeleton, the step of calculating the variation parameters of the fashion skeleton corresponding to the main skeleton, and using the variation parameters to drive the fashion skeleton to perform corresponding movements, includes: Based on the preset inheritance relationship between the double-ended fixed ribbon skeleton and the corresponding main skeleton and the first position constraint, the displacement variation of the double-ended fixed ribbon skeleton is calculated according to the motion parameters of the main skeleton and the first positioning skeleton, and the displacement variation is applied to the double-ended fixed ribbon skeleton.
8. The method for adapting virtual character outfits according to claim 3, characterized in that, The fashion skeleton also includes a fashion skeleton with a hard surface material; the constraint relationship also includes a second position constraint between the fashion skeleton with the hard surface material material and the second positioning skeleton; Based on the constraint relationship, and according to the motion parameters of the main skeleton, the step of calculating the variation parameters of the fashion skeleton corresponding to the main skeleton, and using the variation parameters to drive the fashion skeleton to perform corresponding movements, includes: Based on the preset inheritance relationship between the hard surface material fashion skeleton and the corresponding main skeleton and the second position constraint, according to the motion parameters of the main skeleton and the second positioning skeleton, the amount of change of the second positioning skeleton in the preset direction is calculated, and the amount of change is applied to the hard surface material fashion skeleton.
9. The method for adapting virtual character outfits according to claim 8, characterized in that, The step of calculating the amount of variation of the second positioning bone in a preset direction based on the motion parameters of the main skeleton and the second positioning bone, and applying the amount of variation to the fashion skeleton made of hard surface material, includes: Based on the motion parameters of the main skeleton and the second positioning skeleton in the preset position coordinate system, the motion parameters of the second positioning skeleton in the preset position coordinate system and the plane perpendicular to the first preset axis are calculated, and the motion parameters are applied to the fashion skeleton of the hard surface material. The preset position coordinate system is established based on the positional relationship between the second positioning skeleton and the preset main skeleton.
10. The method for adapting virtual character outfits according to claim 9, characterized in that, The hard surface material fashion skeleton includes a fashion scapula skeleton, and the second positioning skeleton includes a scapula skeleton, wherein the first preset axis is the first direction axis where the fashion scapula skeleton points to the forearm skeleton; The step of calculating the motion parameters of the second positioning bone in the preset position coordinate system and the plane perpendicular to the first preset axis, and applying the motion parameters to the fashion bone of the hard surface material, includes: Calculate the rotational value of the scapula bone in the plane perpendicular to the first direction axis; The motion rotation value is applied to the fashion scapula.
11. The method for adapting virtual character outfits according to claim 10, characterized in that, The plane perpendicular to the first direction axis includes a plane composed of a second direction axis and a third direction axis, wherein the first direction axis, the second direction axis, and the third direction axis are perpendicular to each other. The calculation of the rotational value of the scapula bone in a plane perpendicular to the first direction axis includes: The motion value of the second direction axis and the motion value of the third direction axis are used to perform vector operation to obtain the motion rotation value.
12. The method for adapting virtual character outfits according to claim 3, characterized in that, The fashion skeleton also includes a fashion skeleton made of soft surface material. Based on the constraint relationship, and according to the motion parameters of the main skeleton, the step of calculating the variation parameters of the fashion skeleton corresponding to the main skeleton, and using the variation parameters to drive the fashion skeleton to perform corresponding movements, includes: Based on the difference between the initial distance and the current distance between the first reference bone and the second reference bone, the constraint weight of the soft surface material fashion bone in the second preset axis is determined, wherein the first reference bone and the second reference bone are used to characterize the motion state of the main bone corresponding to the soft surface material fashion bone. In the second preset axis, based on the constraint weight, the soft surface material fashion skeleton moves synchronously with the main skeleton where the soft surface material fashion skeleton is located; In the vertical plane where the second preset axis is located, the soft surface material fashion skeleton and the main skeleton where the soft surface material fashion skeleton is located move synchronously.
13. The method for adapting virtual character outfits according to claim 3, characterized in that, The fashion skeleton also includes a fashion skirt skeleton, the main skeleton includes leg bones, and the constraint relationship also includes a distance constraint between the leg bones and the fashion skirt skeleton, wherein the distance constraint is used to characterize the distance relationship between the leg bones and the fashion skirt skeleton. Based on the constraint relationship, and according to the motion parameters of the main skeleton, the step of calculating the variation parameters of the fashion skeleton corresponding to the main skeleton, and using the variation parameters to drive the fashion skeleton to perform corresponding movements, includes: Based on the distance constraint, according to the motion parameters of the leg bone, the initial distance between the fashion skirt bone and the corresponding leg bone is assigned a preset weight and then applied to the fashion skirt bone.
14. The method for adapting virtual character outfits according to claim 13, characterized in that, The step of assigning a preset weight to the initial distance between the fashion skirt bone and the corresponding leg bone based on the movement parameters of the leg bone and then applying it to the fashion skirt bone includes: Calculate the initial distance between the fashion skirt bone and the leg bone and the unit vector of the leg bone pointing to the initial position of the fashion skirt bone, wherein the unit vector is used to characterize the positional relationship between the fashion skirt bone and the leg bone; Based on the unit vector and the current position of the leg bone, obtain the target position of the fashion skirt bone during the movement; Based on the current position and target position of the leg bone, obtain the constraint weight between the fashion skirt bone and the leg bone; The constraint weights are applied to the fashion skirt skeleton to follow the movement of the corresponding leg bones.
15. A fashion adaptation device for virtual characters, characterized in that, The device includes: The acquisition module is used to acquire the constraint relationship between the main skeleton and the costume skeleton of the virtual character; The driving module is used to drive the fashion skeleton to perform corresponding movements based on the constraint relationship and the motion parameters of the main skeleton when the main skeleton moves.
16. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the fashion adaptation method for virtual characters as described in any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the fashion adaptation method for a virtual character as described in any one of claims 1 to 14.
18. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the fashion adaptation method for a virtual character as described in any one of claims 1 to 14.