CN114596394A - Method, device, system and storage medium for generating bone animation - Google Patents

Method, device, system and storage medium for generating bone animation Download PDF

Info

Publication number
CN114596394A
CN114596394A CN202210086058.7A CN202210086058A CN114596394A CN 114596394 A CN114596394 A CN 114596394A CN 202210086058 A CN202210086058 A CN 202210086058A CN 114596394 A CN114596394 A CN 114596394A
Authority
CN
China
Prior art keywords
target
template
instruction
skeletal animation
skeleton
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
CN202210086058.7A
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.)
Shenzhen Tatfook Network Tech Co Ltd
Original Assignee
Shenzhen Tatfook Network Tech 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 Shenzhen Tatfook Network Tech Co Ltd filed Critical Shenzhen Tatfook Network Tech Co Ltd
Priority to CN202210086058.7A priority Critical patent/CN114596394A/en
Publication of CN114596394A publication Critical patent/CN114596394A/en
Pending legal-status Critical Current

Links

Images

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
    • 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)
  • 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

本申请公开了一种骨骼动画生成的方法、装置、系统及存储介质,用于降低制作骨骼动画的难度,从而降低了在学校教育中普及骨骼动画的难度。本申请方法包括:接收第一指令,根据所述第一指令创建以普通方块为基本单元的静态对象;接收第二指令,根据所述第二指令调用预先创建好的骨骼动画模板库;判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板;若存在,则根据所述静态对象的三维形状创建目标对象;根据所述骨骼方块信息在所述目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;根据所述目标运动逻辑信息对所述骨骼对象添加运动逻辑得到动态对象。

Figure 202210086058

The present application discloses a method, device, system and storage medium for generating skeletal animation, which are used to reduce the difficulty of producing skeletal animation, thereby reducing the difficulty of popularizing skeletal animation in school education. The method of the present application includes: receiving a first instruction, and creating a static object with a common block as a basic unit according to the first instruction; receiving a second instruction, calling a pre-created skeletal animation template library according to the second instruction; Whether there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library; if there is, create a target object according to the three-dimensional shape of the static object; The target ordinary square corresponding to the object is replaced with a skeleton square to obtain a skeleton object; a dynamic object is obtained by adding motion logic to the skeleton object according to the target motion logic information.

Figure 202210086058

Description

一种骨骼动画生成的方法、装置、系统及存储介质A method, device, system and storage medium for generating skeletal animation

技术领域technical field

本申请涉及数据处理技术领域,尤其涉及一种骨骼动画生成的方法、装置、系统及存储介质。The present application relates to the technical field of data processing, and in particular, to a method, device, system and storage medium for generating skeletal animation.

背景技术Background technique

骨骼动画是模型动画中的一种,在骨骼动画中,模型具有互相连接的“骨骼”组成的骨架结构,通过改变骨骼的朝向和位置来为模型生成动画。Skeletal animation is a type of model animation. In skeletal animation, the model has a skeleton structure composed of interconnected "bones", and the model is animated by changing the orientation and position of the bones.

现有技术中,动画制作人员在制作骨骼动画时,需要先建立三维模型,然后将骨骼绑定到三维模型的各个顶点,然后在一条二维时间轴上设定动画的帧数(例如时间轴为1秒,帧数为30帧),接着在每帧设置好各个骨骼的位置、朝向以及缩放,最后播放该时间轴,完成骨骼动画的制作。In the prior art, when animators make skeletal animations, they need to build a 3D model first, then bind the bones to each vertex of the 3D model, and then set the number of animation frames on a 2D timeline (for example, a timeline). It is 1 second and the number of frames is 30 frames), then set the position, orientation and scale of each bone in each frame, and finally play the timeline to complete the production of skeletal animation.

因此,现有技术中制作骨骼动画的方法太过繁杂,对动画制作人员的要求很高,不利于在用户教学和学校教育中普及。Therefore, the methods for producing skeletal animations in the prior art are too complicated and require high animation production personnel, which is not conducive to popularization in user teaching and school education.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种骨骼动画生成的方法、装置及计算机可读存储介质,用于降低制作骨骼动画的难度。The present application provides a method, device and computer-readable storage medium for generating skeletal animation, which are used to reduce the difficulty of producing skeletal animation.

本申请第一方面提供了一种骨骼动画生成的方法,所述方法包括:A first aspect of the present application provides a method for generating skeletal animation, the method comprising:

接收第一指令,根据所述第一指令创建以普通方块为基本单元的静态对象;receiving a first instruction, and creating a static object with an ordinary block as a basic unit according to the first instruction;

接收第二指令,根据所述第二指令调用预先创建好的骨骼动画模板库;receiving the second instruction, and calling the pre-created skeletal animation template library according to the second instruction;

判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板,所述目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息;Judging whether there is a target skeletal animation template that matches the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template includes skeleton block information and target motion logic information;

若是,则根据所述静态对象的三维形状创建目标对象;If so, create a target object according to the three-dimensional shape of the static object;

根据所述骨骼方块信息在所述目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;According to the bone square information, the target ordinary square corresponding to the target object is replaced with a bone square to obtain a bone object;

根据所述目标运动逻辑信息对所述骨骼对象添加运动逻辑得到动态对象。A dynamic object is obtained by adding motion logic to the skeletal object according to the target motion logic information.

可选的,所述根据所述第二指令调用预先创建好的骨骼动画模板库包括:Optionally, calling the pre-created skeletal animation template library according to the second instruction includes:

根据所述第二指令创建动画模型方块;Create an animation model block according to the second instruction;

根据所述动画模型方块调用骨骼动画模板库。The skeletal animation template library is called according to the animation model block.

可选的,所述根据所述第二指令创建动画模型方块包括:Optionally, the creating an animation model block according to the second instruction includes:

根据所述第二指令在与所述静态对象相连的位置创建动画模型方块。An animated model square is created at a position connected to the static object according to the second instruction.

可选的,所述根据所述动画模型方块调用预先创建好的骨骼动画模板库之后,所述判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板之前,所述方法还包括:Optionally, after the pre-created skeletal animation template library is called according to the animation model block, it is determined whether there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library. Before, the method further includes:

根据所述动画模型方块的位置,确定所述静态对象与所述动画模型方块连接的面为所述静态对象的正面;According to the position of the animation model square, it is determined that the surface connecting the static object and the animation model square is the front surface of the static object;

所述判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板包括:The judging whether there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library includes:

判断所述骨骼动画模板库中是否存在与正面视图的所述静态对象的三维形状相匹配的目标骨骼动画模板。It is judged whether there is a target skeletal animation template matching the three-dimensional shape of the static object of the frontal view in the skeletal animation template library.

可选的,所述判断所述骨骼动画模板库中是否存在与正面视图的所述静态对象的三维形状相匹配的目标骨骼动画模板包括:Optionally, the judging whether there is a target skeletal animation template that matches the three-dimensional shape of the static object of the frontal view in the skeletal animation template library includes:

获取正面视图的所述静态对象的三维形状;obtaining the three-dimensional shape of the static object of the frontal view;

以与所述动画模型方块相连的普通方块为所述静态对象的第一基准方块,计算所述静态对象的所有其他普通方块与所述第一基准方块的第一相对位置信息;Taking the common block connected with the animation model block as the first reference block of the static object, calculate the first relative position information of all other common blocks of the static object and the first reference block;

获取所述静态对象的正面二维图像;obtaining a frontal two-dimensional image of the static object;

从所述骨骼动画模板库中获取任一个未获取过的骨骼动画模板作为测试模板,所述骨骼动画模板对应骨骼方块和普通方块;Obtain any unobtained skeletal animation template from the skeletal animation template library as a test template, and the skeletal animation template corresponds to a skeleton square and a normal square;

