Model animation generation method and device, electronic equipment and storage medium
By presenting the target model on the graphical user interface and generating deformation information based on preset mapping relationships, the problem of too many controllers in the complex structure character binding file is solved, and more efficient animation production and clearer operational vision is achieved.
Patent Information
- Application Number
- CN202510228047.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-20
AI Technical Summary
In the prior art, complex structures or character binding files with many decorations contain a large number of controllers, resulting in a messy animation production process and reducing efficiency.
By presenting the target model on the graphical user interface, and according to the preset position mapping relationship between the source model and the target model, the controller position change information of the target part corresponding to the source part on the source model is determined, the deformation information of each point in the source part is generated, the deformation of the target part is controlled to deformation, and the model animation is generated.
It reduces the display of the controller, improves the efficiency of animation production, and makes the animator's operations clearer and more accurate, suitable for the production of fine animations, special effects or character expressions.
Smart Images

Figure CN120182441A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D animation technology. Specifically, it relates to a method, device, electronic device, and storage medium for generating model animations. Background Art
[0002] During the production of animations or games, riggers are responsible for binding models to controllers and generating binding files for animators to use, enabling animators to create animations according to shot requirements.
[0003] However, for the binding of characters with complex structures or numerous decorations (such as clothing, accessories, etc.), the binding files often contain many controllers, which not only makes the animation production process chaotic but also significantly reduces the animation production efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a method, device, electronic device, and storage medium for generating model animations to reduce the display of controllers and improve the animation production efficiency in view of the above deficiencies in the prior art.
[0005] To achieve the above objective, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, an embodiment of this application provides a method for generating a model animation. The method includes:
[0007] Presenting a target model pre-created based on a source model on a graphical user interface, where the source model includes multiple parts and a controller corresponding to each part;
[0008] Responding to a deformation control operation on a target part of the target model, and determining position change information of a controller of a source part corresponding to the target part on the source model according to a preset position mapping relationship between the source model and the target model;
[0009] Using the controller of the source part to generate deformation information of each point in the source part according to the position change information;
[0010] Controlling each point of the target part to deform according to the deformation information of each point in the source part by using a preset deformation mapping relationship between the source model and the target model to generate a model animation corresponding to the source model.
[0011] In a second aspect, an embodiment of this application further provides a device for generating a model animation. The device includes:
[0012] A display module for presenting a target model corresponding to a source model on a graphical user interface, where the source model includes multiple parts and a controller corresponding to each part;
[0013] A determination module, configured to respond to a deformation control operation on a target part of the target model, and determine position change information of a controller of a source part corresponding to the target part on the source model according to a preset position mapping relationship between the source model and the target model;
[0014] A generation module, configured to use the controller of the source part to generate deformation information of each point in the source part according to the position change information;
[0015] A control module, configured to control deformation of each point of the target part according to the deformation information of each point in the source part, and use a preset deformation mapping relationship between the source model and the target model to generate an animation model corresponding to the source model.
[0016] In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the model animation generation method according to any one of the first aspects.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the steps of the model animation generation method according to any one of the first aspects.
[0018] The beneficial effects of the present application are as follows:
[0019] The model animation generation method, device, electronic device, and storage medium provided by the present application hide the source model and the controller. By performing deformation control on the target part in the target model, and then based on the position mapping relationship and deformation mapping relationship between the target part and the source part, the deformation information of each point generated by the source part based on the position change information is transmitted to the target part to realize the deformation of the target part. In this way, the control of each part of the model is more intuitive. It not only realizes the generation of the model animation by controlling the deformation of the model, but also does not display too many controllers visually to affect the operation line of sight of the animator, ensuring the clarity of the animator's operation and improving the production efficiency; and because the deformation control operation directly acts on the target part rather than the controller, more accurate deformation control of the model can be performed, which is convenient for application in fine animations, special effects, or character expressions. Description of the Drawings
[0020] To more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings required for the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 It is a schematic diagram of existing model control;
[0022] Figure 2 It is a flowchart showing the method for generating a model animation provided by an embodiment of the present application Figure 1 ;
[0023] Figure 3 It is a flowchart showing the method for generating a model animation provided by an embodiment of the present application Figure 2 ;
[0024] Figure 4 It is a flowchart showing the method for generating a model animation provided by an embodiment of the present application Figure 3 ;
[0025] Figure 5 It is a flowchart showing the method for generating a model animation provided by an embodiment of the present application Figure 4 ;
[0026] Figure 6 It is a flowchart showing the method for generating a model animation provided by an embodiment of the present application Figure 5 ;
[0027] Figure 7 It is a flowchart showing the method for generating a model animation provided by an embodiment of the present application Figure 6 ;
[0028] Figure 8 It is a flowchart showing the process of binding the source part and the target part provided by an embodiment of the present application;
[0029] Figure 9 It is a comparison diagram of the source model and the target model provided by an embodiment of the present application Figure 1 ;
[0030] Figure 10 It is a schematic diagram of the point-plane mapping relationship provided by an embodiment of the present application;
[0031] Figure 11 It is a comparison diagram of the source model and the target model provided by an embodiment of the present application Figure 2 ;
[0032] Figure 12 It is a logical flowchart of the deformation node provided by an embodiment of the present application;
[0033] Figure 13 Schematic diagram of the model animation generation device provided by an embodiment of the present application;
[0034] Figure 14 Schematic diagram of the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application.
[0036] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application claimed, but merely represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0037] In addition, the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0038] It should be noted that the features in the embodiments of the present application can be combined with each other without conflict.
[0039] After the model is completed, it cannot be directly used by animators to create animations. The rigger needs to add bones and controllers to the model and reasonably allocate the weights of the bones before handing it over to the animator, who then operates the controller to create 3D animations.
[0040] Controllers usually refer to auxiliary objects used to manipulate the bound character file to create animations. Animators use the controller to move, rotate, and scale various parts of the character. The controller itself will not be rendered, and its purpose is to provide an intuitive and easy-to-operate way to control the character's animation.
[0041] Controllers can be simple shapes like circles, squares, or custom NURBS curves, or they can be more complex setups that include multiple layers for manipulating complex movements or expressions. Figure 1 The control diagram for the existing model is as follows: Figure 1 As shown, the highlighted curve is the controller bound to the model, which can control the model's expression and action. The specific control method is that the animator controls the controllers of each part to control the corresponding part to rotate and move.
[0042] It can be seen that there is a hierarchy between the parts of the model to be controlled and the controllers. The control effect is acceptable when the model only contains a small number of controllers. However, in the animation refinement stage, the model contains a large number of controllers. Multiple controllers will hinder the animator's operating vision and affect the clarity and efficiency of the operation.
[0043] Based on the problems existing in the above prior art, the present application provides a model animation generation method, device, electronic device and storage medium. The specific implementation of the solution provided by the present application is described below in conjunction with the embodiments.
[0044] It should be noted that the model animation generation method provided in the present application can be implemented based on a digital content creation tool (DDC). The DDC tool may be, for example, Maya, Houdini, Nuke, UnrealEngine, etc. This embodiment does not impose any limitation on this.
[0045] Figure 2 Schematic diagram of the process of generating model animation provided in the embodiment of the present application Figure 1 ,like Figure 2 As shown, the method may include:
[0046] S101. Presenting a target model pre-created based on a source model on a graphical user interface, where the source model includes multiple parts and a controller corresponding to each part.
[0047] The source model is a model of the object to be controlled. The source model is composed of multiple parts, and each part is pre-bound with a corresponding controller Ctrl, wherein the division of parts can be determined according to the control requirements and control accuracy. For example, taking the humanoid source model as an example, the multiple parts can be the head, limbs and torso. Under higher control accuracy, the eyebrows and mouth of the head can also be controllable parts, and the arms can also be divided into upper arms, elbows, forearms, palms and other parts. The same is true for the legs. If the humanoid source model contains clothing and accessories, the clothing and accessories can also be used as controllable parts. For multiple parts of the source model, the binder pre-binds the corresponding controller Ctrl for each of the multiple parts. Specifically, it can be as followsFigure 1 as shown
[0048] When there are many parts that can be controlled by the source model and the corresponding controllers Ctrl are also numerous, if the corresponding parts are directly deformed by the controllers Ctrl, there will be problems such as the controllers Ctrl blocking the animator's line of sight, affecting the clarity of operations, and operation efficiency.
[0049] In this embodiment, in order to achieve both controlling the model to deform and avoiding the problem of a cluttered screen caused by too many controllers, a target model is created according to the first part of the source model where the controller Ctrl needs to be hidden.
[0050] In some embodiments, the source model is copied, and according to the first part of the source model where the controller Ctrl needs to be hidden, it is determined that the first part on the copied target model is in an editable state. The target model is exactly the same as the source model in terms of model structure and includes multiple parts, but the first part in the target model does not have the controller Ctrl.
[0051] After creating the target model corresponding to the source model, a mapping relationship between the first part of the target model and the first part of the source model is established, a binding file including the source model, the target model, and the mapping relationship is generated, and in response to an open operation on the binding file, the target model is presented in the graphical user interface.
[0052] In some embodiments, after creating the target model, the target model generates a model animation instead of the source model. For the first part where the controller Ctrl needs to be hidden, the first part in the target model does not have the controller Ctrl. For the second part where the controller Ctrl does not need to be hidden, the second part in the target model has the controller Ctrl.
[0053] In some embodiments, if the controllers of all parts in the source model are hidden, then the controller Ctrl is not displayed in the target model presented in the graphical user interface.
[0054] In other embodiments, if the controllers of some parts in the source model need to be hidden, then the number of controllers Ctrl displayed in the target model presented in the graphical user interface is much smaller than the number of controllers Ctrl displayed in the source model.
[0055] S102. In response to a deformation control operation on a target part of the target model, according to the preset position mapping relationship between the source model and the target model, determine the position change information of the controller of the source part corresponding to the target part on the source model.
[0056] In this embodiment, the position mapping relationship between the source model and the target model is the position mapping relationship between the first part in the source model and the first part in the target model. When an animator needs to control the deformation of the target part TarModel in the first part, the target part TarModel can be selected from the first part of the target model, and the deformation control of the target part TarModel is performed. The deformation control includes rotation, translation, and scaling. According to the deformation control operation of the target part TarModel, the position change information of the target part TarModel is determined.
[0057] According to the position mapping relationship between the first part in the source model and the first part in the target model, the source part OriModel corresponding to the target part TarModel on the source model is determined. Since the target part TarModel is obtained by copying the source part OriModel on the source model, the position change information of the target part TarModel is equivalent to the position change information of the source part OriModel.
[0058] Since the deformation of the source part in the source model is determined by the controller Ctrl of the source part OriModel, the position change information of the source part OriModel is used as the position change information of the controller Ctrl.
[0059] S103. Use the controller of the source part to generate the deformation information of each point in the source part according to the position change information.
[0060] In this embodiment, the source part OriModel is composed of multiple faces with preset shapes, and each face has corresponding vertices. According to the deformation algorithm of the controller Ctrl of the source part OriModel and the position change information of the controller Ctrl, the deformation information of the vertices of the multiple faces of the source part OriModel is calculated. The deformation information of the vertices is the position coordinate information of the vertices in the world coordinate system after deformation based on the control of the controller Ctrl.
[0061] S104. According to the deformation information of each point in the source part, use the preset deformation mapping relationship between the source model and the target model to control the deformation of each point of the target part, and generate the model animation corresponding to the source model.
[0062] In this embodiment, since the target part TarModel in the target model is obtained by copying the source part OriModel in the source model, there is a one-to-one mapping relationship between each point in the source part OriModel and each point in the target part TarModel. The preset deformation mapping relationship is used to indicate the mapping relationship between each point in the source part OriModel and each point in the target part TarModel, and the deformation information of each point in the source part OriModel is transmitted to the target part TarModel to control the deformation of each point in the target part TarModel, so that based on the deformation control operation for the target part TarModel, the deformation calculation is performed through the controller Ctrl of the source part OriModel, and the deformation information is transmitted to the target part TarModel to achieve the deformation control of the target part TarModel. The model animation generated based on the deformation of the target part TarModel of the target model is actually the model animation of the source model.
[0063] Among them, the target model that undergoes deformation is the action of the model set by the animator at the key frame. By setting the deformation of the target model at multiple key frames, a model animation can be generated.
[0064] In some embodiments, if there is a second part in the target model that displays the controller Ctrl, the second part can be directly controlled to deform through the controller Ctrl of the second part. For example, the second part can be the whole of the target model, or a large part composed of each part, such as the whole arm, the whole torso, etc. The controller Ctrl of the second part can control the whole target model to rotate and scale.
[0065] It should be noted that in the prior art, the source model is directly controlled by the controller to generate a model animation, while in this application, the source model and the controller are hidden, and the deformation control of the target part in the target model is performed. Then, based on the position mapping relationship and the deformation mapping relationship between the target part and the source part, the deformation information of each point generated by the source part based on the position change information is transmitted to the target part to achieve the deformation of the target part.
[0066] The model animation generation method provided in the above embodiments hides the source model and the controller, controls the deformation of the target part in the target model, and then based on the position mapping relationship and the deformation mapping relationship between the target part and the source part, transmits the deformation information of each point generated by the source part based on the position change information to the target part to achieve the deformation of the target part. In this way, the control of each part of the model is more intuitive. It not only realizes the deformation control of the model to generate model animations, but also does not display too many controllers visually to affect the animator's operation line of sight, ensuring the clarity of the animator's operation and improving the production efficiency. Moreover, since the deformation control operation directly acts on the target part rather than the controller, more accurate deformation control of the model can be performed, which is convenient for application in fine animations, special effects, or character expressions.
[0067] In a possible implementation manner, Figure 3 is a flowchart of the model animation generation method provided by the embodiments of the present application Figure 2 as Figure 3 shown, before presenting the target model pre-created based on the source model on the graphical user interface in the above S101, the method may further include:
[0068] S201. Determine the source part from multiple parts of the source model, where each part of the source model includes multiple faces.
[0069] S202. Create a target model including the target part according to the face information of the source part.
[0070] S203. Establish a position mapping relationship and a deformation mapping relationship between the source part and the target part.
[0071] In this embodiment, the source model is composed of multiple parts, each part includes multiple faces. Select the part that needs to hide the controller from the multiple parts as the source part OriModel, copy the source model, and determine the target part TarModel corresponding to the source part in the copied model according to the face information of the source part OriModel, so as to obtain a target model including the target part TarModel, and make the copied target part TarModel have the same face information as the source part OriModel.
[0072] The target model has the same shape as the source model. The difference is that the target part TarModel in the target model does not include a controller, and only the target part has face information, and other parts do not have face information.
[0073] Establish a one-to-one correspondence between the source part OriModel and the target part TarModel as the position mapping relationship, which is used to indicate that the overall position of the source part OriModel corresponds to the overall position of the target part TarModel; establish a one-to-one correspondence between the vertices of multiple faces in the source part OriModel and the vertices of multiple faces in the target part TarModel of the part TarModel as the deformation mapping relationship, and the deformation mapping relationship is used to indicate that the position of each vertex of the source part OriModel corresponds to the position of each vertex of the target part TarModel.
[0074] In some embodiments, the position mapping relationship between the source part and the target part TarModel can be established according to the central position of the source part OriModel and the central position of the target part TarModel.
[0075] In some embodiments, the position mapping relationship between the source part and the target part TarModel can be established according to the central position of the source part OriModel and the central position of the target part TarModel.
[0076] In other embodiments, the position mapping relationship between the source part and the target part TarModel can be established according to the axis of the source part OriModel and the axis of the target part TarModel of the part TarModel.
[0077] In a possible implementation manner, the process of determining the source part from multiple parts of the source model in S201 may include:
[0078] According to the list of multiple face numbers of the source model, determine the source face number list, and the numbers of the multiple faces included in each part constitute the face number list corresponding to each part; determine the source part according to the faces corresponding to the source face number list, and the face information of the source part is the source face number list.
[0079] In this embodiment, multiple parts included in the source model are all composed of multiple faces of a preset shape, where the preset shape is a polygon, such as a rectangle or a triangle. Number all the faces in the source model, each face has a unique number, and the numbers of the multiple faces corresponding to each part form the face number list corresponding to each part. According to the parts corresponding to the multiple face number lists, select the face number list corresponding to the source part OriModel that needs to hide the controller from the multiple face number lists as the source face number list OriFaceList, and form the source part OriModel according to the faces corresponding to the respective face numbers in the source face number list OriFaceList on the source model.
[0080] The model animation generation method provided in the above embodiments generates a target part by replicating a source part based on the face information of the source part, and establishes a position mapping relationship and a deformation mapping relationship between the source part and the target part, so as to transmit the position change of the target part to the source part based on the position mapping relationship. The controller of the source part determines the deformation information of each point based on the position change, and then transmits the deformation information of each point to each point of the target part based on the deformation mapping relationship to control the deformation of the target part, realizing deformation control without displaying the controller on the target part, ensuring the visual simplicity of the animator, and improving the operation clarity and operation efficiency of the animator.
[0081] In a possible implementation manner, Figure 4 is a schematic flowchart of the model animation generation method provided in the embodiments of the present application Figure 3 , as Figure 4 shown, the process of establishing the position mapping relationship between the source part and the target part in S203 above may include:
[0082] S301. Set a moving and rotating axis for the target part according to the moving and rotating axis corresponding to the controller of the source part.
[0083] S302. Establish a binding relationship between the target part and the controller of the source part, and the position mapping relationship is the binding relationship between the target part and the controller of the source part.
[0084] In this embodiment, the controller of each part of the source model has a corresponding moving and rotating axis Pivot. During the process of controlling the deformation of the corresponding part through the controller, the controller is controlled based on the moving and rotating axis Pivot. Among them, the position information of the moving and rotating axis Pivot of the controller includes the world coordinate position of the moving and rotating axis Pivot and the axis direction.
[0085] In order to ensure that the position change of the target part TarModel is consistent with the position change of the source part OriModel, the position information of the moving and rotating axis of the target part TarModel is set according to the position information of the moving and rotating axis Pivot corresponding to the controller of the source part OriModel, so that the position information of the moving and rotating axis of the target part TarModel is the same as the position information of the moving and rotating axis Pivot corresponding to the controller of the source part OriModel.
[0086] Bind the controller of the target part TarModel to the controller of the source part OriModel, so that when the position of the target part TarModel changes, the position change information of the moving and rotating axis center of the target part TarModel is transmitted to the controller Ctrl of the source part OriModel, so that the controller Ctrl of the source part OriModel controls the position of its own moving and rotating axis center Pivot to change in the same way based on the position change information of the moving and rotating axis center of the target part TarModel, and thus determine the deformation information of each point of the source part OriModel based on the deformation control algorithm in the controller Ctrl.
[0087] In some embodiments, the model includes two attribute information, namely transform information and shape information. Among them, the transform information records the position information of the model, and the shape information records the position information of each point in the model. When the transform information of the target part TarModel changes, based on the position mapping relationship between the target part TarModel and the controller Ctrl of the source part OriModel, the transform information of the controller Ctrl also changes in the same way, causing the shape information of each point of the source part OriModel to change. Based on the deformation mapping relationship between the target part TarModel and the source part OriModel, the shape information of each point of the target part TarModel also changes in the same way.
[0088] In a possible implementation manner, the process of establishing the binding relationship between the controller of the target part and the controller of the source part in S302 may include:
[0089] Establish the rotation and movement constraint relationship and the scaling follow constraint relationship between the controller of the target part and the controller of the source part.
[0090] In this embodiment, establish the parent-child constraint relationship between the controller Ctrl of the target part TarModel and the source part OriModel, where the target part TarModel is the parent node and the controller Ctrl of the source part OriModel is the child node. The parent-child constraint relationship includes the rotation and movement constraint relationship and the scaling mapping relationship.
[0091] The rotation and movement constraint relationship means that when the target part TarModel rotates and / or moves in the world coordinate system, the controller Ctrl of the source part OriModel also rotates and / or moves in the world coordinate system.
[0092] If the rotation and translation constraint relationship between the controller Ctrl of the target part TarModel and the controller Ctrl of the source part OriModel is a non-offset constraint, the axis center of the target part TarModel completely coincides with the axis center of the controller Ctrl of the source part OriModel, and the offset value is 0; if the rotation and translation constraint relationship between the controller Ctrl of the target part TarModel and the controller Ctrl of the source part OriModel is an offset constraint, there is a preset offset value between the axis center of the target part TarModel and the axis center of the controller Ctrl of the source part OriModel, and the preset offset value does not change with the rotation and / or translation of the parent and child nodes.
[0093] The scale mapping relationship means that when the target part TarModel is scaled down or up in the world coordinate system, the controller Ctrl of the source part OriModel is also scaled down or up in the world coordinate system.
[0094] If the scale constraint relationship between the controller Ctrl of the target part TarModel and the controller Ctrl of the source part OriModel is a non-offset constraint, the scale of the target part TarModel completely coincides with the scale of the controller Ctrl of the source part OriModel, and the offset value is 0; if the scale constraint relationship between the controller Ctrl of the target part TarModel and the controller Ctrl of the source part OriModel is an offset constraint, there is a preset offset value in the scale between the target part TarModel and the controller Ctrl of the source part OriModel, and the preset offset value does not change with the rotation and / or translation of the parent and child nodes.
[0095] The model animation generation method provided in the above embodiments sets the translation and rotation axis centers for the target part based on the translation and rotation axis center of the controller of the source part, and binds the controller of the source part to the target part, so that the controller of the source part changes with the position change of the target part, thereby enabling deformation control without directly operating the controller, avoiding excessive controllers from affecting the operation of the animator, and improving the operation accuracy and efficiency of the animator.
[0096] In a possible implementation manner, the process of establishing the deformation mapping relationship between the source part and the target part in S203 may include:
[0097] According to the face information of the source part and the face information of the target part, determine the source point sequence number list of the source part and the target point sequence number list of the target part, and the source point sequence number list and the target point sequence number list have a point mapping relationship; according to the source point sequence number list and the target point sequence number list, establish the deformation mapping relationship between the source part and the target part.
[0098] In this embodiment, multiple parts of the source model are each composed of multiple faces, and each face is a polygon composed of multiple points. The points in the source model are sequentially numbered, and each point has a unique serial number. According to the serial numbers of the points that make up the multiple faces of the source part OriModel, the source point serial number list OriIdList of the source part OriModel is determined.
[0099] The target part TarModel is also composed of multiple faces, and each face is a polygon composed of multiple points. The points of the target part TarModel are sequentially numbered, and each point has a unique serial number, and the target point serial number list TarIdList of the target part TarModel is determined.
[0100] According to the correspondence between the points of the source part OriModel and the points of the target part TarModel, the one-to-one correspondence between the serial numbers of the points in the source point serial number list OriIdList and the serial numbers of the points in the target point serial number list TarIdList is determined.
[0101] A reference point serial number list is established. The number of points in the reference point serial number list is the same as the number of points in the source point serial number list OriIdList and the target point serial number list TarIdList, and there is also a one-to-one correspondence between the points in the reference point serial number list and the points in the source point serial number list OriIdList and the target point serial number list TarIdList. Each point in the reference point serial number list has a corresponding world coordinate, and the world coordinates of the points in the reference point serial number list are fixed and unchanged. According to the one-to-one correspondence between the points in the reference point serial number list, the source point serial number list OriIdList, and the target point serial number list TarIdList, the deformation mapping relationship between the source part OriModel and the target part TarModel is established.
[0102] The deformation mapping relationship is used to indicate that according to the coordinate differences of the one-to-one corresponding points in the reference point serial number list and the source point serial number list OriIdList, the deformation information of each point is determined, and according to the mapping relationship between the points in the source point serial number list OriIdList and the target point serial number list TarIdList, the deformation information of each point is transmitted to the points in the target point serial number list TarIdList for deformation.
[0103] In a possible implementation manner, Figure 5 is a schematic flow of the model animation generation method provided by the embodiment of the present application Figure 4 As Figure 5 shown, the process of determining the source point serial number list of the source part and the target point serial number list of the target part according to the face information of the source part and the face information of the target part may include:
[0104] S401. Determine the first point sequence number list of the source part according to the surface information of the source part. Each point in the first point sequence number list is the vertex of multiple surfaces constituting the source part.
[0105] S402. Determine the second point sequence number list of the target part according to the surface information of the target part. Each point in the second point sequence number list is the vertex of multiple surfaces constituting the target part.
[0106] S403. Update the first point sequence number list and the second point sequence number list according to the mapping relationship between each point in the source part and the target part, to obtain the source point sequence number list and the target point sequence number list.
[0107] In this embodiment, according to the sequence numbers of the points of multiple surfaces constituting the source part OriModel, determine the first point sequence number list OriVertexList of the source part OriModel, number each point of the target part TarModel in sequence, each point has a unique sequence number, and determine the second point sequence number list TarVertexList of the target part TarModel.
[0108] To ensure that the numbering order of each point in the two point sequence number lists is arranged corresponding to the mapping relationship between each point, it is necessary to reorder the numbers of each point in the first point sequence number list OriVertexList and the second point sequence number list TarVertexList according to the mapping relationship between each point in the source part and the target part, so that the point numbers in the same order after sorting represent two points with a mapping relationship, to obtain the source point sequence number list OriIdList and the target point sequence number list TarIdList.
[0109] In some embodiments, Figure 6 is the flowchart illustration of the model animation generation method provided by the embodiment of the present application Figure 5 , as Figure 6 shown, the process of the above S403 to update the first point sequence number list and the second point sequence number list according to the mapping relationship between each point in the source part and the target part, to obtain the source point sequence number list and the target point sequence number list, may include:
[0110] S501. Traverse each source point in the first point sequence number list, and generate a source point data list according to the sequence number and position information of each source point.
[0111] In this embodiment, iterate through the numbers ID of each source point in the first point sequence number list OriVertexList, obtain the number ID of each source point, and determine the position information of the source point in the world coordinate system from the source model according to the number ID of each source point. The position information includes the coordinates Pos of the source point in the world coordinate system and the distance Dist of the source point from the origin. According to the number ID of each source point, the coordinates Pos of each source point, and the distance Dist, form a source point data list OriPosDistList, where the number ID of each source point is the first element, the X, Y, and Z axis coordinates of each source point are the second, third, and fourth elements respectively, and the distance Dist of each source point is the fifth element. For example, [[1, 0.1, 0.2, 0.3, 0.37416], [2, 3.0, 4.0, 5.0, 7.071],...].
[0112] S502. Traverse each target point in the second point sequence number list, and generate a target point data list according to the sequence number and position relationship of each target point.
[0113] In this embodiment, iterate through the numbers ID of each target point in the second point sequence number list TarVertexList, obtain the number ID of each target point, and determine the position information of the target point in the world coordinate system from the target model according to the number ID of each target point. The position information includes the coordinates Pos of the target point in the world coordinate system and the distance Dist of the target point from the origin. According to the number ID of each target point, the coordinates Pos of each target point, and the distance Dist, form a target point data list TarPosDistList. Wherein, the number ID of each target point is the first element, the X, Y, and Z axis coordinates of each target point are the second, third, and fourth elements respectively, and the distance Dist of each target point is the fifth element.
[0114] S503. Sort each source point in the source point data list according to the position information of each source point.
[0115] In this embodiment, according to the coordinates Pos of each source point in the world coordinate system and the distance Dist of each source point from the origin, each source point in the source point data list OriPosDistList is sorted. Specifically, each source point in the source point data list OriPosDistList can be sorted first according to the distance Dist of each source point from the origin. For source points with the same distance Dist from the origin, they can be sorted according to the coordinates Pos. For example, they can be sorted first according to the X-axis coordinates, and if the X-axis coordinates are the same, then according to the Y-axis coordinates, and if the Y-axis coordinates are the same, then according to the Z-axis coordinates, so as to obtain the sorted source point data list OriPosDistList. Among them, the sorting order can be ascending order or descending order, and this embodiment does not limit this.
[0116] S504. Sort each target point in the target point data list according to the position information of each target point.
[0117] In this embodiment, according to the coordinates Pos of each target point in the world coordinate system and the distance Dist of each target point from the origin, each target point in the target point data list TarPosDistList is sorted. Specifically, each target point in the target point data list TarPosDistList can be sorted first according to the distance Dist of each target point from the origin. For target points with the same distance Dist from the origin, they can be sorted according to the coordinates Pos. For example, they can be sorted first according to the X-axis coordinates, and if the X-axis coordinates are the same, then according to the Y-axis coordinates, and if the Y-axis coordinates are the same, then according to the Z-axis coordinates, so as to obtain the sorted target point data list TarPosDistList. Among them, the sorting order can be ascending order or descending order, and this embodiment does not limit this.
[0118] S505. Determine the source point serial number list and the target point serial number list according to the sorted source point data list and the sorted target point data list.
[0119] In this embodiment, since the target part TarModel is obtained by copying the source part OriModel, therefore, each point of the target part TarModel and the source part OriModel will coincide. Therefore, the numbers ID of each point in the sorted source point data list OriPosDistList and the sorted target point data list TarPosDistList correspond one by one according to their positions on the source part OriModel and the target part TarModel.
[0120] Poll the sorted source point data list OriPosDistList in sequence, obtain the first element in the list, which is the ID of each source point, generate the source point sequence number list OriIdList, poll the sorted target point data list TarPosDistList in sequence, obtain the first element in the list, which is the ID of each target point, and generate the target point sequence number list TarIdList.
[0121] The model animation generation method provided by the above embodiment generates a source point sequence number list and a target point sequence number list based on the mapping relationship of each point in the source part and the target part, so as to transfer the deformation information of each point in the source part to the corresponding points in the target part and control the deformation of the target part. It is not necessary to display a controller on the target part to control the deformation of the target part.
[0122] In a possible implementation manner, Figure 7 is a schematic flowchart of the model animation generation method provided by the embodiments of the present application Figure 6 , as Figure 7 shown, the process of establishing the deformation mapping relationship between the source part and the target part according to the source point sequence number list and the target point sequence number list may include:
[0123] S601. Establish a preset deformation node.
[0124] S602. Input the source point sequence number list and the target point sequence number list into the source point sequence number list attribute and the target point sequence number list attribute of the preset deformation node.
[0125] S603. Connect the source part to the input source model attribute of the preset deformation node.
[0126] S604. Connect the copied part of the target part to the input target model attribute of the preset deformation node.
[0127] S605. Connect the target part to the output target model attribute of the preset deformation node to establish a deformation mapping relationship.
[0128] In this embodiment, the deformation node DeformNode is used to transfer the deformation of each point in the source part OriModel to each point in the target part TarModel. The deformation node DeformNode has an input attribute, an output attribute, and a serial number list attribute. Among them, the input attribute includes an input source (driving) model attribute and an input target (driven) model attribute. The source part OriModel is used to connect to the input source (driving) model attribute as the input source (driving) model InputDriverModel. The target part TarModel is copied to obtain a copy model, and the copy model is connected to the input target (driven) model attribute as the input target (driven) model InputDrivenModel. The copy model serves as a basic reference model, and its three-dimensional coordinates never change. According to the coordinate differences between each point of the source part OriModel and the copy model, the deformation information of each point can be determined.
[0129] The output attribute includes an output target model attribute. The target part TarModel is connected to the output target model attribute as the output target model OutputModel.
[0130] The serial number list attribute includes a source point serial number list attribute and a target point serial number list attribute. The source point serial number list OriIdList is connected to the source point serial number list attribute, and the target point serial number list TarIdList is connected to the target point serial number list attribute.
[0131] In this way, based on the coordinate differences between each point of the source part OriModel and the copy model, the deformation node DeformNode can determine the deformation information of each point. Based on the one-to-one correspondence between each point in the source point serial number list OriIdList and the target point serial number list TarIdList, the world coordinates of each point in the target point serial number list TarIdList of the target part TarModel are updated. After the world coordinates of all points are updated, they are output to the target part TarModel to achieve the deformation of the target part TarModel.
[0132] The model animation generation method provided in the above embodiment uses a preset deformation node to connect the source part and the target part, realizing the deformation control of the target part based on the deformation of the source part. In this way, even if there is no controller set on the target part, the deformation control of the target part can be achieved by means of the controller of the source part, avoiding too many controllers displayed on the model from affecting the operation of the animator and improving the operation accuracy and efficiency of the animator.
[0133] The following describes the complete process of binding the source part OriModel and the target part TarModel. Figure 8The flowchart for binding the source part and the target part provided by the embodiment of this application is as follows Figure 8 As shown, the complete process of binding the source part OriModel and the target part TarModel is as follows:
[0134] 1. Select the source face sequence number list OriFaceList of the source part OriModel that needs to be converted into a real-time deformation controller and the corresponding controller Ctrl from the binding file of the source model. Here, the real-time deformation controller refers to the target part TarModel generated based on the source part OriModel.
[0135] 2. Obtain the source part OriModel through the source face sequence number list OriFaceList.
[0136] 3. According to the source face sequence number list OriFaceList, obtain the first point sequence number list OriVertexList for converting the face into a point.
[0137] 4. Copy the source model to form the target model, form the target part TarModel corresponding to the source part OriModel, and delete all faces other than the source face sequence number list OriFaceList in the target model to obtain a target model that only contains the faces corresponding to the target part TarModel.
[0138] For example, Figure 9 The comparison schematic diagram of the source model and the target model provided by the embodiment of this application Figure 1 is as Figure 9 shown in (a) of. In the source model, the face of the selected source part is the highlighted model face. It can be seen that in the source model, in addition to the face information corresponding to the source part, there is also face information of other parts, such as Figure 9 shown in (b) of, which are the points corresponding to the face of the source part. As Figure 9 shown in (c) of, the target model only contains the face information of the target part, and there is no face information of other parts.
[0139] 5. Obtain the world coordinate position and axis direction of the moving and rotating axis Pivot of the controller Ctrl of the source part OriModel, and set the moving and rotating axis of the target part TarModel to the world coordinate position and axis direction of Pivot, so that the positions of the moving and rotating axes of the target part TarModel and the controller Ctrl are aligned.
[0140] 6. Obtain all the points in the target part TarModel to get the second point sequence number list TarVertexList.
[0141] Figure 10Schematic diagram of the point-plane mapping relationship provided by the embodiments of the present application, as Figure 10 shown, in the source part OriModel, the list OriFaceList of the source face numbers of each face in the source model is [1, 2, 4, 5], in the target part TarModel, the list TarFaceList of the target face numbers of each face is [0, 1, 2, 3], the first point number list OriVertexList is [1, 2, 9, …], and the second point number list TarVertexList is [0, 1, 4, …].
[0142] 7. Iterate the ID of each source point in the first point number list OriVertexList, and form the source point data list OriPosDistList according to the ID of each source point, the coordinate Pos of each source point, and the distance Dist.
[0143] 8. Iterate the ID of each target point in the second point number list TarVertexList, and form the target point data list TarPosDistList according to the ID of each target point, the coordinate Pos of each target point, and the distance Dist.
[0144] 9. Sort the first point number list OriVertexList and the second point number list TarVertexList respectively according to the fifth element (the distance Dist from the point to the origin), the second element (the X-axis coordinate), the third element (the Y-axis coordinate), and the fourth element (the X-axis coordinate). After sorting, each point in the first point number list OriVertexList and the second point number list TarVertexList corresponds one by one in the position order.
[0145] 10. Poll the sorted source point data list OriPosDistList and the sorted target point data list TarPosDistList in sequence, obtain the ID of each source point and the ID of each target point, and generate the source point number list OriIdList and the target point number list TarIdList.
[0146] Exemplarily, as Figure 9 shown in (c) of, OriID: 428 corresponds to TarID: 173 for the same point.
[0147] 11. Generate the deformation node DeformNode, and fill the source point number list OriIdList and the target point number list TarIdList into the OriIdList attribute and the TarIdList attribute of the deformation node DeformNode.
[0148] 12. Connect the source part OriModel to the InputDriverModel property of the deformation node DeformNode.
[0149] 13. Copy the target part OriModel to obtain the copied model TarModelOrig. The copied model TarModelOrig is not displayed in the graphical user interface. Connect the copied model TarModelOrig to the InputDrivenModel property of the deformation node DeformNode.
[0150] 14. Connect the outputModel property of the deformation node DeformNode to the input model of the target part TarModel, so that the source part OriModel controls the deformation of the target part TarModel.
[0151] 15. Establish the rotational movement constraint relationship and the scaling following constraint relationship between the target part TarModel and the controller Ctrl, so that the Transform property of the controller follows the Transform property of the target part TarModel.
[0152] Exemplarily, Figure 11 is a comparison schematic diagram of the source model and the target model provided by the embodiment of the present application. Figure 2 As Figure 11 shown, controllers are set for multiple parts in the source model. When the number of controllers is large, it affects both the animator's line of sight and the operation accuracy. After setting the bound target parts for some source parts, the controllers of the target parts are no longer displayed in the target model. Generally, only the controllers of the overall model are displayed in the target model, greatly reducing the visual impact of the controllers on the animator and ensuring the operation accuracy and convenience of the animator.
[0153] Exemplarily, Figure 12 is a logic flow chart of the deformation node provided by the embodiment of the present application. As Figure 12 shown, the logical steps for the deformation node to control the model deformation are as follows:
[0154] 21. Obtain the source part OriModel as the input source model InputDriverModel, and obtain the copied model as the input target model InputDrivenModel.
[0155] 22. Obtain the source point sequence number list OriIdList and the target point sequence number list TarIdList.
[0156] 23. Poll sequentially to obtain the current index number Index, and determine the source point number OriId of the current index number Index in the source point number list OriIdList and the target point number TarId in the target point number list TarIdList.
[0157] 24. Obtain the world coordinates Pos of the vertex Orivertex corresponding to the source point number OriId in the input source model InputDriverModel.
[0158] 25. Set the world coordinates Pos of the vertex Tarvertex corresponding to the target point number TarId of the output target model OutputModel to implement the deformation of the target part TarModel.
[0159] It should be noted that if at least two target parts in the target model are bound to at least two source parts in the source model, and the deformations between at least two target parts will correspond to each other, then in response to the deformation control operation of the animator for the first target part, the position change information of the first target part is transmitted to the controller of the first source part. The controller of the first source part controls the first source part to deform, determines the deformation information of each point of the first source part. At the same time, the movement of the controller of the first source part controls the controller of the second source part to also move. Based on the controller of the second source part, the deformation information of each point of the second source part is determined. The deformation information of each point of the first source part is transmitted to each point of the first target part, and the deformation information of each point of the second source part is transmitted to each point of the second target part to implement the deformation of the two target parts.
[0160] Based on the above method embodiments, an embodiment of the present application further provides a model animation generation device. Figure 13 The following is a schematic structural diagram of the model animation generation device provided by the embodiment of the present application, as Figure 13 shown, the device may include:
[0161] A display module 701, configured to present a target model corresponding to the source model on a graphical user interface, where the source model includes multiple parts and a controller corresponding to each part;
[0162] A determination module 702, configured to respond to a deformation control operation on a target part of the target model, and determine the position change information of the controller of the source part corresponding to the target part on the source model according to a preset position mapping relationship between the source model and the target model;
[0163] A generation module 703, configured to use the controller of the source part to generate deformation information of each point in the source part according to the position change information;
[0164] A control module 704, configured to control each point of the target part to deform according to the deformation information of each point in the source part, and generate an animation model corresponding to the source model by using a preset deformation mapping relationship between the source model and the target model.
[0165] In some embodiments, the apparatus may further include:
[0166] A selection module, configured to determine a source part from multiple parts of the source model, where each part of the source model includes multiple faces;
[0167] A creation module, configured to create a target model including the target part according to the face information of the source part;
[0168] A mapping module, configured to establish a position mapping relationship and a deformation mapping relationship between the source part and the target part.
[0169] Optionally, the selection module is specifically configured to determine a source face serial number list according to a list of multiple face serial numbers of the source model, where the serial numbers of the multiple faces included in each part constitute the face serial number list corresponding to each part; determine the source part according to the faces corresponding to the source face serial number list, and the face information of the source part is the source face serial number list.
[0170] Optionally, the mapping module is specifically configured to set a moving and rotating axis center for the target part according to the moving and rotating axis center corresponding to the controller of the source part; establish a binding relationship between the controller of the target part and the controller of the source part, and the position mapping relationship is the binding relationship between the controller of the target part and the controller of the source part.
[0171] Optionally, the mapping module is specifically configured to establish a rotation and movement constraint relationship and a scaling following constraint relationship between the controller of the target part and the controller of the source part.
[0172] Optionally, the mapping module is specifically configured to determine a source point serial number list of the source part and a target point serial number list of the target part according to the face information of the source part and the face information of the target part, and the source point serial number list and the target point serial number list have a point mapping relationship; establish a deformation mapping relationship between the source part and the target part according to the source point serial number list and the target point serial number list.
[0173] Optionally, the mapping module is specifically configured to determine a first point serial number list of the source part according to the face information of the source part, where each point in the first point serial number list is a vertex of the multiple faces constituting the source part; determine a second point serial number list of the target part according to the face information of the target part, where each point in the second point serial number list is a vertex of the multiple faces constituting the target part; update the first point serial number list and the second point serial number list according to the mapping relationship between each point in the source part and the target part, and obtain the source point serial number list and the target point serial number list.
[0174] Optionally, the mapping module is specifically configured to traverse each source point in the first point sequence number list, generate a source point data list according to the sequence number and position information of each source point; traverse each target point in the second point sequence number list, generate a target point data list according to the sequence number and position relationship of each target point; sort each source point in the source point data list according to the position information of each source point; sort each target point in the target point data list according to the position information of each target point; determine the source point sequence number list and the target point sequence number list according to the sorted source point data list and the sorted target point data list.
[0175] Optionally, the mapping module is specifically configured to establish a preset deformation node; input the source point sequence number list and the target point sequence number list into the source point sequence number list attribute and the target point sequence number list attribute of the preset deformation node; connect the source part to the input source model attribute of the preset deformation node; connect the replicated part of the target part to the input target model attribute of the preset deformation node; connect the target part to the output target model attribute of the preset deformation node to establish a deformation mapping relationship.
[0176] The model animation generation device provided in the above embodiment hides the source model and the controller, controls the deformation of the target part in the target model, and then based on the position mapping relationship and the deformation mapping relationship between the target part and the source part, transmits the deformation information of each point generated by the source part based on the position change information to the target part to realize the deformation of the target part. In this way, the control of each part of the model is more intuitive. It not only realizes the deformation control of the model to generate model animation, but also does not display too many controllers visually to affect the animator's operation line of sight, ensuring the clarity of the animator's operation and improving the production efficiency; and because the deformation control operation directly acts on the target part rather than the controller, more accurate deformation control of the model can be performed, which is convenient for application in fine animation, special effects or character expressions.
[0177] The above device is used to execute the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar and will not be elaborated here.
[0178] The above-mentioned modules may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs), or, one or more microprocessors, or, one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when a certain above-mentioned module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0179] Figure 14 Schematic diagram of the electronic device provided by the embodiment of the present application, as Figure 14 shown, the electronic device 800 may include: a processor 801, a storage medium 802, and a bus. The storage medium 802 stores program instructions executable by the processor 801. When the electronic device 800 runs, the processor 801 communicates with the storage medium 802 through the bus, and the processor 801 executes the program instructions to execute the above method embodiment.
[0180] Specifically, the steps for the processor to execute the model animation generation method may include:
[0181] Present a target model pre-created based on a source model on a graphical user interface. The source model includes multiple parts and a controller corresponding to each part; in response to a deformation control operation on a target part of the target model, determine the position change information of the controller of the source part corresponding to the target part on the source model according to the preset position mapping relationship between the source model and the target model; use the controller of the source part to generate deformation information of each point in the source part according to the position change information; according to the deformation information of each point in the source part, use the preset deformation mapping relationship between the source model and the target model to control the deformation of each point of the target part and generate a model animation corresponding to the source model.
[0182] Optionally, before the processor executes the step of presenting the target model pre-created based on the source model on the graphical user interface, the steps for the processor to execute the model animation generation method may further include:
[0183] Determine a source part from the multiple parts of the source model, where each part of the source model contains multiple faces; create a target model including the target part according to the face information of the source part; establish a position mapping relationship and a deformation mapping relationship between the source part and the target part.
[0184] Optionally, the step of the processor determining the source part from multiple parts of the source model may include:
[0185] Determine a source face serial number list according to a list of multiple face serial numbers of the source model. The serial numbers of the multiple faces included in each part constitute the face serial number list corresponding to each part; determine the source part according to the faces corresponding to the source face serial number list, and the face information of the source part is the source face serial number list.
[0186] Optionally, the step of the processor performing the above-mentioned step of establishing the position mapping relationship between the source part and the target part may include:
[0187] Set a moving and rotating axis center for the target part according to the moving and rotating axis center corresponding to the controller of the source part; establish a binding relationship between the controller of the target part and the controller of the source part, and the position mapping relationship is the binding relationship between the controller of the target part and the controller of the source part.
[0188] Optionally, the step of the processor performing the above-mentioned step of establishing the binding relationship between the controller of the target part and the controller of the source part may include:
[0189] Establish a rotation and movement constraint relationship and a scaling following constraint relationship between the controller of the target part and the controller of the source part.
[0190] Optionally, the step of the processor performing the above-mentioned step of establishing the deformation mapping relationship between the source part and the target part may include:
[0191] Determine a source point serial number list of the source part and a target point serial number list of the target part according to the face information of the source part and the face information of the target part. The source point serial number list and the target point serial number list have a point mapping relationship; establish a deformation mapping relationship between the source part and the target part according to the source point serial number list and the target point serial number list.
[0192] Optionally, the step of the processor determining the source point serial number list of the source part and the target point serial number list of the target part according to the face information of the source part and the face information of the target part may include:
[0193] Determine a first point serial number list of the source part according to the face information of the source part. Each point in the first point serial number list is a vertex of the multiple faces constituting the source part; determine a second point serial number list of the target part according to the face information of the target part. Each point in the second point serial number list is a vertex of the multiple faces constituting the target part; update the first point serial number list and the second point serial number list according to the mapping relationship of each point in the source part and the target part to obtain the source point serial number list and the target point serial number list.
[0194] Optionally, when the processor executes the step of updating the first point sequence number list and the second point sequence number list according to the mapping relationship between each point in the source part and the target part as described above to obtain the source point sequence number list and the target point sequence number list, it may include:
[0195] Traverse each source point in the first point sequence number list, and generate a source point data list according to the sequence number and position information of each source point; traverse each target point in the second point sequence number list, and generate a target point data list according to the sequence number and position relationship of each target point; sort each source point in the source point data list according to the position information of each source point; sort each target point in the target point data list according to the position information of each target point; determine the source point sequence number list and the target point sequence number list according to the sorted source point data list and the sorted target point data list.
[0196] Optionally, when the processor executes the step of establishing the deformation mapping relationship between the source part and the target part according to the source point sequence number list and the target point sequence number list as described above, it may include:
[0197] Establish a preset deformation node; input the source point sequence number list and the target point sequence number list into the source point sequence number list attribute and the target point sequence number list attribute of the preset deformation node; connect the source part to the input source model attribute of the preset deformation node; connect the copied part of the target part to the input target model attribute of the preset deformation node; connect the target part to the output target model attribute of the preset deformation node to establish the deformation mapping relationship.
[0198] In the model animation generation method executed by the processor in the above embodiment, the source model and the controller are hidden, the deformation of the target part in the target model is controlled, and then based on the position mapping relationship and the deformation mapping relationship between the target part and the source part, the deformation information of each point generated by the source part based on the position change information is transmitted to the target part to realize the deformation of the target part. In this way, the control of each part of the model is more intuitive. It not only realizes the generation of model animation by controlling the deformation of the model, but also does not display too many controllers visually to affect the operation line of sight of the animator, ensuring the clarity of the animator's operation and improving the production efficiency; and because the deformation control operation directly acts on the target part rather than the controller, more precise deformation control of the model can be performed, which is convenient for application in fine animations, special effects or character expressions.
[0199] Optionally, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, it executes the above method embodiment.
[0200] Specifically, when the processor executes the steps of the model animation generation method, it may include:
[0201] Present a target model pre-created based on a source model on a graphical user interface, where the source model includes multiple parts and a corresponding controller for each part; in response to a deformation control operation on a target part of the target model, determine the position change information of the controller of the source part corresponding to the target part on the source model according to a preset position mapping relationship between the source model and the target model; use the controller of the source part to generate deformation information for each point in the source part according to the position change information; and control the deformation of each point of the target part according to the deformation information of each point in the source part by using a preset deformation mapping relationship between the source model and the target model to generate a model animation corresponding to the source model.
[0202] Optionally, before the processor executes the step of presenting the target model pre-created based on the source model on the graphical user interface, the steps for the processor to execute the model animation generation method may further include:
[0203] Determine a source part from multiple parts of the source model, where each part of the source model contains multiple faces; create a target model including the target part according to the face information of the source part; and establish a position mapping relationship and a deformation mapping relationship between the source part and the target part.
[0204] Optionally, the step for the processor to execute to determine the source part from multiple parts of the source model may include:
[0205] Determine a source face sequence list according to a multiple face sequence list of the source model, where the sequence numbers of the multiple faces included in each part constitute the face sequence list corresponding to each part; determine the source part according to the faces corresponding to the source face sequence list, and the face information of the source part is the source face sequence list.
[0206] Optionally, the step for the processor to execute to establish the position mapping relationship between the source part and the target part may include:
[0207] Set a moving and rotating axis center for the target part according to the moving and rotating axis center corresponding to the controller of the source part; and establish a binding relationship between the target part and the controller of the source part, and the position mapping relationship is the binding relationship between the target part and the controller of the source part.
[0208] Optionally, the step for the processor to execute to establish the binding relationship between the target part and the controller of the source part may include:
[0209] Establish a rotation and movement constraint relationship and a scaling following constraint relationship between the target part and the controller of the source part.
[0210] Optionally, the step for the processor to execute to establish the deformation mapping relationship between the source part and the target part may include:
[0211] Determine the source point sequence number list of the source part and the target point sequence number list of the target part according to the surface information of the source part and the surface information of the target part. The source point sequence number list and the target point sequence number list have a point mapping relationship. Establish a deformation mapping relationship between the source part and the target part according to the source point sequence number list and the target point sequence number list.
[0212] Optionally, when the processor executes the step of determining the source point sequence number list of the source part and the target point sequence number list of the target part according to the surface information of the source part and the surface information of the target part, it may include:
[0213] Determine the first point sequence number list of the source part according to the surface information of the source part. Each point in the first point sequence number list is the vertex of multiple surfaces that make up the source part. Determine the second point sequence number list of the target part according to the surface information of the target part. Each point in the second point sequence number list is the vertex of multiple surfaces that make up the target part. Update the first point sequence number list and the second point sequence number list according to the mapping relationship of each point in the source part and the target part to obtain the source point sequence number list and the target point sequence number list.
[0214] Optionally, when the processor executes the step of updating the first point sequence number list and the second point sequence number list according to the mapping relationship of each point in the source part and the target part to obtain the source point sequence number list and the target point sequence number list, it may include:
[0215] Traverse each source point in the first point sequence number list, and generate a source point data list according to the sequence number and position information of each source point. Traverse each target point in the second point sequence number list, and generate a target point data list according to the sequence number and position relationship of each target point. Sort each source point in the source point data list according to the position information of each source point. Sort each target point in the target point data list according to the position information of each target point. Determine the source point sequence number list and the target point sequence number list according to the sorted source point data list and the sorted target point data list.
[0216] Optionally, when the processor executes the step of establishing a deformation mapping relationship between the source part and the target part according to the source point sequence number list and the target point sequence number list, it may include:
[0217] Establish a preset deformation node. Input the source point sequence number list and the target point sequence number list into the source point sequence number list attribute and the target point sequence number list attribute of the preset deformation node. Connect the source part to the input source model attribute of the preset deformation node. Connect the copied part of the target part to the input target model attribute of the preset deformation node. Connect the target part to the output target model attribute of the preset deformation node to establish a deformation mapping relationship.
[0218] In the model animation generation method executed by the processor in the above embodiments, the source model and the controller are hidden. By controlling the deformation of the target part in the target model, and then based on the position mapping relationship and deformation mapping relationship between the target part and the source part, the deformation information of each point generated by the source part based on the position change information is transmitted to the target part to achieve the deformation of the target part. In this way, the control of each part of the model is more intuitive. It not only realizes the deformation control of the model to generate model animation, but also does not display too many controllers visually, which affects the animator's operation line of sight, ensuring the clarity of the animator's operation and improving the production efficiency. And because the deformation control operation directly acts on the target part rather than the controller, more precise deformation control of the model can be performed, which is convenient for application in fine animations, special effects or character expressions.
[0219] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0220] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0221] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
[0222] The integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium and include several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks, or optical discs.
[0223] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A model animation generation method, characterized in that: The method comprises: Presenting a target model pre-created based on a source model on a graphical user interface, wherein the source model includes a plurality of parts and a controller corresponding to each part; In response to a deformation control operation on a target part on the target model, determining position change information of a controller of a source part corresponding to the target part on the source model according to a preset position mapping relationship between the source model and the target model; Using the controller of the source part, generating deformation information of each point in the source part according to the position change information; According to the deformation information of each point in the source part, a preset deformation mapping relationship between the source model and the target model is adopted to control the deformation of each point in the target part to generate a model animation corresponding to the source model.
2. The method according to claim 1, characterized in that Before presenting the target model pre-created based on the source model on the graphical user interface, the method further includes: determining the source part from a plurality of parts of the source model, wherein each part of the source model includes a plurality of faces; Creating a target model including the target part according to the surface information of the source part; A position mapping relationship and a deformation mapping relationship between the source part and the target part are established.
3. The method according to claim 2, characterized in that The determining the source part from the plurality of parts of the source model comprises: Determine a source surface sequence number list according to the plurality of surface sequence number lists of the source model, wherein the sequence numbers of the plurality of surfaces included in each part constitute the surface sequence number list corresponding to each part; The source part is determined according to the surface corresponding to the source surface serial number list, and the surface information of the source part is the source surface serial number list.
4. The method according to claim 2, characterized in that The establishing of the position mapping relationship between the source part and the target part includes: According to the movement rotation axis corresponding to the controller of the source part, setting a movement rotation axis for the target part; A binding relationship between the target part and the controller of the source part is established, and the position mapping relationship is a binding relationship between the target part and the controller of the source part.
5. The method according to claim 4, characterized in that The establishing of a binding relationship between the target part and the controller of the source part includes: A rotation and movement constraint relationship and a scaling and following constraint relationship are established between the controllers of the target part and the source part.
6. The method according to claim 2, characterized in that The step of establishing a deformation mapping relationship between the source part and the target part includes: Determine a source point sequence number list of the source part and a target point sequence number list of the target part according to the surface information of the source part and the surface information of the target part, wherein the source point sequence number list and the target point sequence number list have a point mapping relationship; A deformation mapping relationship between the source part and the target part is established according to the source point sequence number list and the target point sequence number list.
7. The method according to claim 6, characterized in that Determining a source point sequence number list of the source part and a target point sequence number list of the target part according to the surface information of the source part and the surface information of the target part comprises: Determine a first point sequence number list of the source part according to the surface information of the source part, wherein each point in the first point sequence number list is a vertex of multiple surfaces constituting the source part; Determine a second point sequence number list of the target part according to the surface information of the target part, each point in the second point sequence number list is a vertex of multiple surfaces constituting the target part; According to the mapping relationship between each point in the source part and the target part, the first point sequence number list and the second point sequence number list are updated to obtain the source point sequence number list and the target point sequence number list.
8. The method according to claim 7, characterized in that The updating of the first point sequence number list and the second point sequence number list according to the mapping relationship between the source part and the respective points in the target part to obtain the source point sequence number list and the target point sequence number list comprises: Traversing each source point in the first point sequence number list, and generating a source point data list according to the sequence number and position information of each source point; Traversing each target point in the second point sequence number list, and generating a target point data list according to the sequence number and position relationship of each target point; Sort the source points in the source point data list according to the position information of each source point; Sort the target points in the target point data list according to the position information of each target point; The source point sequence number list and the target point sequence number list are determined according to the sorted source point data list and the sorted target point data list.
9. The method according to claim 6, characterized in that The step of establishing a deformation mapping relationship between the source part and the target part according to the source point sequence number list and the target point sequence number list comprises: Create a preset deformation node; Input the source point sequence number list and the target point sequence number list into the source point sequence number list attribute and the target point sequence number list attribute of the preset deformation node; Connecting the source part to the input source model attribute of the preset deformation node; Connecting a replica of the target part to an input target model attribute of the preset deformation node; The target part is connected to the output target model attribute of the preset deformation node to establish the deformation mapping relationship.
10. A model animation generating device, characterized in that: The device comprises: A display module, used for presenting a target model corresponding to a source model on a graphical user interface, wherein the source model includes a plurality of parts and a controller corresponding to each part; A determination module, configured to respond to a deformation control operation on a target part on the target model and determine position change information of a controller of a source part corresponding to the target part on the source model according to a preset position mapping relationship between the source model and the target model; A generating module, configured to generate deformation information of each point in the source part according to the position change information by using the controller of the source part; The control module is used to control the deformation of each point in the target part according to the deformation information of each point in the source part and adopt the preset deformation mapping relationship between the source model and the target model to generate an animation model corresponding to the source model.
11. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the model animation generation method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the model animation generation method according to any one of claims 1 to 9 are executed.