CN111009025A - Skeleton animation hiding method, device and equipment - Google Patents

Skeleton animation hiding method, device and equipment Download PDF

Info

Publication number
CN111009025A
CN111009025A CN201911245229.0A CN201911245229A CN111009025A CN 111009025 A CN111009025 A CN 111009025A CN 201911245229 A CN201911245229 A CN 201911245229A CN 111009025 A CN111009025 A CN 111009025A
Authority
CN
China
Prior art keywords
texture
target object
preset
interface
animation
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.)
Granted
Application number
CN201911245229.0A
Other languages
Chinese (zh)
Other versions
CN111009025B (en
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.)
Beijing Kingsoft Cheetah Technology Co ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201911245229.0A priority Critical patent/CN111009025B/en
Publication of CN111009025A publication Critical patent/CN111009025A/en
Application granted granted Critical
Publication of CN111009025B publication Critical patent/CN111009025B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Abstract

According to the method, the device and the equipment for hiding the bone animation, when a hiding instruction of the bone animation is detected, an object corresponding to the hiding instruction is obtained from objects quoted by a designated class and is used as a target object; the appointed class is used for displaying skeleton animation constructed by Spine in a graphical user interface; and removing the texture of the target object from the rendered texture by using a preset texture removing interface. The scheme can give consideration to hiding of skeleton animation constructed by using Spine and performance of a CPU.

Description