根据所述第一基准方块在所述正面二维图像中的位置,确定所述测试模板对应的第二基准方块;According to the position of the first reference square in the front two-dimensional image, determine the second reference square corresponding to the test template;

计算所述测试模板对应的其他所有骨骼方块以及普通方块与所述第二基准方块的第二相对位置信息;Calculate the second relative position information of all other bone squares corresponding to the test template and the ordinary square and the second reference square;

计算所述第一相对位置信息与所述第二相对位置信息的相似度;calculating the similarity between the first relative position information and the second relative position information;

判断所述相似度是否不低于预设值;Determine whether the similarity is not lower than a preset value;

若是,则确定所述测试模板与所述静态对象的三维形状相匹配,并确定所述测试模板为目标骨骼动画模板。If so, determine that the test template matches the three-dimensional shape of the static object, and determine that the test template is a target skeletal animation template.

可选的,所述接收第一指令之前,所述方法还包括:Optionally, before the receiving the first instruction, the method further includes:

接收第三指令,并根据所述第三指令创建以普通方块和骨骼方块为基本单元的骨骼模板对象;receiving a third instruction, and creating a skeleton template object with ordinary squares and bone squares as basic units according to the third instruction;

接收第四指令,并根据所述第四指令设定所述骨骼模板对象的运动逻辑;receiving a fourth instruction, and setting the motion logic of the skeleton template object according to the fourth instruction;

根据所述骨骼模板对象所有的骨骼方块和普通方块的相对位置以及所述运动逻辑,生成自定义骨骼模板;Generate a custom skeleton template according to the relative positions of all the skeleton squares and the normal squares of the skeleton template object and the motion logic;

将所述自定义骨骼模板添加到所述骨骼动画模板库。Add the custom skeleton template to the skeletal animation template library.

可选的,所述根据所述目标运动逻辑信息对所述目标普通方块添加运动逻辑得到动态对象之后,所述方法还包括:Optionally, after the dynamic object is obtained by adding motion logic to the target ordinary block according to the target motion logic information, the method further includes:

对所述动态对象设定自主运动逻辑,使得所述动态对象根据所述自主运动逻辑随机执行前进、后退、旋转和/或跳跃的动作。An autonomous motion logic is set for the dynamic object, so that the dynamic object randomly performs forward, backward, rotating and/or jumping actions according to the autonomous motion logic.

本申请第二方面提供了一种骨骼动画生成的装置,所述装置包括:A second aspect of the present application provides a device for generating skeletal animation, the device comprising:

第一接收单元,用于接收第一指令,根据所述第一指令创建以普通方块为基本单元的静态对象;a first receiving unit, configured to receive a first instruction, and create a static object with an ordinary block as a basic unit according to the first instruction;

第二接收单元,用于接收第二指令,根据所述第二指令调用预先创建好的骨骼动画模板库;;A second receiving unit, configured to receive a second instruction, and call the pre-created skeletal animation template library according to the second instruction;

判断单元,用于判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板,所述目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息;a judging unit for judging whether there is a target skeletal animation template that matches the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template includes skeleton block information and target motion logic information;

创建单元,用于当所述判断单元确定所述骨骼动画模板库中存在与所述静态对象的三维形状相匹配的目标骨骼动画模板时,根据所述静态对象的三维形状创建目标对象;A creating unit, configured to create a target object according to the three-dimensional shape of the static object when the judging unit determines that there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library;

替换单元,用于根据所述骨骼方块信息在所述目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;A replacement unit, configured to replace the target ordinary square corresponding to the target object with a bone square according to the bone square information to obtain a bone object;

添加单元,用于根据所述目标运动逻辑信息对所述骨骼对象添加运动逻辑得到动态对象。The adding unit is configured to add motion logic to the skeletal object according to the target motion logic information to obtain a dynamic object.

本申请第三方面提供了一种骨骼动画生成的系统,所述装置包括:A third aspect of the present application provides a system for generating skeletal animation, the device comprising:

处理器、存储器、输入输出单元以及总线;processors, memories, input and output units, and buses;

所述处理器与所述存储器、所述输入输出单元以及所述总线相连;the processor is connected to the memory, the input-output unit and the bus;

所述存储器保存有程序,所述处理器调用所述程序以执行如第一方面以及第一方面中任意一项可选的方法。The memory stores a program, and the processor invokes the program to execute the method according to the first aspect and any one of the optional methods of the first aspect.

本申请第四方面提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上保存有程序,当所述程序在计算机上运行时,所述计算机执行如第一方面以及第一方面中任一项可选的方法。A fourth aspect of the present application provides a computer-readable storage medium, wherein a program is stored on the computer-readable storage medium, and when the program is run on a computer, the computer executes the first aspect and The optional method of any one of the first aspect.

从以上技术方案可以看出,本申请具有以下优点:As can be seen from the above technical solutions, the present application has the following advantages:

本申请提供的方法,首先接收第一指令,根据第一指令创建以普通方块为基本单元的静态对象,然后接收第二指令,并根据第二指令调用预先创建好的骨骼动画模板库,再判断骨骼动画模板库中是否有与静态对象的三维形状相匹配的目标骨骼动画模板,如果有则根据静态对象的三维形状创建目标对象,并根据目标骨骼动画模板将该目标对象对应的普通方块替换为骨骼方块得到骨骼对象,再根据目标骨骼动画模板为该骨骼对象添加运动逻辑,使得该骨骼对象可以根据该运动逻辑做出相应的动作,从而得到动态对象。通过本申请提供的方法,用户只需要向执行方法的装置发送第一指令和第二指令这两条简单指令,就可以得到能够运动的动态对象,完成骨骼动画的制作,简化了用户制作骨骼动画的过程,降低了对用户的要求,使得骨骼动画的制作更容易普及。The method provided by the present application firstly receives the first instruction, creates a static object with an ordinary block as the basic unit according to the first instruction, then receives the second instruction, and calls the pre-created skeletal animation template library according to the second instruction, and then judges Whether there is a target skeletal animation template that matches the 3D shape of the static object in the skeletal animation template library, if so, create a target object based on the 3D shape of the static object, and replace the ordinary square corresponding to the target object with the target skeletal animation template. The skeleton block obtains the skeleton object, and then adds motion logic to the skeleton object according to the target skeleton animation template, so that the skeleton object can perform corresponding actions according to the motion logic, thereby obtaining a dynamic object. With the method provided in this application, the user only needs to send two simple instructions, the first instruction and the second instruction, to the device executing the method, and then a dynamic object that can move can be obtained, the production of skeletal animation is completed, and the production of skeletal animation by the user is simplified. The process of reducing the requirements for users, making the production of skeletal animation easier to popularize.

附图说明Description of drawings

为了更清楚地说明本申请中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本申请中骨骼动画生成的方法一个实施例流程示意图;1 is a schematic flowchart of an embodiment of a method for generating skeletal animation in the application;

图2为本申请中骨骼动画生成的方法另一实施例流程示意图;2 is a schematic flowchart of another embodiment of a method for generating skeletal animation in the application;

图3为本申请中骨骼动画生成的装置一个实施例结构示意图;3 is a schematic structural diagram of an embodiment of a device for generating skeletal animation in the application;

图4为本申请中骨骼动画生成的装置另一实施例结构示意图;4 is a schematic structural diagram of another embodiment of the device for generating skeletal animation in the application;

图5为本申请中骨骼动画生成的系统一个实施例结构示意图。FIG. 5 is a schematic structural diagram of an embodiment of a system for generating skeletal animation in this application.

具体实施方式Detailed ways

本申请提供了一种骨骼动画生成的方法、装置、系统及存储介质,用于降低骨骼动画的制作难度。The present application provides a method, device, system and storage medium for generating skeletal animation, which are used to reduce the difficulty of producing skeletal animation.

