Method and system for matching animation data to generate skeleton
By presetting the position and number of biological bones, adjusting the bone size and generating customized animation content, the problems of both diversity and body shape characteristics of animation display in the existing technology are solved, and a reasonable bone model and diversified animation display are achieved.
Patent Information
- Application Number
- CN202510381816.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-08
AI Technical Summary
When presenting biological animations of different body shapes and types, the prior art cannot take into account both the body shape characteristics and the diversity of animation display, resulting in the animation losing body shape characteristics and the animation display of both humans and animals cannot take into account both the animation display of humans and animals.
By presetting the position and number of biological bones, adjusting the bone size, and generating custom animation content based on animation data, building a complete bone model, and adjusting the pose of the bone model to match the character pose.
实现了自定义动画数据的生成,能够更好地展示多样化的动画形象,骨骼模型各部位比例合理,支持人类和动物的动画展示。
Smart Images

Figure CN120279143A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of animation character construction, and in particular, to a method and system for generating skeletons by matching animation data. Background Art
[0002] In order to display the animation effects of creatures of different body types and species, conventional action libraries use some fixed human figures for preset animation displays. For example, both Mixamo and Rokoko Studio use this method. This approach results in the loss of body type characteristics in the animation. For instance, both obese and thin body types are displayed using a fixed body shape. Moreover, this pre-set animation cannot simultaneously accommodate the animation displays of humans and animals and fails to meet the requirements for diverse animation image displays.
[0003] Therefore, it is highly necessary to provide a method and system for generating skeletons by matching animation data. By presetting the skeletons of animation images, arranging the positions and quantities of the skeletons in sequence, scaling the sizes of the skeletons at different positions, and then associating the skeletons with the poses of each frame according to the animation data to form animation content that matches the custom animation data, better output of custom content can be achieved. Summary of the Invention
[0004] In view of this, the present invention proposes a method and system that can preset the positions and shapes of the skeletons of creatures corresponding to the body types of characters, construct a complete skeleton model and a basic position, and then adjust the poses of each part of the creature corresponding to the skeleton model according to the poses of the animation frames, so as to better match the data to generate the skeleton.
[0005] On the one hand, the present invention provides a method for generating skeletons by matching animation data, including the following steps:
[0006] S1: Establish the biological skeletons of the character. The biological skeletons at different positions have unique encodings and the same initial lengths, but their shapes are not completely the same;
[0007] S2: Construct a complete skeleton model according to the quantity of the biological skeletons in the character animation data and the displacement information with the next section of biological skeletons;
[0008] S3: Adjust the length of each biological skeleton according to the height of the character and the existence of the next adjacent section of biological skeletons;
[0009] S4: According to the pose matrix of the corresponding biological skeleton in each frame of the character animation data, and the animation data uses the same encoding method as the biological skeleton, adjust the corresponding biological skeleton in the skeleton model to the corresponding position to generate the biological skeleton image of each frame.
[0010] Based on the above technical solutions, preferably, the specific content of establishing the biological skeleton of the character in step S1 is as follows: According to the appearance of the character, the first biological skeletons of different parts are correspondingly made, and the appearances of the first biological skeletons of different parts are not completely the same; the character is divided into two categories: human body and quadruped animals. A number of first biological skeletons are established for the human body character; a first biological skeleton and a second biological skeleton are established for the quadruped animal character.
[0011] Preferably, the biological skeletons at different positions in step S1 have a unique code and the same length. The first biological skeletons of the hip, waist, chest, neck, and head are sequentially used as the common parts of the torso and encoded.
[0012] For the human body character or the quadruped animal character, the left upper limb and the left lower limb are respectively defined on both sides of the chest. The left upper limb includes the first biological skeletons corresponding to the left shoulder, left upper arm, left forearm, left palm, and left fingers arranged in sequence; the right upper limb includes the first biological skeletons corresponding to the right shoulder, right upper arm, right forearm, right palm, and right fingers arranged in sequence; the left lower limb and the right lower limb are respectively defined on both sides of the end of the hip close to the ground. The left lower limb includes the first biological skeletons corresponding to the left thigh, left calf, left foot sole, and left toes arranged in sequence; the right lower limb includes the first biological skeletons corresponding to the right thigh, right calf, right foot sole, and right toes arranged in sequence; and each first biological skeleton is encoded.
[0013] At the end of the hip of the quadruped animal character away from the waist, a tail is also provided, and a second biological skeleton is generated for the tail and sequentially encoded; the initial lengths of the first biological skeleton and the second biological skeleton are both the default unit length.
[0014] Further preferably, the quadruped animal character also includes ordinary bones, which are biological bones of the quadruped animal character that cannot be classified into the first biological skeleton and the second biological skeleton and have no specific parts.
[0015] Further preferably, the code of the biological skeleton is (a, b), where a is the part coding information and b is the quantity coding information; the first biological skeletons of the non-finger parts of the same limb connected to the chest, or the first biological skeletons of the non-toe parts of the same limb connected to the hip, have the same part coding information; the first biological skeletons of different parts of the common part of the torso have different corresponding part coding information.
[0016] More preferably, the specific content of step S2 is as follows: Place the character in the initial pose; obtain the position information of each biological bone and the position information of adjacent biological bones at the initial position. Each biological bone is represented by a right-hand coordinate system matrix in the animation data. Extract the position information (x1, y1, z1) of one end of the current biological bone that is close to the previous biological bone from the right-hand coordinate system matrix. If the current biological bone has a next biological bone and the position information of one end of the next biological bone close to the current biological bone is (x2, y2, z2), calculate the distance d between the current biological bone and the adjacent biological bone, Scale the unit length of the current biological bone to d; if the current biological bone has no next biological bone, estimate the length of the biological bone based on the height. After obtaining the lengths of each biological bone in the initial state, obtain the complete bone model.
[0017] Even more preferably, the character being in the initial pose means that for a human character, the human body is in an extended state, the left and right upper limbs hang naturally, the palms and finger pads face the side of the body, and the distance between the left and right lower limbs does not exceed the distance between the left and right upper limbs; or the left and right upper limbs extend horizontally to both sides of the body and the palms and finger pads face the ground direction, and the distance between the left and right lower limbs does not exceed the distance between the left and right upper limbs;
[0018] For a quadruped character, keep the four limbs in an extended pose, the first biological bone corresponding to the common part of the torso is located on the symmetry plane of the quadruped, and the tail hangs naturally.
[0019] Even more preferably, the content of step S3 is to give the height of the character according to the standing pose of the character, and then scale the biological bones at the ends of the bone model that have no next biological bone according to the height of the character;
[0020] For a human character, let the given height of the character be H. Then the scaled length of the first biological bone of the head does not exceed H / 5, the total length of the upper limbs after scaling does not exceed H / 3, the total length of the lower limbs after scaling does not exceed H / 2, the total height of the lower limbs and the hip after scaling does not exceed H / 2, the total height of the lower limbs, the hip and the waist does not exceed 3H / 5, the scaled length of the first biological bone of the neck does not exceed H / 11, and the total length of the head, neck and chest after scaling does not exceed H / 3;
[0021] For a quadruped character, if the weight is less than 200 kg or the height does not exceed 1.5 m, let the height of the given character be H. Then, the scaled length of the first biological bone of the head does not exceed H / 5, the scaled length of the first biological bone of the chest does not exceed H / 3, the scaled length of the limb length corresponds to not exceeding H / 2, and the total length of the hind limbs is greater than or equal to the length of the forelimbs; the scaled length of the first biological bone of the neck does not exceed H / 5, and the scaled length of the total length of the hip and lower limbs corresponds to not exceeding 0.9H. If the weight is greater than 200 kg or the height exceeds 1.5 m, let the height of the given character be H. Then, the scaled length of the first biological bone of the head does not exceed H / 6, the scaled length of the first biological bone of the chest does not exceed H / 4, the scaled length of the limb length corresponds to not exceeding H / 3, and the total length of the hind limbs is greater than or equal to the length of the forelimbs; the scaled length of the first biological bone of the neck does not exceed H / 8, and the scaled length of the total length of the hip and lower limbs corresponds to not exceeding 0.8H.
[0022] More preferably, the content of step S4 is to adjust the position information and rotation information of the current biological bone in the bone model according to the position matrix of each frame of animation data, obtain the rotation information and position information of each biological bone in the world coordinate, generate the bone animation file of the character; extract the animation information from the character animation data and write it into the bone animation file of the character.
[0023] On the other hand, the present invention provides a system for generating bones by matching animation data, which is used to implement the method for generating bones by matching animation data as described above, and is characterized by including
[0024] A biological bone generation module, which is used to establish the biological bones of the character, and the biological bones in different positions have unique encodings and the same length;
[0025] A bone model establishment module, which constructs a complete bone model of the character according to the number of biological bones in the character animation data and the displacement information with the next segment of biological bones;
[0026] A biological bone adjustment module, which adjusts the length of each biological bone according to the height of the character;
[0027] A biological bone image generation module, which is used to adjust the corresponding biological bone in the bone model to the corresponding position according to the pose matrix of the corresponding biological bone in each frame of character animation data, and generate the biological bone image of each frame.
[0028] The method and system for generating bones by matching animation data provided by the present invention have the following beneficial effects compared with the prior art:
[0029] (1) The present invention pre - sets a certain number of biological bones and encodes them sequentially. Adjust the number and position of biological bones according to the body type, and adjust the growth mode and replication number of the biological bones with corresponding codes according to the number of biological bones in the animation data, so as to construct a combined structure of biological bones that conforms to the character image. Then, adjust the length of the combined structure of biological bones in the initial posture according to the character's height to obtain a complete bone model in the initial posture. Then, combined with the character posture corresponding to each frame of animation, adjust the pose of each biological bone in the bone model to obtain the bone animation file of the character, realizing the visual animation display function of static data;
[0030] (2) The present invention also scales the size of the terminal biological bone without the next - section biological bone of the bone model according to the character's height. For non - terminal biological bones with the next - section biological bone, perform corresponding scaling in combination with the distance d, and roughly give the corresponding relationship between the scaling length of the character's bones and the given height, so as to make the proportion of each part of the bone model more reasonable. Description of the Drawings
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following - described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0032] Figure 1 It is a flowchart of a method for generating bones by matching animation data and a system according to the present invention;
[0033] Figure 2 It is a schematic diagram of a bone model of a human character in a method for generating bones by matching animation data and a system according to the present invention;
[0034] Figure 3 It is a schematic diagram of a bone model of a quadruped animal in a method for generating bones by matching animation data and a system according to the present invention. Detailed Embodiments
[0035] Next, in combination with the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0036] Combined with Figure 1 It can be seen that, on the one hand, the present invention provides a method for generating bones by matching animation data, including the following steps:
[0037] S1: Establish the biological skeleton of the character. The biological skeletons in different positions have unique codes and the same initial length, but their shapes are not completely the same.
[0038] Among them, establishing the biological skeleton of the character specifically includes: according to the appearance of the character, correspondingly making the first biological skeletons of different parts, and the appearances of the first biological skeletons of different parts are not completely the same; dividing the character into two categories: human body and quadruped animals, establishing several first biological skeletons for human body characters; establishing the first biological skeleton and the second biological skeleton for quadruped animal characters. Here, the quadruped animal characters include not only small-sized organisms such as cats and dogs, but also large-sized organisms such as horses, elephants, and camels. The quadruped animal characters can be either the image of a conventional quadruped standing animal or the anthropomorphic form of a bipedal standing animal.
[0039] Among them, the biological skeletons in different positions have unique codes and the same length. The first biological skeletons of the hip, waist, chest, neck, and head are successively used as the common parts of the trunk and encoded.
[0040] For human body characters or quadruped animal characters, the left upper limb and the left lower limb are respectively defined on both sides of the chest. The left upper limb includes the first biological skeletons corresponding to the left shoulder, left upper arm, left forearm, left palm, and left fingers in sequence and is encoded; the right upper limb includes the first biological skeletons corresponding to the right shoulder, right upper arm, right forearm, right palm, and right fingers in sequence and is encoded; the left lower limb and the right lower limb are respectively defined on both sides of the end of the hip close to the ground. The left lower limb includes the first biological skeletons corresponding to the left thigh, left calf, left foot sole, and left toes in sequence and is encoded; the right lower limb includes the first biological skeletons corresponding to the right thigh, right calf, right foot sole, and right toes in sequence and is encoded.
[0041] One end of the hip of the quadruped animal character far from the waist is also provided with a tail, and the second biological skeleton is generated for the tail and encoded in sequence; the initial lengths of the first biological skeleton and the second biological skeleton are both the default unit length. Here, the default unit length can be 10 cm, 5 cm, or 1 cm. In this embodiment, it is preferably 1 cm. Subsequent corresponding scaling operations are performed according to the actual situation.
[0042] The following table is the starting serial number for encoding different parts of the biological skeleton.
[0043]
[0044]
[0045] The quadruped character also includes ordinary bones, which are biological bones without specific parts that the quadruped character cannot be classified as the first biological bone and the second biological bone. The ordinary bones can be the horns on the head, the protrusions on the back, or the appendages on both sides of the body, etc., which are biological bones with uncertain positions.
[0046] As can be seen from the above table, the coding of the biological bone is (a, b), where a is the part coding information and b is the quantity coding information; the first biological bone of the non-finger part of the same limb connected to the chest, or the first biological bone of the non-toe part of the same limb connected to the hip, has the same part coding information; the first biological bones of different parts of the common part of the torso have different corresponding part coding information.
[0047] In the above table, first, the biological bones are classified according to the installation part. The part coding information a corresponding to the first biological bone of the hip, the first biological bone of the waist, the first biological bone of the chest, the first biological bone of the neck, and the first biological bone of the head, which are the bases of the common part of the torso, are 0, 9, 12, 17, and 11 respectively; the part coding information a of the left upper limb, the right upper limb, the left lower limb, and the right lower limb are 1, 2, 5, and 6 respectively; the part coding information a of the tail of the quadruped is 10. When coding, the structure of this part is simplified. For example, only one first biological bone is used to represent the shoulder part, the forearm part, the calf part, the palm part, and the sole part in the limb.
[0048] For the common part of the torso, if there are multiple first biological bones in the same part, they are expressed in the ways of (a, 1), (a, 2), (a, 3),... etc. For example, if there are 4 first biological bones in the waist, they are represented by the codes (9, 1), (9, 2), (9, 3), and (9, 4) respectively.
[0049] For the same limb, each first biological bone of the non-finger part or the non-toe part of the limb uses the same part coding information, and according to the extension direction away from the chest or the hip, the quantity coding information increases sequentially. For example, the codes of the first biological bone of the left shoulder, the first biological bone of the left upper arm, the first biological bone of the left forearm, and the first biological bone of the left palm included in the left upper limb are represented as (1, 1), (1, 2), (1, 3), and (1, 4) in sequence, because there is only one first biological bone for the first biological bone of the left shoulder, the first biological bone of the left upper arm, the first biological bone of the left forearm, and the first biological bone of the left palm in the simplified upper limb.
[0050] For fingers or toes, they have independent part coding information and sequentially increasing quantity coding information. For example, in the order of the thumb, index finger, middle finger, ring finger, and little finger, and in the order from near to far from the palm, the codes of the first biological bone of the left thumb are (3, 1), (3, 2), and (3, 3), and the codes of the first biological bone of the left index finger are (3, 4), (3, 5), and (3, 6), and so on.
[0051] As for the coding method of ordinary bones, the same part coding information 100 is adopted, and different quantity coding information is numbered sequentially, and the part coding information of the first biological bone where the ordinary bone is located is recorded separately.
[0052] It should be noted that when the character animation data defines biological bones using data or matrix content, a table with the same coding rules as the above content is adopted, so that there is a one-to-one correspondence in the data.
[0053] S2: Construct a complete bone model according to the quantity of biological bones in the character animation data and the displacement information of the next segment of biological bones.
[0054] The specific content is as follows: Make the character in the initial posture; obtain the position information of each biological bone in the initial position and the position information of adjacent biological bones. Each biological bone is represented by a right-hand coordinate system matrix in the animation data, and extract the position information (x1, y1, z1) of one end of the current biological bone close to the previous segment of biological bone from the right-hand coordinate system matrix; if the current biological bone has the next segment of biological bone, and the position information of one end of the next segment of biological bone close to the current biological bone is (x2, y2, z2), calculate the distance d between the current biological bone and the adjacent biological bone, scale the unit length of the current biological bone to d; if the current biological bone has no next segment of biological bone, estimate the length of the biological bone by height; after obtaining the lengths of each biological bone in the initial state, obtain the complete bone model. The right-hand coordinate system matrix mentioned here is a 4×4 matrix based on translation, rotation, scaling, and skew content, and the position information of the current biological bone can be extracted from the right-hand coordinate system matrix. Define the previous segment of biological bone of the head biological bone as the neck biological bone; the previous segment of biological bone of the upper limb and neck biological bones is the chest biological bone, the previous segment of biological bone of the chest biological bone is the waist biological bone, the previous segment of biological bone of the waist biological bone and the biological bone corresponding to the thigh of the lower limb is the hip biological bone, and the hip biological bone has no previous segment of biological bone. The biological bones at the fingertips of fingers, toes, and the head have no next segment of biological bone.
[0055] Among them, putting the character in the initial posture means that for a human character, the human body is in a stretched state, the left and right upper limbs hang naturally, the palms and the finger pads face the side of the body, the distance between the left and right lower limbs does not exceed the distance between the left and right upper limbs, and the toes are pointed straight towards the ground; or the left and right upper limbs extend horizontally to both sides of the body and the palms and the finger pads face the ground direction, the distance between the left and right lower limbs does not exceed the distance between the left and right upper limbs, and the toes are pointed straight towards the ground;
[0056] For a quadruped character, keep the four limbs in a stretched posture, the first biological bone corresponding to the common part of the trunk is located on the symmetry center plane of the quadruped, and the tail is in a natural hanging state.
[0057] Figure 2 A complete bone model of a human character is shown; the light blue part is the first biological bone of the head; the blue part is the first biological bones of the neck, chest and waist; the dark yellow part is the first biological bone of the hip; the dark blue part is the first biological bones of the left upper limb and the left lower limb; the green part is the first biological bones of the right upper limb and the right lower limb; the magenta part is the first biological bones corresponding to the left fingers and the left toes; the bright yellow is the first biological bones corresponding to the right fingers and the right toes.
[0058] Figure 3 A complete bone model of a quadruped character is shown; similarly, the blue part is the first biological bones of the neck, chest and waist; the dark yellow part is the first biological bone of the hip and the second biological bone of the tail extending outward from the hip; the dark blue part is the first biological bones of the left upper limb and the left lower limb; the green part is the first biological bones of the right upper limb and the right lower limb; the magenta part is the first biological bones corresponding to the left fingers and the left toes; the bright yellow is the first biological bones corresponding to the right fingers and the right toes; several pyramid-shaped ordinary bones are also arranged above the neck, and the silver pyramid-shaped ordinary bones represent the hair attachments or protrusions on the body surface.
[0059] S3: Adjust the length of each biological bone according to the height of the character and whether there is a next adjacent biological bone.
[0060] The biological bones established according to the above content are not the actual height of the character, so it is necessary to scale the first biological bones and the second biological bones of different parts according to the actual height.
[0061] According to the standing posture of the character, give the height of the character, and then scale the biological bones at the ends of the bone model that do not have the next section of biological bone according to the height of the character.
[0062] For a humanoid character, let the height of the given character be H. Then, the length of the first biological bone of the head after scaling does not exceed H / 5, the total length of the upper limbs after corresponding scaling does not exceed H / 3, the total length of the lower limbs after corresponding scaling does not exceed H / 2, the total height of the lower limbs and the hip after corresponding scaling does not exceed H / 2, the total height of the lower limbs, the hip and the waist does not exceed 3H / 5, the length of the first biological bone of the neck after scaling does not exceed H / 11, and the total length of the head, the neck and the chest after corresponding scaling does not exceed H / 3.
[0063] For a quadruped character, if the weight is less than 200 kg or the height does not exceed 1.5 m, let the height of the given character be H. Then, the length of the first biological bone of the head after scaling does not exceed H / 5, the length of the first biological bone of the chest after scaling does not exceed H / 3, the length of the limbs after corresponding scaling does not exceed H / 2, and the total length of the hind limbs is greater than or equal to the length of the front limbs; the length of the first biological bone of the neck after scaling does not exceed H / 5, and the total length of the hip and the lower limbs after corresponding scaling does not exceed 0.9H; if the weight is greater than 200 kg or the height exceeds 1.5 m, let the height of the given character be H. Then, the length of the first biological bone of the head after scaling does not exceed H / 6, the length of the first biological bone of the chest after scaling does not exceed H / 4, the length of the limbs after corresponding scaling does not exceed H / 3, and the total length of the hind limbs is greater than or equal to the length of the front limbs; the length of the first biological bone of the neck after scaling does not exceed H / 8, and the total length of the hip and the lower limbs after corresponding scaling does not exceed 0.8H.
[0064] S4: According to the pose matrix of the corresponding biological bone in each frame of the character animation data, and since the animation data uses the same encoding method as the biological bone, adjust the corresponding biological bone in the bone model to the corresponding position to generate the biological bone image of each frame.
[0065] According to the position matrix of each frame of animation data, adjust the position information and rotation information of the current biological bone in the bone model to obtain the rotation information and position information of each biological bone in the world coordinate, and generate the bone animation file of the character; extract the animation information from the character animation data and write it into the bone animation file of the character.
[0066] In this embodiment, the established bone animation file is in the gltf format, and the gltf file is played in the form of 3d window webgl. The coordinate origin of the bone model is at the center position at the bottom of the model space. The position information and rotation information of each biological bone of the bone model in the world coordinate are written into the nodes node part of the bone animation file, and the animation information is written into the animation animation part of the bone animation file. Thus, the required bone image and animation are obtained.
[0067] On the other hand, the present invention provides a system for generating bones by matching animation data, which is used to implement the method for generating bones by matching animation data as described above, and includes
[0068] A biological bone generation module, which is used to establish the biological bones of a character, and the biological bones in different positions have unique encodings and the same length;
[0069] A bone model establishment module, which constructs a complete bone model of the character according to the number of biological bones in the character animation data and the displacement information with the next segment of biological bones;
[0070] A biological bone adjustment module, which adjusts the length of each biological bone according to the height of the character;
[0071] A biological bone image generation module, which is used to adjust the corresponding biological bones in the bone model to the corresponding positions according to the pose matrix of the corresponding biological bones in each frame of the character animation data, and generate the biological bone images of each frame.
[0072] The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating a skeleton by matching animation data, characterized in that, It includes the following steps: S1: Establish the biological skeleton of the character. The biological skeletons at different positions have unique encodings and the same initial length, but their shapes are not exactly the same; S2: Construct a complete skeleton model according to the number of biological skeletons in the character animation data and the displacement information of the next segment of the biological skeleton; S3: Adjust the length of each biological skeleton according to the height of the character and whether there is a next adjacent biological skeleton; S4: According to the pose matrix of the corresponding biological skeleton in each frame of the character animation data, and the animation data uses the same encoding method as the biological skeleton, adjust the corresponding biological skeleton in the skeleton model to the corresponding position to generate the biological skeleton image of each frame.
2. The method for generating a skeleton by matching animation data according to claim 1, wherein The establishment of the biological skeleton of the character described in step S1 specifically includes: making the first biological skeletons of different parts according to the appearance of the character, and the appearances of the first biological skeletons of different parts are not exactly the same; the character is divided into two categories: human body and quadruped animals. Establish several first biological skeletons for human body characters; establish the first biological skeleton and the second biological skeleton for quadruped animal characters.
3. A method for generating a skeleton by matching animation data according to claim 2, characterized in that, The biological skeletons at different positions described in step S1 have unique encodings and the same length. The first biological skeletons of the hip, waist, chest, neck and head are sequentially used as the common parts of the torso and encoded; For human body characters or quadruped animal characters, the left upper limb and the left lower limb are respectively defined on both sides of the chest. The left upper limb includes the first biological skeletons corresponding to the left shoulder, left upper arm, left forearm, left palm and left fingers arranged in sequence; the right upper limb includes the first biological skeletons corresponding to the right shoulder, right upper arm, right forearm, right palm and right fingers arranged in sequence; the left lower limb and the right lower limb are respectively defined on both sides of the end of the hip close to the ground. The left lower limb includes the first biological skeletons corresponding to the left thigh, left calf, left foot sole and left toes arranged in sequence; the right lower limb includes the first biological skeletons corresponding to the right thigh, right calf, right foot sole and right toes arranged in sequence; and each first biological skeleton is encoded; At the end of the hip of the quadruped animal character away from the waist, a tail is also provided, and the second biological skeleton is generated for the tail and encoded sequentially; the initial lengths of the first biological skeleton and the second biological skeleton are both the default unit length.
4. A method for generating a skeleton by matching animation data according to claim 3, characterized in that, The quadruped animal character also includes ordinary skeletons, and the ordinary skeletons are biological skeletons of the quadruped animal character that cannot be classified as the first biological skeleton and the second biological skeleton and have no specific parts.
5. A method for generating a skeleton by matching animation data according to claim 3, characterized in that The encoding of the biological skeleton is (a, b), where a is the part encoding information and b is the quantity encoding information; the first biological skeletons of the non-finger parts of the same limb connected to the chest, or the first biological skeletons of the non-toe parts of the same limb connected to the hip, have the same part encoding information; the first biological skeletons of different parts of the common part of the torso have different corresponding part encoding information.
6. A method for generating a skeleton by matching animation data according to claim 5, wherein The specific content of step S2 is as follows: Set the character in the initial pose; obtain the position information of each biological bone at the initial position and the position information of adjacent biological bones. Each biological bone is represented by a right-hand coordinate system matrix in the animation data, and extract the position information (x1, y1, z1) of one end of the current biological bone that is close to the previous biological bone from the right-hand coordinate system matrix; if the current biological bone has a next biological bone, and the position information of one end of the next biological bone close to the current biological bone is (x2, y2, z2), calculate the distance d between the current biological bone and the adjacent biological bone. Scale the unit length of the current biological bone to d; if the current biological bone has no next biological bone, estimate the length of the biological bone based on the height; after obtaining the lengths of the respective biological bones in the initial state, obtain the complete bone model.
7. A method for generating a skeleton by matching animation data according to claim 6, wherein, When the character is in the initial pose, for a human character, the human body is in an extended state, with the left and right upper limbs hanging naturally, the palms and finger pads facing the sides of the body, and the distance between the left and right lower limbs not exceeding the distance between the left and right upper limbs; or the left and right upper limbs are extended horizontally to both sides of the body with the palms and finger pads facing the ground direction, and the distance between the left and right lower limbs does not exceed the distance between the left and right upper limbs. For a quadruped character, keep the four limbs in an extended pose, with the first biological bone corresponding to the common part of the trunk located on the symmetry center plane of the quadruped, and the tail hanging naturally.
8. A method for generating a skeleton by matching animation data according to claim 6, characterized in that The content of step S3 is to, according to the standing pose of the character, assign the height of the character, and then scale the biological bones at the ends of the bone model that do not have the next section of biological bone according to the height of the character. For a human character, let the height of the given character be H. Then the scaled length of the first biological bone of the head does not exceed H / 5, the scaled length corresponding to the total length of the upper limbs does not exceed H / 3, the scaled length corresponding to the total length of the lower limbs does not exceed H / 2, the scaled length corresponding to the total height of the lower limbs and the hip does not exceed H / 2, the total height of the lower limbs, hip and waist does not exceed 3H / 5, the scaled length of the first biological bone of the neck does not exceed H / 11, and the scaled length corresponding to the total length of the head, neck and chest does not exceed H / 3. For a quadruped character, if the weight is less than 200 kg or the height does not exceed 1.5 m, let the height of the given character be H. Then the scaled length of the first biological bone of the head does not exceed H / 5, the scaled length of the first biological bone of the chest does not exceed H / 3, the scaled length corresponding to the limb length does not exceed H / 2, and the total length of the hind limbs is greater than or equal to the length of the front limbs; the scaled length of the first biological bone of the neck does not exceed H / 5, and the scaled length corresponding to the total length of the hip and lower limbs does not exceed 0.9H. If the weight is greater than 200 kg or the height exceeds 1.5 m, let the height of the given character be H. Then the scaled length of the first biological bone of the head does not exceed H / 6, the scaled length of the first biological bone of the chest does not exceed H / 4, the scaled length corresponding to the limb length does not exceed H / 3, and the total length of the hind limbs is greater than or equal to the length of the front limbs; the scaled length of the first biological bone of the neck does not exceed H / 8, and the scaled length corresponding to the total length of the hip and lower limbs does not exceed 0.8H.
9. A method for generating a skeleton by matching animation data according to claim 8, wherein, The content of step S4 is to, according to the position matrix of each frame of animation data, adjust the position information and rotation information of the current biological bone in the bone model to obtain the rotation information and position information of each biological bone in the world coordinates, and generate the bone animation file of the character. Extract the animation information from the character animation data and write it into the bone animation file of the character.
10. A system for generating bones by matching animation data, which is used to implement a method for generating bones by matching animation data according to any one of claims 1-9, characterized in that, Including a biological bone generation module for establishing the biological bones of the character, where the biological bones in different positions have unique encodings and the same length; a bone model establishment module for constructing a complete bone model of the character according to the number of biological bones and the displacement information with the next section of biological bone in the character animation data; a biological bone adjustment module for adjusting the length of each biological bone according to the height of the character. A biological skeleton image generation module, which is used to adjust the corresponding biological skeleton in the skeleton model to the corresponding position according to the pose matrix of the biological skeleton in each frame of character animation data, and generate the biological skeleton image of each frame.
Citation Information
Cited By
Performance optimization method based on UE5 modular role
CN120953451A
A performance optimization method based on UE5 modular roles
CN120953451B
