CN-122023606-A - Animation generation method and device based on Unity engine, electronic equipment and storage medium
Abstract
The disclosure relates to the technical field of image processing, in particular to a method and a device for generating animation based on a Unity engine, electronic equipment and a storage medium. The method comprises the steps of splitting a building model corresponding to a target building based on a Unity engine according to a composition structure of the target building, obtaining at least one component corresponding to the building model, constructing parent level information corresponding to the at least one component, adding an animation group control to the parent level information, obtaining a parameter set corresponding to the parent level information, wherein the parameter set comprises at least one of animation mode parameters and material mode parameters, controlling the animation group control, and applying the parameter set to each component included in the parent level information to generate an animation corresponding to the building model. The accuracy and convenience of animation generation can be improved by adopting the method and the device.
Inventors
- Xi Zhemin
- CHEN PU
Assignees
- 咪咕新空文化科技(厦门)有限公司
- 咪咕文化科技有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251231
Claims (10)
- 1. The animation generation method based on the Unity engine is characterized by comprising the following steps: Based on a Unity engine, splitting a building model corresponding to a target building according to a composition structure of the target building, acquiring at least one component corresponding to the building model, and constructing father-level information corresponding to the at least one component; Adding an animation group control to the parent level information; Acquiring a parameter set corresponding to the parent level information, wherein the parameter set comprises at least one of animation mode parameters and material mode parameters; And controlling the animation group control, applying the parameter set to each component included in the parent level information, and generating the animation corresponding to the building model.
- 2. The method of claim 1, wherein the controlling the animation group control to apply the parameter set to each component included in the parent level information to generate the animation corresponding to the building model comprises: Acquiring inclusion corresponding to the building model according to the model information of the building model, wherein the inclusion is used for indicating the animation playing range of the building model; and controlling the animation group control, applying the parameter set to each component in the animation playing range, and generating the animation corresponding to the building model.
- 3. The method according to claim 1 or 2, wherein the obtaining animation mode parameters corresponding to the parent level information includes: acquiring global setting information corresponding to the parent level information; and obtaining animation mode information of each component corresponding to the parent level information.
- 4. The method according to claim 3, wherein the obtaining animation mode information of each component corresponding to the parent level information includes at least one of: Acquiring a range corresponding to a first function curve through a preset parameter range, and adding a key frame to each component corresponding to the parent level information through calling the first function curve and the range to acquire at least one animation mode information of each component; And adding a random offset value to each component by calling a second function curve according to the world coordinate position offset value corresponding to each component, and obtaining at least one animation mode information of each component.
- 5. The method according to claim 1 or 2, wherein the obtaining the texture mode parameter corresponding to the parent level information includes: And acquiring parameters of the material corresponding to the parent level information and effect change information of the material.
- 6. The method of claim 5, wherein the applying the texture mode parameter to each component included in the parent level information generates an animation corresponding to the building model, comprising: Acquiring the height of world coordinates corresponding to the target building, and acquiring the starting position and the ending position of material change according to the height of the world coordinates; Acquiring a mask map corresponding to the building model according to the starting position and the ending position; Acquiring parameters of the material and display positions corresponding to effect change information of the material; and according to the display position, applying the parameters of the material and the effect change information of the material to each component included in the parent level information, and generating the material animation corresponding to the building model.
- 7. The method of claim 1, wherein the applying the parameter set to each component included in the parent level information generates an animation corresponding to the building model, comprising: Acquiring triggering information corresponding to each component included in the parent level information; acquiring animation playing time points corresponding to the components according to the triggering information; acquiring each component included in the parent level information according to first tag information corresponding to the parent level information, wherein second tag information of each component is consistent with the first tag information; And according to the animation playing time point and the father level, applying the parameter set to each component included in the father level information, and generating the animation corresponding to the building model.
- 8. An animation generation device based on a Unity engine, comprising: The information construction unit is used for splitting a building model corresponding to a target building according to the composition structure of the target building based on the Unity engine, acquiring at least one component corresponding to the building model, and constructing father-level information corresponding to the at least one component; The control adding unit is used for adding an animation group control to the parent level information; the parameter acquisition unit is used for acquiring a parameter set corresponding to the parent level information, wherein the parameter set comprises at least one of animation mode parameters and material mode parameters; and the animation generation unit is used for controlling the animation group control, applying the parameter set to each component included in the parent level information and generating the animation corresponding to the building model.
- 9. An electronic device, comprising: A processor; a memory for storing the processor-executable instructions; Wherein the processor is configured to execute the instructions to implement the Unity engine-based animation generation method of any of claims 1 to 7.
- 10. A non-transitory computer readable storage medium storing computer instructions, the storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the Unity engine-based animation generation method of any of claims 1 to 7.
Description
Animation generation method and device based on Unity engine, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of image processing, in particular to a method and a device for generating animation based on a Unity engine, electronic equipment and a storage medium. Background With the development of computer modeling animation techniques, building-related animations can be obtained. For example, a building model may be built in three-dimensional software, binding bones and setting key frames on each building component in the three-dimensional software, and animating the combined athletic performance and growth process of the building components, and animating the process of rendering changes in materials, etc., and then exporting to the engine environment for viewing. However, in the process of obtaining the animation, the physical mechanics is required to be simulated manually, so that the animation generation difficulty is high, the animation generation and modification difficulty is high, and the animation generation accuracy and convenience are poor. Disclosure of Invention The present disclosure provides an animation generation method, apparatus, electronic device, and storage medium based on a Unity engine, which can improve the accuracy and convenience of animation generation. The technical scheme of the present disclosure is as follows: according to a first aspect of an embodiment of the present disclosure, there is provided an animation generation method based on a Unity engine, including: Based on a Unity engine, splitting a building model corresponding to a target building according to a composition structure of the target building, acquiring at least one component corresponding to the building model, and constructing father-level information corresponding to the at least one component; Adding an animation group control to the parent level information; Acquiring a parameter set corresponding to the parent level information, wherein the parameter set comprises at least one of animation mode parameters and material mode parameters; And controlling the animation group control, applying the parameter set to each component included in the parent level information, and generating the animation corresponding to the building model. According to some embodiments, the controlling the animation group control, applying the parameter set to each component included in the parent level information, and generating the animation corresponding to the building model includes: Acquiring inclusion corresponding to the building model according to the model information of the building model, wherein the inclusion is used for indicating the animation playing range of the building model; and controlling the animation group control, applying the parameter set to each component in the animation playing range, and generating the animation corresponding to the building model. According to some embodiments, the obtaining the animation mode parameter corresponding to the parent level information includes: acquiring global setting information corresponding to the parent level information; and obtaining animation mode information of each component corresponding to the parent level information. According to some embodiments, the obtaining animation mode information of each component corresponding to the parent level information includes at least one of the following: Acquiring a range corresponding to a first function curve through a preset parameter range, and adding a key frame to each component corresponding to the parent level information through calling the first function curve and the range to acquire at least one animation mode information of each component; And adding a random offset value to each component by calling a second function curve according to the world coordinate position offset value corresponding to each component, and obtaining at least one animation mode information of each component. According to some embodiments, the obtaining the material mode parameter corresponding to the parent level information includes: And acquiring parameters of the material corresponding to the parent level information and effect change information of the material. According to some embodiments, the applying the material mode parameter to each component included in the parent level information, and generating the animation corresponding to the building model, includes: Acquiring the height of world coordinates corresponding to the target building, and acquiring the starting position and the ending position of material change according to the height of the world coordinates; Acquiring a mask map corresponding to the building model according to the starting position and the ending position; Acquiring parameters of the material and display positions corresponding to effect change information of the material; and according to the display position, applying the parameters of the mate