需要说明的是,本申请提供的骨骼动画生成的方法,可以应用于终端,还可以应用于服务器上。终端可以是智能手机、平板电脑、智能手表等可移动终端,也可以是台式计算机等固定终端。为方便描述,本申请中以终端为执行主体进行举例说明。It should be noted that the method for generating a skeletal animation provided in this application can be applied to a terminal, and can also be applied to a server. The terminal may be a mobile terminal such as a smart phone, a tablet computer, and a smart watch, or a fixed terminal such as a desktop computer. For the convenience of description, in this application, a terminal is used as an execution subject for illustration.

请参阅图1,图1是本申请提供的骨骼动画生成的方法一个实施例的流程示意图,骨骼动画生成的方法包括:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of an embodiment of a method for generating skeletal animation provided by the present application. The method for generating skeletal animation includes:

101、接收第一指令,并根据第一指令创建以普通方块为基本单元的静态对象;101. Receive the first instruction, and create a static object with an ordinary block as a basic unit according to the first instruction;

在实际应用中,终端接收用户通过输入设备发送的第一指令,然后根据第一指令在3D场景中创建以普通方块为基本单元的静态对象。普通方块为立方体,是构成静态对象的基本单元,静态对象由至少一个普通方块组成,当静态对象包含多个普通方块时,这些普通方块直接或者间接相连。第一指令中携带有创建静态对象的命令以及静态对象中各个普通方块在3D场景中的坐标信息,因此终端接收到第一指令后,可以根据第一指令在3D场景的相应位置创建各个普通方块,完成静态对象的创建。In practical applications, the terminal receives the first instruction sent by the user through the input device, and then creates a static object with an ordinary square as a basic unit in the 3D scene according to the first instruction. A common block is a cube, which is a basic unit constituting a static object. The static object consists of at least one common block. When the static object contains multiple common blocks, these common blocks are directly or indirectly connected. The first instruction carries the command to create the static object and the coordinate information of each ordinary block in the static object in the 3D scene. Therefore, after receiving the first instruction, the terminal can create each ordinary block at the corresponding position of the 3D scene according to the first instruction. , to complete the creation of the static object.

102、接收第二指令,根据第二指令调用预先创建好的骨骼动画模板库;102. Receive the second instruction, and call the pre-created skeletal animation template library according to the second instruction;

在终端根据第一指令创建静态对象之后,用户可以通过输入设备继续向终端发送用于调用骨骼动画模板库的第二指令,而终端在接收到第二指令之后,则会根据第二指令调用骨骼动画模板库。After the terminal creates the static object according to the first instruction, the user can continue to send the second instruction for calling the skeletal animation template library to the terminal through the input device, and after receiving the second instruction, the terminal will call the skeleton according to the second instruction. Animated template library.

103、判断骨骼动画模板库中是否存在与静态对象的三维形状相匹配的目标骨骼动画模板,目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息,若存在,则执行步骤104;103, determine whether there is a target skeletal animation template that matches the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template contains bone block information and target motion logic information, if there is, then perform step 104;

终端判断被调用的骨骼动画模板库中的骨骼动画模板是否有与静态对象的三维形状相匹配的目标骨骼动画模板,如果骨骼动画模板库中存在目标骨骼动画模板,则执行步骤104。该目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息,骨骼方块信息包括各骨骼方块之间的相对位置信息、各骨骼方块之间的连接信息以及各骨骼方块绑定普通方块的信息;目标运动逻辑信息包括至少一个动作信息,动作信息为各骨骼方块在一定的时间内的变换信息,每个动作信息的时间长短可以是不同的,也可以是相同的,具体此处不做限定。骨骼方块控制与之绑定的普通方块,并且骨骼方块的一端用于表示方向,若一个骨骼方块表示方向的一端指向另一个骨骼方块,则后者与前者是父子关系,后者是前者的父级,后者运动时,前者也会跟着运动。The terminal determines whether the skeletal animation template in the called skeletal animation template library has a target skeletal animation template matching the three-dimensional shape of the static object, and if there is a target skeletal animation template in the skeletal animation template library, step 104 is performed. The target skeletal animation template includes bone block information and target motion logic information, and the bone block information includes relative position information between each bone block, connection information between each bone block, and information about the normal block bound to each bone block; target; The motion logic information includes at least one motion information, and the motion information is the transformation information of each skeleton block within a certain period of time. The time length of each motion information may be different or the same, which is not specifically limited here. The bone block controls the normal block bound to it, and one end of the bone block is used to indicate the direction. If one end of the bone block that indicates the direction points to another bone block, the latter is a parent-child relationship with the former, and the latter is the parent of the former. When the latter moves, the former will follow.

104、根据静态对象的三维形状创建目标对象;104. Create a target object according to the three-dimensional shape of the static object;

当终端确定存在目标骨骼动画模板,则可以根据静态对象的三维形状在3D场景中创建目标对象,使得被创建出的目标对象的三维形状与静态对象的三维形状相同。When the terminal determines that the target skeletal animation template exists, the target object can be created in the 3D scene according to the three-dimensional shape of the static object, so that the three-dimensional shape of the created target object is the same as the three-dimensional shape of the static object.

本申请中,目标对象的尺寸大小可以与静态对象一致,也可以不一致,具体此处不做限定。In this application, the size of the target object may or may not be the same as that of the static object, which is not specifically limited here.

105、根据骨骼方块信息将目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;105. Replace the target ordinary square corresponding to the target object with a bone square according to the bone square information to obtain a bone object;

由于目标对象与静态对象的三维形状相同,而目标骨骼动画模板是与该静态对象的三维形状相匹配,因此目标对象也与目标骨骼动画模板的三维形状相匹配。由于目标骨骼动画模板的骨骼方块信息包括骨骼方块之间的相对位置信息、骨骼方块之间的连接信息以及各骨骼方块绑定普通方块的信息,因此终端可以根据目标骨骼动画模板的骨骼方块信息,确定目标对象中与目标骨骼动画模板的骨骼方块对应的普通方块,并将这些普通方块作为目标普通方块,然后将这些目标普通方块替换为骨骼方块,再建立起这些骨骼方块之间的连接关系,最后将目标对象的普通方块绑定到这些骨骼方块,从而得到骨骼对象。Since the three-dimensional shape of the target object is the same as that of the static object, and the target skeletal animation template matches the three-dimensional shape of the static object, the target object also matches the three-dimensional shape of the target skeletal animation template. Since the bone square information of the target skeletal animation template includes the relative position information between the bone squares, the connection information between the bone squares, and the information of the ordinary squares bound to each bone square, the terminal can, according to the bone square information of the target bone animation template, Determine the common blocks in the target object corresponding to the bone blocks of the target skeletal animation template, and use these common blocks as target common blocks, then replace these target common blocks with bone blocks, and then establish the connection relationship between these bone blocks, Finally, bind the normal squares of the target object to these bone squares to get the bone object.

106、根据目标运动逻辑信息对骨骼对象添加运动逻辑得到动态对象;106. Add motion logic to the skeleton object according to the target motion logic information to obtain a dynamic object;

终端根据目标骨骼动画模板的目标运动逻辑信息,对骨骼对象添加运动逻辑,使得骨骼对象可以根据运动逻辑进行相应的动作,从而得到动态对象。The terminal adds motion logic to the skeleton object according to the target motion logic information of the target skeleton animation template, so that the skeleton object can perform corresponding actions according to the motion logic, thereby obtaining a dynamic object.