Skeleton animation hiding method, device and equipment
Technical Field
The invention relates to the technical field of model animation, in particular to a skeleton animation hiding method, device and equipment.
Background
In a model animation in which a model of a three-dimensional body is built by using a computing mechanism and a series of continuous dynamic images with a sense of reality are automatically generated by a computer, a skeleton animation is a model animation in which a skeleton structure composed of interconnected "skeletons" can be built, and further an animation effect is realized by changing the orientation and position of the skeletons, so that a very rich animation effect can be realized by using relatively few resources, and therefore, the skeleton animation is widely used in various game scenes in which the animation effect of the model needs to be realized. In specific application, skeleton animation can be conveniently constructed by utilizing Spine, which is a solution for realizing skeleton animation.
In the related art, a skeletal animation constructed using Spine may be displayed in a GUI (Graphical user interface) of an application that needs to realize an animation effect of a model. Also, since the skeletal animation and the GUI belong to different components, respectively, Spine provides a class for displaying the skeletal animation in the GUI in order to ensure that the skeletal animation can be displayed in the GUI belonging to another component.
However, if the displayed skeletal animation is to be hidden, it needs to be moved out of the display screen. As a result, although the skeletal animation is hidden, data relating to the display of the skeletal animation still exists, and this data consumes processing resources of a Central Processing Unit (CPU), resulting in a reduction in performance of the CPU. Therefore, how to consider hiding of skeletal animation constructed by Spine and performance of the CPU is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device and equipment for hiding bone animation, so as to achieve the effect of hiding the bone animation constructed by Spine and realizing the performance of a CPU. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for hiding a bone animation, where the method includes:
when a hidden instruction for the skeleton animation is detected, acquiring an object corresponding to the hidden instruction from objects referenced by a specified class as a target object; the appointed class is used for displaying skeleton animation constructed by Spine in a graphical user interface;
and removing the texture of the target object from the rendered texture by using a preset texture removing interface.
Optionally, before the removing the texture of the target object from the rendered texture by using the preset texture removing interface, the method further includes:
packaging the preset texture removing interface in a preset forbidden model;
the removing the texture of the target object from the rendered texture by using the preset texture removing interface includes:
and transferring the target object into the preset forbidden model, so that the preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and the preset forbidden model removes data used for rendering the texture of the target object.
Optionally, the passing the target object into the preset prohibition model includes:
and transmitting a first preset parameter into an instantiation interface corresponding to the target object, so that the instantiation interface triggers the calling of the component to which the skeleton animation belongs to the preset prohibition model, and transmitting the target object corresponding to the instantiation interface into the preset prohibition model.
Optionally, after removing the texture of the target object from the rendered texture, the method further includes:
when a display restoration instruction of the target object is detected, a second preset parameter is transmitted to an instantiation interface corresponding to the target object, so that the instantiation interface triggers a component to which the skeleton animation belongs to render the target object by using the specified class, the texture of the target object is obtained, and the texture of the target object is displayed in the graphical user interface.
Optionally, the number of the rendered textures is multiple, and the rendered textures are stored as a texture array;
the removing the texture of the target object from the rendered texture by using the preset texture removing interface includes:
traversing the texture array by using a preset texture removing interface and the target object to obtain the texture of the target object;
and clearing the texture of the target object.
In a second aspect, an embodiment of the present invention provides a skeletal animation hiding device, including:
the target object acquisition module is used for acquiring an object corresponding to a hidden instruction from objects referenced by a specified class as a target object when the hidden instruction of the skeleton animation is detected; the appointed class is used for displaying skeleton animation constructed by Spine in a graphical user interface;
and the hiding module is used for clearing the texture of the target object from the rendered texture by using a preset texture clearing interface.
Optionally, the hiding module is specifically configured to:
before the texture of the target object is removed from the rendered texture by using a preset texture removing interface, packaging the preset texture removing interface in a preset forbidden model;
and transferring the target object into the preset forbidden model, so that the preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and the preset forbidden model removes data used for rendering the texture of the target object.
Optionally, the hiding module is specifically configured to:
and transmitting a first preset parameter into an instantiation interface corresponding to the target object, so that the instantiation interface triggers the calling of the component to which the skeleton animation belongs to the preset prohibition model, and transmitting the target object corresponding to the instantiation interface into the preset prohibition model.
Optionally, the apparatus further comprises: a restoration display module to:
after the texture of the target object is removed from the rendered texture, when a display restoration instruction of the target object is detected, a second preset parameter is transmitted to an instantiation interface corresponding to the target object, so that the instantiation interface triggers a component to which the skeletal animation belongs to render the target object by using the specified class, the texture of the target object is obtained, and the texture of the target object is displayed in the graphical user interface.
Optionally, the number of the rendered textures is multiple, and the rendered textures are stored as a texture array;
the hidden module is specifically configured to:
traversing the texture array by using a preset texture removing interface and the target object to obtain the texture of the target object;
and clearing the texture of the target object.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the bus; a memory for storing a computer program; and the processor is used for executing the program stored in the memory and realizing the steps of the hiding method of the skeletal animation provided by the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for hiding the skeletal animation provided in the first aspect.
In the scheme provided by the embodiment of the invention, the specified class is used for displaying the bone animation in the graphical user interface, so that when a hiding instruction of the bone animation constructed by using Spine is detected, an object corresponding to the hiding instruction in the objects quoted by the specified class is obtained and is used as a target object, which is equivalent to taking the bone animation to be hidden in the bone animation displayed by the graphical user interface as the target object. On this basis, the displayed bone animation is the display of the texture obtained by rendering the bone animation, so that the texture of the target object is removed from the texture obtained by rendering by using a preset texture removing interface, namely the displayed bone animation to be hidden is removed from the graphical user interface, and the hiding of the bone animation constructed by using Spine is realized. And the texture of the target object is removed from the rendered texture, so that the data about the skeletal animation display to be hidden can be ensured to be no longer existed, and the reduction of the performance of the CPU caused by the occupation of the processing resources of the CPU and the data about the skeletal animation display to be hidden when the skeletal animation hiding is carried out can be reduced. Therefore, the hiding of the skeleton animation constructed by using Spine and the performance of the CPU can be considered through the scheme.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a skeletal animation hiding method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an application scenario of a hiding method for skeletal animation according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a skeletal animation hiding method according to another embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a hiding device for skeletal animation according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, a method for hiding a skeletal animation according to an embodiment of the present invention will be described.
The skeleton animation hiding method provided by the embodiment of the invention can be applied to electronic equipment capable of constructing and displaying skeleton animation, and in specific application, the electronic equipment can comprise a desktop computer, a portable computer, an internet television, an intelligent mobile terminal, a server, a wearable intelligent terminal and the like, which are not limited herein, and any electronic equipment capable of realizing the embodiment of the invention belongs to the protection scope of the embodiment of the invention.
As shown in fig. 1, a flow of a hiding method of a skeletal animation according to an embodiment of the present invention may include the following steps:
and S101, when a hiding command for the skeleton animation is detected, acquiring an object corresponding to the hiding command from the objects referenced by the specified class as a target object. Wherein the specified classes are used to display skeletal animations in the graphical user interface.
In a specific application, the detection mode of the hidden instruction of the skeleton animation can be various. Illustratively, when a hiding instruction for a skeletal animation is input by a user, if the hiding instruction input by the user is received, it is determined that the hiding instruction for the skeletal animation is detected. The manner of inputting the hiding instruction by the user may be various, for example, the user clicks a specific button or a specific position in the graphical user interface, or the user directly inputs the hiding instruction, and the like. Or, for example, when the hiding instruction for the bone animation is triggered by the application of the bone animation according to the preset periodicity, if the current time reaches the preset periodicity, or it is monitored that the hiding instruction is triggered, it is determined that the hiding instruction for the bone animation is detected. Any detection method for hidden instructions of skeletal animation can be used in the present invention, and this embodiment does not limit this.
And, the specified class is used to display a skeletal animation constructed using Spine in a graphic user interface, and generally, the skeletal animation is composed of one animation file and one texture file. In addition, the multi-texture skeletal animation constructed by using Spine is composed of an animation file and a plurality of texture files. Wherein the animation file provides data on actions of the multi-texture skeletal animation, for example, data on actions of running, jumping, and attacking of the multi-texture skeletal animation; the texture file, i.e. the picture, provides data about the appearance of the multi-textured skeletal animation, e.g. the appearance and the form of the multi-textured skeletal animation display, etc. data about the appearance. When the multi-texture skeleton animation constructed by using Spine is displayed in the graphical user interface by using the designated class, the animation file and the texture files of the multi-texture skeleton animation can be loaded, and the loaded texture files are converted into objects for reference of the designated class, so that the multi-texture skeleton animation is displayed in the graphical user interface. Based on the above, hiding the multi-texture skeleton animation is equivalent to realizing the effect that the texture file of the multi-texture skeleton animation is not displayed any more. Moreover, the number of the objects referenced by the designated class is multiple, and the number of the objects corresponding to the hiding instruction is one or more than one object to be hidden. Therefore, in order to ensure that the object to be hidden in step S102 is the object indicated by the hidden instruction, the object corresponding to the hidden instruction may be acquired from the objects referenced by the specified class as the target object.
The obtaining mode of the object corresponding to the hidden instruction may specifically include: and acquiring the identification of the object indicated by the hidden instruction, and acquiring the object with the identification from the objects referenced by the specified class as a target object. In a particular application, the specified class may be the class skelethongraphic for displaying the class that has skeletal animation present; the specified class may be the class skelestonnagricmultiobject for displaying classes of multi-texture skeletal animation where there are multiple textures. Moreover, when the development platform for constructing the multi-texture skeletal animation is the game engine Unity, the image user interface may be a set of GUI systems owned by Unity.
And S102, removing the texture of the target object from the rendered texture by using a preset texture removing interface.
In a particular application, displaying a multi-texture skeletal animation in a graphical user interface with a specified class of skeleston graphics multiobject may include: loading a plurality of texture files of the multi-texture skeleton animation to obtain a plurality of objects, designating a plurality of objects which are referred by a SkeletonGraphic Multi object, inputting the referred objects into a canvas rendering component for rendering to obtain a plurality of textures displayed in a graphical user interface. For example, as shown in FIG. 2, a character in a multi-textured skeletal animation includes two appearances, one for each texture file. When the character role is shown in the graphical user interface 201, two texture files corresponding to two appearances can be loaded to obtain two objects, the SkeletonGraphic MultiObject of a specified class refers to the two objects, and a Canvas Render component is input to Render to obtain a texture 202 and a texture 203 which are displayed in the graphical user interface 201. Therefore, in order to hide the target object corresponding to the hiding instruction, the texture of the target object may be removed from the rendered texture using a preset texture removal interface. In addition, when there is one texture file, the display process of the skeleton animation in the graphical user interface is similar to that of the plurality of texture files, except that the number of texture files is one, and correspondingly, the number of objects obtained by loading is one.
The number of the Canvas Render components can be multiple or one, and when the number of the Canvas Render components is multiple, multiple textures can be rendered synchronously by the multiple Canvas Render components aiming at multiple objects, so that the rendering efficiency is improved. In an alternative embodiment, the number of rendered textures may be multiple, and the number of rendered textures is stored as a texture array;
correspondingly, the removing the texture of the target object from the rendered texture by using the preset texture removing interface may specifically include the following steps:
traversing the texture array by using a preset texture removing interface and the target object to obtain the texture of the target object;
the texture of the target object is removed.
In a specific application, when a plurality of textures obtained by rendering are stored as a texture array, the texture array may be traversed by using a preset texture removal interface and a target object, and the texture of the target object is found from the texture array, so as to remove the texture of the target object. The target object may provide an identifier of a texture of the target object, and is used to find the texture of the target object from the texture array, and the preset texture removal interface is used to perform texture removal. According to the optional embodiment, aiming at the condition that a plurality of textures exist, the plurality of textures are stored as the texture array, and then the texture of the target object is obtained in a traversal mode, so that the removal is realized, and the application range of the skeletal animation hiding method provided by the embodiment of the invention is widened.
In addition, the texture of the target object is removed from the rendered texture by using a preset texture removal interface, which may be specifically described in various ways in the form of alternative embodiments below.
In an alternative embodiment, the removing the texture of the target object from the rendered texture by using a preset texture removing interface may include the following steps:
acquiring a texture identifier of a texture of a target object;
and inputting the determined texture identifier into a preset texture removing interface, so that the preset texture removing interface removes the texture with the determined texture identifier from the rendered texture.
The texture identifier of the texture may be the same as or correspond to the identifier of the target object, and accordingly, obtaining the texture identifier of the texture of the target object may include: taking the identification of the target object as the determined texture identification; or, the texture identifier corresponding to the target object is searched from the corresponding relationship between the pre-stored identifier of the object and the texture identifier. In a specific application, when the development platform for constructing the skeletal animation is specifically the game engine Unity, the preset texture removal interface may be an interface Clear in the game engine Unity.
In another optional implementation manner, before the texture of the target object is removed from the rendered texture by using the preset texture removal interface, the method for hiding the skeletal animation provided in the embodiment of the present invention may further include the following steps:
packaging a preset texture removing interface in a preset forbidden model;
correspondingly, the removing the texture of the target object from the rendered texture by using the preset texture removing interface may specifically include the following steps:
and transferring the target object into a preset forbidden model so that a preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and removing the data used for rendering the texture of the target object by the preset forbidden model.
In a specific application, after the texture of the target object is removed, data for rendering the texture of the target object, for example, data such as a code for rendering the texture of the target object and a texture identifier, still exist, and may occupy a memory space and a processing resource of the CPU. For this reason, the preset texture removing interface can be encapsulated in the preset forbidden model, and then the target object is transmitted into the preset forbidden model, so that the preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and the skeleton animation is hidden; moreover, when the target object is introduced into the preset prohibition model, the preset prohibition model can clear the data used for rendering the texture of the target object, so that the existence of the data related to the display of the hidden skeleton animation is reduced, the occupation of the storage space and the processing resources of the CPU is reduced, and the performance of the CPU is further improved. When the development platform for constructing the skeletal animation is specifically the game engine Unity, the preset forbidden model may be specifically an interface ondable (forbidden) in the game engine Unity.
In the scheme provided by the embodiment of the invention, the specified class is used for displaying the bone animation in the graphical user interface, so that when a hiding instruction of the bone animation constructed by using Spine is detected, an object corresponding to the hiding instruction in the objects quoted by the specified class is obtained and is used as a target object, which is equivalent to taking the bone animation to be hidden in the bone animation displayed by the graphical user interface as the target object. On this basis, the displayed bone animation is the display of the texture obtained by rendering the bone animation, so that the texture of the target object is removed from the texture obtained by rendering by using a preset texture removing interface, namely the displayed bone animation to be hidden is removed from the graphical user interface, and the hiding of the bone animation constructed by using Spine is realized. And the texture of the target object is removed from the rendered texture, so that the data about the skeletal animation display to be hidden can be ensured to be no longer existed, and the reduction of the performance of the CPU caused by the occupation of the processing resources of the CPU and the data about the skeletal animation display to be hidden when the skeletal animation hiding is carried out can be reduced. Therefore, the hiding of the skeleton animation constructed by using Spine and the performance of the CPU can be considered through the scheme.
As shown in fig. 3, a flow of a hiding method of a skeletal animation according to another embodiment of the present invention may include the following steps:
s301, when a hiding command for the skeleton animation is detected, an object corresponding to the hiding command is obtained from the objects referenced by the specified class and is used as a target object.
S301 is the same as S101 in the embodiment of fig. 1, and will not be described herein again, for details, see the description of the embodiment of fig. 1.
S302, packaging a preset texture removing interface in a preset forbidden model.
The steps S301 and S302 may be executed synchronously or sequentially, in this embodiment, the execution sequence between the steps S301 and S302 is not limited, and the step S302 may be executed before the subsequent step S303. S301 is the same as the step of encapsulating the predetermined texture removal interface in the predetermined forbidden model in the optional embodiment of fig. 1 of the present invention, and details thereof are not described herein again, see the description of the optional embodiment of fig. 1 of the present invention.
And S303, transmitting the first preset parameter into an instantiation interface corresponding to the target object, so that the instantiation interface triggers the calling of the component to which the skeleton animation belongs to the preset prohibition model, transmitting the target object corresponding to the instantiation interface into the called preset prohibition model, so that the preset texture in the called preset prohibition model clears the interface, the texture of the target object is cleared from the rendered texture, and the preset prohibition model clears the data for rendering the texture of the target object.
In a specific application, if the preset forbidden model is directly called, the interface may be directly exposed to an environment that can be viewed by non-developers, and the preset forbidden model affects the display of the skeleton animation, which easily causes an increase of security risk. In this regard, a first preset parameter may be introduced into an instantiation interface corresponding to the target object, so that the instantiation interface triggers a component to which the skeleton animation belongs to call a preset prohibition model. At the moment, the instantiation interface triggers the component to which the skeleton animation belongs to call the preset prohibition model, so that the preset texture clearing interface in the called preset prohibition model clears the texture of the target object from the rendered texture, and the preset prohibition model clears the data used for rendering the texture of the target object. Therefore, the safety risk increase caused by directly calling the preset forbidden model can be reduced and the safety can be improved while the hiding of the skeleton animation constructed by using Spine and the performance of the CPU are considered.
The first preset parameter is a parameter used for enabling an instantiation interface to trigger calling of a component to which the skeleton animation belongs to a preset forbidden model; the component to which the skeletal animation belongs may be a development platform for building the skeletal animation. For example, when the development platform for constructing the skeleton animation is the game engine Unity, the instantiated interface may specifically be the interface SetActive, and at this time, the first preset parameter may be false. And the instantiation interface corresponding to the target object is used for processing the instantiation interface of the target object.
Optionally, after removing the texture of the target object from the rendered texture, the object hiding method provided in the embodiment of the present invention may further include the following steps:
when a display restoring instruction of the target object is detected, a second preset parameter is transmitted to an instantiation interface corresponding to the target object, so that the instantiation interface triggers a component to which the skeleton animation belongs to render the target object by using the specified class, the texture of the target object is obtained, and the texture of the target object is displayed in the graphical user interface.
In a specific application, the restoration display instruction for the target object is equivalent to the restoration display instruction for the skeleton animation, and is used for redisplaying the hidden skeleton animation. Illustratively, when a restoration display instruction for the skeletal animation is input by the user, if the restoration display instruction input by the user is received, it is determined that the restoration display instruction for the target object is detected. The manner of inputting the resume display instruction by the user may be various, for example, the user clicks a specific button or a specific position in the graphical user interface, or the user directly inputs the resume display instruction, and the like. Or, for example, when the hiding instruction for the skeletal animation is triggered by the application of the display restoration instruction for the target object at a preset periodicity, if the current time reaches the preset periodicity, or it is monitored that the hiding instruction is triggered, it is determined that the display restoration instruction for the target object is detected. Any detection method for the restoration display instruction of the target object can be used in the present invention, and this embodiment does not limit this.
The second preset parameter is a parameter used for enabling the instantiation interface to trigger the component to which the skeleton animation belongs to render the target object; the component to which the skeletal animation belongs may be a development platform for building the skeletal animation. For example, when the development platform for constructing the skeletal animation is the game engine Unity, the instantiated interface may specifically be the interface SetActive, and at this time, the second preset parameter may be true. Moreover, the rendering of the target object by the component to which the skeleton animation belongs by using the specified class to obtain the texture of the target object, and displaying the texture of the target object in the graphical user interface may specifically include: the game engine Unity inputs the target object into a SkeletonGraphic Multi object of a specified class, and the specified class calls a Canvas Render component to Render the target object to obtain the texture of the target object, and displays the texture of the target object in a graphical user interface, thereby redisplaying the hidden target object.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a hiding device for skeletal animation.
As shown in fig. 4, a skeletal animation hiding device according to an embodiment of the present invention may include:
a target object obtaining module 401, configured to, when a hidden instruction for a skeletal animation is detected, obtain an object corresponding to the hidden instruction from objects referenced by a specified class, as a target object; the appointed class is used for displaying skeleton animation constructed by Spine in a graphical user interface;
a hiding module 402, configured to use a preset texture removal interface to remove the texture of the target object from the rendered texture.
In the scheme provided by the embodiment of the invention, the specified class is used for displaying the bone animation in the graphical user interface, so that when a hiding instruction of the bone animation constructed by using Spine is detected, an object corresponding to the hiding instruction in the objects quoted by the specified class is obtained and is used as a target object, which is equivalent to taking the bone animation to be hidden in the bone animation displayed by the graphical user interface as the target object. On this basis, the displayed bone animation is the display of the texture obtained by rendering the bone animation, so that the texture of the target object is removed from the texture obtained by rendering by using a preset texture removing interface, namely the displayed bone animation to be hidden is removed from the graphical user interface, and the hiding of the bone animation constructed by using Spine is realized. And the texture of the target object is removed from the rendered texture, so that the data about the skeletal animation display to be hidden can be ensured to be no longer existed, and the reduction of the performance of the CPU caused by the occupation of the processing resources of the CPU and the data about the skeletal animation display to be hidden when the skeletal animation hiding is carried out can be reduced. Therefore, the hiding of the skeleton animation constructed by using Spine and the performance of the CPU can be considered through the scheme.
Optionally, the hiding module 402 is specifically configured to:
before the texture of the target object is removed from the rendered texture by using a preset texture removing interface, packaging the preset texture removing interface in a preset forbidden model;
and transferring the target object into the preset forbidden model, so that the preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and the preset forbidden model removes data used for rendering the texture of the target object.
Optionally, the hiding module 402 is specifically configured to:
and transmitting a first preset parameter into an instantiation interface corresponding to the target object, so that the instantiation interface triggers the calling of the component to which the skeleton animation belongs to the preset prohibition model, and transmitting the target object corresponding to the instantiation interface into the preset prohibition model.
Optionally, the apparatus further comprises: a restoration display module to:
after the texture of the target object is removed from the rendered texture, when a display restoration instruction of the target object is detected, a second preset parameter is transmitted to an instantiation interface corresponding to the target object, so that the instantiation interface triggers a component to which the skeletal animation belongs to render the target object by using the specified class, the texture of the target object is obtained, and the texture of the target object is displayed in the graphical user interface.
Optionally, the number of the rendered textures is multiple, and the rendered textures are stored as a texture array;
the hiding module 402 is specifically configured to:
traversing the texture array by using a preset texture removing interface and the target object to obtain the texture of the target object;
and clearing the texture of the target object.
Corresponding to the above embodiment, an embodiment of the present invention further provides an electronic device, as shown in fig. 5, where the electronic device may include:
the system comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory complete mutual communication through the communication bus 504 through the 503;
a memory 503 for storing a computer program;
the processor 501 is configured to implement the steps of the method for hiding the skeletal animation in any one of the embodiments when executing the computer program stored in the memory 503.
In the scheme provided by the embodiment of the invention, the specified class is used for displaying the bone animation in the graphical user interface, so that when a hiding instruction of the bone animation constructed by using Spine is detected, an object corresponding to the hiding instruction in the objects quoted by the specified class is obtained and is used as a target object, which is equivalent to taking the bone animation to be hidden in the bone animation displayed by the graphical user interface as the target object. On this basis, the displayed bone animation is the display of the texture obtained by rendering the bone animation, so that the texture of the target object is removed from the texture obtained by rendering by using a preset texture removing interface, namely the displayed bone animation to be hidden is removed from the graphical user interface, and the hiding of the bone animation constructed by using Spine is realized. And the texture of the target object is removed from the rendered texture, so that the data about the skeletal animation display to be hidden can be ensured to be no longer existed, and the reduction of the performance of the CPU caused by the occupation of the processing resources of the CPU and the data about the skeletal animation display to be hidden when the skeletal animation hiding is carried out can be reduced. Therefore, the hiding of the skeleton animation constructed by using Spine and the performance of the CPU can be considered through the scheme.
The Memory may include a RAM (Random Access Memory) or an NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The computer-readable storage medium provided by an embodiment of the present invention is embodied in an electronic device, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any one of the above-mentioned bone animation hiding methods are implemented.
In the scheme provided by the embodiment of the invention, the specified class is used for displaying the bone animation in the graphical user interface, so that when a hiding instruction of the bone animation constructed by using Spine is detected, an object corresponding to the hiding instruction in the objects quoted by the specified class is obtained and is used as a target object, which is equivalent to taking the bone animation to be hidden in the bone animation displayed by the graphical user interface as the target object. On this basis, the displayed bone animation is the display of the texture obtained by rendering the bone animation, so that the texture of the target object is removed from the texture obtained by rendering by using a preset texture removing interface, namely the displayed bone animation to be hidden is removed from the graphical user interface, and the hiding of the bone animation constructed by using Spine is realized. And the texture of the target object is removed from the rendered texture, so that the data about the skeletal animation display to be hidden can be ensured to be no longer existed, and the reduction of the performance of the CPU caused by the occupation of the processing resources of the CPU and the data about the skeletal animation display to be hidden when the skeletal animation hiding is carried out can be reduced. Therefore, the hiding of the skeleton animation constructed by using Spine and the performance of the CPU can be considered through the scheme.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer, causes the computer to perform the concealment method of skeletal animation as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, from a website, computer, server, or data center, over a wired (e.g., coaxial cable, fiber optic, DSL (Digital Subscriber Line), or wireless (e.g., infrared, radio, microwave, etc.) network, to another website, computer, server, or data center, to any available medium that is accessible by a computer or that is a data storage device including one or more integrated servers, data centers, etc. the available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD (Digital Versatile Disc, digital versatile disc)), or a semiconductor medium (e.g.: SSD (Solid state disk)), etc.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device and electronic apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for hiding a bone animation, the method comprising:
when a hidden instruction for the skeleton animation is detected, acquiring an object corresponding to the hidden instruction from objects referenced by a specified class as a target object; wherein the specified class is for displaying a skeletal animation in a graphical user interface;
and removing the texture of the target object from the rendered texture by using a preset texture removing interface.
2. The method according to claim 1, wherein before said removing the texture of the target object from the rendered texture using the preset texture removal interface, the method further comprises:
packaging the preset texture removing interface in a preset forbidden model;
the removing the texture of the target object from the rendered texture by using the preset texture removing interface includes:
and transferring the target object into the preset forbidden model, so that the preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and the preset forbidden model removes data used for rendering the texture of the target object.
3. The method of claim 2, wherein said importing the target object into the preset inhibition model comprises:
and transmitting a first preset parameter into an instantiation interface corresponding to the target object, so that the instantiation interface triggers the calling of the component to which the skeleton animation belongs to the preset prohibition model, and transmitting the target object corresponding to the instantiation interface into the preset prohibition model.
4. The method of claim 3, wherein after said removing the texture of the target object from the rendered texture, the method further comprises:
when a display restoration instruction of the target object is detected, a second preset parameter is transmitted to an instantiation interface corresponding to the target object, so that the instantiation interface triggers a component to which the skeleton animation belongs to render the target object by using the specified class, the texture of the target object is obtained, and the texture of the target object is displayed in the graphical user interface.
5. The method according to claim 1, wherein the number of the rendered textures is plural and the number of the rendered textures is stored as a texture array;
the removing the texture of the target object from the rendered texture by using the preset texture removing interface includes:
traversing the texture array by using a preset texture removing interface and the target object to obtain the texture of the target object;
and clearing the texture of the target object.
6. A device for concealment of bone animation, the device comprising:
the target object acquisition module is used for acquiring an object corresponding to a hidden instruction from objects referenced by a specified class as a target object when the hidden instruction of the skeleton animation is detected; wherein the specified class is for displaying a skeletal animation in a graphical user interface;
and the hiding module is used for clearing the texture of the target object from the rendered texture by using a preset texture clearing interface.
7. The apparatus according to claim 6, wherein the hiding module is specifically configured to:
before the texture of the target object is removed from the rendered texture by using a preset texture removing interface, packaging the preset texture removing interface in a preset forbidden model;
and transferring the target object into the preset forbidden model, so that the preset texture removing interface in the preset forbidden model removes the texture of the target object from the rendered texture, and the preset forbidden model removes data used for rendering the texture of the target object.
8. The apparatus according to claim 7, wherein the hiding module is specifically configured to:
and transmitting a first preset parameter into an instantiation interface corresponding to the target object, so that the instantiation interface triggers the calling of the component to which the skeleton animation belongs to the preset prohibition model, and transmitting the target object corresponding to the instantiation interface into the preset prohibition model.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the bus; the memory is used for storing a computer program; the processor, configured to execute the program stored in the memory, to implement the method steps according to any one of claims 1-5.
10. A computer-readable storage medium, characterized in that a computer program is stored in the storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN201911245229.0A 2019-12-06 2019-12-06 Bone animation hiding method, device and equipment Active CN111009025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911245229.0A CN111009025B (en) 2019-12-06 2019-12-06 Bone animation hiding method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911245229.0A CN111009025B (en) 2019-12-06 2019-12-06 Bone animation hiding method, device and equipment

