Animation generation method and apparatus
Patent Information
- Application Number
- CN202311171380.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-09-11
AI Technical Summary
虽然上述方法能够在一定程度上实现捏脸效果,但是也存在一定的局限性,比如融合变形技术需要创建大量的表情权重,导致工作量庞大
[0019]本说明书提供的动画生成方法,为了能够提高捏脸效率以及避免穿模的问题发生,可以先基于初始角色的捏脸数据将状态机初始化为目标状态机,实现结合引擎的状态机达到高效且灵活的完成捏脸处理。在此基础上,为了捏脸处理更加灵活且避免穿模,可以在目标状态机中针对初始角色添加旋转约束和拉伸约束,以及针对初始角色的目标器官对象配置视觉变化组件,从而根据约束添加结果和视觉变化组件的配置结果得到目标角色。此后即可再加载关联目标角色的修型数据和修型动画,以此利用修型数据驱动修型动画对目标角色进行捏脸处理,实现在捏脸的过程中,可以利用修型数据和修型动画进行角色的捏脸效果修复和校正,以得到捏脸动画数据。最后,再根据预设的优化规则对捏脸动画数据进行更新,即可根据更新结果生成目标捏脸动画,从而确保捏脸动画更加真实。实现了在降低捏脸工作量的前提下,灵活且不穿模的完成捏脸处理,以方便下游业务可以使用质量更高的捏脸动画完成项目工程。
Smart Images

Figure CN117195563B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of game technology, and in particular to animation generation methods and apparatus. Background Technology
[0002] With the development of internet technology, virtual avatars are being used in an increasing number of scenarios, such as games, virtual reality, animation, and game rotation animations, all of which involve the rendering of virtual avatars. Furthermore, as the performance of computing devices improves, users' demands for the realism of virtual avatars are also increasing, especially in fields such as games, film, and virtual reality. A key focus of enhancing virtual avatars is the realism of facial expressions. Currently, the facial sculpting technology for virtual avatars is mainly based on blending deformation and parent bone offset. While these methods can achieve facial sculpting effects to a certain extent, they also have limitations. For example, blending deformation requires creating a large number of expression weights, resulting in a huge workload. Parent bone offset technology is limited in scope, making it difficult to meet the needs of flexible facial sculpting, and it also causes clipping issues. Therefore, an effective solution is urgently needed to address these problems. Summary of the Invention
[0003] In view of this, embodiments of this specification provide an animation generation method. One or more embodiments of this specification also relate to an animation generation apparatus, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.
[0004] According to a first aspect of the embodiments of this specification, an animation generation method is provided, comprising:
[0005] The state machine is initialized to the target state machine based on the initial character's facial data;
[0006] In the target state machine, rotational and stretching constraints are added to the initial character, and visual change components are configured for the target organ object of the initial character to obtain the target character;
[0007] Load the shaping data and shaping animation associated with the target character, and use the shaping data to drive the shaping animation to perform face shaping processing on the target character, thereby obtaining face shaping animation data;
[0008] The character creation animation data is updated according to preset optimization rules, and the target character creation animation corresponding to the initial character is generated based on the update results.
[0009] According to a second aspect of the embodiments of this specification, an animation generation apparatus is provided, comprising:
[0010] The initialization module is configured to initialize the state machine to the target state machine based on the initial character's character creation data;
[0011] An add module is configured to add rotational and stretch constraints to the initial character in the target state machine, and to configure a visual change component for the target organ object of the initial character to obtain the target character;
[0012] The processing module is configured to load the shaping data and shaping animation associated with the target character, and use the shaping data to drive the shaping animation to perform face shaping processing on the target character, thereby obtaining face shaping animation data.
[0013] The generation module is configured to update the face-shaping animation data according to preset optimization rules, and generate the target face-shaping animation corresponding to the initial character based on the update result.
[0014] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising:
[0015] Memory and processor;
[0016] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described animation generation method.
[0017] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the above-described animation generation method.
[0018] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described animation generation method.
[0019] The animation generation method provided in this manual, in order to improve face-shaping efficiency and avoid clipping issues, first initializes the state machine to a target state machine based on the initial character's face-shaping data. This allows for efficient and flexible face-shaping processing in conjunction with the engine's state machine. Building upon this, to further enhance flexibility and prevent clipping, rotational and stretching constraints are added to the target state machine for the initial character, and visual change components are configured for the target organ objects of the initial character. The target character is then obtained based on the constraint additions and the configuration results of the visual change components. Next, the associated shaping data and shaping animation of the target character are loaded. This allows the shaping data to drive the shaping animation for face-shaping processing. During the face-shaping process, the shaping data and animation can be used to repair and correct the face-shaping effect, resulting in face-shaping animation data. Finally, the face-shaping animation data is updated according to preset optimization rules, and the target face-shaping animation is generated based on the updated results, ensuring a more realistic face-shaping animation. This method achieves flexible and clipping-free face-shaping processing while reducing the workload, enabling downstream businesses to use higher-quality face-shaping animations to complete project engineering. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of an animation generation method provided in one embodiment of this specification;
[0021] Figure 2 This is a flowchart illustrating an animation generation method provided in one embodiment of this specification;
[0022] Figure 3 This is a schematic diagram of facial expressions in an animation generation method provided in one embodiment of this specification;
[0023] Figure 4 This is a schematic diagram of an animation curve in an animation generation method provided in one embodiment of this specification;
[0024] Figure 5 This is a flowchart illustrating the processing steps of an animation generation method provided in one embodiment of this specification.
[0025] Figure 6 This is a schematic diagram of the structure of an animation generation device provided in one embodiment of this specification;
[0026] Figure 7 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0027] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0028] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0029] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0030] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0031] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0032] Unity is a real-time 3D interactive content creation and operation platform. Creators across industries, including game development, art, architecture, automotive design, and film, can bring their ideas to life with Unity. The Unity platform provides a complete suite of software solutions for creating, operating, and monetizing any real-time interactive 2D and 3D content, supporting platforms including mobile phones, tablets, PCs, game consoles, augmented reality, and virtual reality devices.
[0033] This specification provides an animation generation method, and also relates to an animation generation apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0034] In practical applications, within the Unity engine, the state machine system is a tool used to control the animation states of game characters. The blending tree of the state machine can overlay animations, but Direct-type blending trees have some blending issues. They do not support the overlaying and blending of rotational animations, and Euler angle calculations can cause gimbal lock problems, failing to correctly represent the blending effects during animation rotation. The engine's existing constraint system can control and adjust bones in character animations, but it is currently mainly used for simple motion restrictions. The animation generation method provided in this manual, by combining Unity's state machine system and constraint system to generate character customization animations, ensures more realistic and efficient character customization results.
[0035] See Figure 1 The diagram illustrates the animation generation method provided in this manual. To improve face-shaping efficiency and avoid clipping issues, the state machine is first initialized as a target state machine based on the initial character's face-shaping data. This allows for efficient and flexible face-shaping processing by combining the engine's state machine with the initial character's data. Furthermore, to enhance flexibility and prevent clipping, rotation and stretch constraints are added to the target state machine for the initial character, and visual change components are configured for the target organ objects. The target character is then obtained based on the constraint additions and the configuration of the visual change components. Next, the associated shaping data and shaping animation for the target character are loaded. This data drives the shaping animation to sculpt the character's face, allowing for adjustments and corrections to the face-shaping effect during the process, resulting in face-shaping animation data. Finally, the face-shaping animation data is updated according to preset optimization rules, generating the target face-shaping animation and ensuring greater realism. It enables flexible and clip-free character creation while reducing the workload of character creation, so that downstream businesses can use higher-quality character creation animations to complete project engineering.
[0036] See Figure 2 , Figure 2 A flowchart of an animation generation method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0037] Step S202: Initialize the state machine to the target state machine based on the initial character's face-shaping data.
[0038] The animation generation method provided in this embodiment can be applied to game scenes, film and television production scenes, or virtual reality scenes. It is used to perform facial customization on virtual characters within the scene, thereby generating corresponding facial animations. For example, in a game scene, facial customization can be performed on a game character to be created; in a film and television production scene, facial customization can be performed on a character in a film; or in a virtual reality scene, facial customization can be performed on a virtual reality character. This embodiment uses a game scene as an example to illustrate the animation generation method. Similar or identical descriptions in other scenes can be found in the descriptions in this embodiment, and will not be elaborated upon further here.
[0039] Specifically, the initial character refers to the character in the current animation generation scene that requires facial customization. This character can be a custom character created by the art team or a character that has already been created and is awaiting facial customization; however, this character has not yet undergone facial customization. Correspondingly, facial customization data refers to the data submitted for facial customization of the initial character. This data describes the facial customization effect and is used to generate a customized facial animation that meets usage requirements. The state machine refers to the state machine in the Unity engine, which is used in conjunction with the Unity engine's constraint system to complete the facial animation processing. The target state machine refers to the state machine obtained after initializing the initial state machine with the facial customization data. This initialization process configures the relevant parameters corresponding to the facial customization data within the state machine, allowing subsequent adjustments to the configured parameters to generate a target facial animation for the initial character that meets usage requirements.
[0040] Therefore, in order to quickly and easily generate more realistic character creation animations using the Unity engine, the state machine in the engine can be used. After receiving the character creation data submitted for the initial character, the state machine can be initialized based on the character creation data corresponding to the initial character. This allows for the configuration of other related parameters as needed, and after configuration, the target state machine is obtained. This facilitates subsequent character creation processing based on the target state machine and the constraint system in the engine, thereby generating the target character creation animation corresponding to the initial character for use in downstream tasks.
[0041] Furthermore, during the state machine initialization phase, to ensure that the generated facial contouring animation meets the requirements, an overlay animation can be generated based on the facial contouring data. This constructs the state machine required for the current scene before initialization. In this embodiment, the specific implementation method is as follows:
[0042] Obtain the character creation data submitted for the initial character and convert the character creation data into an initial character creation animation; perform slicing processing on the initial character creation animation and generate an overlay animation based on the slicing processing results; construct a state machine based on the overlay animation and perform initialization processing on the state machine to obtain the target state machine.
[0043] Specifically, the initial character creation animation refers to the animation created based on character creation data. This animation only includes a portion of the character creation effects and requires further adjustments before it can be used. Correspondingly, slicing refers to the operation of dividing the character creation animation into frames; this is used to generate overlay animations based on the slicing results, enabling the subsequent construction of the state machine for the corresponding initial character.
[0044] Based on this, given the character creation data submitted for the initial character, in order to combine the state machine system and constraint system in the engine to generate a more realistic character creation animation, the character creation data can first be converted into an initial character creation animation. Then, the initial character creation animation is sliced, and an overlay animation is generated based on the sliced processing results. At this point, a state machine can be built based on the overlay animation. Finally, the state machine is initialized according to the requirements to obtain the target state machine corresponding to the initial character. This allows subsequent character creation processing of the initial character to be performed in the target state machine, thereby obtaining the target character creation animation.
[0045] In practice, the facial customization data can be stored as animation clips in the art software. These clips are then sliced in the engine, and the "Add Reference Pose" option is selected to generate an overlay animation for frame 0. A state machine is then built using the AnimationClip resources of these clips. The base layer of this state machine can play facial animations without expressions, allowing for subsequent creation of facial customization animations. Furthermore, by utilizing the animation overlay mechanism, the facial customization parameters and expression parameters from the data can be added as additional attributes to the state machine to achieve an overlay effect. This overlay can be maintained and managed, and within the overlay layer, a blending tree can be used to mix and create more realistic facial customization animations.
[0046] For example, when customizing the appearance of a game character, you can first obtain the character customization data submitted for the game character. At this point, you can generate a blank facial animation based on the customization data. Then, you can slice the customization animation and create an overlay animation based on it. You can then build a state machine based on the overlay animation to add a game character that corresponds to the actual needs using the engine's state machine system. After that, by initializing the state machine, you can set multi-dimensional parameters for the character customization process, which makes it easier to generate the corresponding character customization animation after adjusting the parameters.
[0047] In summary, by combining facial sculpting data to create a state machine, we can ensure that the created state machine corresponds to the actual facial sculpting requirements. Then, by initializing the state machine, we can set the basic parameters, which will facilitate subsequent parameter adjustments to obtain the target facial sculpting animation that meets the requirements.
[0048] Step S204: Add rotational and stretching constraints to the initial character in the target state machine, and configure a visual change component for the target organ object of the initial character to obtain the target character.
[0049] Specifically, after initializing the state machine and obtaining the target state machine, to further achieve face-shaping processing within the state machine while ensuring realism and efficiency, rotation and stretch constraints can be added to the initial character in the target state machine. This allows for constraint settings for different organ objects from multiple perspectives, ensuring that organ objects change in a realistic manner when the character's expression changes, thus guaranteeing face-shaping realism. Simultaneously, to achieve more subtle micro-expression changes, visual change components can be configured for the target organ objects of the initial character. These components compensate for change components, resulting in a well-configured target character with configured constraints and components. Subsequent repair and correction yield the corresponding face-shaping animation, realistically expressing different facial expressions within the animation.
[0050] Specifically, rotation constraints refer to the constraints set for organ objects that require rotational changes during the face-shaping process. For example, the opening and closing of the mouth involves rotation, so a rotation constraint can be set. Similarly, stretch constraints refer to the constraints set for organ objects that require deformation during the face-shaping process. For example, the opening and closing of the eyelids involves skin stretching. The corresponding visual change component refers to the component used to calculate directional increment information, compensating for the character's facial expressions to ensure that subtle changes in expression occur as the visual target moves. Finally, the target character refers to the character obtained after configuring constraints and adding components in the target state machine. This character can then undergo further face-shaping processing to generate a target face-shaping animation with facial expression changes.
[0051] Furthermore, when adding rotational constraints to the initial character in the target state machine, in order to ensure that the objects with added rotational constraints can meet the face-shaping requirements, the mouth object and teeth object can be selected to complete the rotational constraint settings, thereby preventing the teeth from not changing with the mouth when opening and closing; in this embodiment, the specific implementation method is as follows:
[0052] In the target state machine, the mouth object and tooth object of the initial character are determined, and the mouth rotation constraint corresponding to the mouth object is loaded; in the target state machine, the mouth rotation constraint is configured for the tooth object as a rotation constraint added to the initial character.
[0053] Specifically, the mouth object refers to the mouth organ of the initial character, and the corresponding tooth object refers to the tooth organ of the initial character; correspondingly, the mouth rotation constraint refers to the rotation constraint configured on the mouth object itself, which is used to drive the mouth organ to open and close as needed.
[0054] Therefore, in order to ensure that the mouth and teeth objects move accordingly when the character is being sculpted, and to avoid the problem of the mouth changing but the teeth not changing, such as the mouth opening but the teeth remaining closed, we can first determine the initial mouth and teeth objects of the character in the target state machine and load the mouth rotation constraints corresponding to the mouth objects. Then, we can configure mouth rotation constraints for the teeth objects in the target state machine, and copy the rotation constraints to the teeth objects, thus using them as rotation constraints added to the initial character.
[0055] In other words, while state machines can achieve the effect of overlaying facial and facial animations, the blending processing of the blending tree cannot effectively blend rotational transformations; it only supports translational transformations. Because the state machine's blending tree uses Euler angles to calculate rotational transformations, omnidirectional deadlock can occur when multi-axis rotational transformations occur. Therefore, a solution is to add copy rotational constraints to the skinned skeleton of the teeth, copying the rotational transformation of the chin, thereby achieving the effect of the mouth and teeth opening and closing as a whole.
[0056] Following the previous example, when customizing a game character's face, for the chin and teeth, a copy rotation constraint can be added to the skinned skeleton of the teeth, and the rotation constraint of the chin can be assigned to the teeth, thereby achieving the effect of the teeth and mouth opening and closing as a whole; for example... Figure 3 As shown in (a), this is a schematic diagram where the teeth and mouth are not completely closed; after completing the rotation constraint copy, the result will be as follows: Figure 3 The diagram shown in (b) illustrates the teeth and mouth in a closed position to enhance the realism of the sculpted face.
[0057] In summary, by assigning rotational constraints from the mouth object to the teeth object, it is possible to change both the teeth and mouth simultaneously, thereby improving the realism of the character creation process.
[0058] Furthermore, when adding stretch constraints to the initial character, the stretch constraints are actually set for the eyeballs and eyelids, thereby avoiding clipping issues when the eyes are closed; in this embodiment, the specific implementation method is as follows:
[0059] In the target state machine, the eyeball object and eyelid object of the initial character are determined, and the driving target point corresponding to the eyelid object is determined; according to the preset volume rules of the eyeball object, the driving target point is configured with a constraint mapping strategy in the target state machine as a stretching constraint added to the initial character.
[0060] Specifically, the "eyeball object" refers to the initial character's eyeball organ, and the "eyelid object" refers to the initial character's eyelid organ. Correspondingly, the "driving target point" refers to the target point that drives the opening and closing of the eyelid, used to control the eyeball volume and achieve a clipping-free effect. Correspondingly, the "volume rule" refers to the rule for adjusting the eyeball volume; and correspondingly, the "constraint mapping strategy" refers to the pre-defined stretching constraints used to ensure that when blinking, the eyelid stretches and the eyeball changes, thus preventing clipping.
[0061] Therefore, in order to avoid clipping, the initial character's eyeball and eyelid objects can be determined in the target state machine, and the corresponding driving target point of the eyelid object can be determined. At this time, according to the preset volume rules of the eyeball object, the constraint mapping strategy can be configured for the driving target point in the target state machine to bind the eyeball and eyelid as a stretching constraint added to the initial character, so as to avoid the eyeball and eyelid clipping when creating the blinking animation.
[0062] In other words, the stretch constraint adheres to its own defined Y-axis for rotation and scaling towards the target. Since the principal axis in a skeleton is the Y-axis, its corresponding Y-axis will be the tracking and stretching axis; no different axis is used. Simultaneously, the constrained bone can select some original volumetric features. Therefore, when the target approaches, the bone is compressed (e.g., when the eyes are closed, the eyelids compress the eyeball); when the target moves away, it becomes thicker (e.g., when the eyes are open, the eyelids become thicker). In character sculpting, by using stretch constraints, the bones involved in eyelid meshing are mapped to scaling transformations while maintaining volumetric rules, following the target point involved in the animation. This solves the problem of the eyelids not clipping through the eyeball when the eyes are closed. In practice, the rotation order of the bones towards the target and the volumetric rules for maintaining the constraint bones can be selected according to actual needs; for example, the rotation order can be XZ, ZX, or any rotation; the volume can be maintained as XZ, X, Z, or no volume is maintained.
[0063] Following the previous example, to ensure that the game character's eyeballs and eyelids do not clip through, stretching constraints can be added to the eyeballs and eyelids in conjunction with the target orientation and volume maintenance rules; for example... Figure 3 As shown in (c), without adding constraints, the eyeball and eyelid will have a clipping effect; after adding stretch constraints, it will generate an image like... Figure 3The realistic effect shown in (d) ensures that the final generated game character face-shaping animation is more realistic.
[0064] In summary, by combining the target orientation and volume maintenance rules to set stretch constraints on the eyeballs and eyelids, the problem of eyeballs and eyelids clipping through when the eyes are open and closed can be avoided, thus ensuring that the face sculpting process can be completed more realistically during the face sculpting stage.
[0065] Furthermore, to achieve a more realistic character animation in any changing scene, a visual change component can be added to the eye object. This component can then compensate for incremental information on other moving parts of the initial character, resulting in more realistic movement. In this embodiment, the specific implementation is as follows:
[0066] An eyeball object is identified in the initial character as the target organ object; a preset visual change component is loaded, and the visual change component is configured for the target organ object; wherein, the visual change component is used to determine the direction increment information of the eyeball object in the target state machine, and drive the eyelid object of the target character to follow the viewpoint change in the target face-shaping animation based on the direction increment information.
[0067] Specifically, directional incremental information refers to the incremental information collected when the eyeball changes its viewing angle, including but not limited to incremental values in the four directions: up, down, left, and right. Based on this, to ensure that the character's facial features change in sync with changes in the character's viewing angle—for example, looking up causes the eyelids to lift and looking down causes them to droop—the eyeball object can be identified as the target organ object in the initial character design. A preset visual change component can then be loaded and configured for the target organ object. This visual change component can be used to determine the directional incremental information of the eyeball object in the target state machine and, based on this directional incremental information, drive the target character's eyelid object to follow the viewing angle changes during the target character creation animation.
[0068] In practical applications, the visual change component can use the Look At component. By adding the Look At component to the eyeball, it is possible to control the direction of the eyeball toward the target object, and the neck and body can also rotate to follow the target. While the eyeball is looking at the target, the components of the eyeball skeleton in the four directions of up, down, left, and right can be calculated. The component values are used to drive the eyelids to follow the change in viewing angle, thus making the facial expressions of the character more realistic and controllable when looking at the target.
[0069] In summary, by adding visual change components to target organ objects, more controllable parameters can be configured on the initial character. When performing face-shaping, these controllable parameters can be combined to complete more subtle changes in facial expressions, thereby making the face-shaping results more realistic.
[0070] Step S206: Load the shaping data and shaping animation associated with the target character, and use the shaping data to drive the shaping animation to perform face shaping processing on the target character to obtain face shaping animation data.
[0071] Specifically, after obtaining the target character with added constraints and components, to further ensure a more realistic character creation effect and avoid clipping or abnormal bugs, shaping data and shaping animations set for the target character can be loaded. This allows shaping data to drive shaping animations to process the target character's face. Since the target character is obtained by adding rotation and stretch constraints, as well as the visual change component of the spouse, the shaping data and shaping animations will be combined to repair and correct the character's facial expressions during the face creation process. This will result in face creation animation data with facial expression changes, which can then be used to generate face creation animations for later use.
[0072] Specifically, the "shaping data" refers to the data used to adjust the facial expressions of the target character. This data drives the shaping animation to change the target character's facial expressions, thereby generating the face-shaping animation data. Correspondingly, the "shaping animation" refers to the animation set for the initial character. This animation adds new facial expressions to the initial character and is driven by the shaping data. It can create facial expressions on the target character's face that correspond to the shaping animation, thus obtaining the face-shaping animation data. Correspondingly, the face-shaping animation data refers to the animation data obtained after combining the shaping animation and shaping data to shape the target character's face. Based on this animation data, animations depicting changes in the target character's facial expressions can be generated, such as blinking, opening the mouth, raising eyebrows, and blowing air. In practical applications, the content of the face-shaping animation can be set according to actual needs; this embodiment does not impose any limitations.
[0073] Furthermore, in order to combine the modeling data with the modeling animation to perform precise facial sculpting of the target character, animation curves and animation expressions can be read from the modeling data. These two independent variables can be used to make more fine-grained adjustments, thereby obtaining more realistic facial sculpting animation data. In this embodiment, the specific implementation method is as follows:
[0074] The animation curve and animation expression are read from the shaping data, and the animation curve is adjusted using the animation expression to obtain the target animation curve; the target animation curve is used to drive the shaping animation to perform face sculpting on the target character to obtain face sculpting animation data.
[0075] Specifically, the animation curve refers to a custom curve function defined according to actual needs. It drives the face-shaping animation to correct the facial data, preventing clipping issues caused by excessively large facial data. In other words, the animation curve can be understood as an expression curve or a custom curve. Correspondingly, the animation expression refers to a preset mathematical calculation expression used in conjunction with the animation curve to dynamically and accurately drive the face-shaping animation, making the overlay of facial features and expressions more realistic. The target animation curve is the curve obtained after correcting the animation curve using the animation expression.
[0076] Therefore, to ensure a more realistic final face-shaping effect, custom shaping data for the initial character can be loaded first. Then, animation curves and animation expressions can be read from the shaping data. The animation curves can then be adjusted using the animation expressions to generate the target animation curve based on the adjustment results. Finally, the target animation curve can be used to drive the shaping animation to sculpt the target character's face, thus obtaining the face-shaping animation data.
[0077] In summary, to ensure a more realistic final face-shaping effect, the animation curves and animation expressions in the shaping data can be combined to overlay expressions and face-shaping, thereby ensuring a more accurate result.
[0078] Furthermore, when adjusting the animation curve, considering that both the animation expression and the animation curve are independent variables used for face-shaping repair and correction, the animation expression can be used to adjust the animation curve; in this embodiment, the specific implementation method is as follows:
[0079] The expression placeholders and animation parameter types of the animation expression are determined; the animation expression is parsed by a parser according to the expression placeholders and animation parameter types; the animation curve is adjusted according to the parsing results to obtain the target animation curve.
[0080] Specifically, "expression placeholder" refers to the placeholder information set for the animation expression, used to update the animation expression after it is obtained. Correspondingly, "animation parameter type" refers to the type set for the character creation animation.
[0081] Based on this, when adjusting the animation curve using animation expressions, the expression placeholders and animation parameter types of the animation expression can be determined. Then, the parser processes the animation expression according to the expression placeholders and animation parameter types. The animation curve can then be adjusted based on the parsing results to obtain the target animation curve.
[0082] In other words, the Bezier curve in the art software is reproduced in the Unity engine, the key points and values of the points on the curve are obtained, and the key points and values of the left and right control handles are used to map them into the engine. By calculating the slope and weight of the ingress and egress curves, subsequent shaping processing can be achieved.
[0083] The calculations are as follows: The slope of the ingress line = (y-coordinate of the point - y-coordinate of LeftHandle) * (x-coordinate of the point - x-coordinate of LeftHandle); the slope of the egress line = (y-coordinate of the point - y-coordinate of RightHandle) * (x-coordinate of the point - x-coordinate of RightHandle); the ingress weight = sqrt((y-coordinate of the point - y-coordinate of LeftHandle)^2 + (x-coordinate of the point - x-coordinate of LeftHandle)^2); the egress weight = sqrt((y-coordinate of the point - y-coordinate of RightHandle)^2 + (x-coordinate of the point - x-coordinate of RightHandle)^2).
[0084] In addition to implementing custom animation curves within the engine, custom mathematical expressions can be used to drive the mapping and adjustment of curve values. To ensure no clipping during the overlay of facial expressions and character creation animations, geometric calculations are used to map the corresponding values onto custom animation curves, which are then used to control facial expressions and poses. A Unity-based parser for evaluating mathematical expressions allows dynamic weight values to be passed as variables in the mathematical expression, participating in real-time calculations. Dynamic animation parameter passing is supported, and expressions can also be dynamically modified. For example, defining expressions for sad and happy states, while still playing a mouth-opening animation, can produce different mouth-opening actions after expression parsing and custom curve modification, thus distinguishing between happy and sad expressions and making character creation more realistic. During development, an expression placeholder can be defined, the types of animation parameters to be passed in can be registered, the animation expression to be calculated can be constructed, and then the parser parses the string into AST encoding. The encoded result, converted using Reverse Polish Notation, becomes the final value, ready for use.
[0085] The custom expression can be var context = new ExpresionContext <float>(); The registered animation parameters are context.RegisterVariable("a",()=>1); context.RegisterVariable("b",()=>2); context.RegisterVariable("c",()=>3); Set the mathematical expression, where a, b, and c are input variables, var input="a>=b AND NOT(b)OR(a+b)>=c"; Parse the expression, var compiledExpr=FloatExpressionParser.Instance.Compile(input,context,true); The final output result is var result=compiledExpr.Invoke(). By combining the mathematical expression parser and custom curves, the animation correction and shaping of facial expressions and character creation effects are well achieved, preventing clipping caused by excessive parameter stacking.
[0086] For example, suppose the eyelids have a three-stage closing motion. To achieve a seamless eyelid fit and correction effect when different characters close their eyes, avoiding clipping issues, a three-stage eye-closing animation can be designed programmatically based on custom curves and expressions. This divides the complete eye-closing process into three independent facial expressions and poses, mapping the values of the custom curves to achieve the desired effect. Figure 4 As shown, each segment of the three-stage eye-closing animation corresponds to a different curve, used to achieve a more realistic final animation effect. Furthermore, mouth shaping is more complex than eye-closing shaping. To meet the requirements, more precise mathematical values and several calculations of multiple input parameters can be introduced to obtain the output weight value of the animation controller, thereby achieving the effect of shaping the mouth's opening and closing.
[0087] Step S208: Update the face-shaping animation data according to the preset optimization rules, and generate the target face-shaping animation corresponding to the initial character based on the update result.
[0088] Specifically, after obtaining the face-shaping animation data, in order to ensure that the target face-shaping animation generated based on the face-shaping animation data is more realistic, the face-shaping animation data can be updated by combining preset optimization rules. This allows the influence of other dimensions to be integrated on the basis of the face-shaping animation data, thereby making the character's facial expressions richer, so as to generate the target face-shaping animation based on the update results.
[0089] Specifically, the optimization rules refer to the rules for updating the character creation animation data, aiming to make the character's facial expressions richer and more realistic in the final generated animation. This includes adding light-masking effects and using changes in facial features to drive changes in skin texture. Correspondingly, the target character creation animation refers to the video clip created for the corresponding initial character, whose content is used to showcase the effects of changes in the character's facial expressions.
[0090] Furthermore, in the target character creation animation generation stage, to improve the realism of the animation, dynamic normal texture rules and dynamic occlusion lighting rules can be combined for animation adjustments. This allows for adjustments to the normal texture and occlusion lighting effects of the character, resulting in a more realistic target character creation animation. In this embodiment, the specific implementation method is as follows:
[0091] Dynamic normal texture rules and dynamic occlusion light rules are extracted from the preset optimization rules; the dynamic normal texture rules are used to adjust the normal texture attribute data in the face-shaping animation data to obtain an intermediate face-shaping animation; the dynamic occlusion light rules are used to update the intermediate face-shaping animation to obtain the target face-shaping animation corresponding to the initial character.
[0092] Specifically, dynamic normal texture rules refer to rules that adjust the normal texture attributes of a character. This allows for changes in facial muscles to mirror changes in facial expressions, ensuring more realistic facial expressions and poses. For example, clenching teeth creates wrinkles on the face; squinting creates crow's feet. Correspondingly, dynamic occlusion lighting rules define occlusion lighting effects to create more natural lighting, such as high darkness and low brightness inside the mouth, and low darkness and high brightness outside the mouth. Finally, in-game character creation animation refers to animations that adjust normal texture attribute data using dynamic normal texture rules, resulting in animations that more closely resemble realistic facial expressions.
[0093] Based on this, in order to make facial expression changes more similar to real facial expression changes, dynamic normal texture rules and dynamic occlusion light rules can be extracted from the preset optimization rules. At this time, the normal texture attribute data in the face-shaping animation data can be adjusted using the dynamic normal texture rules to obtain the intermediate face-shaping animation. Then, the intermediate face-shaping animation can be updated using the dynamic occlusion light rules to realize the transformation of dynamic materials and obtain the target face-shaping animation corresponding to the initial character.
[0094] In summary, by combining dynamic normal texture rules and dynamic occlusion rules to adjust normal texture properties and occlusion effects, we can ensure that the final generated animation content is more similar to real facial expression changes, thereby improving the player's gaming experience in game scenes.
[0095] Furthermore, when dynamically adjusting the masking light, the intensity and boundary of the masking light are actually set using the masking light adsorption points; in this embodiment, the specific implementation method is as follows:
[0096] The vertex position information corresponding to the target character in the intermediate character creation animation is determined according to the dynamic occlusion light rules, and occlusion light snap points are created according to the vertex position information; a vertex configuration file is generated according to the occlusion light snap points, and occlusion light intensity information and occlusion light boundary information are generated based on the vertex configuration file; the intermediate character creation animation is updated using the occlusion light intensity information and the occlusion light boundary information to obtain the target character creation animation corresponding to the initial character.
[0097] Specifically, vertex position information refers to the vertex position information of the target character in the character creation animation. It allows for the setting of occlusion light snap points, enabling adjustments to the occlusion light effect based on these snap points. Correspondingly, the vertex configuration file is the file used for calculating the occlusion light effect. Furthermore, occlusion light intensity information sets the strength of the occlusion light effect, and occlusion light boundary information defines the range within which the occlusion light effect occurs.
[0098] Based on this, when processing the occlusion effect, the vertex position information corresponding to the target character in the intermediate character creation animation can be determined according to the dynamic occlusion rules. At this time, occlusion snap points can be created based on the vertex position information. Then, a vertex configuration file is generated based on the occlusion snap points. Based on this, the occlusion intensity information and occlusion boundary information are generated based on the vertex configuration file. This allows the intermediate character creation animation to be updated using the occlusion intensity information and occlusion boundary information, thereby obtaining the target character creation animation corresponding to the initial character.
[0099] In other words, by using facial expression and character creation animation poses in the state machine, combined with set rules and weight values, the normal texture properties in the material can be driven to achieve dynamic material transformation effects, such as frowning causing changes in the forehead skin. When setting dynamic occlusion lighting effects, considering that the area inside the character's mouth and under the eyelids are areas that are not illuminated, occlusion lighting treatment needs to be applied to these unlit areas. If a fake mesh material is overlaid, it will cause mesh window problems when playing character creation and expression animations on the character's face. Therefore, to improve the generation of occlusion lighting effects, the face mesh can be added to the overall target component to store the vertex positions of the face mesh in the expressionless state. Then, snap points are marked on the outline of the mesh that needs to be occluded. The skeletal animation will drive the snap points to move, achieving a dynamic point following effect. After marking the snap points, they are stored as a vertex configuration file for the overall mesh management component to read. Finally, in the real-time animation, the intensity and boundary of the occlusion lighting are dynamically geometrically output using the relevant data of the snap points, and then written into the material to generate the final character creation animation.
[0100] The animation generation method provided in this manual, in order to improve face-shaping efficiency and avoid clipping issues, first initializes the state machine to a target state machine based on the initial character's face-shaping data. This allows for efficient and flexible face-shaping processing in conjunction with the engine's state machine. Building upon this, to further enhance flexibility and prevent clipping, rotational and stretching constraints are added to the target state machine for the initial character, and visual change components are configured for the target organ objects of the initial character. The target character is then obtained based on the constraint additions and the configuration results of the visual change components. Next, the associated shaping data and shaping animation of the target character are loaded. This allows the shaping data to drive the shaping animation for face-shaping processing. During the face-shaping process, the shaping data and animation can be used to repair and correct the face-shaping effect, resulting in face-shaping animation data. Finally, the face-shaping animation data is updated according to preset optimization rules, and the target face-shaping animation is generated based on the updated results, ensuring a more realistic face-shaping animation. This method achieves flexible and clipping-free face-shaping processing while reducing the workload, enabling downstream businesses to use higher-quality face-shaping animations to complete project engineering.
[0101] The following is in conjunction with the appendix Figure 5 Taking the application of the animation generation method provided in this specification in a game scene as an example, the animation generation method will be further explained. Figure 5 The flowchart of an animation generation method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0102] Step S502: Obtain the character creation data submitted for the initial character and convert the character creation data into the initial character creation animation.
[0103] Step S504: Slice the initial face-shaping animation, generate an overlay animation based on the slicing results, construct a state machine based on the overlay animation, and initialize the state machine to obtain the target state machine.
[0104] In art software, the facial customization data is stored as animation clips. These clips are then sliced within the engine, and the "Add Reference Pose" option is selected to generate an overlay animation for frame 0. A state machine is then built using the AnimationClip resources of these clips. The base layer of this state machine can play facial animations without any expression, allowing for subsequent creation of facial customization animations. Furthermore, by utilizing the animation overlay mechanism, facial customization parameters and expression parameters from the data can be added as additional attributes within the state machine to achieve an overlay effect. This overlay can be maintained and managed, and within the overlay layer, a blending tree can be used to blend the facial customization animation effects, resulting in more realistic facial customization animations.
[0105] Step S506: Determine the mouth object and teeth object of the initial character in the target state machine, and load the mouth rotation constraint corresponding to the mouth object.
[0106] Step S508: Configure mouth rotation constraints for the tooth object in the target state machine as rotation constraints added to the initial character.
[0107] While state machines can achieve the effect of overlaying facial and facial animations, Unity's Direct Blend Tree does not support rotational blending, meaning it cannot effectively blend rotational transformations; it only supports translational transformations. Because rotational transformations in the state machine's blend tree are calculated using Euler angles, omnidirectional deadlock can occur when multi-axis rotational transformations occur. Therefore, a solution is to add a copy rotation constraint to the skinned skeleton of the teeth, copying the rotational transformation of the chin, thus achieving the effect of the mouth and teeth opening and closing as a whole.
[0108] Step S510: Determine the initial character's eyeball object and eyelid object in the target state machine, and determine the driving target point corresponding to the eyelid object.
[0109] Step S512: According to the preset volume rules of the eyeball object, configure constraint mapping rules for the driving target point in the target state machine as stretching constraints added to the initial character.
[0110] The stretch constraint adheres to its own defined Y-axis for rotation and scaling towards the target. Since the principal axis in the skeleton is the Y-axis, its corresponding Y-axis will be the tracking and stretching axis; no different axis is used. Simultaneously, the constrained bone can select some original volumetric features. Therefore, when the target approaches, the bone is compressed (e.g., when the eyes are closed, the eyelids compress the eyeball); when the target moves away, it becomes thicker (e.g., when the eyes are open, the eyelids become thicker). In character sculpting, by using stretch constraints, the bones involved in eyelid meshing are mapped to scaling transformations while maintaining volumetric rules, following the target point involved in the animation. This solves the problem of the eyelids not clipping through the eyeball when the eyes are closed. In practice, the rotation order of the bones towards the target and the volumetric rules for maintaining the constraint bones can be selected according to actual needs; for example, the rotation order can be XZ, ZX, or any rotation; the volume can be maintained as XZ, X, Z, or no volume is maintained.
[0111] Step S514: Identify the eyeball object in the initial character as the target organ object; load the preset visual change component, and configure the visual change component for the target organ object. The visual change component is used to determine the directional increment information of the eyeball object during target transformation, and based on the directional increment information, drive the eyelid object of the target character to follow the viewpoint change in the target character's facial animation.
[0112] Visual change components can utilize the Look At component. By adding the Look At component to the eyeball, it's possible to control the eyeball's orientation towards the target object, and the neck and body can also rotate to follow the target. While the eyeball is looking at the target, the components of the eyeball skeleton in the four directions of up, down, left, and right can be calculated. These component values are then used to drive the eyelids to follow the viewpoint changes, making the character's facial expressions more realistic and controllable when looking at the target.
[0113] Step S516 involves reading the expression curve and animation expression from the shaping data, adjusting the expression curve using the animation expression to obtain the target animation curve, and then using the target animation curve to drive the shaping animation to perform face sculpting on the target character, thereby obtaining face sculpting animation data. It can be understood that adjusting the curve essentially maps the expression processing result to the expression curve.
[0114] In the Unity engine, the Bézier curves in the art software are reproduced, and the key points and values of the points on the curve are obtained. Using the key points and values of the left and right control handles, they are mapped into the engine. By calculating the slope and weight of the ingress and egress curves, subsequent reshaping can be achieved.
[0115] The calculations are as follows: The slope of the ingress line = (y-coordinate of the point - y-coordinate of LeftHandle) * (x-coordinate of the point - x-coordinate of LeftHandle); the slope of the egress line = (y-coordinate of the point - y-coordinate of RightHandle) * (x-coordinate of the point - x-coordinate of RightHandle); the ingress weight = sqrt((y-coordinate of the point - y-coordinate of LeftHandle)^2 + (x-coordinate of the point - x-coordinate of LeftHandle)^2); the egress weight = sqrt((y-coordinate of the point - y-coordinate of RightHandle)^2 + (x-coordinate of the point - x-coordinate of RightHandle)^2).
[0116] In addition to implementing custom animation curves within the engine, custom mathematical expressions can be used to drive the mapping and adjustment of curve values. To ensure no clipping during the overlay of facial expressions and character creation animations, geometric calculations are used to map the corresponding values onto custom animation curves, which are then used to control facial expressions and poses. A Unity-based parser for evaluating mathematical expressions allows dynamic weight values to be passed as variables in the mathematical expression, participating in real-time calculations. Dynamic animation parameter passing is supported, and expressions can also be dynamically modified. For example, defining expressions for sad and happy states, while still playing a mouth-opening animation, can produce different mouth-opening actions after expression parsing and custom curve modification, thus distinguishing between happy and sad expressions and making character creation more realistic. During development, an expression placeholder can be defined, the types of animation parameters to be passed in can be registered, the animation expression to be calculated can be constructed, and then the parser parses the string into AST encoding. The encoded result, converted using Reverse Polish Notation, becomes the final value, ready for use.
[0117] The custom expression can be var context = new ExpresionContext <float>(); The registered animation parameters are context.RegisterVariable("a",()=>1); context.RegisterVariable("b",()=>2); context.RegisterVariable("c",()=>3); Set the mathematical expression, where a, b, and c are input variables, var input="a>=b AND NOT(b)OR(a+b)>=c"; Parse the expression, var compiledExpr=FloatExpressionParser.Instance.Compile(input,context,true); The final output result is var result=compiledExpr.Invoke(). By combining the mathematical expression parser and custom curves, the animation correction and shaping of facial expressions and character creation effects are well achieved, preventing clipping caused by excessive parameter stacking.
[0118] Step S518: Extract dynamic normal texture rules and dynamic occlusion light rules from the preset optimization rules, and use the dynamic normal texture rules to adjust the normal texture attribute data in the face-shaping animation data to obtain the intermediate face-shaping animation.
[0119] Step S520: Determine the vertex position information corresponding to the target character in the intermediate face-shaping animation according to the dynamic occlusion light rules, and create occlusion light snap points according to the vertex position information.
[0120] Step S522: Generate a vertex configuration file based on the shading light adsorption point, and generate shading light intensity information and shading light boundary information based on the vertex configuration file.
[0121] Step S524: Update the intermediate face-shaping animation using the occlusion light intensity information and occlusion light boundary information to obtain the target face-shaping animation corresponding to the initial character.
[0122] By using facial expression and character creation animation poses in the state machine, combined with set rules and weight values, the normal texture properties in the material can be driven to achieve dynamic material transformation effects, such as frowning causing changes in the forehead skin. When setting dynamic occlusion lighting effects, considering that the areas inside the character's mouth and under the eyelids are areas that are not illuminated, occlusion lighting treatment needs to be applied to these unlit areas. If a fake mesh material is overlaid, it will cause mesh window problems when playing character creation and expression animations on the character's face. Therefore, to improve the generation of occlusion lighting effects, the face mesh can be added to the overall target component, storing the vertex positions of the face mesh in the expressionless state. Then, snap points are marked on the outline of the mesh that needs to be occluded. The skeletal animation will drive the movement of the snap points, achieving a dynamic point following effect. After marking the snap points, they are stored as a vertex configuration file for the overall mesh management component to read. Finally, in the real-time animation, the intensity and boundary of the occlusion lighting are dynamically output using the relevant data of the snap points, and then written into the material to generate the final character creation animation.
[0123] The animation generation method provided in this manual, in order to improve face-shaping efficiency and avoid clipping issues, first initializes the state machine to a target state machine based on the initial character's face-shaping data. This allows for efficient and flexible face-shaping processing in conjunction with the engine's state machine. Building upon this, to further enhance flexibility and prevent clipping, rotational and stretching constraints are added to the target state machine for the initial character, and visual change components are configured for the target organ objects of the initial character. The target character is then obtained based on the constraint additions and the configuration results of the visual change components. Next, the associated shaping data and shaping animation of the target character are loaded. This allows the shaping data to drive the shaping animation for face-shaping processing. During the face-shaping process, the shaping data and animation can be used to repair and correct the face-shaping effect, resulting in face-shaping animation data. Finally, the face-shaping animation data is updated according to preset optimization rules, and the target face-shaping animation is generated based on the updated results, ensuring a more realistic face-shaping animation. This method achieves flexible and clipping-free face-shaping processing while reducing the workload, enabling downstream businesses to use higher-quality face-shaping animations to complete project engineering.
[0124] Corresponding to the above method embodiments, this specification also provides embodiments of an animation generation apparatus. Figure 6 A schematic diagram of an animation generation apparatus according to one embodiment of this specification is shown. Figure 6 As shown, the device includes:
[0125] Initialization module 602 is configured to initialize the state machine to the target state machine based on the initial character's face-shaping data;
[0126] Add module 604 is configured to add rotational and stretching constraints to the initial character in the target state machine, and to configure a visual change component for the target organ object of the initial character to obtain the target character;
[0127] The processing module 606 is configured to load the shaping data and shaping animation associated with the target character, and use the shaping data to drive the shaping animation to perform face shaping processing on the target character, thereby obtaining face shaping animation data.
[0128] The generation module 608 is configured to update the face-shaping animation data according to preset optimization rules, and generate the target face-shaping animation corresponding to the initial character based on the update result.
[0129] In an optional embodiment, the initialization module 602 is further configured to:
[0130] Obtain the character creation data submitted for the initial character and convert the character creation data into an initial character creation animation; perform slicing processing on the initial character creation animation and generate an overlay animation based on the slicing processing results; construct a state machine based on the overlay animation and perform initialization processing on the state machine to obtain the target state machine.
[0131] In an optional embodiment, the adding module 604 is further configured to:
[0132] In the target state machine, the mouth object and tooth object of the initial character are determined, and the mouth rotation constraint corresponding to the mouth object is loaded; in the target state machine, the mouth rotation constraint is configured for the tooth object as a rotation constraint added to the initial character.
[0133] In an optional embodiment, the adding module 604 is further configured to:
[0134] In the target state machine, the eyeball object and eyelid object of the initial character are determined, and the driving target point corresponding to the eyelid object is determined; according to the preset volume rules of the eyeball object, the driving target point is configured with a constraint mapping strategy in the target state machine as a stretching constraint added to the initial character.
[0135] In an optional embodiment, the adding module 604 is further configured to:
[0136] An eyeball object is identified in the initial character as the target organ object; a preset visual change component is loaded, and the visual change component is configured for the target organ object; wherein, the visual change component is used to determine the direction increment information of the eyeball object in the target state machine, and drive the eyelid object of the target character to follow the viewpoint change in the target face-shaping animation based on the direction increment information.
[0137] In an optional embodiment, the processing module 606 is further configured to:
[0138] The animation curve and animation expression are read from the shaping data, and the animation curve is adjusted using the animation expression to obtain the target animation curve; the target animation curve is used to drive the shaping animation to perform face sculpting on the target character to obtain face sculpting animation data.
[0139] In an optional embodiment, the processing module 606 is further configured to:
[0140] The expression placeholders and animation parameter types of the animation expression are determined; the animation expression is parsed by a parser according to the expression placeholders and animation parameter types; the animation curve is adjusted according to the parsing results to obtain the target animation curve.
[0141] In an optional embodiment, the generation module 608 is further configured to:
[0142] Dynamic normal texture rules and dynamic occlusion light rules are extracted from the preset optimization rules; the dynamic normal texture rules are used to adjust the normal texture attribute data in the face-shaping animation data to obtain an intermediate face-shaping animation; the dynamic occlusion light rules are used to update the intermediate face-shaping animation to obtain the target face-shaping animation corresponding to the initial character.
[0143] In an optional embodiment, the generation module 608 is further configured to:
[0144] The vertex position information corresponding to the target character in the intermediate character creation animation is determined according to the dynamic occlusion light rules, and occlusion light snap points are created according to the vertex position information; a vertex configuration file is generated according to the occlusion light snap points, and occlusion light intensity information and occlusion light boundary information are generated based on the vertex configuration file; the intermediate character creation animation is updated using the occlusion light intensity information and the occlusion light boundary information to obtain the target character creation animation corresponding to the initial character.
[0145] The animation generation device provided in this manual, in order to improve face-shaping efficiency and avoid clipping issues, first initializes the state machine to a target state machine based on the initial character's face-shaping data. This allows for efficient and flexible face-shaping processing in conjunction with the engine's state machine. Building upon this, to further enhance flexibility and prevent clipping, rotational and stretching constraints are added to the target state machine for the initial character, and visual change components are configured for the target organ objects. The target character is then obtained based on the constraint additions and the configuration of the visual change components. Next, the associated shaping data and shaping animation of the target character are loaded. This allows the shaping data to drive the shaping animation for face-shaping processing. During the face-shaping process, the shaping data and animation can be used to repair and correct the face-shaping effect, resulting in face-shaping animation data. Finally, the face-shaping animation data is updated according to preset optimization rules, generating the target face-shaping animation based on the updated results, ensuring a more realistic face-shaping animation. This achieves flexible and clipping-free face-shaping processing while reducing workload, enabling downstream businesses to use higher-quality face-shaping animations to complete project engineering.
[0146] The above is a schematic representation of an animation generation device according to this embodiment. It should be noted that the technical solution of this animation generation device and the technical solution of the above-described animation generation method belong to the same concept. Details not described in detail in the technical solution of the animation generation device can be found in the description of the technical solution of the above-described animation generation method.
[0147] Figure 7 A structural block diagram of a computing device 700 according to one embodiment of this specification is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.
[0148] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0149] In one embodiment of this specification, the above-described components of the computing device 700 and Figure 7 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 7 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0150] The computing device 700 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 700 can also be a mobile or stationary server.
[0151] The processor 720 is used to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described animation generation method.
[0152] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the animation generation method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the animation generation method described above.
[0153] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described animation generation method.
[0154] The above is an illustrative embodiment of a computer-readable storage medium. It should be noted that the technical solution of this storage medium and the technical solution of the animation generation method described above belong to the same concept. Details not described in detail in the technical solution of the storage medium can be found in the description of the technical solution of the animation generation method described above.
[0155] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described animation generation method.
[0156] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the animation generation method described above belong to the same concept. Details not described in detail in the technical solution of the computer program can be found in the description of the technical solution of the animation generation method described above.
[0157] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0158] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0159] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0160] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0161] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.< / float> < / float>
Claims
1. An animation generation method, characterized in that, include: The state machine is initialized to the target state machine based on the initial character's facial data; In the target state machine, rotational and stretching constraints are added to the initial character, and visual change components are configured for the target organ object of the initial character to obtain the target character; Load the shaping data and shaping animation associated with the target character, and use the shaping data to drive the shaping animation to perform face shaping processing on the target character, thereby obtaining face shaping animation data; The character creation animation data is updated according to preset optimization rules, and the target character creation animation corresponding to the initial character is generated based on the update results.
2. The animation generation method according to claim 1, characterized in that, The initialization of the state machine to the target state machine based on the initial character's facial data includes: Obtain the character creation data submitted for the initial character, and convert the character creation data into an initial character creation animation; The initial character creation animation is sliced, and an overlay animation is generated based on the slicing results. A state machine is constructed based on the superimposed animation, and the state machine is initialized to obtain the target state machine.
3. The animation generation method according to claim 1, characterized in that, Adding rotation constraints to the initial role in the target state machine includes: In the target state machine, determine the mouth object and teeth object of the initial character, and load the mouth rotation constraint corresponding to the mouth object; In the target state machine, the mouth rotation constraint is configured for the tooth object as a rotation constraint added to the initial character.
4. The animation generation method according to claim 1, characterized in that, The step of adding stretch constraints to the initial role in the target state machine includes: In the target state machine, the eyeball object and eyelid object of the initial character are determined, and the driving target point corresponding to the eyelid object is determined; According to the preset volume rules of the eyeball object, a constraint mapping strategy is configured for the driving target point in the target state machine as a stretching constraint added to the initial role.
5. The animation generation method according to claim 1, characterized in that, The configuration of the visual change component for the target organ object of the initial character includes: In the initial character, an eyeball object is identified as the target organ object; Load the preset visual change component and configure the visual change component for the target organ object; The visual change component is used to determine the direction increment information of the eyeball object in the target state machine, and drive the eyelid object of the target character to follow the viewpoint change in the target face-shaping animation based on the direction increment information.
6. The animation generation method according to claim 1, characterized in that, The step of using the shaping data to drive the shaping animation to perform face sculpting on the target character, and obtaining face sculpting animation data, includes: The animation curve and animation expression are read from the modification data, and the animation curve is adjusted using the animation expression to obtain the target animation curve; The target animation curve is used to drive the shaping animation to perform face sculpting on the target character, thereby obtaining face sculpting animation data.
7. The animation generation method according to claim 6, characterized in that, The step of adjusting the animation curve using the animation expression to obtain the target animation curve includes: Determine the expression placeholders and animation parameter types for the animation expression; The parser parses the animation expression according to the expression placeholders and the animation parameter types. The animation curve is adjusted based on the analysis results to obtain the target animation curve.
8. The animation generation method according to any one of claims 1-7, characterized in that, The step of updating the character creation animation data according to preset optimization rules and generating the target character creation animation corresponding to the initial character based on the update result includes: Extract dynamic normal texture rules and dynamic occlusion light rules from the preset optimization rules; The dynamic normal texture rules are used to adjust the normal texture attribute data in the face-shaping animation data to obtain the intermediate face-shaping animation; The intermediate character creation animation is updated using the dynamic occlusion light rules to obtain the target character creation animation corresponding to the initial character.
9. The animation generation method according to claim 8, characterized in that, The step of updating the intermediate character creation animation using the dynamic occlusion light rule to obtain the target character creation animation corresponding to the initial character includes: The vertex position information corresponding to the target character in the intermediate face-shaping animation is determined according to the dynamic occlusion light rules, and occlusion light adsorption points are created according to the vertex position information; A vertex configuration file is generated based on the shading light adsorption points, and shading light intensity information and shading light boundary information are generated based on the vertex configuration file; The intermediate character creation animation is updated using the occlusion light intensity information and the occlusion light boundary information to obtain the target character creation animation corresponding to the initial character.
10. An animation generation device, characterized in that, include: The initialization module is configured to initialize the state machine to the target state machine based on the initial character's character creation data; An add module is configured to add rotational and stretch constraints to the initial character in the target state machine, and to configure a visual change component for the target organ object of the initial character to obtain the target character; The processing module is configured to load the shaping data and shaping animation associated with the target character, and use the shaping data to drive the shaping animation to perform face shaping processing on the target character, thereby obtaining face shaping animation data. The generation module is configured to update the face-shaping animation data according to preset optimization rules, and generate the target face-shaping animation corresponding to the initial character based on the update result.
11. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Expression animation generation method and device, storage medium and electronic device
CN107657651A
Enhanced system for generation of facial models and animation
US20220398796A1