A profiling method, device, and storage medium
By obtaining model bones and creating measurement systems, generating repair targets, and using blueprint functions to drive joint repair in real time, the problem that characters in the existing technology cannot preview the repair effect in Unreal Engine in real time is solved, simplifying the operation process and improving efficiency.
Patent Information
- Application Number
- CN202210120947.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-02-09
AI Technical Summary
In the prior art, characters cannot preview the joint repair effect in Unreal Engine in real time, and manual driver repair operation is cumbersome, inefficient, and not standardized.
By obtaining the bones of the model to be repaired, creating a measurement bone and locator system, generating a repair target, and using the Blueprint function to drive joint repair in real time, real-time driving joint repair in Unreal Engine when recording motion capture.
It simplifies the operation process of creating and setting driver repairs in Maya, realizes real-time driving character joints in Unreal Engine when recording motion capture, and improves the standardization and efficiency of workflows.
Smart Images

Figure CN114445530B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computers, and particularly relates to a shaping method, device, and storage medium. Background Art
[0002] When performing motion capture of a 3D character, when previewed through the Unreal Engine (a real-time 3D creation tool, abbreviated as UE), when certain joint parts of the character's body (such as shoulders, elbows, wrists, fingers, knees, ankles, etc.) are rotated to a certain angle, the shape does not achieve the ideal effect. Since the character assets imported into UE are meshes bound with bones, when the character makes movements, the deformation generated only by the bones controlling the mesh cannot achieve the ideal muscle effect.
[0003] To solve this problem, we will rotate the joint bones of the model to a specified angle in Autodesk Maya (a 3D modeling software, abbreviated as Maya). In this form, modify the shape of its joint parts (usually referred to as "shaping"), create the correct deformation effect of the joint, and then let the bones of the joint set driving keyframes for the shaping. That is, when the bones are rotated to the specified angle, the joints of the character model will become the shaped shape. After completing the driving of the shaping, then input the bone animation data generated by the motion capture onto the bones of the bound character model. When the character makes movements, drive the shaping and set keyframe animation for the shaping. Finally, export the character model file with shaping and the animation data to UE to preview the final effect.
[0004] In the existing solution, the shaping of the character can only be driven offline, and the shaping effect of the joints cannot be previewed in UE during the process of motion capture. And the operation of manually setting the driving shaping is relatively cumbersome and has low efficiency. If there are too many shapings and the shapings are not named according to specifications, it will be inconvenient to view and organize. Summary of the Invention
[0005] The purpose of the present invention is to solve the problems mentioned in the background art, and propose a shaping method, device, and storage medium.
[0006] To achieve the above purpose, the present invention first proposes a shaping method, including the following steps: obtaining the bones bound to the model to be shaped; creating a shaping target according to the rotation axis and angle of the joint bones to be set; creating a combined shaping for joint shaping; creating a blueprint function for driving the shaping and the corresponding blueprint; and executing the blueprint during the recording of motion capture to achieve real-time driving of joint shaping.
[0007] Optionally, creating a shaping target according to the rotation axis and angle of the set joint bone includes the following steps: generating a set of measurement bones based on the joint bone and three sets of locators matching the measurement bones, where the first set of locators are respectively located in the six axial directions of the joint and fixed relative to the joint, the second set of locators are respectively located at the measurement bones and their rotation and displacement follow the changes of the measurement bones, and the third set of locators are located at the joint and their displacement follows the changes of the measurement bones; judging the rotation axis and positive and negative directions of the joint bone by measuring the first included angle, where the first included angle is the included angle between the third set of locators and the first set of locators; mapping the first included angles in the six axes to a sequence of 1 or 0 according to the rotation axis, where 1 indicates rotation in this axis and 0 indicates no rotation in this axis; multiplying the second included angle by the sequence to obtain the corresponding shaping attribute value, where the second included angle is the included angle between the second set of locators and the first set of locators located on the positive x-axis and positive z-axis.
[0008] Optionally, when the included angle between the third set of locators and the first set of locators in a certain axis is 90°, then this axis is not the rotation axis of the joint bone. When the included angle between the third set of locators and the first set of locators in a certain axis is 0° or 180°, then this axis is the rotation axis of the joint bone, and 0° is rotation along the positive direction and 180° is rotation along the negative direction.
[0009] Optionally, creating a combined shaping of joint shaping includes the following steps: mapping the driving range of the shaping to be combined to between 0 and 1, then multiplying, then calculating the square root of the product, and finally outputting it to the attribute value of the combined shaping.
[0010] Optionally, when there are n shapings to be combined, first map the driving ranges of the shapings to be combined to between 0 and 1, then multiply them in sequence, and then calculate the nth root of the product to create a combined shaping of joint shaping.
[0011] Optionally, the blueprint function receives shaping variables to drive the shaping, and the shaping variables include bone-driven shaping data and combined shaping data.
[0012] Optionally, the shaping target is named according to the joint name and rotation axis.
[0013] The present invention also proposes a shaping device, including: a bone acquisition module configured to acquire the bones bound to the model to be shaped; a shaping target module configured to create a shaping target according to the rotation axis and angle of the set joint bone; a combined shaping module configured to create a combined shaping of joint shaping; a blueprint creation module configured to create a blueprint function for driving the shaping and the corresponding blueprint; and a real-time driving module configured to execute the blueprint during recording of motion capture to achieve real-time driving of joint shaping.
[0014] Optionally, the modification target module further includes: a first measurement module configured to generate a set of measurement bones and three sets of locators matching the measurement bones according to the joint bones, wherein the first set of locators are respectively located in six axial directions of the joint and are fixed relative to the joint, the second set of locators are respectively located at the measurement bones and their rotation and displacement follow the changes of the measurement bones, and the third set of locators are located at the joint and their displacement follows the changes of the measurement bones; a second measurement module configured to determine the rotation axis and positive / negative direction of the joint bones by measuring a first angle, where the first angle is the angle between the third set of locators and the first set of locators; a mapping module configured to map the first angles in six axial directions into a sequence of 1 or 0 according to the rotation axis, where 1 indicates rotation in this axis and 0 indicates no rotation in this axis; an attribute value module configured to multiply a second angle by the sequence to obtain a corresponding modification attribute value, where the second angle is the angle between the second set of locators and the first set of locators located on the positive x-axis and positive z-axis.
[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the above modification method is implemented.
[0016] Advantages of the present invention:
[0017] A modification method, device and storage medium according to an embodiment of the present invention obtain the rotation angle of a driving joint through a system for measuring angles and axes, and automatically create a driving modification using this system. This not only simplifies the operation process of creating, setting and merging driving modifications in maya, making the work process production standardized. Moreover, it can also transplant the driving modification data information set in maya to UE and automatically convert it into a functional method suitable for UE, realizing real-time driving of the modification of the character joints in UE during the recording of motion capture.
[0018] The features and advantages of the present invention will be described in detail through embodiments in conjunction with the drawings. Description of the Drawings
[0019] Figure 1 It is a schematic flowchart of a modification method according to an embodiment of the present invention;
[0020] Figure 2 It is a schematic diagram of an angle measurement system for a modification method according to an embodiment of the present invention;
[0021] Figure 3 It is a schematic flowchart of a modification method according to an embodiment of the present invention;
[0022] Figure 4 It is a schematic block diagram of a modification device according to an embodiment of the present invention;
[0023] Figure 5This is the second structural block diagram of a shaping device according to an embodiment of the present invention. Detailed implementation manners
[0024] For the convenience of those skilled in the art, the present invention will be further described in detail below in conjunction with specific embodiments.
[0025] Figure 1 Schematically shows a flow diagram of a shaping method according to an embodiment of the present invention. As Figure 1 shown, the shaping method includes steps S10 to S50:
[0026] Step S10, obtaining the bones bound to the model to be shaped;
[0027] Step S20, creating a shaping target according to the rotation axis and angle of the joint bones to be set;
[0028] Step S30, creating a combined shaping for joint shaping;
[0029] Step S40, creating a blueprint function for driving shaping and the corresponding blueprint;
[0030] Step S50, executing the blueprint during the recording of motion capture to achieve real-time driving of joint shaping.
[0031] A shaping method according to an embodiment of the present invention, through a system for measuring angles and axes, obtains the rotation angles of the driving joints, and automatically creates a driving shaping with this system. This not only simplifies the operation process of creating and setting driving shaping and combined shaping in maya, making the work process production standardized. Moreover, it can also transplant the driving shaping data information set in maya to UE and automatically convert it into a functional method suitable for UE, realizing real-time driving of the shaping of character joints in UE during the recording of motion capture.
[0032] Next, each step of the shaping method in the embodiment of the present invention will be described in more detail in conjunction with the drawings and embodiments.
[0033] Step S10, obtaining the bones bound to the model to be shaped.
[0034] Specifically, after the character model binding is completed, select the model or model group that needs to be shaped, obtain all the bones bound to this model, and list them in the tool window according to the hierarchical relationship, which is similar to the outline list, but the secondary bones can be set to be displayed or hidden. After hiding the secondary bones, only the bone joints that usually need to be shaped will be displayed in the window list (the thigh, knee, ankle, toe, spine, chest, neck, scapula, shoulder, elbow, wrist on both the left and right sides, and each bent finger joint).
[0035] Step S20: Create a shaping target according to the rotation axis and angle of the set joint bone.
[0036] In one embodiment, first set the required rotation axis and angle for the selected bone, and then create a shaping target according to the rotation axis and angle of the set joint bone.
[0037] In the prior art, the method of manually creating and setting driving keyframes only uses the bone as the driver and the shaping target as the driven. For example, when the joint rotates 60°, it drives the shaping. Then, when the joint rotation angle is 0°, add a driving keyframe to represent the shaping being closed; when the joint rotates 60°, add a driving keyframe to represent the shaping being open. The role of the driving keyframe is to drive the opening and closing of the shaping.
[0038] The implementation principle of a shaping method of the present invention is different from that of the prior art. In one embodiment, after setting the rotation axis and angle of the joint bone, a small system for measuring the angle is created separately for the joint bone.
[0039] Please refer to Figure 2 , this small system for measuring the angle has positive (Pos) and negative (Neg) rotation x, y, z axes, which are abbreviated as Nx, Ny, Nz, Px, Py, Pz respectively. And it includes a set of measurement bones constrained by the joint and three groups of locators, which will be created at the same position as the driving bone while setting the driving joint bone. The two bone directions are respectively towards the x-axis and y-axis of the joint.
[0040] Please refer to Figure 3 , creating a shaping target through the above-mentioned small system for measuring the angle includes the following steps:
[0041] Step S210: Generate a set of measurement bones and three groups of locators matching the measurement bones according to the joint bone.
[0042] Please refer to Figure 2 , the first group is six locators respectively located in the six axial directions of the joint and fixed relative to the joint for reference positioning. The second group is two locators respectively created at two bone positions and whose rotation and displacement follow the bone changes. The third group is one locator located at the joint and whose displacement follows the change of the measurement bone. The third group of locators will translate along the axial direction of the bone rotation. For example, if the bone rotates positively along the z-axis, this locator will also move positively along the z-axis.
[0043] Step S220: Judge the rotation axis and positive / negative direction of the joint bone by measuring the first included angle, where the first included angle is the included angle between the third group of locators and the first group of locators.
[0044] Specifically, when the angle between the third set of locators and the first set of locators in a certain axial direction is 90°, then this axial direction is not the rotational axial direction of the joint bone. When the angle between the third set of locators and the first set of locators in a certain axial direction is 0° or 180°, then this axial direction is the rotational axial direction of the joint bone, and 0° represents rotation in the positive direction, while 180° represents rotation in the negative direction.
[0045] Step S230, map the first angles of the six axial directions to a sequence of 1 or 0 according to the rotational axial direction, where 1 indicates rotation in this axial direction and 0 indicates no rotation in this axial direction.
[0046] For the convenience of calculation, the measured angles are processed by mapping them within the range of 0° to 90°. The resulting values are only 0° or 90°. Divide this value by 90° to get 0 or 1, and then reverse the value (obtained by subtracting it from 1).
[0047] Step S240, multiply the second angle by the said sequence to obtain the corresponding modification attribute values of Nx, Ny, Nz, Px, Py, and Pz. The modification attribute values drive the modification targets of the corresponding axial directions. The second angle is the angle between the second set of locators and the first set of locators on the positive x-axis and positive z-axis.
[0048] Step S30, create a combined modification for joint modification.
[0049] Specifically, when there are two modifications to be combined, map the driving ranges of the modifications to be combined to between 0 and 1, then multiply them, and then calculate the square root of the product, and finally output it as the attribute value of the combined modification. In an embodiment, when there are n modifications to be combined, first map the driving ranges of the modifications to be combined to between 0 and 1, then multiply them in sequence, and then calculate the nth root of the product to create a combined modification for joint modification.
[0050] Through the above steps, when the joint morphology of the mesh body does not achieve the desired effect after two or more modifications with different axial directions and rotational angles under the same joint bone are simultaneously driven, the corresponding morphology adjustment function can be realized.
[0051] Step S40, create a blueprint function for driving the modification and the corresponding blueprint.
[0052] Since the real-time driving is finally implemented in UE, it is necessary to create a blueprint function for driving the modification and the corresponding blueprint in UE.
[0053] Among them, several exposed variables are set in the blueprint function. The modification variables include skeleton-driven modification data and merging modification data. The skeleton-driven modification data includes a skeleton mesh, a driving joint, a reference skeleton, the maximum and minimum values of the driving angle range of the driving joint, and modification targets for six axes. The merging modification data includes the names of the modification targets to be merged, the maximum and minimum values of the driving ranges of the targets, and the name of the merged modification target. Subsequently, the modification data in Maya will be input into the corresponding variables to call the function's functionality.
[0054] The blueprint function creates a bone at the same level as the modified joint as the reference bone. Its rotation is 0° and it is constrained by the displacement of the modified joint. The blueprint function measures the angles between this bone and the modified joint on the X, Y, and Z axes respectively and determines the positive and negative. At the same time, the blueprint function drives the modification target according to the input rotation angle. If it is positive, the modification target on the positive axis is selected; otherwise, the negative axis is selected. If the angle of a certain axis is 0°, it means that the joint has not rotated on this axis and the modification is not driven.
[0055] In this application scenario, different characters have different driving modification data, but the called blueprint function is always the same. Only the variables in the function can be replaced with the data of the corresponding characters. The function method can be called repeatedly. If there are many groups of different variable values and the calculation logic methods are the same, only the same function method needs to be called and the variable values in the method are replaced, which effectively saves time and resources.
[0056] Step S50, execute the blueprint during the recording of motion capture to achieve real-time driving of joint modification.
[0057] The template code for creating the blueprint is pre-written according to the logic of implementing driving modification, which includes statements for creating each node and connecting the nodes logically.
[0058] Statements for calling the blueprint function are written in the template code, and the extracted data information is input into the corresponding variables of the blueprint function to drive the modification. Each group of different modification data needs to call the function method once. Functional nodes related to this information are created and connected logically to achieve the function of driving merged modification.
[0059] After copying the template code to the blueprint editor of UE, a connected blueprint with modification setting data will be automatically created according to the code content. When the blueprint is executed during the recording of motion capture, the joint modification will be driven as the joint rotates, achieving the same effect as in Maya.
[0060] Based on the above modification method, an embodiment of the present invention also provides a modification device, as Figure 4 shown. The device includes the following modules:
[0061] The bone acquisition module 100 is configured to acquire the bones bound to the model to be modified;
[0062] The modification target module 200 is configured to create a modification target according to the rotation axis and angle of the joint bones set;
[0063] The combined modification module 300 is configured to create a combined modification for joint modification;
[0064] The blueprint creation module 400 is configured to create a blueprint function for driving the modification and the corresponding blueprint;
[0065] The real-time driving module 500 is configured to execute the blueprint during recording of motion capture to achieve real-time driving of joint modification.
[0066] As Figure 5 shown, in one embodiment, the modification target module further includes:
[0067] The first measurement module 2100 is configured to generate a set of measurement bones and three sets of locators matching the measurement bones according to the joint bones, wherein the first set of locators are respectively located in six axial directions of the joint and are fixed relative to the joint, the second set of locators are respectively located at the measurement bones and their rotation and displacement follow the change of the measurement bones, and the third set of locators are located at the joint and their displacement follows the change of the measurement bones;
[0068] The second measurement module 2200 is configured to judge the rotation axis and positive and negative directions of the joint bones by measuring a first included angle, and the first included angle is the included angle between the third set of locators and the first set of locators;
[0069] The mapping module 2300 is configured to map the first included angles in six axial directions into a sequence of 1 or 0 according to the rotation axis, where 1 indicates rotation in this axial direction and 0 indicates no rotation in this axial direction;
[0070] The attribute value module 2400 is configured to multiply the second included angle by the sequence to obtain the corresponding modification attribute value, and the second included angle is the included angle between the second set of locators and the first set of locators located on the positive x-axis and positive z-axis.
[0071] In summary, a modification device according to an embodiment of the present invention can be implemented in the form of a program and run on a computer device. Each program module constituting the modification device can be stored in the memory of the computer device. For example, Figure 4 the bone acquisition module 100, the modification target module 200, the combined modification module 300, the blueprint creation module 400, and the real-time driving module 500 shown. The program constituted by each program module enables the processor to execute the steps in a modification method according to various embodiments of the present application described in this specification.
[0072] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps in a modification method of various embodiments of the present application are implemented.
[0073] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0074] The above embodiments are illustrative of the present invention and not restrictive. Any solution obtained by simply transforming the present invention belongs to the protection scope of the present invention. The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A profiling method, characterized in that, It includes the following steps: Obtain the skeleton bound to the model to be modified; Create a modification target according to the rotation axis and angle of the joint skeleton to be set; Create a combined modification for joint modification; Create a blueprint function for driving the modification and the corresponding blueprint; Execute the blueprint during recording of motion capture to achieve real-time driving of joint modification; The step of creating a modification target according to the rotation axis and angle of the joint skeleton to be set includes the following steps: Generate a set of measurement skeletons and three sets of locators matching the measurement skeletons according to the joint skeleton, where the first set of locators are respectively located in six axial directions of the joint and are fixed relative to the joint, the second set of locators are respectively located at the measurement skeletons and their rotation and displacement follow the change of the measurement skeletons, and the third set of locators are located at the joint and their displacement follows the change of the measurement skeletons; Judge the rotation axis and positive and negative directions of the joint skeleton by measuring the first included angle, where the first included angle is the included angle between the third set of locators and the first set of locators; Map the first included angles in six axial directions to a sequence of 1 or 0 according to the rotation axis, where 1 indicates rotation in this axis and 0 indicates no rotation in this axis; Multiply the second included angle by the sequence to obtain the corresponding modification attribute value, where the second included angle is the included angle between the second set of locators and the first set of locators located on the positive x-axis and positive z-axis; 2. The profiling method according to claim 1, wherein When the included angle between the third set of locators and the first set of locators in a certain axis is 90°, then this axis is not the rotation axis of the joint skeleton. When the included angle between the third set of locators and the first set of locators in a certain axis is 0° or 180°, then this axis is the rotation axis of the joint skeleton, and 0° is rotation in the positive direction and 180° is rotation in the negative direction; 3. The profiling method according to claim 1, characterized in that The step of creating a combined modification for joint modification includes the following steps: Map the driving range of the modification to be combined to between 0 and 1, then multiply, then calculate the square root of the product, and finally output it to the attribute value of the combined modification; 4. The profiling method according to claim 1, characterized in that, When there are n modifications to be combined, first map the driving ranges of the modifications to be combined to between 0 and 1, then multiply them in sequence, and then calculate the nth root of the product to create a combined modification for joint modification; 5. The profiling method according to claim 1, characterized in that, The blueprint function receives modification variables to drive the modification, and the modification variables include skeleton-driven modification data and combined modification data; 6. The profiling method according to claim 1, characterized in that The modification target is named according to the joint name and rotation axis; 7. A profiling device, characterized in that, It includes: A skeleton acquisition module configured to obtain the skeleton bound to the model to be modified; A modification target module configured to create a modification target according to the rotation axis and angle of the joint skeleton to be set; A combined modification module configured to create a combined modification for joint modification; A blueprint creation module configured to create a blueprint function for driving the modification and the corresponding blueprint; A real-time driving module configured to execute the blueprint during recording of motion capture to achieve real-time driving of joint modification; The modification target module further includes: A first measurement module configured to generate a set of measurement skeletons and three sets of locators matching the measurement skeletons according to the joint skeleton, where the first set of locators are respectively located in six axial directions of the joint and are fixed relative to the joint, the second set of locators are respectively located at the measurement skeletons and their rotation and displacement follow the change of the measurement skeletons, and the third set of locators are located at the joint and their displacement follows the change of the measurement skeletons; A second measurement module, configured to determine the rotation axis and positive / negative directions of the joint bone by measuring a first included angle, where the first included angle is the included angle between a third set of locators and a first set of locators; A mapping module, configured to map the first included angles in six axes to a sequence of 1 or 0 according to the rotation axis, where 1 indicates rotation in that axis and 0 indicates no rotation in that axis; An attribute value module, configured to multiply the second included angle by the sequence to obtain a corresponding modification attribute value, where the second included angle is the included angle between a second set of locators and the first set of locators located on the positive x-axis and the positive z-axis.
8. A computer-readable storage medium, having stored thereon a computer program, which when executed by a processor implements the modification method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Animation model role binding method and system based on Maya software
CN107657650A