Publications (2)

Publication Number Publication Date
CN111009025A true CN111009025A (en) 2020-04-14
CN111009025B CN111009025B (en) 2024-01-19

Family

ID=70114020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911245229.0A Active CN111009025B (en) 2019-12-06 2019-12-06 Bone animation hiding method, device and equipment

Country Status (1)

Country Link
CN (1) CN111009025B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6538654B1 (en) * 1998-12-24 2003-03-25 B3D Inc. System and method for optimizing 3D animation and textures
JP2007272355A (en) * 2006-03-30 2007-10-18 Namco Bandai Games Inc Program, information storage medium and image generation system
US20120306890A1 (en) * 2011-06-05 2012-12-06 Shaffer Joshua H Device and Method for Dynamically Rendering an Animation
US20120327090A1 (en) * 2010-03-02 2012-12-27 Nokia Corporation Methods and Apparatuses for Facilitating Skeletal Animation
CN106214294A (en) * 2016-08-10 2016-12-14 邹德威 Can dilating expansion Intervertebral disc fusion device and built-in vertebral body grappling nail formula drawer
CN106485773A (en) * 2016-09-14 2017-03-08 厦门幻世网络科技有限公司 A kind of method and apparatus for generating animation data
CN107294838A (en) * 2017-05-24 2017-10-24 腾讯科技(深圳)有限公司 Animation producing method, device, system and the terminal of social networking application
US20180322725A1 (en) * 2017-05-04 2018-11-08 Inspired Gaming (Uk) Limited Generation of variations in computer graphics from intermediate file formats of limited variability, including generation of different game outcomes
CN109529347A (en) * 2018-11-21 2019-03-29 北京像素软件科技股份有限公司 3D game bone additions and deletions method and device
CN109621419A (en) * 2018-12-12 2019-04-16 网易(杭州)网络有限公司 The generating means method and device of game role expression, storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6538654B1 (en) * 1998-12-24 2003-03-25 B3D Inc. System and method for optimizing 3D animation and textures
JP2007272355A (en) * 2006-03-30 2007-10-18 Namco Bandai Games Inc Program, information storage medium and image generation system
US20120327090A1 (en) * 2010-03-02 2012-12-27 Nokia Corporation Methods and Apparatuses for Facilitating Skeletal Animation
US20120306890A1 (en) * 2011-06-05 2012-12-06 Shaffer Joshua H Device and Method for Dynamically Rendering an Animation
CN106214294A (en) * 2016-08-10 2016-12-14 邹德威 Can dilating expansion Intervertebral disc fusion device and built-in vertebral body grappling nail formula drawer
CN106485773A (en) * 2016-09-14 2017-03-08 厦门幻世网络科技有限公司 A kind of method and apparatus for generating animation data
US20180322725A1 (en) * 2017-05-04 2018-11-08 Inspired Gaming (Uk) Limited Generation of variations in computer graphics from intermediate file formats of limited variability, including generation of different game outcomes
CN107294838A (en) * 2017-05-24 2017-10-24 腾讯科技(深圳)有限公司 Animation producing method, device, system and the terminal of social networking application
CN109529347A (en) * 2018-11-21 2019-03-29 北京像素软件科技股份有限公司 3D game bone additions and deletions method and device
CN109621419A (en) * 2018-12-12 2019-04-16 网易(杭州)网络有限公司 The generating means method and device of game role expression, storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
季卓尔;张景峤;: "基于可编程图形处理器的骨骼动画算法及其比较", 计算机工程与设计, no. 21 *
王军;禹东川;: "3D骨骼动画的算法分析与WebGL实现", 自动化与仪器仪表, no. 04 *
赵士杰: ""基于纹理映射的群体动画渲染"", 《全国优秀硕士学位论文全文库》 *
骆浩;: "骨骼系统对于实现动作流畅性的关键技术分析", no. 08 *
黄梅娟;: "Maya中仿真二足角色骨骼绑定技巧", no. 05 *

Also Published As

Publication number Publication date
CN111009025B (en) 2024-01-19

Similar Documents

Publication Publication Date Title
CN108619720B (en) Animation playing method and device, storage medium and electronic device
CN109064390B (en) Image processing method, image processing device and mobile terminal
CN111957040B (en) Detection method and device for shielding position, processor and electronic device
CN109783757B (en) Method, device and system for rendering webpage, storage medium and electronic device
CN108389151B (en) Over-rendering evaluation method and system
CN111580730B (en) Background display method of application program, electronic device and storage medium
CN111127611B (en) Three-dimensional scene rendering method and device and electronic equipment
CN112652046A (en) Game picture generation method, device, equipment and storage medium
CN104346463A (en) Loading method and device of page label and browser client
CN111127612A (en) Game scene node updating method and device, storage medium and electronic equipment
CN110750664A (en) Picture display method and device
CN112691381A (en) Rendering method, device and equipment of virtual scene and computer readable storage medium
WO2023197762A1 (en) Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product
CN115309516A (en) Application life cycle detection method and device and computer equipment
CN114297746A (en) Rendering method and device of building information model, electronic equipment and storage medium
CN110930484B (en) Animation configuration method and device, storage medium and electronic device
CN110471700B (en) Graphic processing method, apparatus, storage medium and electronic device
CN114529658A (en) Graph rendering method and related equipment thereof
CN110248165B (en) Label display method, device, equipment and storage medium
CN111580808A (en) Page generation method and device, computer equipment and storage medium
CN109976744B (en) Visual programming method, system and terminal equipment
CN109359260B (en) Network page change monitoring method, device, equipment and medium
CN114254305A (en) Android system application isolation method and device
CN112288841A (en) Method and device for creating rendering frame graph
CN111009025B (en) Bone animation hiding method, device and equipment

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
TA01 Transfer of patent application right

Effective date of registration: 20200528

Address after: 100043 room a-0831, floor 2, building 3, No. 30 yard, Shixing street, Shijingshan District, Beijing

Applicant after: BEIJING KINGSOFT CHEETAH TECHNOLOGY Co.,Ltd.

Address before: 100123 Building 8, Huitong Times Square, 1 South Road, Chaoyang District, Beijing.

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant