Method, device, equipment and medium for controlling secondary bone
By setting control curves for the soft body model and constraining the relative orientation of key bones in the secondary skeletal chain to remain unchanged with respect to control points, the problems of limb interlacing and abnormal shape in the animation of flexible objects are solved, and efficient animation production is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU BOGUAN TELECOMM TECH LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies often suffer from problems such as limb overlap and abnormal shape when generating animations of flexible objects, leading to complex manual corrections that are inefficient and contrary to intuition.
By setting a first control curve for the soft body model and constraining the key bones of the secondary skeletal chain to maintain a constant relative orientation with the control points in the control curve, the rotation of the key bones of the secondary skeletal chain is controlled using target rotation parameters to ensure that they follow the movement of the character model.
It effectively avoids the problem of character models passing through soft body models, reduces the animation production cycle, lowers production costs, and is applicable to soft body models such as clothing and ribbons of different styles.
Smart Images

Figure CN122199754A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to methods, devices, equipment, and media for controlling secondary skeletons. Background Technology
[0002] To simulate flexible objects such as skirts, ribbons, and ornaments, it is generally necessary to set up secondary skeletal chains for these objects. These chains can achieve natural dynamic expressions through fabric or physics calculations. However, while current mainstream skeletal calculation methods can generate natural swaying animations, various factors can cause limbs to protrude from gaps, resulting in interlacing, abnormal shapes, and other problems, necessitating complex post-processing corrections. Summary of the Invention
[0003] In view of this, this application provides a method, apparatus, device and medium for controlling secondary skeletons to solve the problem of clipping through soft body models.
[0004] In a first aspect, this application provides a method for controlling secondary bone formation, comprising: For each secondary skeletal chain of the soft body model, determine the reference bone in each of the secondary skeletal chains; A first control curve is set for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each of the secondary skeletal chains; For each first control point, when the position of the first control point is updated, the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point are determined; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point. The key bones of the secondary skeletal chain are rotated according to the target rotation parameters.
[0005] Secondly, this application provides a control device for secondary skeleton, comprising: The skeleton determination module is used to determine the reference bones in each of the secondary skeleton chains of the soft body model. The setting module is used to set a first control curve for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each of the secondary skeletal chains; The processing module is used to determine the target rotation parameters of the key bones of the secondary skeletal chain corresponding to each first control point when the position of the first control point is updated; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point. An adjustment module is used to control the rotation of key bones in the secondary skeletal chain according to the target rotation parameters.
[0006] Thirdly, this application provides a computer 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 secondary skeleton control method of the first aspect or any corresponding embodiment described above.
[0007] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the secondary skeleton control method of the first aspect or any corresponding embodiment described above.
[0008] Fifthly, this application provides a computer program product, including computer instructions for causing a computer to execute the secondary skeleton control method described in the first aspect or any corresponding embodiment.
[0009] The secondary skeleton control method provided in this application sets a first control curve for the character model based on reference bones in each secondary skeleton chain, and constrains the relative orientation of key bones in the secondary skeleton chain to the corresponding control points in the first control curve, so that the secondary skeleton chain can move reasonably following the movement of the character model, realizing the motion linkage between the soft body model and the character model, and minimizing the problem of the character model passing through the soft body model. This method is applicable to soft body models of different styles of clothing, ribbons, etc., with a wide range of applications. While reducing the model clipping problem, it can effectively shorten the production cycle of soft body model animation and reduce production costs. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application; Figure 2 This is a schematic flowchart of a first method for controlling secondary skeletons according to an embodiment of this application; Figure 3 This is a schematic diagram of a model skeleton according to an embodiment of this application; Figure 4 This is a second flowchart illustrating the control method for secondary skeletons according to an embodiment of this application; Figure 5 This is a schematic diagram illustrating the determination of a minimum distance according to an embodiment of this application; Figure 6 This is a schematic diagram illustrating the creation of a virtual root skeleton according to an embodiment of this application; Figure 7 This is a schematic diagram illustrating the creation of a second control curve according to an embodiment of this application; Figure 8 This is a schematic diagram illustrating the creation of a third control curve according to an embodiment of this application; Figure 9 This is a schematic diagram illustrating the adjustment of bone position via a controller according to an embodiment of this application; Figure 10 This is a structural block diagram of a secondary skeleton control device according to an embodiment of this application; Figure 11 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0014] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0015] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0016] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0017] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0018] 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. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0019] As one optional application scenario in the embodiments of this application, such as Figure 1 As shown, application 101 is installed in terminal device 110, and user 130 can interact with application 101 through terminal device 110 and / or access device of terminal device 110.
[0020] For example, application 101 can be arbitrary; for instance, application 101 can be an application that generates 3D animations. Figure 1 In the application scenario shown, if application 101 is active, the terminal device 110 can display the interface 102 of application 101. The interface 102 may include various pages that application 101 can provide, such as interactive pages, settings pages, query pages, etc.
[0021] In some embodiments, terminal device 110 is communicatively connected to server 120 to provide services to application 101. Terminal device 110 may be a mobile terminal, fixed terminal, or portable terminal, etc., including but not limited to mobile phones, desktop computers, laptop computers, multimedia tablets, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. In some embodiments, terminal device 110 may also support any type of interface, and server 120 may be various types of computing systems or servers capable of providing computing power, including but not limited to mainframes, edge computing nodes, computing devices in cloud environments, etc.
[0022] It should be noted that, Figure 1 This is merely an example of an application scenario and does not limit the scope of protection of this application. The embodiments of this application will be described below with reference to the accompanying drawings.
[0023] The complete animation production of equipment and ribbons involves three parts: ribbon rigging, animation decoding, and adjustments. After the ribbon model is rigged with a secondary skeletal chain, a natural swinging animation can be generated using skeletal decoding plugins (such as SpringMagic or Overlapper). However, after decoding, due to the lack of lateral constraints and lateral collisions, problems such as limb interlocking and abnormal shapes may occur, thus requiring adjustments.
[0024] Adjustment is the core step in achieving the ribbon effect, requiring a significant amount of time to adjust and refine the areas where the ribbon has passed through. When attempting to repair the pass through by dragging secondary bones, in forward dynamics mode, an animation layer is superimposed on top of the solved animation layer, and at least three bone segments are rotated to prevent excessive distortion of the ribbon's shape. This manual correction method is inefficient and counterintuitive, but in reality, most ribbon animation repairs are performed using this method.
[0025] Some related solutions attempt to reduce the adjustment burden before solution processing. For example: 1. RBF (Radial Basis Function) Pose Interpolation: The secondary skeleton poses are preset for different states, and the secondary skeleton interpolation is driven by the features of the main skeleton. The drawback is that it is highly dependent on specific binding structures and is difficult to reuse (e.g., umbrella skirts and tube skirt ribbons).
[0026] 2. Body pre-collision methods: Establishing spatial triggering relationships between limbs and secondary bones is used to avoid collisions in advance. However, long skirts involve lower leg movement, and pre-collision makes it difficult to establish a mathematical relationship between the lower leg and the ribbon, so this method is not suitable for long skirt ribbons.
[0027] 3. Vertex cloth reverse anchoring skeleton: The method of simulating cloth mesh vertices to reverse-drive the skeletal chain is relatively rare. It introduces structural problems such as bone stretching and model distortion; at the same time, this method requires a certain bone resolution to maintain stable results.
[0028] The secondary skeleton control method provided in this application sets a first control curve for the character model based on the reference bones in each secondary skeleton chain, and constrains the relative orientation of the key bones of the secondary skeleton chain and the corresponding control points in the first control curve to remain unchanged, so that the secondary skeleton chain can move reasonably following the movement of the character model and avoid the problem of the character model passing through the soft body model as much as possible.
[0029] According to an embodiment of this application, a method for controlling secondary skeleton 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.
[0030] This embodiment provides a method for controlling secondary skeletons, which can be used in the aforementioned terminal device. Figure 2 This is a flowchart of a secondary skeleton control method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps.
[0031] Step S201: For each secondary skeletal chain of the soft body model, determine the reference bone in each secondary skeletal chain.
[0032] In this embodiment, a model corresponding to a flexible object, i.e., a soft body model, is generally provided on the outer layer of the character model. This soft body model can be, for example, a model of a flexible object such as clothing, skirt, or ribbon. The character model (e.g., a person) itself has a certain body skeleton (or main skeleton); and in order to better simulate the movement of the flexible object following the character, a corresponding skeletal chain, i.e., a secondary skeletal chain, is set for the soft body model.
[0033] Secondary skeletal chains are chain-like skeletons, typically comprising multiple bones. One of these bones can be selected as a reference bone, depending on the specific requirements. If the soft body model includes multiple secondary skeletal chains, a reference bone for each chain can be determined.
[0034] In this embodiment, a reference bone can be selected based on whether clipping issues are likely to occur. Specifically, key locations (such as key nodes) where clipping has already occurred in the main bone chain of the character model can be identified first, and the bone in the secondary bone chain closest to that key location can be used as the reference bone.
[0035] Figure 3 A schematic diagram of the model skeleton is shown, such as Figure 3 As shown, the character model has a main skeletal chain 301, which includes multiple bones ( Figure 3 (Only one bone from the main skeletal chain is shown in the image). The soft body model surrounding the character model includes two secondary skeletal chains, namely secondary skeletal chain 302 and secondary skeletal chain 303, and each secondary skeletal chain includes four bones. If the soft body model corresponds to the skirt, then the main skeletal chain 301 corresponds to the leg bones, and the two secondary skeletal chains are the skirt's skeletal chains. Since clipping issues are prone to occur at the knee position, the bones near the knee can be used as reference bones.
[0036] refer to Figure 3 If main skeleton chain 301 represents the thigh bone of the character model, then Figure 3 The lowest point of the main skeletal chain 301 is at the knee position, therefore, the corresponding bones in the two secondary skeletal chains can be used as reference bones. For example... Figure 3 As shown, reference bone 3021 and reference bone 3031 can be identified.
[0037] Step S202: Set a first control curve for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each secondary skeletal chain.
[0038] In this embodiment, for the character model corresponding to the soft body model, a corresponding control curve is set for the character model. For ease of description, this control curve is referred to as the first control curve. The first control curve includes multiple control points, i.e., first control points, and each first control point corresponds to a reference bone in each secondary skeletal chain.
[0039] For example, in the initial state (e.g., when the character model is stationary), each first control point can coincide with the corresponding reference skeleton. It can be understood that the first control curve can be a closed curve around the key positions of the character model.
[0040] The first control curve is a control curve corresponding to the character model, and it changes as the character model moves. Specifically, the position of each first control point can be updated based on the motion data of each bone in the main skeleton chain of the character model.
[0041] Optionally, the position of each first control point can be updated based on the LBS (Linear Blend Skinning) algorithm principle.
[0042] Specifically, the final transformation matrix of the i-th point can be calculated, thus allowing the transformation to be performed based on the positions of each control point. Calculate the final position To achieve location update: .
[0043] Where j represents the joint index, and there are a total of N joints; This represents the weight of the j-th joint relative to the i-th point (e.g., 0.7 from the knee, 0.3 from the thigh, etc.). For skinning matrix, and , which represents the position matrix corresponding to the transformation from the binding state to the current skeleton pose; To bind the global matrix of joint j under the pose, Let be the global matrix of joint j in the current pose.
[0044] Step S203: For each first control point, when the position of the first control point is updated, determine the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point.
[0045] In this embodiment, at least one bone in the secondary skeletal chain is designated as a critical bone. Since the root bone of the secondary skeletal chain has a significant impact on the overall movement of the secondary skeletal chain, it is generally recommended to designate at least the root bone of the secondary skeletal chain as a critical bone.
[0046] As shown above, when the character model moves, the positions of at least some of the first control points will be updated. In this embodiment, the key bones of the secondary skeletal chain are constrained based on the positions of the first control points.
[0047] Specifically, for any first control point, a change in its position may affect one or more corresponding secondary skeletal chains, and consequently, the critical bones of these secondary skeletal chains. In this case, the critical bone can be adaptively rotated to ensure that its relative orientation to the first control point remains unchanged. For example, the critical bone may always face the first control point in a certain direction.
[0048] Based on the position of the first control point before and after the change, it is possible to determine how to rotate the key bones of the secondary skeletal chain, that is, to calculate the parameters used to rotate the key bones, i.e., the target rotation parameters.
[0049] Step S204: Control the key bones of the secondary skeletal chain to rotate according to the target rotation parameters.
[0050] In this embodiment, after determining the target rotation parameters, the key bones of the secondary skeletal chain can be rotated according to these parameters to ensure that the key bones rotate at appropriate angles. After rotation according to the target parameters, the relative orientation between the key bones and the first control point remains unchanged; for example, the key bones still face the corresponding first control point. In other words, after the character model moves, because the first control point adapts and the key bones of the secondary skeletal chain still face the changed first control point, the key bones of the secondary skeletal chain can maintain a relatively good pose. Under FK (forward dynamics) control, each secondary bone of the secondary skeletal chain can rotate sequentially from the root bone to the terminal bone, allowing the secondary skeletal chain to move reasonably following the character model's movement and minimizing the problem of the character model passing through the soft body model.
[0051] The secondary skeleton control method provided in this embodiment sets a first control curve for the character model based on reference bones in each secondary skeleton chain, and constrains the relative orientation of key bones in the secondary skeleton chain to the corresponding control points in the first control curve, so that the secondary skeleton chain can move reasonably following the movement of the character model, realizing the motion linkage between the soft body model and the character model, and minimizing the problem of the character model passing through the soft body model. This method is applicable to soft body models of different styles of clothing, ribbons, etc., has a wide range of applications, and while reducing the model clipping problem, it can effectively shorten the production cycle of soft body model animation and reduce production costs.
[0052] This embodiment provides a method for controlling secondary skeletons, which can be used in the aforementioned terminal device. Figure 4 This is a flowchart of a secondary skeleton control method according to an embodiment of this application, such as... Figure 4 As shown, the process includes the following steps.
[0053] Step S401: For each secondary skeletal chain of the soft body model, determine the reference bone in each secondary skeletal chain.
[0054] Please see details Figure 2 Step S201 of the illustrated embodiment will not be described again here.
[0055] Step S402: Set a first control curve for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each secondary skeletal chain.
[0056] Please see details Figure 2 Step S202 of the illustrated embodiment will not be described again here.
[0057] Step S403: For each first control point, when the position of the first control point is updated, determine the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point.
[0058] Specifically, step S403, "determining the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point", may include steps S4031 to S4033.
[0059] Step S4031: Determine the adjustment coefficient corresponding to the reference bone based on the relative position between the reference bone and the body bones of the character model.
[0060] In this embodiment, for the reference bone of the secondary skeletal chain, its relative position with the body bones of the character model can be determined. The farther the relative position between the two is, the lower the possibility of the character model clipping through, so the less adjustment is needed to the secondary skeletal chain. Conversely, if the relative position between the reference bone and the body bones of the character model is close, the more likely the character model is to clip through, so the more necessary it is to drive the secondary skeletal chain.
[0061] Based on this, this embodiment determines the adjustment coefficient corresponding to the reference bone according to the relative position between the two. The adjustment coefficient is used to represent the degree of drive of the reference bone or secondary skeletal chain. The larger the adjustment coefficient, the greater the degree of drive.
[0062] In some optional implementations, step S4031, "determining the adjustment coefficient corresponding to the reference bone based on the relative position between the reference bone and the body bones of the character model," may include steps a1 to a3.
[0063] Step a1: Determine the constraint curve corresponding to the reference bone based on the range of motion of the character model's body skeleton.
[0064] Step a2: Determine the minimum distance between the reference skeleton and the constraint curve.
[0065] Step a3: Determine the adjustment coefficient corresponding to the reference skeleton based on the minimum distance; there is a negative correlation between the adjustment coefficient and the minimum distance.
[0066] In this embodiment, the character model's body skeleton has a certain range of motion, which can be used as the safety range for the reference skeleton. Based on this, a curve is determined to constrain the position of the reference skeleton, i.e., a constraint curve, according to the range of motion. This constraint curve can generally be a closed curve. If the reference skeleton exceeds the constraint curve, it indicates a significant risk of clipping through the frame. Therefore, the driving effect of the reference skeleton or secondary skeleton chain can be determined by utilizing the relationship between the secondary reference skeleton and the closed constraint curve.
[0067] Specifically, determine the minimum distance between the reference skeleton and the constraint curve. For example, the distance between the reference skeleton and each point on the constraint curve can be determined, and then the minimum distance can be determined. Alternatively, the point on the constraint curve that is closest to the reference skeleton can be determined, and the distance between this closest point and the reference skeleton can be used as the minimum distance.
[0068] In this embodiment, the minimum distance represents the relative position between the reference bone and the body bones of the character model, thereby determining the adjustment coefficient corresponding to the reference bone. Furthermore, there is a negative correlation between the adjustment coefficient and the minimum distance; that is, the larger the minimum distance, the smaller the adjustment coefficient, and the less need there is to additionally drive the adjustment of the secondary skeletal chain.
[0069] It is understandable that this constraint curve is determined based on the range of motion of the body skeleton. As the body skeleton moves (i.e., the character model moves), its range of motion changes, and correspondingly, the constraint curve also changes.
[0070] In this embodiment, by establishing a constraint curve, it is possible to accurately characterize whether the reference bone of the secondary skeletal chain is within a safe range. Furthermore, by calculating the minimum distance between the reference bone and the constraint curve, the possibility of clipping through the character model can be determined, and then appropriate adjustment coefficients can be set to adaptively adjust the driving effect of the secondary skeletal chain.
[0071] Optionally, step a2, “determining the minimum distance between the reference skeleton and the constraint curve”, may include steps a21 to a24.
[0072] Step a21: Set a first locator for the reference skeleton and a second locator with adjustable position for the constraint curve.
[0073] Step a22: Determine the curve parameters of the point in the constraint curve that is closest to the first locator; the curve parameters are used to represent the position of each point in the constraint curve.
[0074] Step a23: Determine the position coordinates of the second locator based on the curve parameters.
[0075] Step a24: Determine the minimum distance between the reference skeleton and the constraint curve based on the position coordinates of the first locator and the second locator.
[0076] Continue with Figure 3 Taking the model skeleton shown as an example, Figure 5 A schematic diagram illustrating the determination of the minimum distance is shown. For example... Figure 5 As shown, constraint curves 500 corresponding to reference bones in each secondary skeletal chain are determined based on the range of motion of key joints in the skeletal system (e.g., the knee); where, Figure 5 This is a side view of the skeletal model, so the constraint curve 500 is represented by a line segment. The constraint curve 500 can actually be a closed curve, such as a circular or elliptical closed curve.
[0077] by Figure 5 Taking the secondary skeletal chain on the right as an example, a first locator 501 is set for the reference bone 3021. This first locator 501 represents the position of the reference bone 3021 in world space within the secondary skeletal chain. Its position within the reference bone 3021 can be fixed. Figure 5 The example shown is that the first locator 501 is set at the end of the reference bone 3021. The first locator 501 is equivalent to a "detection point" and is used to calculate the distance with the constraint curve 500.
[0078] Furthermore, another second locator 502 is created, and this second locator 502 is attached to the constraint curve 500. That is, the position of the second locator 502 can be changed at will, as long as it is located on the constraint curve 500.
[0079] In this embodiment, curve parameters are used to represent the positions of each point in the constraint curve 500. For example, the curve parameter can be a curve U value, which is a value from 0 to 1 used to uniquely identify any point on a parameterized curve. For example, U=0 represents the starting point of the constraint curve 500, and U=1 represents the ending point of the constraint curve 500.
[0080] The curve parameters of the point closest to the first locator 501 in the constraint curve can be determined in real time. Based on these curve parameters, the position of the closest point within the constraint curve 500 can be determined, and the second locator 502 can be positioned at that location. For example, the curve U value can be mapped to the controllable second locator 502, thereby obtaining the position coordinates of the second locator 502 when it is at the closest point. Based on the position coordinates of the first locator 501 and the second locator 502, the distance between the two locators can be calculated; this distance is the minimum distance between the reference skeleton 3021 and the constraint curve 500.
[0081] It is understandable that, for other secondary skeletal chains, the minimum distance between the corresponding reference bone and the constraint curve 500 can also be determined, for example... Figure 5 The minimum distance between the reference skeleton 3031 and the constraint curve 500 will not be described in detail in this embodiment.
[0082] Optionally, step a3, "determine the adjustment coefficient corresponding to the reference bone based on the minimum distance," may include steps a31 to a32.
[0083] Step a31: Determine the corresponding distance coefficient based on the minimum distance; there is a negative correlation between the distance coefficient and the minimum distance.
[0084] Step a32: Under the constraints of preset minimum and maximum distance coefficients, the distance coefficients are normalized to obtain the adjustment coefficients corresponding to the reference skeleton.
[0085] In this embodiment, after determining the minimum distance between the reference skeleton and the constraint curve, a coefficient representing the distance magnitude, i.e., the distance coefficient, can be initially calculated. This embodiment sets the relationship between the distance coefficient and the minimum distance as a negative correlation; that is, the larger the minimum distance, the smaller the corresponding distance coefficient. For example, the negative correlation between the two can be an inverse relationship.
[0086] Furthermore, the minimum and maximum values of the distance coefficient are preset, namely the minimum distance coefficient and the maximum distance coefficient. The current minimum distance is normalized based on the minimum and maximum distance coefficients, and the normalization result is constrained within a certain range to obtain the final adjustment coefficient.
[0087] For example, the current minimum distance between the reference skeleton and the constraint curve is d The corresponding distance coefficient can be calculated based on a preset functional relationship. v ,and ;in, This represents the functional relationship between the distance coefficient and the minimum distance, which is a negatively correlated functional relationship.
[0088] Furthermore, a minimum distance coefficient is preset. and maximum distance coefficient Then refer to the adjustment coefficient corresponding to the bone. For example, it could be: It's understandable that when the distance coefficient... v Less than the minimum distance coefficient When, it indicates the minimum distance. d If the value is large, no additional processing is needed for the secondary skeletal chain. The adjustment coefficient is set to 0, and the target rotation parameters obtained based on this adjustment coefficient are also 0. In other words, no additional rotation of the root bone is needed. The secondary skeletal chain can be processed according to the traditional solution method to achieve conditional driving.
[0089] Optionally, step a31, "determine the corresponding distance coefficient based on the minimum distance", may include steps a311 to a313.
[0090] Step a311: Determine the first coefficient corresponding to the reference skeleton; the first coefficient and the preset distance between the reference skeleton and the constraint curve when the character model is in a static state are negatively correlated.
[0091] Step a312: Determine the second coefficient corresponding to the reference skeleton based on the minimum distance; the second coefficient and the minimum distance have a negative correlation function relationship.
[0092] Step a313: The ratio between the second coefficient and the first coefficient is used as the corresponding distance coefficient.
[0093] In this embodiment, an appropriate minimum distance coefficient can be set according to different soft body models. and maximum distance coefficient For ease of standardization, the distance coefficient can be... v To a certain extent, standardization should be implemented.
[0094] Specifically, when the character model is stationary, the preset distance d' between the reference skeleton and the constraint curve can be determined. Based on the negative correlation function between the preset distances of the reference skeleton and the constraint curve, the first coefficient corresponding to the reference skeleton in the stationary state can be obtained. a '.For example, This means that the negative correlation function is a reciprocal relationship. It can be understood that this negative correlation function can also be other monotonically decreasing functions; this embodiment does not limit this.
[0095] Furthermore, in determining the minimum distance d Then, the corresponding second coefficient can be calculated based on this negative correlation function. a .For example, The first coefficient was calculated. a ' and second coefficient a Then, the ratio between the two is used as the distance coefficient. v ,Right now .
[0096] By using the first coefficient in a static state, the distance coefficient can be standardized to a certain extent, so that the minimum and maximum distance coefficients of different soft body models are not much different, which makes it easy to cover a variety of soft body models, such as exaggerated umbrella skirts, everyday clothing and other different soft body models.
[0097] Step S4032: Determine the original rotational parameters used to keep the key bones of the secondary skeletal chain oriented toward the first control point.
[0098] In this embodiment, to ensure that the key bones of the secondary skeletal chain always face the first control point, appropriate rotation parameters, i.e., original rotation parameters, need to be set for them. Controlling the key bones of the secondary skeletal chain according to these original rotation parameters ensures that the key bones are completely oriented towards the first control point.
[0099] In some alternative implementations, the key bones of the secondary skeletal chain include the root bones of the secondary skeletal chain. Furthermore, step S4032, "determining the original rotational parameters for maintaining the key bones of the secondary skeletal chain toward the first control point," may include steps b1 to b3.
[0100] Step b1: Create a virtual root bone for the root bone of the secondary skeletal chain.
[0101] Step b2: Establish rotational constraints between the root bone of the secondary skeletal chain and the virtual root bone.
[0102] Step b3: Determine the original rotation parameters corresponding to the local coordinate axis of the virtual root bone pointing to the corresponding first control point in the first control curve.
[0103] In this embodiment, for the key root bones in the secondary skeletal chain, a virtual bone, namely a virtual root bone, can be created for it. By rotating the virtual root bone, the root bone can also rotate synchronously with the virtual root bone. Optionally, step b1, "creating a virtual root bone for the root bones of the secondary skeletal chain", may include steps b11 to b12.
[0104] Step b11: Create the first virtual bones for each bone in the secondary skeletal chain.
[0105] Step b12: Create a virtual root bone for the first virtual bone corresponding to the root bone of the secondary skeletal chain.
[0106] In this embodiment, corresponding virtual bones are created for each bone of the secondary skeletal chain. Multiple first virtual bones can form a virtual skeletal chain. The movement of the secondary skeletal chain is represented based on this virtual skeletal chain, which can achieve decoupling and separation and is easy to debug.
[0107] Figure 6 This illustrates a schematic diagram of creating a virtual root skeleton. (For example...) Figure 6 As shown, for the secondary skeletal chain 601, a corresponding first virtual bone can be created to form a corresponding virtual skeletal chain 602. For example... Figure 6 As shown, the secondary skeleton chain 601 is a skeleton chain in the skirt model (a soft body model), which includes four secondary bones and corresponds to multiple nodes: Skirt00, Skirt01, Skirt02, Skirt03, and Skirt04. Correspondingly, by setting a skeleton proxy layer (Ctrl Forward layer) for each bone in the secondary skeleton chain 601, the corresponding first virtual bone can be obtained, and the nodes of each first virtual bone are as follows: CF_Skirt00, CF_Skirt01, CF_Skirt02, CF_Skirt03, and CF_Skirt04.
[0108] Furthermore, for the first virtual bone in the virtual bone chain 602 that corresponds to the root bone of the secondary bone chain (i.e. Figure 6 The first virtual bone at the top of the secondary bone chain 602 is used to create a clone bone, namely a virtual root bone 603, for the first virtual bone. The virtual root bone 603 is used to perform rotational constraints on the corresponding first virtual bone, thereby realizing the rotational constraints on the root bone in the secondary bone chain 601.
[0109] In this embodiment, a rotational constraint is established between the first virtual bone in the virtual skeleton chain 602 and the virtual root bone 603, so that a rotational constraint can be established between the root bone of the secondary skeleton chain 601 and the virtual root bone 603.
[0110] Specifically, the local coordinate axes of the virtual root bone are used as the basis for rotation constraints. If the local coordinate axes of the virtual root bone are pointed to the corresponding first control point in the first control curve, the rotation parameters corresponding to the virtual root bone can be determined, and these rotation parameters are used as the original rotation parameters.
[0111] Optionally, step b3, "determining the original rotation parameters corresponding to the local coordinate axis of the virtual root bone pointing to the corresponding first control point in the first control curve", may include steps b31 to b32.
[0112] Step b31: Determine the relative direction vector between the virtual root bone and the corresponding first control point in the first control curve.
[0113] Step b32: Determine the original rotation parameters corresponding to the local coordinate axes when the local coordinate axis rotation of the virtual root bone is set along the relative direction vector.
[0114] In this embodiment, if the position of the virtual root bone is p, and the position of the first control point corresponding to the virtual root bone in the first control curve is t, then the relative direction vector r between the two can be expressed as: This is a unit vector. The original rotation parameters can be calculated based on the vector corresponding to a local coordinate axis of the virtual root bone.
[0115] For example, taking the local z-axis (or local x-axis, local y-axis, etc.) of the virtual root skeleton as an example, its vector is: Then the original rotation parameters q Relative direction vector r, local coordinate axes of the virtual root skeleton The relationship between them is: Based on this, the original rotation parameters can be calculated. q Among them, the original rotation parameter q It can be a quaternion to avoid problems such as multiple solutions or deadlock during the solution process. The parameters of this quaternion... q This can be converted to the corresponding Euler angles. The original rotation parameters... q Specifically, its function can be to adjust the local axis of the virtual root skeleton. Rotate and align to the relative direction vector r of the world direction.
[0116] Step S4033: Determine the target rotation parameters based on the adjustment coefficients and the original rotation parameters.
[0117] In this embodiment, the adjustment coefficient is determined. and original rotation parameters q Then, the product of the two can be used as the target rotation parameter, that is, the target rotation parameter is... .
[0118] In this embodiment, adaptive rotation can be achieved by ensuring that a certain local coordinate axis of the virtual root bone of the clone always points towards the corresponding first control point. Furthermore, there is a rotational constraint relationship between the virtual root bone and the root bone of the secondary bone chain. When the virtual root bone rotates, the rotation angle of the first virtual bone can be modified, thereby adaptively adjusting the rotation angle of the root bones in the secondary bone chain. Moreover, by establishing virtual root bones and the first virtual bone, computational decoupling and separation can be achieved, facilitating debugging and data modification. Furthermore, this virtual bone structure does not pollute the original bone binding system, meaning that users can directly uninstall or delete these virtual bones without affecting the original bone structure itself.
[0119] Step S404: Control the key bones of the secondary skeletal chain to rotate according to the target rotation parameters.
[0120] Please see details Figure 2 Step S204 of the illustrated embodiment will not be described again here.
[0121] In some alternative implementations, the method further includes steps c1 to c2.
[0122] Step c1: Set up corresponding controllers for each bone in the secondary skeletal chain.
[0123] Step c2, in response to the position adjustment command of the target controller, adjust the position of the bone in the secondary skeletal chain corresponding to the target controller.
[0124] In this embodiment, after steps S401 to S404, positive anchoring of the secondary skeletal chain can be achieved. That is, through leg movement, the secondary skeletal chain will passively change, which can directly adjust the secondary skeletal chain in a positive direction and reduce the probability of clipping problems. Moreover, even if clipping problems occur, they are generally not serious and are convenient for users to adjust manually.
[0125] In adjusting the secondary skeletal chain, unlike traditional methods that require rotating more than three bones, this embodiment adjusts the secondary skeletal chain of the soft body model by adjusting the position of the bones. Specifically, each bone in the secondary skeletal chain is assigned an adjustable controller. When the position of a corresponding bone needs to be adjusted, the user can input a position adjustment command for that controller. For ease of description, this controller is referred to as the target controller. It can be understood that the target controller is one of the controllers. By adjusting the position of the target controller, the position of the bones can be adaptively adjusted.
[0126] Optionally, step c1, "setting a corresponding controller for each bone in the secondary skeletal chain", may include steps c11 to c13.
[0127] Step c11: Set a second control curve for the secondary skeletal chain; the second control point in the second control curve corresponds to the position of each bone in the secondary skeletal chain, and the position of the second control point changes according to the solution result of the corresponding bone in the secondary skeletal chain.
[0128] Step c12: Determine the corresponding target points based on each of the second control points in the second control curve.
[0129] Step c13: Set up a corresponding controller for each target point and generate a third control curve that includes each target point; the position of the target point in the third control curve changes with the position of the controller.
[0130] In this embodiment, a corresponding control curve, namely a second control curve, can be set for each secondary skeletal chain, and each second control point in the second control curve corresponds to the position of each bone in the secondary skeletal chain.
[0131] Optionally, step c11, "setting a second control curve for the secondary skeletal chain", may include steps c111 to c112.
[0132] Step c111: Create second virtual bones for each bone in the secondary skeletal chain.
[0133] Step c112: Set corresponding second control points for each second virtual bone of the secondary skeletal chain and generate second control curves; the position of the second control points changes according to the solution results of the second virtual bones.
[0134] In this embodiment, a calculation layer (Ctrl_Calculate layer) can be set for each bone in the secondary skeletal chain, and the corresponding virtual bones, i.e., the second virtual bones, can be set by the calculation layer.
[0135] Continue with Figure 6 Taking the secondary skeletal chain shown as an example, corresponding second virtual bones can be set for each bone, thereby generating a second control curve. Figure 7 This illustrates a schematic diagram for creating a second control curve, such as... Figure 7 As shown, corresponding second virtual bones are created for the secondary skeletal chain, forming a virtual bone chain 701. The nodes corresponding to each second virtual bone in this virtual bone chain 701 include: CC_Skirt00, CC_Skirt01, CC_Skirt02, CC_Skirt03, and CC_Skirt04. Furthermore, by setting corresponding second control points for each second virtual bone, a second control curve 702 can be generated.
[0136] In this system, the second control points in the second control curve 702 correspond to the positions of each bone in the secondary skeleton chain. Furthermore, the positions of each second control point change according to the solution results of the corresponding bone in the secondary skeleton chain. Taking the Skirt03 bone in the secondary skeleton chain as an example, its solution results are stored in the second virtual bone CC_Skirt03, and this second virtual bone CC_Skirt03 establishes constraints with the corresponding second control points in the second control curve 702. When the solution results stored in CC_Skirt03 change, the positions of the corresponding second control points also change, meaning the second control points move accordingly.
[0137] Furthermore, after the above-mentioned forward anchoring calculation, the probability of clipping in the solution is greatly reduced, but some clipping problems may still exist. Therefore, reverse anchoring can also be performed on the secondary skeletal chain to actively adjust the shape and avoid clipping by moving the target point of reverse anchoring. Specifically, the corresponding target point is determined according to each second control point in the second control curve to generate the third control curve.
[0138] Optionally, step c13, "generating a third control curve including each target point", may include steps c131 to c132.
[0139] Step c131: Create a third virtual bone for each bone in the secondary skeletal chain.
[0140] Step c132: Associate each third virtual bone with each target point to generate the third control curve corresponding to the third virtual bone; the third control curve is used to adjust the pose of each third virtual bone.
[0141] Continue with Figure 6 Taking the short skirt model shown as an example, Figure 8 A schematic diagram illustrating the generation of a third control curve is shown. Figure 8 As shown, the second control curve 702 contains multiple second control points. By performing reverse anchoring on each second control point, the target point corresponding to each second control point can be determined. This target point corresponds one-to-one with each second control point, and their positions overlap. Furthermore, as... Figure 8 As shown, another control curve, namely the third control curve 801, can be generated based on each target point; a controller 802 is set for each target point for user adjustment. Figure 8 The circle in the diagram represents the controller, allowing the user to adjust the shape of the third control curve 801 by adjusting the position of the corresponding controller 802.
[0142] It is understandable that when the position of the second control point changes according to the solution result of the second virtual skeleton, the positions of each target point will also change adaptively, that is, the third control curve 801 will also change with the solution result. In addition, when the user adjusts the position of the controller 802, the position of the target point in the third control curve changes with the position of the controller 802, which will cause the shape of the third control curve 801 to change adaptively so as to be adjusted according to the user's needs.
[0143] Specifically, similar to creating the first and second virtual bones described above, another set of virtual bones, namely the third virtual bones, is created for each bone in this secondary bone chain. For example, an adjustment layer (Ctrl_Modify layer) can be established for the secondary bone chain, and this adjustment layer implements the third virtual bones corresponding to each bone. The third virtual bones can form a virtual bone link 803, and the nodes corresponding to each third virtual bone in this virtual bone link 803 include: CM_Skirt00, CM_Skirt01, CM_Skirt02, CM_Skirt03, and CM_Skirt04.
[0144] Furthermore, each third virtual bone is associated with a corresponding target point, enabling the third control curve 801 to control the position of the third virtual bone, i.e., to adjust the pose of each third virtual bone. For example, a splineIK constraint can be established between the third virtual bone and the third control curve 801. Through the corresponding splineIK algorithm, the movement controller is used to adjust the shape of the third control curve 801, thereby modifying the original bone transformation.
[0145] Figure 9 This diagram illustrates how bone position can be adjusted via a controller. Figure 9 As shown, if the user adjusts the positions of each controller 901 based on actual needs, the shape of the third control curve 902 will change, thereby causing the virtual skeleton connection 903 formed by the third virtual skeleton to adapt. Specifically, this can be seen as follows: Figure 9 As shown.
[0146] In this embodiment, by creating a virtual root bone, the pose of the root bone toward the first control point can be represented, thereby determining the rotation parameters; by creating a first virtual bone, the rotation direction of each first virtual bone can be adjusted according to the rotation parameters; by creating a second virtual bone, the pose of the second virtual bone can be adaptively adjusted according to the actual solution results of the character model and the soft body model; and by creating a third virtual bone, the user can change the pose of the third virtual bone by adjusting the position of the controller.
[0147] Among them, the first virtual bone, the second virtual bone, and the third virtual bone are in a hierarchical relationship, or rather, the bone proxy layer, the calculation layer, and the adjustment layer are in a hierarchical relationship; for any bone in the secondary bone chain, the final posture of the bone can be determined by combining the adjustment results of each virtual bone.
[0148] For example, . Among them, represents the transformation matrix of the bone in the secondary bone chain, represents the transformation matrix corresponding to the third virtual bone, represents the transformation matrix corresponding to the second virtual bone, represents the transformation matrix corresponding to the first virtual bone. Through this transformation matrix the bone in the secondary bone chain can be processed. Other bones in the secondary bone chain can also be controlled in a similar manner and will not be elaborated here.
[0149] In this embodiment, using the first control curve to constrain the secondary bone chain can enable the secondary bone chain to sense the relative positions of limb movements and the corresponding skinning curves in real time and achieve linkage; it is applicable to various secondary bone chains such as skirt hems, streamers, and pendants, and can take into account different equipment and clothing types. Moreover, the animation repair operation can be completed with fewer bone adjustments, avoiding the inefficient operation of manually stacking multiple rotating bones. Through the third control curve and the corresponding controller, when adjusting the secondary bone chain, it can be changed from forward kinematics rotation to moving the target point, which can avoid cumbersome forward kinematics correction and conform to the operation intuition. A closed-loop control can be formed between the two stages of pre-solver drive and post-solver adjustment, enabling the secondary bone chain to not only automatically reshape in response to the character's actions but also efficiently correct the posture after the solver.
[0150] Create corresponding virtual bones (such as virtual root bones, first virtual bones, etc.) at each stage, making the calculations at each stage decoupled and separated, which is easy to debug and modify data. Moreover, such virtual bones will not pollute the original bone binding system, meaning that users can directly uninstall or delete these virtual bones without affecting the original bones themselves. Among them, a new binding system can be set up, and this new binding system can implement the above functions and synchronously map the bone poses onto the actual binding system. If the control method provided in this embodiment is not needed, the new binding system can be directly deleted, so that the solution provided in this embodiment will not affect the actual assets.
[0151] This embodiment also provides a secondary skeleton control device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to 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.
[0152] This embodiment provides a control device for secondary skeletons, such as... Figure 10 As shown, the device includes: The skeleton determination module 1001 is used to determine the reference bones in each of the secondary skeleton chains of the soft body model. The setting module 1002 is used to set a first control curve for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each of the secondary skeletal chains; Processing module 1003 is used to determine the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to each first control point when the position of the first control point is updated; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point. The adjustment module 1004 is used to control the rotation of the key bones of the secondary skeletal chain according to the target rotation parameters.
[0153] In some optional implementations, determining the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point includes: The adjustment coefficient corresponding to the reference bone is determined based on the relative position between the reference bone and the body bones of the character model; Determine the original rotational parameters used to maintain the key bones of the secondary skeletal chain toward the first control point; The target rotation parameters are determined based on the adjustment coefficients and the original rotation parameters.
[0154] In some optional implementations, determining the adjustment coefficient corresponding to the reference bone based on the relative position between the reference bone and the body bones of the character model includes: Based on the range of motion of the body skeleton of the character model, determine the constraint curve corresponding to the reference skeleton; Determine the minimum distance between the reference skeleton and the constraint curve; The adjustment coefficient corresponding to the reference bone is determined based on the minimum distance; the adjustment coefficient and the minimum distance are negatively correlated.
[0155] In some alternative implementations, determining the minimum distance between the reference bone and the constraint curve includes: A first locator is set for the reference skeleton, and a second locator with adjustable position is set for the constraint curve; Determine the curve parameters of the point in the constraint curve that is closest to the first locator; the curve parameters are used to represent the position of each point in the constraint curve. The position coordinates of the second locator are determined based on the curve parameters; Based on the position coordinates of the first locator and the position coordinates of the second locator, the minimum distance between the reference skeleton and the constraint curve is determined.
[0156] In some optional implementations, determining the adjustment coefficient corresponding to the reference skeleton based on the minimum distance includes: A corresponding distance coefficient is determined based on the minimum distance; the distance coefficient and the minimum distance are negatively correlated. Under the constraints of preset minimum and maximum distance coefficients, the distance coefficients are normalized to obtain the adjustment coefficients corresponding to the reference skeleton.
[0157] In some optional implementations, determining the corresponding distance coefficient based on the minimum distance includes: Determine the first coefficient corresponding to the reference skeleton; the first coefficient and the preset distance between the reference skeleton and the constraint curve when the character model is in a static state are negatively correlated functional relationships. The second coefficient corresponding to the reference skeleton is determined based on the minimum distance; the second coefficient and the minimum distance are in a negative correlation function relationship. The ratio between the second coefficient and the first coefficient is used as the corresponding distance coefficient.
[0158] In some alternative implementations, the key bones of the secondary skeletal chain include the root bones of the secondary skeletal chain; Determining the original rotational parameters for maintaining the key bones of the secondary skeletal chain toward the first control point includes: Create a virtual root bone for the root bone of the secondary skeletal chain; Establish rotational constraints between the root bone of the secondary skeletal chain and the virtual root bone; The original rotation parameters are determined when the local coordinate axis of the virtual root bone points to the corresponding first control point in the first control curve.
[0159] In some optional implementations, the original rotation parameters corresponding to determining when the local coordinate axis of the virtual root bone points to the corresponding first control point in the first control curve include: The relative direction vector between the virtual root skeleton and the corresponding first control point in the first control curve is determined based on their positions. When the local coordinate axis rotation of the virtual root bone is set along the relative direction vector, the original rotation parameters corresponding to the local coordinate axis are determined.
[0160] In some alternative implementations, creating a virtual root bone for the root bone of the secondary skeletal chain includes: Create a first virtual bone for each bone of the secondary skeletal chain; A virtual root bone is created for the first virtual bone corresponding to the root bone of the secondary skeletal chain.
[0161] In some optional implementations, the processing module is further configured to: A corresponding controller is set for each bone in the secondary skeletal chain; In response to a position adjustment command for the target controller, the position of the bone in the secondary skeletal chain corresponding to the target controller is adjusted.
[0162] In some alternative implementations, the step of setting a corresponding controller for each bone of the secondary skeletal chain includes: A second control curve is set for the secondary skeletal chain; the second control point in the second control curve corresponds to the position of each bone in the secondary skeletal chain, and the position of the second control point changes according to the solution result of the corresponding bone in the secondary skeletal chain; Determine the corresponding target points based on each of the second control points in the second control curve; A corresponding controller is set for each of the target points, and a third control curve including each of the target points is generated; the position of the target point in the third control curve changes with the position of the controller.
[0163] In some alternative implementations, setting a second control curve for the secondary skeletal chain includes: Create a second virtual bone for each bone of the secondary skeletal chain; A corresponding second control point is set for each second virtual bone of the secondary skeletal chain, and a second control curve is generated; the position of the second control point changes according to the solution result of the second virtual bone. And / or, The generation of the third control curve, which includes each of the target points, includes: Create a third virtual bone for each bone of the secondary skeletal chain; Each of the third virtual bones is associated with each of the target points to generate a third control curve corresponding to the third virtual bone; the third control curve is used to adjust the pose of each of the third virtual bones.
[0164] The secondary skeleton control device provided in this disclosure can execute the secondary skeleton control 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.
[0165] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0166] The following is a detailed reference. Figure 11 The diagram illustrates a structural schematic suitable for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1102 or a program loaded from memory 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of the electronic device. The processor 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0167] Typically, the following devices can be connected to I / O interface 1105: input devices 1106 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1107 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1108 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1109. Communication device 1109 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 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.
[0168] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application 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 1109, or installed from memory 1108, or installed from ROM 1102. When the computer program is executed by processor 1101, it performs the functions defined in the secondary skeleton control method of embodiments of this application.
[0169] Figure 11 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0170] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. 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 can 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. When the software or computer code is accessed and executed by the computer, processor, or hardware, the secondary skeleton control method shown in the above embodiments is implemented.
[0171] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application 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, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or 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.
[0172] Although embodiments of this application 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 this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A method for controlling secondary skeleton, characterized in that, The method includes: For each secondary skeletal chain of the soft body model, determine the reference bone in each of the secondary skeletal chains; A first control curve is set for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each of the secondary skeletal chains; For each first control point, when the position of the first control point is updated, the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point are determined; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point. The key bones of the secondary skeletal chain are rotated according to the target rotation parameters.
2. The method according to claim 1, characterized in that, The determination of the target rotation parameters corresponding to the key bones of the secondary skeletal chain corresponding to the first control point includes: The adjustment coefficient corresponding to the reference bone is determined based on the relative position between the reference bone and the body bones of the character model; Determine the original rotational parameters used to maintain the key bones of the secondary skeletal chain toward the first control point; The target rotation parameters are determined based on the adjustment coefficients and the original rotation parameters.
3. The method according to claim 2, characterized in that, The step of determining the adjustment coefficient corresponding to the reference bone based on the relative position between the reference bone and the body bones of the character model includes: Based on the range of motion of the body skeleton of the character model, determine the constraint curve corresponding to the reference skeleton; Determine the minimum distance between the reference skeleton and the constraint curve; The adjustment coefficient corresponding to the reference bone is determined based on the minimum distance; the adjustment coefficient and the minimum distance are negatively correlated.
4. The method according to claim 3, characterized in that, Determining the minimum distance between the reference bone and the constraint curve includes: A first locator is set for the reference skeleton, and a second locator with adjustable position is set for the constraint curve; Determine the curve parameters of the point in the constraint curve that is closest to the first locator; the curve parameters are used to represent the position of each point in the constraint curve. The position coordinates of the second locator are determined based on the curve parameters; Based on the position coordinates of the first locator and the position coordinates of the second locator, the minimum distance between the reference skeleton and the constraint curve is determined.
5. The method according to claim 3, characterized in that, Determining the adjustment coefficient corresponding to the reference bone based on the minimum distance includes: A corresponding distance coefficient is determined based on the minimum distance; the distance coefficient and the minimum distance are negatively correlated. Under the constraints of preset minimum and maximum distance coefficients, the distance coefficients are normalized to obtain the adjustment coefficients corresponding to the reference skeleton.
6. The method according to claim 5, characterized in that, The step of determining the corresponding distance coefficient based on the minimum distance includes: Determine the first coefficient corresponding to the reference skeleton; the first coefficient and the preset distance between the reference skeleton and the constraint curve when the character model is in a static state are negatively correlated functional relationships. The second coefficient corresponding to the reference skeleton is determined based on the minimum distance; the second coefficient and the minimum distance are in a negative correlation function relationship. The ratio between the second coefficient and the first coefficient is used as the corresponding distance coefficient.
7. The method according to claim 2, characterized in that, The key bones of the secondary skeletal chain include the root bone of the secondary skeletal chain; Determining the original rotational parameters for maintaining the key bones of the secondary skeletal chain toward the first control point includes: Create a virtual root bone for the root bone of the secondary skeletal chain; Establish rotational constraints between the root bone of the secondary skeletal chain and the virtual root bone; The original rotation parameters are determined when the local coordinate axis of the virtual root bone points to the corresponding first control point in the first control curve.
8. The method according to claim 7, characterized in that, The original rotation parameters corresponding to determining that the local coordinate axis of the virtual root bone points to the corresponding first control point in the first control curve include: The relative direction vector between the virtual root skeleton and the corresponding first control point in the first control curve is determined based on their positions. When the local coordinate axis rotation of the virtual root bone is set along the relative direction vector, the original rotation parameters corresponding to the local coordinate axis are determined.
9. The method according to claim 7, characterized in that, Creating a virtual root bone for the root bone of the secondary skeletal chain includes: Create a first virtual bone for each bone of the secondary skeletal chain; A virtual root bone is created for the first virtual bone corresponding to the root bone of the secondary skeletal chain.
10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: A corresponding controller is set for each bone in the secondary skeletal chain; In response to a position adjustment command for the target controller, the position of the bone in the secondary skeletal chain corresponding to the target controller is adjusted.
11. The method according to claim 10, characterized in that, The step of setting corresponding controllers for each bone in the secondary skeletal chain includes: A second control curve is set for the secondary skeletal chain; the second control point in the second control curve corresponds to the position of each bone in the secondary skeletal chain, and the position of the second control point changes according to the solution result of the corresponding bone in the secondary skeletal chain; Determine the corresponding target points based on each of the second control points in the second control curve; A corresponding controller is set for each of the target points, and a third control curve including each of the target points is generated; the position of the target point in the third control curve changes with the position of the controller.
12. The method according to claim 11, characterized in that, Setting a second control curve for the secondary skeletal chain includes: Create a second virtual bone for each bone of the secondary skeletal chain; A corresponding second control point is set for each second virtual bone of the secondary skeletal chain, and a second control curve is generated; the position of the second control point changes according to the solution result of the second virtual bone. And / or, The generation of the third control curve, which includes each of the target points, includes: Create a third virtual bone for each bone of the secondary skeletal chain; Each of the third virtual bones is associated with each of the target points to generate a third control curve corresponding to the third virtual bone; the third control curve is used to adjust the pose of each of the third virtual bones.
13. A control device for secondary skeleton, characterized in that, The device includes: The skeleton determination module is used to determine the reference bones in each of the secondary skeleton chains of the soft body model. The setting module is used to set a first control curve for the character model corresponding to the soft body model; the first control point in the first control curve corresponds to the reference bone of each of the secondary skeletal chains; The processing module is used to determine the target rotation parameters of the key bones of the secondary skeletal chain corresponding to each first control point when the position of the first control point is updated; the target rotation parameters are used to maintain the relative orientation between the key bones of the secondary skeletal chain and the first control point. An adjustment module is used to control the rotation of key bones in the secondary skeletal chain according to the target rotation parameters.
14. 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 secondary skeleton control method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the control method for secondary skeleton as described in any one of claims 1 to 12.