终端接收到用户的第一指令后,可以根据第一指令创建静态对象,然后接收该第二指令,并根据第二指令调用预先创建好的骨骼动画模板库,如果该骨骼动画模板库中有与静态对象的三维形状相匹配的目标骨骼动画模板,则根据静态对象的三维形状创建目标对象,然后根据目标骨骼动画模板将该目标对象对应的普通方块替换为骨骼方块得到骨骼对象,再根据目标骨骼动画模板为该骨骼对象添加运动逻辑,使得该骨骼对象可以根据该运动逻辑做出相应的动作,从而得到动态对象。通过本申请提供的方法,用户只需要向终端发送用于创建静态对象的第一指令以及用于调用骨骼动画模板库的第二指令,就可以得到能够运动的动态对象,简化了用户制作骨骼动画的过程,降低了对用户的要求,使得制作骨骼动画的难度大大降低,从而降低了在学校教育中普及制作骨骼动画的难度。After receiving the user's first instruction, the terminal can create a static object according to the first instruction, then receive the second instruction, and call the pre-created skeletal animation template library according to the second instruction. If the target skeletal animation template matches the 3D shape of the static object, create the target object according to the 3D shape of the static object, and then replace the ordinary square corresponding to the target object with the skeleton square according to the target skeleton animation template to obtain the skeleton object, and then according to the target skeleton The animation template adds motion logic to the skeleton object, so that the skeleton object can perform corresponding actions according to the motion logic, thereby obtaining a dynamic object. With the method provided in this application, the user only needs to send the first instruction for creating a static object and the second instruction for calling the skeletal animation template library to the terminal, and then a dynamic object that can move can be obtained, which simplifies the user's production of skeletal animation. The process of skeletal animation reduces the requirements for users and greatly reduces the difficulty of making skeletal animations, thereby reducing the difficulty of popularizing skeletal animations in school education.

请参阅图2,图2是本申请提供的骨骼动画生成的方法另一实施例的流程示意图,骨骼动画生成的方法包括:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of another embodiment of a method for generating skeletal animation provided by the present application. The method for generating skeletal animation includes:

201、接收第三指令,并根据第三指令创建以普通方块和骨骼方块为基本单元的骨骼模板对象;201. Receive a third instruction, and create a skeleton template object with ordinary squares and bone squares as basic units according to the third instruction;

在实际应用中,用户可以通过输入设备向终端发送指令创建自定义的骨骼模板。要创建自定义的骨骼模板,则首先需要创建骨骼模板对象,用户可以向终端发送第三指令,终端接收到第三指令后,可以根据第三指令创建以普通方块和骨骼方块为基本单元的骨骼模板对象。In practical applications, the user can create a custom skeleton template by sending instructions to the terminal through the input device. To create a custom skeleton template, you first need to create a skeleton template object. The user can send a third command to the terminal. After the terminal receives the third command, it can create a skeleton with ordinary squares and bone squares as the basic units according to the third command. Template object.

202、接收第四指令,并根据第四指令设定骨骼模板对象的运动逻辑;202. Receive the fourth instruction, and set the motion logic of the skeleton template object according to the fourth instruction;

终端完成骨骼模板对象的创建之后,用户可以接着向终端发送第四指令,终端则会接收到第四指令,然后根据第四指令设定骨骼模板对象的运动逻辑,该运动逻辑包括至少一个动作,而动作是该骨骼模板对象中各骨骼方块在一定的时间内进行的变换,其中,每个动作的时间可以是相同的,也可以是不同的,具体此处不做限定。After the terminal completes the creation of the skeleton template object, the user can then send a fourth instruction to the terminal, and the terminal receives the fourth instruction, and then sets the motion logic of the skeleton template object according to the fourth instruction, and the motion logic includes at least one action, The action is the transformation of each skeleton block in the skeleton template object within a certain period of time, wherein the time of each action may be the same or different, which is not specifically limited here.

203、根据骨骼模板对象所有的骨骼方块和普通方块的相对位置以及运动逻辑,生成自定义骨骼模板;203. Generate a custom skeleton template according to the relative positions and motion logic of all skeleton blocks and normal blocks of the skeleton template object;

终端可以将骨骼模板对象所有的骨骼方块和普通方块的相对位置的信息记录下来,并且把骨骼模板对象的各个骨骼方块的运动逻辑的信息也记录下来,然后将这些信息融合,生成自定义骨骼模板骨骼动画模板。The terminal can record the relative position information of all skeleton blocks and ordinary blocks of the skeleton template object, and also record the motion logic information of each skeleton block of the skeleton template object, and then fuse these information to generate a custom skeleton template Skeletal animation template.

204、将自定义骨骼模板添加到骨骼动画模板库;204. Add a custom skeleton template to the skeleton animation template library;

终端生成自定义骨骼模板之后,可以将骨骼模板添加到骨骼动画模板库。After the terminal generates a custom skeleton template, you can add the skeleton template to the skeletal animation template library.

本实施例中,用户向终端发送创建自定义骨骼模板的指令,终端根据指令完成用户自定义骨骼模板的创建,丰富了骨骼动画模板库,同时也提高了用户体验。In this embodiment, the user sends an instruction to create a custom skeleton template to the terminal, and the terminal completes the creation of the user-defined skeleton template according to the instruction, which enriches the skeletal animation template library and improves the user experience.

205、接收第一指令,并根据第一指令创建以普通方块为基本单元的静态对象;205. Receive the first instruction, and create a static object with an ordinary block as a basic unit according to the first instruction;

本实施例中,步骤205与前述实施例中的步骤101类似,此处不再赘述。In this embodiment, step 205 is similar to step 101 in the foregoing embodiment, and details are not repeated here.

206、接收第二指令,并根据第二指令在与静态对象相连的位置创建动画模型方块;206. Receive the second instruction, and create an animation model block at the position connected to the static object according to the second instruction;

在终端根据第一指令创建静态对象之后,用户可以通过输入设备继续向终端发送第二指令,第二指令中携带有创建动画模型方块的命令以及动画模型方块在3D场景中的坐标信息,并且动画模型方块在3D场景中的坐标与静态对象中的某一个普通方块的坐标相邻。因此终端在接收到第二指令后,可以根据第二指令在与静态对象相连的位置创建动画模型方块。动画模型方块是3D场景中用于调用骨骼动画模板库的方块,终端可以通过动画模型方块调用骨骼动画模板库对与动画模型方块连接的由普通方块组成的对象进行匹配。After the terminal creates the static object according to the first instruction, the user can continue to send the second instruction to the terminal through the input device. The second instruction carries the command to create the animation model block and the coordinate information of the animation model block in the 3D scene, and the animation The coordinates of the model block in the 3D scene are adjacent to the coordinates of a normal block in the static object. Therefore, after receiving the second instruction, the terminal can create the animation model block at the position connected with the static object according to the second instruction. The animation model block is a block used to call the skeletal animation template library in the 3D scene. The terminal can call the skeletal animation template library through the animation model block to match the objects composed of ordinary blocks connected to the animation model block.

207、根据动画模型方块调用预先创建好的骨骼动画模板库;207. Call the pre-created skeletal animation template library according to the animation model block;

因为终端根据第二指令创建的动画模型方块是与静态对象相连的,所以终端可以调用预先创建好的骨骼动画模板库,从而对静态对象进行匹配。Because the animation model block created by the terminal according to the second instruction is connected with the static object, the terminal can call the pre-created skeletal animation template library to match the static object.

208、根据动画模型方块的位置,确定静态对象与动画模型方块连接的面为静态对象的正面;208. According to the position of the animation model block, determine that the surface connecting the static object and the animation model block is the front side of the static object;

终端根据动画模型方块的位置,可以将静态对象与动画模型方块连接的面作为静态对象的正面。According to the position of the animation model square, the terminal may take the surface connecting the static object and the animation model square as the front surface of the static object.

209、以与动画模型方块相连的普通方块为静态对象的第一基准方块,计算静态对象的所有其他普通方块与第一基准方块的第一相对位置信息;209, take the common block connected with the animation model block as the first reference block of the static object, calculate the first relative position information of all other common blocks of the static object and the first reference block;

