CN118015155A - Animation production method and device and electronic equipment - Google Patents

Animation production method and device and electronic equipment Download PDF

Info

Publication number
CN118015155A
CN118015155A CN202410166048.3A CN202410166048A CN118015155A CN 118015155 A CN118015155 A CN 118015155A CN 202410166048 A CN202410166048 A CN 202410166048A CN 118015155 A CN118015155 A CN 118015155A
Authority
CN
China
Prior art keywords
prop
skeleton
animation
game
coordinate system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410166048.3A
Other languages
Chinese (zh)
Inventor
吴嘉健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202410166048.3A priority Critical patent/CN118015155A/en
Publication of CN118015155A publication Critical patent/CN118015155A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a method, a device, an electronic device and a computer readable storage medium for producing animation, wherein the method comprises the following steps: determining a father-son relationship between a prop skeleton in a game prop and a first skeleton in a role skeleton, wherein in the father-son relationship, the prop skeleton is a father skeleton and the first skeleton is a son skeleton; acquiring preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and determining constraint conditions of father-son relations according to the preset transformation parameters; determining a first animation of the game prop, and generating a skeleton animation of a first skeleton according to the father-son relationship, the constraint condition and the first animation; and attaching the prop skeleton to a first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation. The scheme can improve the generation efficiency and accuracy of the animation.

Description