终端可以将与动画模型方块相连的普通方块作为静态对象的第一基准方块,然后基于第一基准方块,根据静态对象的各个方块在3D场景中的坐标信息,逐一计算出静态对象的所有其他普通方块与第一基准方块的相对位置信息,生成第一相对位置信息。The terminal can use the common block connected to the animation model block as the first reference block of the static object, and then, based on the first reference block, according to the coordinate information of each block of the static object in the 3D scene, calculate all other common blocks of the static object one by one. The relative position information of the block and the first reference block is used to generate the first relative position information.

210、获取静态对象的正面二维图像;210. Acquire a frontal two-dimensional image of the static object;

终端可以从静态对象的正面获取静态对象的正面二维图像,由于第一基准方块在静态对象的正面,因此从正面二维图像中包含有第一基准方块的二维图像。The terminal can acquire the front two-dimensional image of the static object from the front of the static object. Since the first reference square is on the front of the static object, the front two-dimensional image includes the two-dimensional image of the first reference square.

211、从骨骼动画模板库中获取任一个未获取过的骨骼动画模板作为测试模板;211. Obtain any unobtained skeletal animation template from the skeletal animation template library as a test template;

终端可以从骨骼动画模板库中获取任一个在对静态对象匹配的过程中未获取过的骨骼动画模板作为测试模板,如果骨骼动画模板库中没有符合条件的骨骼动画模板,则结束流程。其中,骨骼动画模板对应骨骼方块和普通方块,每一个骨骼动画模板包括该骨骼动画模板中各骨骼方块之间的相对位置信息、各骨骼方块之间的连接信息以及各骨骼方块绑定普通方块的信息;另外,骨骼动画模板还包括运动逻辑信息,运动逻辑信息包括至少一个动作信息,动作信息为各骨骼方块在一定的时间内的变换信息,每个动作信息的时间长短可以是不同的,也可以是相同的,具体此处不做限定。The terminal can obtain any skeletal animation template from the skeletal animation template library that has not been acquired in the process of matching the static object as a test template. If there is no qualified skeletal animation template in the skeletal animation template library, the process ends. Among them, the skeletal animation template corresponds to the skeleton block and the ordinary block, and each skeletal animation template includes the relative position information between the skeleton blocks in the skeletal animation template, the connection information between the skeleton blocks, and the binding information of each skeleton block to the normal block. In addition, the skeletal animation template also includes motion logic information, the motion logic information includes at least one action information, and the action information is the transformation information of each skeleton block within a certain period of time, and the time length of each action information can be different, or It can be the same, which is not specifically limited here.

212、根据第一基准方块在正面二维图像中的位置,确定测试模板对应的第二基准方块;212. Determine the second reference square corresponding to the test template according to the position of the first reference square in the frontal two-dimensional image;

正面二维图像中包含有第一基准方块的二维图像,因此终端可以根据第一基准方块在正面二维图像中的位置,确定测试模板对应的第二基准方块。The front two-dimensional image includes a two-dimensional image of the first reference square, so the terminal can determine the second reference square corresponding to the test template according to the position of the first reference square in the frontal two-dimensional image.

213、计算测试模板对应的其他所有骨骼方块以及普通方块与第二基准方块的第二相对位置信息;213. Calculate the second relative position information of all other bone squares corresponding to the test template and the ordinary square and the second reference square;

测试模板中携带有对应的所有骨骼方块以及普通方块之间的相对位置的信息,因此终端可以基于第二基准方块,逐一计算出测试模板对应的其他所有骨骼方块以及普通方块与第二基准方块的相对位置信息,生成第二相对位置信息。The test template carries information about the relative positions of all the corresponding bone blocks and the common blocks, so the terminal can calculate the distance between all other bone blocks corresponding to the test template and the common blocks and the second base block one by one based on the second reference block. relative position information to generate second relative position information.

214、计算第一相对位置信息与第二相对位置信息的相似度;214. Calculate the similarity between the first relative position information and the second relative position information;

在得到第一相对位置信息以及第二相对位置信息之后,终端可以计算出二者的相似度。相似度即为第一相对位置信息和第二相对位置信息重合的程度,也是静态对象和测试对象三维形状相似的程度。第一相对位置信息和第二相对位置信息的重合度越高,则二者的相似度越高。After obtaining the first relative position information and the second relative position information, the terminal may calculate the similarity between the two. The similarity is the degree to which the first relative position information and the second relative position information overlap, and also the degree to which the three-dimensional shapes of the static object and the test object are similar. The higher the degree of coincidence between the first relative position information and the second relative position information, the higher the similarity between the two.

215、判断相似度是否不低于预设值,若是则执行步骤216,若否则再次执行步骤211至215;215. Determine whether the similarity is not lower than a preset value, if so, perform step 216, if otherwise, perform steps 211 to 215 again;

终端计算出第一相对位置信息与第二相对位置信息的相似度之后,需要将得到的相似度和预设值进行对比,如果相似度不低于即大于或者等于预设值,则执行步骤216;如果相似度低于预设值,则再次执行步骤211至215,重新获取测试模板、确定第二基准方块、计算第二相对位置信息、计算相似度以及判断相似度是否不低于预设值,直到相似度不低于预设值或者无法从骨骼动画模板库中获取测试模板。After the terminal calculates the similarity between the first relative position information and the second relative position information, it needs to compare the obtained similarity with the preset value. If the similarity is not lower than or equal to the preset value, step 216 is executed. If the similarity is lower than the preset value, then perform steps 211 to 215 again, re-acquire the test template, determine the second reference square, calculate the second relative position information, calculate the similarity and judge whether the similarity is not lower than the preset value. , until the similarity is not lower than the preset value or the test template cannot be obtained from the skeletal animation template library.

216、确定测试模板与静态对象相匹配,并确定测试模板为目标骨骼动画模板;216. Determine that the test template matches the static object, and determine that the test template is the target skeletal animation template;

终端在确定第一相对位置信息与第二相对位置信息的相似度不低于预设值之后,即可以确定测试模板与静态对象相匹配,并且将该测试模板确定为目标骨骼动画模板。After determining that the similarity between the first relative position information and the second relative position information is not lower than the preset value, the terminal may determine that the test template matches the static object, and determine the test template as the target skeletal animation template.

217、根据静态对象的三维形状创建目标对象;217. Create a target object according to the three-dimensional shape of the static object;

218、根据骨骼方块信息将目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;218. Replace the target ordinary square corresponding to the target object with a bone square according to the bone square information to obtain a bone object;

219、根据目标运动逻辑信息对骨骼对象添加运动逻辑得到动态对象;219. Add motion logic to the skeleton object according to the target motion logic information to obtain a dynamic object;

本实施例中的步骤217至219与前述实施例中的步骤104至106类似,此处不再赘述。Steps 217 to 219 in this embodiment are similar to steps 104 to 106 in the foregoing embodiment, and are not repeated here.

220、对动态对象设定自主运动逻辑。220. Set autonomous motion logic for the dynamic object.

终端在完成动态对象的生成之后,可以对动态对象设定自主运动逻辑,使得动态对象可以根据自主运动逻辑随机执行前进、后退、旋转和/或跳跃的动作。After completing the generation of the dynamic object, the terminal can set autonomous motion logic for the dynamic object, so that the dynamic object can randomly perform forward, backward, rotating and/or jumping actions according to the autonomous motion logic.

终端对动态对象设定自主运动逻辑,可以丰富动态对象的动作,一定程度上减少了动态对象动作单一的情况。The terminal sets autonomous motion logic for dynamic objects, which can enrich the actions of dynamic objects and reduce the situation of single actions of dynamic objects to a certain extent.

请参阅图3,图3是本申请中骨骼动画生成的装置一个实施例的结构示意图,骨骼动画生成的装置包括:Please refer to FIG. 3. FIG. 3 is a schematic structural diagram of an embodiment of a device for generating skeletal animation in the present application. The device for generating skeletal animation includes:

第一接收单元301,用于接收第一指令,根据第一指令创建以普通方块为基本单元的静态对象;The first receiving unit 301 is configured to receive a first instruction, and create a static object with an ordinary block as a basic unit according to the first instruction;

第二接收单元302,用于接收第二指令,根据第二指令调用预先创建好的骨骼动画模板库;The second receiving unit 302 is configured to receive the second instruction, and call the pre-created skeletal animation template library according to the second instruction;

判断单元303,用于判断骨骼动画模板库中是否存在与静态对象的三维形状相匹配的目标骨骼动画模板,目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息;Judging unit 303, for judging whether there is a target skeletal animation template that matches the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template includes skeleton block information and target motion logic information;

创建单元304,用于当判断单元303确定骨骼动画模板库中存在与静态对象的三维形状相匹配的目标骨骼动画模板时,根据静态对象的三维形状创建目标对象;The creating unit 304 is used to create the target object according to the three-dimensional shape of the static object when the determining unit 303 determines that there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library;

替换单元305,用于根据骨骼方块信息在目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;The replacement unit 305 is used to replace the target ordinary square corresponding to the target object with a bone square according to the bone square information to obtain a bone object;

添加单元306,用于根据目标运动逻辑信息对骨骼对象添加运动逻辑得到动态对象。The adding unit 306 is configured to add motion logic to the skeleton object according to the target motion logic information to obtain a dynamic object.

本实施例中,第一接收单元301接收到第一指令后,可以根据第一指令创建静态对象,然后第二接收单元302接收第二指令并根据第二指令调用预先创建好的骨骼动画模板库,如果该骨骼动画模板库中有与静态对象的三维形状相匹配的目标骨骼动画模板,则创建单元304根据静态对象的三维形状创建目标对象,然后替换单元305根据目标骨骼动画模板将该目标对象对应的普通方块替换为骨骼方块得到骨骼对象,添加单元306再根据目标骨骼动画模板为该骨骼对象添加运动逻辑,使得该骨骼对象可以根据该运动逻辑做出相应的动作,从而得到动态对象。通过本申请提供的方法,用户只需要向终端发送用于创建静态对象的第一指令以及用于调用骨骼动画模板库的第二指令,就可以得到能够运动的动态对象,简化了用户制作骨骼动画的过程,降低了对用户的要求,使得制作骨骼动画的难度大大降低,从而降低了在学校教育中普及制作骨骼动画的难度。In this embodiment, after receiving the first instruction, the first receiving unit 301 can create a static object according to the first instruction, and then the second receiving unit 302 receives the second instruction and calls the pre-created skeletal animation template library according to the second instruction , if there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library, the creation unit 304 creates the target object according to the three-dimensional shape of the static object, and then the replacement unit 305 creates the target object according to the target skeletal animation template The corresponding ordinary square is replaced with a bone square to obtain a skeleton object, and the adding unit 306 adds motion logic to the skeleton object according to the target skeleton animation template, so that the skeleton object can perform corresponding actions according to the motion logic, thereby obtaining a dynamic object. With the method provided in this application, the user only needs to send the first instruction for creating a static object and the second instruction for calling the skeletal animation template library to the terminal, and then a dynamic object that can move can be obtained, which simplifies the user's production of skeletal animation. The process of skeletal animation reduces the requirements for users and greatly reduces the difficulty of making skeletal animations, thereby reducing the difficulty of popularizing skeletal animations in school education.

请参阅图4,图4是本申请中骨骼动画生成的装置另一实施例的结构示意图,骨骼动画生成的装置包括:Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of another embodiment of a device for generating skeletal animation in this application. The device for generating skeletal animation includes:

第一接收单元401,用于接收第一指令,根据第一指令创建以普通方块为基本单元的静态对象;The first receiving unit 401 is configured to receive a first instruction, and create a static object with an ordinary block as a basic unit according to the first instruction;

第二接收单元402,用于接收第二指令,根据第二指令调用预先创建好的骨骼动画模板库;The second receiving unit 402 is configured to receive the second instruction, and call the pre-created skeletal animation template library according to the second instruction;

判断单元403,用于判断骨骼动画模板库中是否存在与静态对象的三维形状相匹配的目标骨骼动画模板,目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息;Judging unit 403, for judging whether there is a target skeletal animation template that matches the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template includes bone block information and target motion logic information;

创建单元404,用于当判断单元403确定骨骼动画模板库中存在与静态对象的三维形状相匹配的目标骨骼动画模板时,根据静态对象的三维形状创建目标对象;The creating unit 404 is used to create the target object according to the three-dimensional shape of the static object when the determining unit 403 determines that there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library;

替换单元405,用于根据骨骼方块信息在目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;The replacement unit 405 is used to replace the target ordinary square corresponding to the target object with a bone square according to the bone square information to obtain a bone object;

添加单元406,用于根据目标运动逻辑信息对骨骼对象添加运动逻辑得到动态对象。The adding unit 406 is configured to add motion logic to the skeleton object according to the target motion logic information to obtain a dynamic object.

本实施例中,第二接收单元402可以具体用于:In this embodiment, the second receiving unit 402 may be specifically used for:

接收第二指令,根据第二指令在与静态对象相连的位置创建动画模型方块;receiving a second instruction, and creating an animation model block at a position connected to the static object according to the second instruction;

根据动画模型方块调用预先创建好的骨骼动画模板库。Call the pre-created skeletal animation template library based on the animation model block.

本实施例中,该装置还可以进一步包括:In this embodiment, the device may further include:

正面确定单元407,用于根据动画模型方块的位置,确定静态对象与动画模型方块连接的面为静态对象的正面。The front face determination unit 407 is configured to determine, according to the position of the animation model square, the face connecting the static object and the animation model square as the front face of the static object.

第三接收单元408,用于接收第三指令,并根据第三指令创建以普通方块和骨骼方块为基本单元的骨骼模板对象。The third receiving unit 408 is configured to receive a third instruction, and create a skeleton template object with ordinary squares and bone squares as basic units according to the third instruction.

第四接收单元409用于接收第四指令,并根据第四指令设定骨骼模板对象的运动逻辑。The fourth receiving unit 409 is configured to receive a fourth instruction, and set the motion logic of the skeleton template object according to the fourth instruction.

生成单元410,用于根据骨骼模板对象所有的骨骼方块和普通方块的相对位置以及运动逻辑,生成自定义骨骼模板。The generating unit 410 is configured to generate a custom bone template according to the relative positions and motion logic of all the bone squares and the normal squares of the bone template object.

第二添加单元411,用于将骨骼模板添加到骨骼动画模板库。The second adding unit 411 is used to add the skeleton template to the skeleton animation template library.

设定单元412,用于对动态对象设定自主运动逻辑,使得动态对象根据自主运动逻辑随机执行前进、后退、旋转和/或跳跃的动作。The setting unit 412 is configured to set autonomous motion logic for the dynamic object, so that the dynamic object randomly performs forward, backward, rotating and/or jumping actions according to the autonomous motion logic.

本实施例中,判断单元403具体用于:In this embodiment, the judgment unit 403 is specifically used for:

以与动画模型方块相连的普通方块为静态对象的第一基准方块,计算静态对象的所有其他普通方块与第一基准方块的第一相对位置信息;Taking the common block connected with the animation model block as the first reference block of the static object, calculate the first relative position information of all other common blocks of the static object and the first reference block;

获取静态对象的正面二维图像;Get a frontal 2D image of a static object;

从骨骼动画模板库中获取任一个未获取过的骨骼动画模板作为测试模板,骨骼动画模板对应骨骼方块和普通方块;Obtain any unobtained skeletal animation template from the skeletal animation template library as a test template, and the skeletal animation template corresponds to skeleton squares and ordinary squares;

根据第一基准方块在正面二维图像中的位置,确定测试模板对应的第二基准方块;According to the position of the first reference square in the frontal two-dimensional image, determine the second reference square corresponding to the test template;

计算测试模板对应的其他所有骨骼方块以及普通方块与第二基准方块的第二相对位置信息;Calculate the second relative position information of all other bone squares corresponding to the test template and the ordinary square and the second reference square;

计算第一相对位置信息与第二相对位置信息的相似度;calculating the similarity between the first relative position information and the second relative position information;

判断相似度是否不低于预设值;Determine whether the similarity is not lower than the preset value;

若是,则确定测试模板与静态对象的三维形状相匹配,并确定测试模板为目标骨骼动画模板。If so, it is determined that the test template matches the three-dimensional shape of the static object, and the test template is determined to be the target skeletal animation template.

本实施例中,各单元的功能和前述图2所示实施例中的步骤对应,此处不再赘述。In this embodiment, the functions of each unit correspond to the steps in the foregoing embodiment shown in FIG. 2 , which will not be repeated here.

请参阅图5,图5为本申请中骨骼动画生成的系统另一实施例的结构示意图,骨骼动画生成的系统包括:Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of another embodiment of the system for generating skeletal animation in the application. The system for generating skeletal animation includes:

处理器501、存储器502、输入输出单元503以及总线504;processor 501, memory 502, input and output unit 503 and bus 504;

处理器501与存储器502、输入输出单元503以及总线相连504;The processor 501 is connected 504 to the memory 502, the input and output unit 503 and the bus;

存储器502保存有程序,处理器501调用程序以执行如上实施例所示的任一方法。The memory 502 stores a program, and the processor 501 invokes the program to execute any of the methods shown in the above embodiments.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above may refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,read-onlymemory)、随机存取存储器(RAM,random access memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), magnetic disk or optical disk and other media that can store program codes.

Claims (10)

1.一种骨骼动画生成的方法,其特征在于,所述方法包括:1. a method for skeletal animation generation, is characterized in that, described method comprises: 接收第一指令,根据所述第一指令创建以普通方块为基本单元的静态对象;receiving a first instruction, and creating a static object with an ordinary block as a basic unit according to the first instruction; 接收第二指令,根据所述第二指令调用预先创建好的骨骼动画模板库;receiving the second instruction, and calling the pre-created skeletal animation template library according to the second instruction; 判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板,所述目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息;Judging whether there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template includes skeleton block information and target motion logic information; 若存在,则根据所述静态对象的三维形状创建目标对象;if it exists, creating a target object according to the three-dimensional shape of the static object; 根据所述骨骼方块信息将所述目标对象中对应的目标普通方块替换为骨骼方块,得到骨骼对象;Replace the corresponding target ordinary square in the target object with a bone square according to the bone square information to obtain a bone object; 根据所述目标运动逻辑信息对所述骨骼对象添加运动逻辑得到动态对象。A dynamic object is obtained by adding motion logic to the skeletal object according to the target motion logic information. 2.根据权利要求1所述的方法,其特征在于,所述根据所述第二指令调用预先创建好的骨骼动画模板库包括:2. The method according to claim 1, wherein the calling the pre-created skeletal animation template library according to the second instruction comprises: 根据所述第二指令创建动画模型方块;Create an animation model block according to the second instruction; 根据所述动画模型方块调用预先创建好的骨骼动画模板库。The pre-created skeletal animation template library is called according to the animation model block. 3.根据权利要求2所述的方法,其特征在于,所述根据所述第二指令创建动画模型方块包括:3. The method according to claim 2, wherein the creating an animation model block according to the second instruction comprises: 根据所述第二指令在与所述静态对象相连的位置创建动画模型方块。An animated model square is created at a position connected to the static object according to the second instruction. 4.根据权利要求3所述的方法,其特征在于,所述根据所述动画模型方块调用预先创建好的骨骼模板库之后,所述判断预先创建好的骨骼模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼模板之前,所述方法还包括:4. The method according to claim 3, characterized in that, after the pre-created skeleton template library is called according to the animation model block, the judgment is made as to whether the pre-created skeleton template library exists in the pre-created skeleton template library. Before matching the three-dimensional shape of the object to the target bone template, the method further includes: 根据所述动画模型方块的位置,确定所述静态对象与所述动画模型方块连接的面为所述静态对象的正面;According to the position of the animation model square, it is determined that the surface connecting the static object and the animation model square is the front surface of the static object; 所述判断所述骨骼模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼模板包括:The judging whether there is a target skeleton template matching the three-dimensional shape of the static object in the skeleton template library includes: 判断所述骨骼动画模板库中是否存在与正面视图的所述静态对象的三维形状相匹配的目标骨骼动画模板。It is judged whether there is a target skeletal animation template matching the three-dimensional shape of the static object of the frontal view in the skeletal animation template library. 5.根据权利要求4所述的方法,其特征在于,所述判断所述骨骼动画模板库中是否存在与正面视图的所述静态对象的三维形状相匹配的目标骨骼动画模板包括:5. The method according to claim 4, wherein the judging whether there is a target skeletal animation template matching the three-dimensional shape of the static object of the frontal view in the skeletal animation template library comprises: 以与所述动画模型方块相连的普通方块为所述静态对象的第一基准方块,计算所述静态对象的所有其他普通方块与所述第一基准方块的第一相对位置信息;Taking the common block connected with the animation model block as the first reference block of the static object, calculate the first relative position information of all other common blocks of the static object and the first reference block; 获取所述静态对象的正面二维图像;obtaining a frontal two-dimensional image of the static object; 从所述骨骼动画模板库中获取任一个未获取过的骨骼动画模板作为测试模板,所述骨骼动画模板对应骨骼方块和普通方块;Obtain any unobtained skeletal animation template from the skeletal animation template library as a test template, and the skeletal animation template corresponds to a skeleton square and a normal square; 根据所述第一基准方块在所述正面二维图像中的位置,确定所述测试模板对应的第二基准方块;According to the position of the first reference square in the front two-dimensional image, determine the second reference square corresponding to the test template; 计算所述测试模板对应的其他所有骨骼方块以及普通方块与所述第二基准方块的第二相对位置信息;Calculate the second relative position information of all other bone squares corresponding to the test template and the ordinary square and the second reference square; 计算所述第一相对位置信息与所述第二相对位置信息的相似度;calculating the similarity between the first relative position information and the second relative position information; 判断所述相似度是否不低于预设值;Determine whether the similarity is not lower than a preset value; 若是,则确定所述测试模板与所述静态对象的三维形状相匹配,并确定所述测试模板为目标骨骼动画模板。If so, determine that the test template matches the three-dimensional shape of the static object, and determine that the test template is a target skeletal animation template. 6.根据权利要求1至5中任一项所述的方法,其特征在于,所述接收第一指令之前,所述方法还包括:6. The method according to any one of claims 1 to 5, wherein before the receiving the first instruction, the method further comprises: 接收第三指令,并根据所述第三指令创建以普通方块和骨骼方块为基本单元的骨骼模板对象;receiving a third instruction, and creating a skeleton template object with ordinary squares and bone squares as basic units according to the third instruction; 接收第四指令,并根据所述第四指令设定所述骨骼模板对象的运动逻辑;receiving a fourth instruction, and setting the motion logic of the skeleton template object according to the fourth instruction; 根据所述骨骼模板对象所有的骨骼方块和普通方块的相对位置以及所述运动逻辑,生成自定义骨骼模板;Generate a custom skeleton template according to the relative positions of all the skeleton squares and the normal squares of the skeleton template object and the motion logic; 将所述自定义骨骼模板添加到所述骨骼动画模板库。Add the custom skeleton template to the skeletal animation template library. 7.根据权利要求6所述的方法,其特征在于,所述根据所述目标运动逻辑信息对所述目标普通方块添加运动逻辑得到动态对象之后,所述方法还包括:7. The method according to claim 6, wherein, after adding motion logic to the target ordinary block according to the target motion logic information to obtain a dynamic object, the method further comprises: 对所述动态对象设定自主运动逻辑,使得所述动态对象根据所述自主运动逻辑随机执行前进、后退、旋转和/或跳跃的动作。An autonomous motion logic is set for the dynamic object, so that the dynamic object randomly performs forward, backward, rotating and/or jumping actions according to the autonomous motion logic. 8.一种骨骼动画生成的装置,其特征在于,所述装置包括:8. A device for skeletal animation generation, wherein the device comprises: 第一接收单元,用于接收第一指令,根据所述第一指令创建以普通方块为基本单元的静态对象;a first receiving unit, configured to receive a first instruction, and create a static object with an ordinary block as a basic unit according to the first instruction; 第二接收单元,用于接收第二指令,根据所述第二指令调用所述骨骼动画模板库;;a second receiving unit, configured to receive a second instruction, and call the skeletal animation template library according to the second instruction; 判断单元,用于判断所述骨骼动画模板库中是否存在与所述静态对象的三维形状相匹配的目标骨骼动画模板,所述目标骨骼动画模板中包含骨骼方块信息以及目标运动逻辑信息;a judging unit for judging whether there is a target skeletal animation template that matches the three-dimensional shape of the static object in the skeletal animation template library, and the target skeletal animation template includes skeleton block information and target motion logic information; 创建单元,用于当所述判断单元确定所述骨骼动画模板库中存在与所述静态对象的三维形状相匹配的目标骨骼动画模板时,根据所述静态对象的三维形状创建目标对象;A creating unit, configured to create a target object according to the three-dimensional shape of the static object when the judging unit determines that there is a target skeletal animation template matching the three-dimensional shape of the static object in the skeletal animation template library; 替换单元,用于根据所述骨骼方块信息将所述目标对象对应的目标普通方块替换为骨骼方块,得到骨骼对象;a replacement unit, configured to replace the target ordinary square corresponding to the target object with a bone square according to the bone square information to obtain a bone object; 添加单元,用于根据所述目标运动逻辑信息对所述骨骼对象添加运动逻辑得到动态对象。The adding unit is configured to add motion logic to the skeletal object according to the target motion logic information to obtain a dynamic object. 9.一种骨骼动画生成的系统,其特征在于,所述装置包括:9. A system for skeletal animation generation, wherein the device comprises: 处理器、存储器、输入输出单元以及总线;processors, memories, input and output units, and buses; 所述处理器与所述存储器、所述输入输出单元以及所述总线相连;the processor is connected to the memory, the input-output unit and the bus; 所述存储器保存有程序,所述处理器调用所述程序以执行如权利要求1至7中任意一项所述的方法。The memory holds a program which is invoked by the processor to perform the method of any one of claims 1 to 7. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上保存有程序,当所述程序在计算机上运行时,所述计算机执行如权利要求1至7中任意一项所述的方法。10. A computer-readable storage medium, wherein a program is stored on the computer-readable storage medium, and when the program is run on a computer, the computer executes any one of claims 1 to 7 the method described.
CN202210086058.7A 2022-01-25 2022-01-25 Method, device, system and storage medium for generating bone animation Pending CN114596394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210086058.7A CN114596394A (en) 2022-01-25 2022-01-25 Method, device, system and storage medium for generating bone animation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210086058.7A CN114596394A (en) 2022-01-25 2022-01-25 Method, device, system and storage medium for generating bone animation

Publications (1)

Publication Number Publication Date
CN114596394A true CN114596394A (en) 2022-06-07

Family

ID=81806806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210086058.7A Pending CN114596394A (en) 2022-01-25 2022-01-25 Method, device, system and storage medium for generating bone animation

Country Status (1)

Country Link
CN (1) CN114596394A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114898022A (en) * 2022-07-15 2022-08-12 杭州脸脸会网络技术有限公司 Image generation method, image generation device, electronic device, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103597516A (en) * 2011-06-06 2014-02-19 微软公司 Controlling objects in a virtual environment
CN111640176A (en) * 2018-06-21 2020-09-08 华为技术有限公司 Object modeling movement method, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103597516A (en) * 2011-06-06 2014-02-19 微软公司 Controlling objects in a virtual environment
CN111640176A (en) * 2018-06-21 2020-09-08 华为技术有限公司 Object modeling movement method, device and equipment
US20200349765A1 (en) * 2018-06-21 2020-11-05 Huawei Technologies Co., Ltd. Object modeling and movement method and apparatus, and device

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
于兵科;: "三维虚拟动画设计中的角色建模与行为控制", 现代电子技术, no. 10, 15 May 2020 (2020-05-15) *
李西峙等著: "《Paracraft编程入门》", 1 January 2021, 哈尔滨工业大学出版社, pages: 43 - 56 *
河马爸爸讲编程: "Paracraft帕拉卡骨骼基础入门 虫子觅食动画2", Retrieved from the Internet <URL:https://www.bilibili.com/video/BV1vK4y1k7sd/?spm_id_from=333.999.0.0&vd_source=d8a24241bdccf31b3c184f63f65e76da> *
韩丽;张黎娜;楚秉智;: "一种MRG骨架树的三维模型检索方法", 计算机工程与应用, no. 31, 31 December 2011 (2011-12-31) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114898022A (en) * 2022-07-15 2022-08-12 杭州脸脸会网络技术有限公司 Image generation method, image generation device, electronic device, and storage medium

Similar Documents

Publication Publication Date Title
CN110390704B (en) Image processing method, image processing device, terminal equipment and storage medium
KR102491140B1 (en) Method and apparatus for generating virtual avatar
Franco et al. A distributed approach for real time 3D modeling
JP2024522287A (en) 3D human body reconstruction method, apparatus, device and storage medium
US20240307779A1 (en) Animation data processing method, non-transitory storage medium and electronic device
CN105955455A (en) Device and method for adding object in virtual scene
US20180276870A1 (en) System and method for mass-animating characters in animated sequences
CN115063518B (en) Trajectory rendering method, device, electronic device and storage medium
CN110288703A (en) Image processing method, device, equipment and storage medium
JP2008090498A (en) Image processing method and image processor
CN112866741A (en) Gift animation effect display method and system based on 3D face animation reconstruction
CN114596394A (en) Method, device, system and storage medium for generating bone animation
CN113230657B (en) Role interaction method and device
CN114782661A (en) Training method and device for lower body posture prediction model
CN114170648A (en) Video generation method, device, electronic device and storage medium
CN114299206A (en) Three-dimensional cartoon face generation method and device, electronic equipment and storage medium
WO2024255667A1 (en) Method and apparatus for generating model animation, and electronic device and storage medium
CN115908664B (en) Animation generation method and device for man-machine interaction, computer equipment and storage medium
CN115775300B (en) Human body model reconstruction method, human body model reconstruction training method and device
US20230120883A1 (en) Inferred skeletal structure for practical 3d assets
CN116934948A (en) Re-illuminable three-dimensional digital human construction method and device based on multi-view video
CN111651623B (en) Method, device, equipment and storage medium for constructing high-precision facial expression library
CN114299203A (en) Method and device for processing virtual model
US12073511B2 (en) Simulation of rigid bodies
US20250045997A1 (en) Scalable soft body locomotion

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