Animation production method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for producing an animation, an electronic device, and a computer readable storage medium.
Background
In the field of animation, an animation asset is usually created in digital content creation software for animation, and the created animation asset is imported into a game engine for animation splicing and playing, so that each created animation asset is spliced and played. Typically, a virtual character may implement an animation effect in combination with virtual props, where many virtual props are rigid props that merely follow the virtual character, without deforming themselves, e.g., a virtual character holds a virtual tool, and the virtual tool follows the hand of the virtual character.
In practical applications, in order to reduce the amount of computation, when an animation asset including rigid-body props is manufactured, it is generally possible to import only relevant animations of virtual characters when the animation asset is imported from digital content generation software into a game engine, and then set the virtual props in the game engine to follow the virtual characters to perform corresponding actions.
However, due to the difference between the digital content generating software and the game engine, the animation of the virtual prop generated in the digital content generating software is not satisfactory after being imported into the game engine, for example, the virtual prop is held by a virtual hand as shown in the digital content generating software, and the virtual prop is inserted into the palm of the virtual hand as shown after being imported into the game engine, so that the modification in the digital content generating software is often required to be repeated for a plurality of times, so that the animation asset displayed in the game engine is satisfactory, and the modification depends on the experience of a developer, so that the generation efficiency and accuracy of the animation are too low.
Disclosure of Invention
The application provides a method and a device for producing an animation, electronic equipment and a computer readable storage medium, which can improve the generation efficiency and accuracy of the animation. The specific scheme is as follows:
In a first aspect, an embodiment of the present application provides a method for producing an animation, where the method includes:
determining a father-son relationship between a prop skeleton in a game prop and a first skeleton in a role skeleton, wherein in the father-son relationship, the prop skeleton is a father skeleton and the first skeleton is a child skeleton;
Acquiring preset transformation parameters of a local coordinate system of the game prop when the game prop is attached to a role skeleton relative to the local coordinate system of the role skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters;
Determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation;
And attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
In a second aspect, an embodiment of the present application provides an animation producing device, including:
A first determining unit, configured to determine a parent-child relationship between a prop skeleton in a game prop and a first skeleton in a character skeleton, where in the parent-child relationship, the prop skeleton is a parent skeleton, and the first skeleton is a child skeleton;
A second determining unit, configured to obtain preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and determine constraint conditions of the parent-child relationship according to the preset transformation parameters;
the generation unit is used for determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation of the first prop;
And the attaching unit is used for attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
In a third aspect, the present application also provides an electronic device, including:
a processor; and
A memory for storing a data processing program, the electronic device being powered on and executing the program by the processor, to perform the method according to the first aspect.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium storing a data processing program for execution by a processor to perform the method of the first aspect.
Compared with the prior art, the application has the following advantages:
According to the animation production method provided by the embodiment of the application, the father-son relationship between prop bones in game props and first bones in character props is determined, wherein in the father-son relationship, prop bones are father bones, and first bones are child bones; acquiring preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of a role skeleton when the game prop is attached to the role skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters; determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation; and attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
It can be seen that in the present application, a parent-child relationship is established between the prop skeleton and the first skeleton, and then, the constraint condition of the established parent-child relationship is determined according to the local coordinate system of the game skeleton and the local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and the constraint condition is used for constraining the first skeleton to move according to the parent-child relationship and the movement of the prop skeleton in the first prop animation of the game prop when the skeleton animation of the first skeleton of the character is manufactured. In this way, when the first skeleton is driven to move through the first prop animation of the game prop, the offset indicated by the constraint condition is always kept between the prop skeleton and the first skeleton, so when the second prop animation is generated by attaching the prop skeleton to the first skeleton, the offset indicated by the preset transformation parameters is always kept relative to the local coordinate system of the first skeleton due to the local coordinate system of the prop skeleton, and thus the offset of the first skeleton when the prop skeleton is driven to move through the first skeleton and the offset of the prop skeleton when the prop skeleton is driven to move through the first skeleton are offset, so that the orientation of the game prop in the second prop animation generated by attaching the game prop to the character skeleton is always consistent with the orientation of the game prop in the first prop animation used in the skeleton animation production stage. According to the animation production method provided by the application, the animation production software does not need to be frequently modified manually, so that the animation production efficiency and accuracy can be improved.
Drawings
FIG. 1 is a schematic diagram of a left-hand coordinate system and a right-hand coordinate system provided by an embodiment of the present application;
FIG. 2 is a schematic diagram showing an example of a coordinate system used by the digital content generating software according to the embodiment of the present application;
FIG. 3 is a schematic diagram of an example of a left hand Zup coordinate system used by a game engine according to an embodiment of the present application;
FIG. 4 is a schematic diagram showing an example of an animation created in digital content creation software according to an embodiment of the present application;
FIG. 5 is a schematic illustration of the hand animation of FIG. 4 imported from digital content generation software into a game engine for prop attachment;
FIG. 6 is a flow chart of data interaction between a game engine and digital content generation software in an animation production method provided by an embodiment of the present application;
FIG. 7 is a flow chart of an animation production method provided by an embodiment of the present application;
FIG. 8-a is a schematic diagram of an example of a local coordinate system of a prop skeleton and a first skeleton in a game engine in a method for producing an animation according to an embodiment of the present application;
FIG. 8-b is a schematic diagram of a transformation of a local coordinate system of a first skeleton and a prop skeleton when the first skeleton moves in a game engine in a method for producing an animation according to an embodiment of the present application;
FIG. 9-a is a schematic diagram of an example of a local coordinate system of a prop bone and a first bone in digital content creation software in an animation production method according to an embodiment of the present application;
FIG. 9-b is a schematic diagram of a transformation of a first skeleton and a local coordinate system of a prop skeleton when the prop skeleton moves in digital content generation software in an animation production method according to an embodiment of the present application;
FIG. 10 is a schematic diagram showing an example of the change of the orientation of props in digital content creation software in the animation production method according to the embodiment of the present application;
FIG. 11 is a schematic diagram showing an example of the change of the orientation of props in a game engine in the animation production method according to the embodiment of the present application;
FIG. 12 is a schematic diagram of converting a coordinate system used by digital content generation software into a coordinate system used by a game engine in an animation production method according to an embodiment of the present application;
FIG. 13 is a schematic diagram of adding a controller to a prop in the animation production method according to the embodiment of the application;
FIG. 14 is a block diagram showing an example of an animation producing device according to an embodiment of the present application;
fig. 15 is a block diagram illustrating an example of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
It should be noted that the terms "first," "second," "third," and the like in the claims, description, and drawings of the present application are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. The data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and their variants are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Before describing embodiments of the present application in detail, related concepts will be described first and prior art will be further described.
1. Introduction to related concepts
1. Digital content generation software (Digital Content Creation, DCC for short): digital content generation software can be used for creating digital media content, has wide application in the fields of movies, televisions, games, animations, architecture, industrial design, etc., and can be used for 3D modeling, animation production, special effect synthesis, video editing, audio editing, image processing, etc. Common digital content generation software may include, for example, but is not limited to Maya, houdini, nuke, 3Dmax, blender, and the like.
In an embodiment of the application, digital content generation software is used for animation.
2. Game engine: the game engine is a software framework for designing, developing, testing and running electronic games. The game engine may be used to implement core functions of the game such as animation stitching, animation playback, graphics rendering, physical simulation, audio processing, scripting language, artificial intelligence, and the like. Game engines provide a fast, efficient, reliable development environment for game developers, and commonly used game engines may include, but are not limited to Unreal Engine, unity, CRYENGINE, for example.
In embodiments of the present application, the game engine may be used to perform processes such as animation stitching.
3. Rigid body: the rigid body is an object whose shape and size are unchanged and the relative positions of points inside are unchanged when the rigid body is in motion and receives force. In the real world, an absolute rigid body is practically absent, but since deformation of a solid prop is not usually observed by human eyes, in film and television or game production, the solid prop is generally regarded as a rigid prop in an ideal state.
4. Software coordinate system: the software coordinate system is a coordinate system used by the digital content generation software and the game engine to describe the position, rotation, and scaling of objects in the 3D scene. Common software coordinate systems include a left hand coordinate system and a right hand coordinate system. In the left-hand coordinate system, the positive direction of the X-axis is directed to the right, the positive direction of the Y-axis is directed upward, and the positive direction of the Z-axis is directed to the inside of the screen. In the right-hand coordinate system, the positive direction of the X axis is directed to the right, the positive direction of the Y axis is directed to the inside of the screen, and the positive direction of the Z axis is directed upward. The coordinate systems used by different software may differ.
As shown in fig. 1, a schematic diagram of a left-hand coordinate system in which the positive direction of the X-axis is directed to the right, the positive direction of the Y-axis is directed upward, and the positive direction of the Z-axis is directed away from the observer is shown, and a right-hand coordinate system in which the positive direction of the X-axis is directed to the right, the positive direction of the Y-axis is directed upward, and the positive direction of the Z-axis is directed toward the observer is shown in the right-hand coordinate system 02. The difference between the left-hand coordinate system 01 and the right-hand coordinate system 02 is that the Z-axis is inverted, i.e. a point in the 3D scene that is co-located, if the point has a coordinate in the left-hand coordinate system 01 of (x 1, y1, Z1), then the coordinate in the right-hand coordinate system 02 is (x 1, y1, -Z1).
5. Zup and Yup: zup and Yup are two common coordinate system conventions in computer graphics, zup representing positive direction of the Z axis pointing upward in the case of the x axis pointing to the right, yup representing positive direction of the Y axis pointing upward.
2. Further description of the prior art
With the continuous development of computer technology, the requirements for animation production are increasing, so that in order to quickly generate an animation and reduce the calculation amount of animation generation, in the case that the generated animation is an animation corresponding to a rigid prop held by a virtual character, generally, only the animation of the virtual character can be imported into a game engine from digital content generation software, the rigid prop is attached to the animation of the virtual character in the game engine, so that the animation corresponding to the rigid prop is generated, the animation data corresponding to the rigid prop is prevented from being imported, and the animation calculation is performed in the game engine through transformation parameters set in the animation, so that the calculation amount in the game engine and the space occupation of the animation are reduced.
However, on the one hand, due to the difference between the coordinate systems corresponding to the digital content generating software and the game engine, a certain deviation exists between the orientation of the rigid prop in the game engine and the orientation of the rigid prop in the digital content generating software. Differences between the coordinate systems corresponding to the digital content generation software and the game engine are described below with reference to fig. 2 and 3:
As shown in fig. 2, an exemplary coordinate system used by the digital content generating software according to the embodiment of the present application is shown in fig. 2, in which the digital content generating software uses a right hand Yup coordinate system 03, the right hand Yup coordinate system is that the positive direction of the X-axis points to the right, the positive direction of the Y-axis points to the upper, and the positive direction of the Z-axis points to the direction of the observer. The coordinates of each position point in the model 1 are a (1, 1), B (2,1,1.5), C (2.5,1,1), D (1.5,2,0.5), and it can be seen that the display mode of the model 1 in the right hand Yup coordinate system 03 used by the digital content generating software is the display mode in fig. 2.
As shown in fig. 3, an exemplary left hand Zup coordinate system used by the game engine according to the embodiment of the present application is shown, where the game engine uses the left hand Zup coordinate system 04, the left hand Zup coordinate system is that the positive direction of the X-axis points to the right, the positive direction of the Z-axis points to the top, and the positive direction of the Y-axis points to the direction of the observer. When the coordinates of each position point in the model 1 are a (1, 1), B (2,1,1.5), C (2.5,1,1), and D (1.5,2,0.5), the display mode of the model 1 in the left-hand Zup coordinate system 04 used by the game engine is the display mode in fig. 3.
Therefore, the display modes of the same model in the digital content generating software and the game engine are different due to the fact that the coordinate systems corresponding to the digital content generating software and the game engine are different, and the directions are not the same.
On the other hand, when the prop is bound, in order to facilitate binding the prop model and the prop skeleton, a developer may set a root skeleton at a suitable position in the prop model, and the prop root skeleton typically does not select a coordinate origin in world coordinates, which results in an initial transformation value between the prop root skeleton and the coordinate origin. In general, in digital content creation software, an initial conversion value is not maintained between a prop and a character, but in game engine, an initial conversion value is maintained between a prop and a character, which causes a change in the orientation of a prop when a character animation created in digital content creation software is introduced into game engine to attach a prop.
Fig. 4 is a schematic diagram of an example of an animation created in digital content creation software according to an embodiment of the present application, and it can be seen that the virtual hand and the virtual prop match each other in the animation created in the digital content creation software.
As shown in fig. 5, the hand animation in fig. 4 is a schematic diagram of the hand animation in fig. 4 after being led from the digital content generating software into the game engine to attach the prop, and when the hand animation in fig. 4 is led from the digital content generating software into the game engine, the prop in the game engine will keep an initial conversion value with the hand during attachment, so that the orientation of the prop cannot be kept consistent with the orientation of the prop in fig. 4.
In summary, since there is a difference between the digital content generating software and the game engine coordinate system, and there is a difference in the attachment rule of the two when the prop is attached, the character animation is derived from the digital content generating software to the game engine, and the orientation of the prop becomes uncontrollable when the prop is attached. In this case, it is necessary to modify the animation in the digital content creation software and export the animation to the game engine to attach the prop until the orientation of the prop after the prop is attached matches the orientation of the prop in the digital content creation software. However, when the animation is modified in the digital content generating software, developers often judge through subjective experience, and prop animation meeting the requirements can be obtained after multiple modifications, so that the generating efficiency and accuracy of the animation are low.
For the above reasons, in order to improve the efficiency and accuracy of animation generation, the first embodiment of the present application provides a method for producing animation, where the method is applied to an electronic device, and the electronic device may be a desktop computer, a notebook computer, a mobile phone, a tablet computer, a server, a terminal device, or other electronic devices capable of performing game marking.
Before describing the animation production method provided by the present application, the following describes, with reference to fig. 6, data interaction between a game engine and digital content generation software in the animation production method provided by the embodiment of the present application.
As shown in fig. 6, a data interaction flow chart between a game engine and digital content generating software in the animation production method provided by the embodiment of the application includes a binding flow 103 and an animation flow 104.
The binding flow 103 includes the following steps S1 to S4:
Step S1: importing the prop binding file from the game engine 101 into the digital content generation software 102;
step S2: in the digital content generating software 102, the game props are subjected to orientation transformation according to transformation parameters of the top node;
step S3: setting an offset attribute parameter in a prop binding file according to preset conversion parameters of game props, and generating a new prop binding file;
Step S4: and adding a controller on the prop skeleton.
The animation flow 104 includes the following steps S5 to S9:
Step S5: establishing a father-son relationship by taking a first skeleton in the character skeleton as a child skeleton and taking a prop skeleton as a father skeleton to obtain a constraint node;
Step S6: setting father-son constraint without position offset for a first skeleton of a character and a prop root skeleton to obtain constraint nodes;
Step S7: performing parameter configuration on offset variables in the constraint nodes according to offset attribute parameters in the new prop binding file to obtain constraint nodes after parameter configuration;
step S8: setting controller parameters, manufacturing a first prop animation of a game prop, and generating a skeleton animation of a first skeleton according to the prop animation and constraint nodes after parameter configuration;
step S9: importing the skeletal animation of the first skeleton into a game engine;
Step S10: and attaching the game prop to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
The steps S1 to S10 in fig. 2 are described in detail below provided in the present specification.
The following describes a method for producing an animation according to an embodiment of the present application with reference to fig. 7 to 12.
As shown in fig. 7, the animation production method provided by the present application includes the following steps S101 to S104.
Step S101: determining a father-son relationship between a prop skeleton in a game prop and a first skeleton in a role skeleton, wherein in the father-son relationship, the prop skeleton is a father skeleton and the first skeleton is a child skeleton.
Prop bones in the present application may be understood as prop root bones that may be used to control and position the bones of a prop during animation.
A first skeleton in a character skeleton may be understood as a skeleton in a character skeleton of a virtual character for attaching game props.
The prop root skeleton can be understood as an anchor point on the prop, the first skeleton in the character skeleton can be understood as an anchor point on the character, and the prop root skeleton and the first skeleton in the character skeleton are positioned at the same position.
Step S101 is specifically to determine a parent-child relationship between the prop skeleton and the first skeleton in the digital content generating software. In practical application, the manufacturing flow of the prop animation of the game prop is as follows:
firstly, in digital content generating software, according to character animation corresponding to a part connected with a game prop in a virtual character, making a first prop animation matched with the game prop;
Secondly, driving a first skeleton in the character skeleton to move according to the first animation to generate a skeleton animation of the first skeleton;
Finally, the skeleton animation of the first skeleton is led into a game engine, game props are attached to the first skeleton in the skeleton animation of the first skeleton, and the game props are driven to move through the movement of the first skeleton in the skeleton animation of the first skeleton, so that second prop animation is obtained.
In a specific embodiment, when a skeleton animation of a first skeleton is generated through a prop animation of a game prop in digital content generating software, father-son relation constraint is generally established on the prop skeleton of the game prop and the first skeleton, so that the father skeleton moves along with the son skeleton.
In the digital content generation software, father-son relation constraint is the setting of an object motion relation, and by carrying out father-son relation constraint on nodes, the effect that a child object can move along with a parent object and keep relative motion with the parent object without placing the child object under the node level of the parent object is realized.
Therefore, in the digital content generating software, the prop root skeleton is taken as a father skeleton, and the first skeleton is taken as a child skeleton to establish a father-son relationship, so that the first skeleton is driven to move through the movement of the prop root skeleton in the first prop animation of the game prop, and the skeleton animation of the first skeleton is generated.
It should be noted that in the present application, the game props imported into the digital content generating software are consistent with the initial orientations of the game props in the game engine, and character animation is produced in the digital content generating software based on the game props consistent with the initial orientations.
In practical applications, when a developer binds a game prop, a proper position is usually selected from a prop model of the game prop as a prop root skeleton, and in general, the selected prop root skeleton is not necessarily located at the origin of coordinates of world coordinates. The game props have preset transformation parameters, and the preset transformation parameters of the game props are contained in a prop binding file generated after the prop binding is completed. For example, for a virtual pistol, typically the stock of the virtual pistol's pistol model is located at the origin of coordinates in world coordinates, and the developer typically selects the pistol root skeleton at the trigger when binding the virtual pistol's pistol model to the pistol skeleton, so that the pistol root skeleton has certain preset transformation parameters after binding is completed.
In general, before binding a game prop, an art staff may perform design of the game prop and building of a prop model corresponding to the game prop, specifically including determining an appearance, a size, a topology structure, and the like of the prop. Then binding a skeleton system corresponding to the prop skeleton of the game prop to the built prop model so as to control the posture and the action of the prop in the animation, and connecting the vertex of the prop model surface with the skeleton system so as to be correctly deformed in the animation. Thus, the prop binding file typically includes binding data between the prop bone and the prop model.
It should be noted that, in the case that the prop binding file of the game prop has preset transformation parameters, there is a difference between the attachment mode of the game prop in the game engine and the attachment mode of the game prop in the digital content generating software.
The attachment mode of game props in digital content generation software: when a prop binding file is opened in digital content generation software and a game prop is attached to a first bone of character bones, there is typically no preset transformation parameter between the local coordinate system of the prop bone of the game prop and the local coordinate system of the first bone. The local coordinate system of the first skeleton can be understood as the local coordinate system of the character skeleton.
The attachment mode of the game props in the digital content generation software game engine: when opening a prop binding file in a game engine, there are typically preset transformation parameters between the local coordinate system of the prop skeleton of the game prop and the local coordinate system of the first skeleton.
It is to be appreciated that different coordinate systems are capable of representing the position of an object based on different angles, and that for three-dimensional scenes, the coordinate systems used may generally include, but are not limited to, world coordinate systems, screen coordinate systems, local coordinate systems, and the like. The world coordinate system is an absolute coordinate system in the three-dimensional scene, coordinates of the object in the world coordinate system are used for representing the position of the object in the three-dimensional scene, the world coordinate system is used for locating a center point in the current game scene as a coordinate origin, and the coordinate of a certain point of the object can be correspondingly obtained by taking the coordinate origin as a reference. The local coordinate system is a coordinate system established with a certain preset origin, and is used for representing the position of the object relative to the origin.
The manner in which props are attached to digital content generation software and the manner in which props are attached to a game engine will be described below with reference to fig. 8-a, 8-b, 9-a, and 9-b.
Fig. 8-a is a schematic diagram of an example of a local coordinate system of a prop skeleton and a first skeleton in a game engine in the animation production method according to the embodiment of the present application, where a certain offset exists between the local coordinate system of the first skeleton and the local coordinate system of the prop skeleton, and the difference is an offset indicated by a preset transformation parameter.
As shown in fig. 8-b, in the method for producing an animation according to the embodiment of the present application, when the first skeleton moves in the game engine, the local coordinate system of the first skeleton and the local coordinate system of the prop skeleton are transformed, so that after the first skeleton moves, the prop skeleton follows to move correspondingly, and the offset between the local coordinate system of the first skeleton and the local coordinate system of the prop skeleton shown in fig. 8-a is always maintained, that is, the offset indicated by the preset transformation parameter is always maintained between the local coordinate system of the first skeleton and the local coordinate system of the prop skeleton regardless of the movement of the first skeleton.
Fig. 9-a is a schematic diagram of an example of a local coordinate system of a prop bone and a first bone in digital content generating software in the animation production method according to the embodiment of the present application, where there is no offset between the local coordinate system of the first bone and the local coordinate system of the prop bone.
As shown in fig. 9-b, a schematic diagram of transformation performed by a first skeleton and a local coordinate system of the prop skeleton when the prop skeleton moves in the digital content generating software in the animation generating method provided by the embodiment of the application, it can be seen that after the prop skeleton moves, the first skeleton follows to perform corresponding movement, and no offset exists between the local coordinate system of the first skeleton and the local coordinate system of the prop skeleton all the time.
Based on the difference between the attaching mode of the game prop in the game engine and the attaching mode of the game prop in the digital content generating software, even if the game prop imported into the digital content generating software is consistent with the initial orientation of the game prop in the game engine, after the skeleton animation of the first skeleton is imported into the game engine, the game engine can perform orientation transformation on the game prop according to preset transformation parameters between the local coordinate system of the game prop and the local coordinate system of the first skeleton, so that the initial orientation of the game prop is changed.
In this case, therefore, in order to eliminate the change in the initial orientation of the game play object caused by the deviation of the game play object occurring at the time of attachment in the game engine, the present application may be provided in the digital content generating software accordingly.
Step S102: obtaining preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters.
It should be noted that, when the game prop is attached to the character skeleton, the local coordinate system of the game prop refers to: a local coordinate system of prop skeleton in the game props in the game engine; the local coordinate system of the character skeleton when the game prop is attached to the character skeleton refers to: a local coordinate system of a first skeleton in a character skeleton in a game engine.
It will be appreciated that the prop skeleton also has a corresponding local coordinate system in the digital content generation software, and the first skeleton also has a corresponding local coordinate system in the digital content generation software, and that the local coordinate systems of the same object in different software may be the same or different, depending on whether the global coordinate systems of the two software are the same or not.
The constraint condition of the father-son relationship determined in the application can be used for generating a bone animation corresponding to a first bone which relatively keeps a first offset between local coordinate systems of prop bones in the first animation, wherein the first offset is an offset for counteracting the preset transformation parameters.
Since the second prop animation of the game prop is generated by driving the prop skeleton of the game prop to move in the game engine through the skeleton animation of the first skeleton generated in the digital content generating software when the second prop animation of the game prop is generated in the game engine, when the prop skeleton of the game prop is attached to the first skeleton and an offset indicated by a preset transformation parameter exists between a local coordinate system of the prop skeleton of the game prop and a local coordinate system of the first skeleton, a first offset for canceling the offset indicated by the preset transformation parameter can be added to the first skeleton in the skeleton animation of the first skeleton introduced into the game engine so that the initial orientation of the prop skeleton of the game prop in the game engine is not changed. This requires that the first bone in the bone animation of the first bone generated in the digital content generating software has a first offset thereon for counteracting the offset indicated by the preset transformation parameters.
Because the skeleton animation of the first skeleton is generated by driving the first skeleton through the first track animation of the game prop in the digital content generating software, when the first skeleton is driven through the first track animation of the game prop, the first skeleton can be restrained by adding the first offset for counteracting the offset indicated by the preset transformation parameter, so that the first skeleton in the skeleton animation of the first skeleton has the first offset for counteracting the offset indicated by the preset transformation parameter.
Thus, the first offset may be used as a constraint on the parent-child relationship in step S101 to constrain the motion of the first bone.
Step S103: determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation.
In the application, the first track animation is an animation asset which is manufactured in digital content generating software and is used for describing game prop motion data, and the first track animation can generally comprise information such as movement, rotation, scaling and the like of the prop.
Specifically, the prop skeleton of the game prop can be used as a father skeleton, the first skeleton is used as a child skeleton, the first skeleton is driven to move through the movement of the prop skeleton in the first prop animation of the game prop, and the movement of the first skeleton is restrained through the restraint condition, so that the first offset is always kept between the local coordinate system of the prop skeleton of the game prop and the local coordinate system of the first skeleton.
In this way, the skeleton animation of the first skeleton, which is generated in the digital content generating software and always keeps the first offset with the prop skeleton in the first prop animation, is imported into the game engine, and when the prop skeleton of the game prop is attached to the first skeleton, the prop skeleton always keeps the offset indicated by the preset transformation parameters with the first skeleton, so that the first offset can be offset, and the direction of the game prop in the second prop animation of the game prop generated in the game engine under the driving of the skeleton animation of the first skeleton is always consistent with the direction of the game prop in the first prop animation manufactured in the digital content generating software.
The steps S101 to S103 are all performed in the digital content generation software.
Step S104: and attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
In the application, after the skeleton animation of the first skeleton is generated in the digital content generating software, the skeleton animation of the first skeleton can be imported into a game engine; then, the prop skeleton is attached to a first skeleton in the skeleton animation of the first skeleton in the game engine, and the prop skeleton is driven to move through the movement of the first skeleton in the skeleton animation of the first skeleton, so that a second prop animation is generated in the game engine.
In the application, the second prop animation is an animation asset which is generated in the game engine through prop attachment and is used for describing game prop motion data. The method for producing the animation provided by the embodiment of the application aims to enable the second prop animation of the game prop produced in the game engine to be consistent with the direction of the prop in the first prop animation produced in the digital content generating software.
In an alternative embodiment, when the skeleton animation of the first skeleton is imported into the game engine, and the prop binding file is loaded in the game engine, the prop skeleton may be directly attached to the first skeleton, in which case the game engine will automatically drive the prop skeleton to move according to the skeleton animation of the first skeleton, so as to generate the second prop animation.
In another alternative embodiment, when the skeleton animation of the first skeleton is imported into the game engine, and the game engine is loaded with the prop binding file, the prop skeleton may not be directly attached to the first skeleton, in which case, an attachment instruction may be triggered in the game engine for attaching the prop skeleton to the first skeleton, and then, in response to the attachment instruction for attaching the prop skeleton to the first skeleton in the game engine, the prop skeleton is driven to move according to the skeleton animation of the first skeleton, so as to generate the second prop animation.
Because in the digital content generating software, when the prop skeleton drives the first skeleton to move in the first prop animation of the game prop, the first offset for counteracting the offset indicated by the preset transformation parameter is always kept between the prop skeleton and the first skeleton, so that the skeleton animation generated by the first skeleton movement in the digital content generating software is imported into the game engine, when the prop skeleton is attached to the first skeleton, the local coordinate system of the prop skeleton always keeps the offset indicated by the preset transformation parameter relative to the local coordinate system of the first skeleton, and then the orientation of the game prop in the game engine always keeps consistent with the orientation of the game prop in the digital content generating software.
According to the animation production method provided by the embodiment of the application, the father-son relationship between prop bones in game props and first bones in character props is determined, wherein in the father-son relationship, prop bones are father bones, and first bones are child bones; acquiring preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of a role skeleton when the game prop is attached to the role skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters; determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation; and attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
It can be seen that in the present application, a parent-child relationship is established between the prop skeleton and the first skeleton, and then, the constraint condition of the established parent-child relationship is determined according to the local coordinate system of the game skeleton and the local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and the constraint condition is used for constraining the first skeleton to move according to the parent-child relationship and the movement of the prop skeleton in the first prop animation of the game prop when the skeleton animation of the first skeleton of the character is manufactured. In this way, when the first skeleton is driven to move through the first prop animation of the game prop, the offset indicated by the constraint condition is always kept between the prop skeleton and the first skeleton, so when the second prop animation is generated by attaching the prop skeleton to the first skeleton, the offset indicated by the preset transformation parameters is always kept relative to the local coordinate system of the first skeleton due to the local coordinate system of the prop skeleton, and thus the offset of the first skeleton when the prop skeleton is driven to move through the first skeleton and the offset of the prop skeleton when the prop skeleton is driven to move through the first skeleton are offset, so that the orientation of the game prop in the second prop animation generated by attaching the game prop to the character skeleton is always consistent with the orientation of the game prop in the first prop animation used in the skeleton animation production stage. According to the animation production method provided by the application, the animation production software does not need to be frequently modified manually, so that the animation production efficiency and accuracy can be improved.
In an alternative embodiment, when there is a difference between the global coordinate system used by the digital content generating software and the global coordinate system used by the game engine, the following steps may be performed after the game prop is imported into the digital content generating software:
in the digital content generation software, determining an orientation of a game prop to be consistent with an orientation of the game prop in a game engine; the play object has been imported into the game engine.
The game props are props which do not deform themselves in the game and only move along with the virtual characters, for example, the virtual props held by the virtual characters can be game props, the virtual bread held by the virtual characters can be game props, and the hat worn on the heads of the virtual characters can be game props.
The orientation of a game prop may be understood as the displayed orientation of the game prop, and determining the orientation of the game prop to be consistent with the orientation of the game prop in the game engine means: the orientation of the game play object in the digital content generation software is determined to be a consistent orientation with the orientation of the game play object in the game engine. For example, when the orientation of the game play object in the game engine is that the a-plane is pointing frontally toward the observer, the orientation of the game play object is also determined in the digital content generation software to be that the a-plane is pointing toward the observer.
Based on the above further description of the prior art, it is known that there is a difference between the coordinate system used by the digital content generating software and the coordinate system used in the game engine, resulting in a difference in the manner of presentation when the same object is opened in the digital content generating software and opened in the game engine, i.e., the orientation of the same object in the digital content generating software and in the game engine is different.
In order to enable the display mode of the game prop in the digital content generating software to be the same as the orientation of the prop in the game engine, so that the second prop animation generated when the game prop is attached by the character animation generated in the digital content generating software in the game engine is ensured to be transformed identically with the first prop animation generated in the digital content generating software.
Thus, in the case where the orientations of the props in the digital content generation software and the game engine are the same, the use of the same animation data may cause the props to undergo the same orientation transformation to obtain the same props animation.
In practical application, since the game prop has no deformation and does not need to be exported from the digital content generating software to the game engine, when the second prop animation is generated in the game engine through prop attachment, the initial orientation of the game prop in the second prop animation is the orientation of the game prop after being opened in the game engine. Thus, in order to keep the orientation of the prop in the first prop animation produced in the digital content generation software consistent with the orientation of the prop in the game engine, the orientation of the game prop in the digital content generation software may be determined from the orientation of the game prop in the game engine.
In an alternative embodiment, the present application may set an orientation changing parameter in the digital content generating software, where the orientation changing parameter is used to change the orientation of the game prop in the digital content generating software to the orientation of the game prop in the game engine. In this way, the orientation of the game play object in the digital content generation software can be determined to be the orientation that coincides with the orientation of the game play object in the game engine according to the preset orientation change parameter.
In another alternative embodiment, after the game props are respectively imported into the game engine and the digital content generating software, the game props in the digital content generating software can be rotated according to the orientation of the game props in the game engine, so that the orientation of the game props in the digital content generating software is determined to be consistent with the orientation of the game props in the game engine.
By this step, the orientation of the game prop is determined in the digital content generating software to be the same as the orientation of the game prop in the game engine, so that the initial orientation of the game prop in the first prop animation of the game prop made in the digital content generating software is the same as the initial orientation of the game prop in the game engine. Providing a basis for generating in the game engine a second prop animation that is identical to the orientation transformation of the game prop in the first prop animation produced in the digital content generation software.
It can be seen that, because the coordinate systems used by the digital content generating software and the game engine are different, by determining the orientation of the game prop in the digital content generating software to be consistent with the orientation of the game prop in the game engine, the initial orientation of the game prop when the first prop animation of the game prop is made in the digital content generating software can be the initial orientation of the game prop in the game engine. In this way, after determining the orientation of the game play object as the orientation that matches the orientation of the game play object in the game engine, a first play object animation may be produced in the digital content generation software based on the game play object having the same initial orientation as the initial orientation of the game play object in the game engine.
The following describes the digital content generation software and the orientation transformation of game props in the game engine in the animation production method according to the embodiment of the present application with reference to fig. 10 and 11.
Fig. 10 is a schematic diagram showing an example of a change in the orientation of a game item in digital content creation software in the animation production method according to the embodiment of the present application. In the digital content creation software, the initial orientation of prop 1 is the initial orientation of prop 1 illustrated in fig. 10, and then, the initial orientation of prop 1 is changed to obtain the orientation shown by prop 1 before conversion, and the orientation shown by prop 1 before conversion is the initial orientation of prop 1 in the game engine. Then, a first prop animation is created in the digital content creation software based on prop 1 before conversion, and the initial orientation of prop 1 in the created first prop animation is the orientation shown by prop 1 before conversion, and the final orientation of prop 1 is the orientation shown by prop 1 after conversion.
Fig. 11 is a schematic diagram showing an example of a change in the direction of a prop in a game engine in the animation production method according to the embodiment of the present application. In the case where the initial orientation of prop 1 in the game engine is the orientation of prop 1 before conversion illustrated in fig. 11, when a second prop animation of prop 1 is generated in the game engine by attaching prop 1 to the character animation, the orientation of prop can be changed based on the orientation of prop 1 before conversion illustrated in fig. 11, so that the second prop animation corresponding to the orientation conversion from prop 1 before conversion to prop 1 after conversion illustrated in fig. 11 is generated based on the orientation of prop 1 before conversion after the orientation is changed, and thus, the second prop animation generated for prop 1 in the game engine can be made to coincide with the orientation conversion of prop 1 in the first prop animation created for prop 1 in the digital content generating software.
In the application, when an object is imported into the digital content generating software from the game engine, the top node generally automatically adds corresponding transformation parameters to enable the display modes (orientations) of the object in the game engine and the digital content generating software to be consistent. Thus, in particular, the present application may be used to position game play objects in digital content generation software by:
Acquiring the prop binding data and importing the prop binding data into the digital content generating software from the game engine; the prop binding data comprises binding data between the prop skeleton and the prop model; setting transformation parameters of a top node in the digital content generation software, and carrying out coordinate transformation on the game prop according to the transformation parameters of the top node; the transformation parameters of the top level node are used for transforming the orientation of the object imported from the game engine into the orientation of the object in the game engine.
It should be noted that, the node is the minimum unit of calculation of the digital content generating software, each node is an attribute group, different types of nodes can be generated through different attribute groups, where the spatial coordinate transformation node (also called transform node) is the most basic node in DCC software, including displacement (transform), rotation (rotation) and scaling (scale) attributes, and by changing these transformation node attributes, translation, rotation or scaling of the whole or part of the special effect object model can be changed.
The top-level node can be understood as the control node of the uppermost layer for controlling the whole object to perform corresponding transformation, and the top-level node can control the object to perform corresponding position transformation through the transformation parameters of the top-level node. Therefore, when the prop binding data is imported into the digital content generating software from the game engine, the game props can be subjected to position conversion in advance according to the conversion parameters of the top node, so that the orientation of the game props in the digital content generating software is consistent with the orientation in the game engine.
In particular embodiments, the property binding data may be imported in a particular file format when imported from the game engine into the digital content generation software.
Specifically, the specific file format may be Fbx files, fbx files are 3D models stored in Autodesk Filmbox format, binding and animation files, and may be used for exchanging and using 3D data between DCC software. The file format of Fbx files can support all major three-dimensional data elements as well as two-dimensional, audio, and video media elements. The Fbx file is commonly used for game development and animation, and through Fbx users have access to three-dimensional files from most three-dimensional suppliers.
In animation, fbx files generally have the following advantages:
and (3) cross-platform manufacturing: fbx files can be shared between different operating systems and applications to support cross-platform animation;
good compatibility: the Fbx file can be compatible with various animation production software and 3D modeling software, so that cross-software animation production is realized;
Support multi-layer animation: the Fbx file supports multi-layer animation, and a plurality of animation layers can be overlapped together, so that a more complex animation effect is realized;
Support animation clips: the Fbx file supports animation clips, and can divide the animation into a plurality of parts, so that the animation clips and the editing are convenient;
Support multiple animation export: the Fbx file supports multiple animation exports, and multiple animations can be exported into different file formats, so that the animation export and distribution are convenient.
Therefore, based on the advantages of Fbx file in animation production, such as cross-platform, good compatibility, multi-layer animation support, animation clipping support and multi-animation export support, the application can support better animation production by importing prop binding data from a game engine into digital content generation software in Fbx file.
Specifically, the step of determining the orientation of the game props to be consistent with the orientation of the game props in the game engine may be achieved by:
acquiring a coordinate type of a first coordinate system used in the digital content generation software and a coordinate type of a second coordinate system used in the game engine;
and carrying out coordinate conversion on each position point of the game prop in the digital content generating software according to the coordinate type of the first coordinate system and the coordinate type of the second coordinate system so as to change the orientation of the game prop in the digital content generating software to be consistent with the orientation of the game prop in a game engine.
It should be noted that the first coordinate system refers to a global coordinate system of the digital content generating software, and the second coordinate system refers to a global coordinate system of the game engine, which is different from a local coordinate system used by the object.
In the case that the first coordinate system is the right hand Yup coordinate system and the second coordinate system is the left hand Zup coordinate system, the step of performing coordinate transformation on the game prop in the digital content generating software according to the coordinate type of the first coordinate system and the coordinate type of the second coordinate system may be implemented as follows:
Converting coordinate values of a third axis of each position point in the game prop into opposite numbers to obtain each position point after coordinate conversion; and rotating each position point subjected to coordinate conversion by 90 degrees around a first axis from the third axis to a second axis, so as to obtain each rotated position point.
The first axis refers to any one of an X axis, a Y axis and a Z axis, the second axis is one axis of the X axis, the Y axis and the Z axis except the first axis, and the third axis is the other axis of the X axis, the Y axis and the Z axis except the first axis and the second axis. For convenience of explanation, the present application will be described with reference to the third axis as the Z axis, the first axis as the X axis, and the second axis as the Y axis.
Fig. 12 is a schematic diagram of a method for producing an animation according to an embodiment of the present application, in which a coordinate system used by digital content generating software is converted into a coordinate system used by a game engine. The first coordinate system used by the digital content generating software is a right hand Yup coordinate system 03, the second coordinate system used by the game engine is a left hand Zup coordinate system 04, and the conversion process is as follows:
firstly, inverting the Z axis in a right hand Yup coordinate system used by digital content generating software, namely converting the positive direction of the Z axis from the direction pointing to the observer to the direction far away from the observer, and obtaining a coordinate system 05;
and secondly, rotating the Z axis and the Y axis in the coordinate system 05 by 90 degrees around the X axis from the rotation direction of the Z axis to the Y axis to obtain a second coordinate system used by the game engine, namely a left-hand Zup coordinate system 04.
For each position point of the game prop, the position transformation is to invert the Z value in the coordinates of each position point to obtain each position point after converting the coordinates after inverting the Z value, then rotate each position point after converting the coordinates after inverting the Z value by 90 degrees around the X axis from the Z axis to the Y axis to obtain each rotated position point, thereby realizing the position transformation of each position point in the game prop and further realizing the position transformation of the game prop.
The Z value in the coordinates of each position point is inverted, that is, the coordinates of each position point are multiplied by the following transformation matrix 1:
Therefore, when the first coordinate system is the right hand Yup coordinate system and the second coordinate system is the left hand Zup coordinate system, the transformation parameters set by the top node may include a parameter obtained by inverting the Z value of each position point and a parameter obtained by rotating each position point by 90 degrees around the X axis from the Z axis to the Y axis.
In the digital content creation software, the positive and negative of the rotation are determined by which axis is rotated, and in general, the positive is rotated by the X-direction Y rotation, the Y-direction Z rotation, and the positive is rotated by the Y-direction X rotation, the Z-direction Y rotation, and the X-direction Z rotation, and therefore, in the case where the first coordinate system is the right-hand Yup coordinate system and the second coordinate system is the left-hand Zup coordinate system, the transformation parameter rotatex rotated about the X-axis among the transformation parameters set by the top-level node may be set to-90 °.
When determining the parent-child relationship between the prop skeleton and the first skeleton, the parent-child relationship between the prop skeleton and the first skeleton without position offset can be determined, and a constraint node is obtained.
Correspondingly, the step of determining the constraint condition of the parent-child relationship according to the preset transformation parameter may be to perform parameter configuration on constraint variables of the constraint nodes according to the preset transformation parameter, and determine the constraint variables after parameter configuration as the constraint condition of the parent-child relationship.
Specifically, setting the prop skeleton as a father skeleton, determining the first skeleton as a child skeleton, and setting the father skeleton and the child skeleton as father-son constraint without position deviation in the digital content generation software to obtain constraint nodes; and setting constraint variables of the constraint nodes as the first offset according to the preset transformation parameters to obtain parent-child constraints with the first offset.
The father-son constraint without position deviation means that the anchor point of the father object and the anchor point of the son object are completely overlapped, and the subsequent movements are completely consistent. In the embodiment of the application, the father-son constraint without position deviation means that the local coordinate system of the first skeleton and the local coordinate system of the prop skeleton have no position deviation, and the subsequent movements are completely consistent.
After the constraint node is established, parameter configuration is carried out on constraint parameters of the constraint node, and specifically, constraint variables of the constraint node are configured to be the first offset according to the preset transformation parameters, so that father-son constraint with the first offset is obtained.
Specifically, the constraint condition of determining the parent-child relationship according to the preset transformation parameters can be realized by the following steps:
generating a preset transformation matrix corresponding to the game prop according to the preset transformation parameters;
Determining an inverse of the preset transformation matrix;
and determining constraint conditions of the parent-child relationship according to the offset indicated by the inverse matrix.
Among them, a transformation Matrix (Matrix) is a mathematical tool used in computer graphics to describe two-dimensional or three-dimensional graphics under transformation operations of translation, rotation, scaling, and shear. The transformation matrix is typically a square matrix, the size of which depends on the type and dimensions of the transformation described. Thus, the preset transformation matrix corresponding to the game play object may be used for the offset indicated in the preset transformation parameters corresponding to the game play object.
The determination of constraints is described in detail below:
Determining the first offset based on the principle that the position transformation of the game prop in the second prop animation obtained in the game engine is consistent with the position transformation of the game prop in the first prop animation manufactured in the digital content generating software, wherein the determining process is as follows:
First, based on the above-mentioned attachment manner of the game props in the game engine, equation (1) is obtained:
WMu (PropJnt) =mu (SocketJnt) × Mu (OriginPropRoot) formula (1)
In formula (1), WMu (PropJnt) refers to the transformation matrix of prop bones in the game engine in world coordinates, mu (SocketJnt) refers to the transformation matrix of the first bone in the game engine in the local coordinate system, and Mu (OriginPropRoot) refers to the initial transformation matrix of prop bones in the game engine.
Because the transformation of the same object in the game engine and the digital content generating software is the same, the transformation of the prop skeleton in the game engine in the world coordinates is the same as the transformation of the prop skeleton in the digital content generating software in the world coordinates, the transformation of the first skeleton in the game engine in the local coordinates is the same as the transformation of the first skeleton in the digital content generating software in the local coordinates, and the initial transformation of the prop skeleton in the game engine is the same as the initial transformation of the prop skeleton in the digital content generating software.
Thus, the above formula (1) can be converted into the following formula (2):
WMm (PropJnt) =mm (SocketJnt) × Mm (OriginPropRoot) formula (2)
In formula (2), WMm (PropJnt) is a transformation matrix of prop bones in the index content generation software in world coordinates, mm (SocketJnt) is a transformation matrix of a first bone in the index content generation software in a local coordinate system, and Mm (OriginPropRoot) is an initial transformation matrix of prop bones in the index content generation software.
The following formula (3) can be obtained from the above formula (2):
Mm (socketJnt) =wmm (PropJnt)/Mm (OriginPropRoot) formula (3)
Wherein IMm (OriginPropRoot) is an inverse matrix corresponding to the initial transformation matrix of prop skeleton in the digital content generation software.
Therefore, the position transformation corresponding to the inverse matrix of the preset transformation parameter corresponding to the play object can be determined as the first offset.
In practical application, since the transformation parameters may include at least one of translation parameters, rotation parameters and scaling parameters, the preset transformation matrix corresponding to the game prop can be determined by the following method:
generating a translation matrix according to a first translation parameter in the preset transformation parameters; generating a rotation matrix according to a first rotation parameter in the preset transformation parameters; generating a scaling matrix according to a second scaling parameter in the preset transformation parameters; and determining the product of the translation matrix, the rotation matrix and the scaling matrix as a preset transformation matrix corresponding to the game prop.
In the application, when the preset transformation parameter includes the first translation parameter, generating a translation matrix according to the first translation parameter, and when the preset transformation parameter does not include the first translation parameter, determining the identity matrix as the translation matrix; generating a rotation matrix according to the first rotation parameter when the first rotation parameter is included in the preset transformation parameter, and determining the identity matrix as the rotation matrix when the first rotation parameter is not included in the preset transformation parameter; and generating a scaling matrix according to the first scaling parameter when the first scaling parameter is included in the preset transformation parameter, and determining the identity matrix as the scaling matrix when the first scaling parameter is not included in the preset transformation parameter.
The step of determining the constraint condition of the parent-child relationship according to the offset indicated by the inverse matrix in the present application may be implemented by the following steps:
performing matrix decomposition on the inverse matrix to obtain a second translation parameter, a second rotation parameter and a second scaling parameter corresponding to the inverse matrix;
determining the second translation parameter, the second rotation parameter, and the second scaling parameter as constraints of the parent-child relationship.
In practical application, a matrix decomposition node MDecompose may be created, and then, the inverse matrix is input to the matrix decomposition node MDecompose, and matrix decomposition is performed on the inverse matrix, so as to obtain a second translation parameter, a second rotation parameter, and a second scaling parameter corresponding to the inverse matrix.
In animation MDecompose (matrix decomposition node) is a node used to decompose and parse the 3D transformation matrix. The MDecompose node is generally used for analyzing and extracting rotation, scaling, translation and other information in the 3D transformation matrix. In the MDecompose node, the information of rotation, scaling, and translation in the 3D transformation matrix may be decomposed and parsed by inputting the 3D transformation matrix and selecting different decomposition modes (e.g., rotation, scaling, and translation, etc.).
For example, by inputting a 3D transformation matrix and selecting a rotation decomposition mode, the MDecompose node may extract rotation information in the 3D transformation matrix. By inputting the 3D transformation matrix and selecting the scaling decomposition mode, the MDecompose node can extract the scaling information in the 3D transformation matrix. By inputting the 3D transformation matrix and selecting the translational decomposition mode, the MDecompose node may extract the translational information in the 3D transformation matrix.
In the digital content generating software, before the skeleton animation of the first skeleton is generated according to the father-son constraint and the first prop animation corresponding to the game prop, the first prop animation corresponding to the game prop matched with the role animation can be generated according to the role animation corresponding to the part connected with the game prop in the virtual role.
The portion of the virtual character connected to the game play object may be, for example, a virtual hand portion where the virtual character holds a virtual tool, a virtual head portion where the virtual character wears a virtual hat, or the like. The first prop animation corresponding to the game prop matched with the character animation can be understood as the animation obtained by combining the first prop animation and the character animation accords with the development requirement.
Specifically, a first prop animation corresponding to the game prop matched with the role animation can be generated in digital content generating software by the following modes:
Adding a controller in the prop skeleton in digital content generating software, wherein the controller is used for controlling the game prop to move; according to the animation data of the character animation corresponding to the virtual character, carrying out parameter configuration on at least one variable of a rotation variable, a movement variable and a scaling variable of the controller; and controlling the game props to move based on the controller after parameter configuration, and generating a first prop animation of the game props.
The controller is an element which can conveniently control the prop form through a certain node when the prop is bound. The method comprises the steps of adding a controller for the prop, and carrying out parameter configuration on at least one parameter of rotation parameters, movement parameters and scaling parameters of the controller, so that the game prop can be controlled to move through the controller after parameter configuration, and a first prop animation corresponding to the game prop matched with the character animation is obtained.
Fig. 13 is a schematic diagram of adding a controller to a prop in the animation production method according to the embodiment of the application. In fig. 13, three controllers 1, 2 and 3 are added to the prop, and the three controllers are used for controlling the prop to move.
Corresponding to the animation production method provided in the first embodiment of the present application, the second embodiment of the present application further provides an animation production apparatus, as shown in fig. 13, the animation production apparatus 1300 includes:
A first determining unit 1301, configured to determine a parent-child relationship between a prop skeleton in a game prop and a first skeleton in a character skeleton, where in the parent-child relationship, the prop skeleton is a parent skeleton, and the first skeleton is a child skeleton;
A second determining unit 1302, configured to obtain preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and determine constraint conditions of the parent-child relationship according to the preset transformation parameters;
The generating unit 1303 is configured to determine a first animation of the first skeleton, where the first animation corresponds to the game prop, and generate a skeleton animation of the first skeleton according to the parent-child relationship, the constraint condition of the parent-child relationship, and the first animation of the first prop;
An attaching unit 1304 is configured to attach the prop skeleton to the first skeleton in the skeleton animation of the first skeleton, so as to obtain a second prop animation.
Optionally, the animation producing device 1300 further includes a third determining unit, where the third determining unit is configured to:
In the digital content generation software, the orientation of the game prop is determined to be consistent with the orientation of the game prop in a game engine, the game prop having been imported into the digital content generation software.
Optionally, the third determining unit is specifically configured to:
acquiring a coordinate type of a first coordinate system used in the digital content generation software and a coordinate type of a second coordinate system used in the game engine;
and carrying out coordinate conversion on each position point of the game prop in the digital content generating software according to the coordinate type of the first coordinate system and the coordinate type of the second coordinate system so as to change the orientation of the game prop in the digital content generating software to be consistent with the orientation of the game prop in a game engine.
Optionally, the first coordinate system is a right hand Yup coordinate system, and the second coordinate system is a left hand Zup coordinate system; the third determining unit is specifically configured to:
converting coordinate values of a third axis of each position point in the game prop into opposite numbers to obtain each position point after coordinate conversion;
And rotating each position point subjected to coordinate conversion by 90 degrees around a first axis from the third axis to a second axis, so as to obtain each rotated position point.
Optionally, the first determining unit 1301 is specifically configured to:
determining parent-child relations of the prop skeleton and the first skeleton without position offset to obtain constraint nodes;
The constraint condition of the father-son relation is determined according to the preset transformation parameters, and the constraint condition comprises the following steps:
And carrying out parameter configuration on constraint variables of the constraint nodes according to the preset transformation parameters, and determining the constraint variables subjected to parameter configuration as constraint conditions of the parent-child relationship.
Optionally, the second determining unit 1302 is specifically configured to:
generating a preset transformation matrix corresponding to the game prop according to the preset transformation parameters;
Determining an inverse of the preset transformation matrix;
and determining constraint conditions of the parent-child relationship according to the offset indicated by the inverse matrix.
Optionally, the second determining unit 1302 is specifically configured to:
Generating a translation matrix according to a first translation parameter in the preset transformation parameters;
generating a rotation matrix according to a first rotation parameter in the preset transformation parameters;
generating a scaling matrix according to a second scaling parameter in the preset transformation parameters;
and determining the product of the translation matrix, the rotation matrix and the scaling matrix as a preset transformation matrix corresponding to the game prop.
Optionally, the second determining unit 1302 is specifically configured to:
performing matrix decomposition on the inverse matrix to obtain a second translation parameter, a second rotation parameter and a second scaling parameter corresponding to the inverse matrix;
determining the second translation parameter, the second rotation parameter, and the second scaling parameter as constraints of the parent-child relationship.
Optionally, the generating unit 1303 is specifically configured to:
and generating a first prop animation corresponding to the game prop matched with the role animation according to the role animation corresponding to the part connected with the game prop in the virtual role.
Optionally, the generating unit 1303 is specifically configured to:
Adding a controller to the prop skeleton, wherein the controller is used for controlling the game prop to move;
according to the animation data of the character animation corresponding to the virtual character, carrying out parameter configuration on at least one variable of a rotation variable, a movement variable and a scaling variable of the controller;
and controlling the game props to move based on the controller after parameter configuration, and generating a first prop animation of the game props.
The third embodiment of the present application also provides an electronic apparatus for animation production, corresponding to the animation production method provided in the first embodiment of the present application. As shown in fig. 14, the electronic device 1400 includes: a processor 1401; and a memory 1402 for storing a program of an animation production method, the apparatus, after being powered on and running the program of the animation production method by the processor, performing the steps of:
determining a father-son relationship between a prop skeleton in a game prop and a first skeleton in a role skeleton, wherein in the father-son relationship, the prop skeleton is a father skeleton and the first skeleton is a child skeleton;
Acquiring preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the role skeleton when the game prop is attached to the role skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters;
Determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation;
And attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
In correspondence with the animation production method provided by the first embodiment of the present application, a fourth embodiment of the present application provides a computer-readable storage medium storing a program of the animation production method, the program being executed by a processor to perform the steps of:
determining a father-son relationship between a prop skeleton in a game prop and a first skeleton in a role skeleton, wherein in the father-son relationship, the prop skeleton is a father skeleton and the first skeleton is a child skeleton;
Acquiring preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the role skeleton when the game prop is attached to the role skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters;
Determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation;
And attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
It should be noted that, for the detailed descriptions of the apparatus, the electronic device, and the computer readable storage medium provided in the second embodiment, the third embodiment, and the fourth embodiment of the present application, reference may be made to the related descriptions of the first embodiment of the present application, and the detailed descriptions are omitted here.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.
In one typical configuration, the node devices in the blockchain include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
1. Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), random Access Memory (RAM) of other nature, read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage media or any other non-transmission media that can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
2. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.

Claims (13)

1. A method of producing an animation, the method comprising:
determining a father-son relationship between a prop skeleton in a game prop and a first skeleton in a role skeleton, wherein in the father-son relationship, the prop skeleton is a father skeleton and the first skeleton is a child skeleton;
Acquiring preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the role skeleton when the game prop is attached to the role skeleton, and determining constraint conditions of the father-son relationship according to the preset transformation parameters;
Determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation;
And attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
2. The method of claim 1, wherein prior to said determining a parent-child relationship of a prop bone of the game props with a first bone of a character bones, the method further comprises:
In the digital content generation software, the orientation of the game prop is determined to be consistent with the orientation of the game prop in a game engine, the game prop having been imported into the digital content generation software.
3. The method of claim 2, wherein the determining the orientation of the play object to be consistent with the orientation of the play object in a game engine comprises:
acquiring a coordinate type of a first coordinate system used in the digital content generation software and a coordinate type of a second coordinate system used in the game engine;
and carrying out coordinate conversion on each position point of the game prop in the digital content generating software according to the coordinate type of the first coordinate system and the coordinate type of the second coordinate system so as to change the orientation of the game prop in the digital content generating software to be consistent with the orientation of the game prop in a game engine.
4. A method according to claim 3, wherein the first coordinate system is a right hand Yup coordinate system and the second coordinate system is a left hand Zup coordinate system; the coordinate conversion of each position point of the game prop in the digital content generating software according to the coordinate type of the first coordinate system and the coordinate type of the second coordinate system comprises the following steps:
converting coordinate values of a third axis of each position point in the game prop into opposite numbers to obtain each position point after coordinate conversion;
And rotating each position point subjected to coordinate conversion by 90 degrees around a first axis from the third axis to a second axis, so as to obtain each rotated position point.
5. The method of claim 1, wherein the determining the parent-child relationship of the prop bone to the first bone comprises:
determining parent-child relations of the prop skeleton and the first skeleton without position offset to obtain constraint nodes;
The constraint condition of the father-son relation is determined according to the preset transformation parameters, and the constraint condition comprises the following steps:
And carrying out parameter configuration on constraint variables of the constraint nodes according to the preset transformation parameters, and determining the constraint variables subjected to parameter configuration as constraint conditions of the parent-child relationship.
6. The method of claim 1, wherein said determining constraints of said parent-child relationship based on said preset transformation parameters comprises:
generating a preset transformation matrix corresponding to the game prop according to the preset transformation parameters;
Determining an inverse of the preset transformation matrix;
and determining constraint conditions of the parent-child relationship according to the offset indicated by the inverse matrix.
7. The method of claim 6, wherein generating the preset transformation matrix for the game play object based on the preset transformation parameters comprises:
Generating a translation matrix according to a first translation parameter in the preset transformation parameters;
generating a rotation matrix according to a first rotation parameter in the preset transformation parameters;
generating a scaling matrix according to a second scaling parameter in the preset transformation parameters;
and determining the product of the translation matrix, the rotation matrix and the scaling matrix as a preset transformation matrix corresponding to the game prop.
8. The method of claim 6, wherein said determining the constraint of the parent-child relationship based on the offset indicated by the inverse matrix comprises:
performing matrix decomposition on the inverse matrix to obtain a second translation parameter, a second rotation parameter and a second scaling parameter corresponding to the inverse matrix;
determining the second translation parameter, the second rotation parameter, and the second scaling parameter as constraints of the parent-child relationship.
9. The method of claim 1, wherein, in the determining the first track animation corresponding to the game play object, comprising:
and generating a first prop animation corresponding to the game prop matched with the role animation according to the role animation corresponding to the part connected with the game prop in the virtual role.
10. The method of claim 8, wherein the generating a first prop animation corresponding to the game prop that matches the character animation comprises:
Adding a controller to the prop skeleton, wherein the controller is used for controlling the game prop to move;
according to the animation data of the character animation corresponding to the virtual character, carrying out parameter configuration on at least one variable of a rotation variable, a movement variable and a scaling variable of the controller;
and controlling the game props to move based on the controller after parameter configuration, and generating a first prop animation of the game props.
11. An animation producing device, the device comprising:
A first determining unit, configured to determine a parent-child relationship between a prop skeleton in a game prop and a first skeleton in a character skeleton, where in the parent-child relationship, the prop skeleton is a parent skeleton, and the first skeleton is a child skeleton;
A second determining unit, configured to obtain preset transformation parameters of a local coordinate system of the game prop relative to a local coordinate system of the character skeleton when the game prop is attached to the character skeleton, and determine constraint conditions of the parent-child relationship according to the preset transformation parameters;
the generation unit is used for determining a first animation of the game prop, and generating a skeleton animation of the first skeleton according to the father-son relationship, the constraint condition of the father-son relationship and the first animation of the first prop;
And the attaching unit is used for attaching the prop skeleton to the first skeleton in the skeleton animation of the first skeleton to obtain a second prop animation.
12. An electronic device, comprising:
a processor; and
A memory for storing a data processing program, the electronic device being powered on and executing the program by the processor, for performing the method of any of claims 1-10.
13. A computer readable storage medium, characterized in that a data processing program is stored, which program is run by a processor, performing the method according to any of claims 1-10.
CN202410166048.3A 2024-02-05 2024-02-05 Animation production method and device and electronic equipment Pending CN118015155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410166048.3A CN118015155A (en) 2024-02-05 2024-02-05 Animation production method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410166048.3A CN118015155A (en) 2024-02-05 2024-02-05 Animation production method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN118015155A true CN118015155A (en) 2024-05-10

Family

ID=90959085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410166048.3A Pending CN118015155A (en) 2024-02-05 2024-02-05 Animation production method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN118015155A (en)

Similar Documents

Publication Publication Date Title
EP3454302A1 (en) Approximating mesh deformation for character rigs
US20030184544A1 (en) Modeling human beings by symbol manipulation
US7920143B1 (en) Method for defining animation parameters for an animation definition interface
US8860731B1 (en) Refining animation
CN111179391A (en) Three-dimensional animation production method, system and storage medium
Valentini et al. Interactive sculpting using augmented-reality, mesh morphing, and force feedback: Force-feedback capabilities in an augmented reality environment
CN115098100A (en) Digital twin body component driving method based on cloud-native industrial application scene
US9652879B2 (en) Animation of a virtual object
CN114053696B (en) Image rendering processing method and device and electronic equipment
CN114452646A (en) Virtual object perspective processing method and device and computer equipment
WO2024011733A1 (en) 3d image implementation method and system
CN118015155A (en) Animation production method and device and electronic equipment
CN109074670B (en) Information processing apparatus, image generating method, and recording medium
Gao Application of 3D Virtual Reality Technology in Film and Television Production Under Internet Mode
US8902236B1 (en) Implicit surface deformer in a defined direction
CN115167940A (en) 3D file loading method and device
CN114627149A (en) Time-space trajectory simulation method and device, electronic equipment and computer storage medium
Herrmann et al. Motion Data and Model Management for Applied Statistical Motion Synthesis.
KR20160051582A (en) Platform structure making support services of manufacturing enterprises based on 3 dimensional data
Hempe et al. A semantics-based, active render framework to realize complex eRobotics applications with realistic virtual testing environments
CN110782533B (en) System for virtual role interaction control in virtual previewing
US20240009560A1 (en) 3D Image Implementation
Mirzaiee et al. Towards retargetable animations for industrial augmented reality
Pokorný et al. The Preparation of Graphic Models for a Virtual Reality Application in Unity
Zhang et al. VR-based generation of photorealistic synthetic data for training hand-object tracking models

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination