CN117873972A - Method, device, electronic equipment and computer readable medium for importing files - Google Patents

Method, device, electronic equipment and computer readable medium for importing files Download PDF

Info

Publication number
CN117873972A
CN117873972A CN202311651679.6A CN202311651679A CN117873972A CN 117873972 A CN117873972 A CN 117873972A CN 202311651679 A CN202311651679 A CN 202311651679A CN 117873972 A CN117873972 A CN 117873972A
Authority
CN
China
Prior art keywords
file
loaded
animation clip
unity engine
result
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
CN202311651679.6A
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202311651679.6A priority Critical patent/CN117873972A/en
Publication of CN117873972A publication Critical patent/CN117873972A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The application provides a method, a device, electronic equipment and a computer readable medium for importing files, wherein the application obtains files to be loaded aiming at a Unity engine; if the file type of the file to be loaded is the target type, the file to be loaded is unpacked to obtain an unpacking result, wherein the unpacking result at least comprises video data of the file to be loaded; generating an animation clip file based on the decapsulation result; and importing the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of performing the animation clip file. Therefore, when the file to be loaded aiming at the Unity engine is received, the animation clip file is utilized as the file which is actually imported and executed, so that the content in the file to be loaded is replaced and can be actually and reliably executed. By the mode, the application range of the file format of the Unity engine can be improved, and the execution stability of the Unity engine can be guaranteed.

Description

Method, device, electronic equipment and computer readable medium for importing files
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for importing a file, an electronic device, and a computer readable medium.
Background
With the development of computer technology, the internet and computers have enabled users to interact by way of, for example, creating and using avatars. In this way, the user is allowed to create 'objects' based on the design and conception of the user, and the virtual image can provide more intuitionistic, multi-element and interesting interaction experience for the user.
And the content creation platform and the engine are generated for helping the user to realize the purpose of creating the avatar. The Unity engine is a platform capable of providing real-time three-dimensional interactive content creation and operation, and can help all creators including game development, art, construction, automobile design and film and television to become a reality. The Unity engine may provide a complete set of software solutions for authoring, operating and rendering any real-time interactive two-dimensional and three-dimensional content, supporting platforms including cell phones, tablet computers, personal Computers (PCs), game hosts, augmented reality and virtual reality devices. Therefore, how to improve the capability and the application range of the Unity engine and ensure the execution stability and the execution safety of the Unity engine is worth focusing and urgently demanded.
Disclosure of Invention
Aspects of the present application provide a method, apparatus, electronic device, and computer-readable storage medium for importing a file, when receiving a file to be loaded for a Unity engine, using an animation clip file as an actually imported and executed file, so as to ensure that replacing content in the file to be loaded can be actually and reliably executed. By the mode, the application range of the file format of the Unity engine can be improved, and the execution stability of the Unity engine can be guaranteed.
In one aspect of the present application, a method for importing a file is provided, including: acquiring a file to be loaded aiming at a Unity engine; if the file type of the file to be loaded is the target type, the file to be loaded is unpacked to obtain an unpacking result, wherein the unpacking result at least comprises video data of the file to be loaded; generating an animation clip file based on the decapsulation result; and importing the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of performing the animation clip file.
In another aspect of the present application, there is provided an apparatus for importing a file, including: the acquisition module is configured to acquire a file to be loaded aiming at the Unity engine; the unpacking module is configured to unpack the file to be loaded to obtain a unpacking result if the file type of the file to be loaded is a target type, wherein the unpacking result at least comprises video data of the file to be loaded; a generation module configured to generate an animation clip file based on the decapsulation result; and an import module configured to import the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of performing the animation clip file.
In another aspect of the present application, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of importing a file as provided above.
In another aspect of the present application, a computer-readable storage medium having stored thereon computer program instructions executable by a processor to implement a method of importing a file as provided above is provided.
In the scheme provided by the embodiment of the application, the file to be loaded aiming at the Unity engine can be obtained; if the file type of the file to be loaded is the target type, the file to be loaded is unpacked to obtain an unpacking result, wherein the unpacking result at least comprises video data of the file to be loaded; generating an animation clip file based on the decapsulation result; and importing the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of performing the animation clip file. Therefore, when the file to be loaded aiming at the Unity engine is received, the animation clip file is utilized as the file which is actually imported and executed, so that the content in the file to be loaded is replaced and can be actually and reliably executed. By the mode, the application range of the file format of the Unity engine can be improved, and the execution stability of the Unity engine can be guaranteed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
FIG. 1 is a schematic diagram of a process for importing files according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a process for generating an animation clip file according to another embodiment of the present application;
FIG. 3 is a schematic structural diagram of an apparatus for importing files according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device suitable for implementing the solution in the embodiments of the present application.
The same or similar reference numbers in the drawings refer to the same or similar parts.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In a typical configuration of the present application, the terminals, the devices of the services network each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer-readable media include both permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer program instructions, data structures, modules of the program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device.
As described above, how to improve the capability and application range of the Unity engine and ensure the stability and safety of the Unity engine is worth focusing and urgent demands.
In some schemes, in order to ensure the execution stability and safety of the Unity engine, a file format which is allowed to be read and used is selected to be configured in advance, so that the Unity engine only has import and processing capability on the file formats, and therefore the file with uncontrollable safety is prevented from being processed, and the execution safety of the Unity engine is ensured. However, in such a manner, the supporting capability of the Unity engine is limited, for example, for some format files, the Unity engine lacks corresponding processing capability, so that the capability and application range of the Unity engine are affected.
In this regard, the embodiment of the application provides a method for importing files, which obtains files to be loaded for a Unity engine; if the file type of the file to be loaded is the target type, the file to be loaded is unpacked to obtain an unpacking result, wherein the unpacking result at least comprises video data of the file to be loaded; generating an animation clip file based on the decapsulation result; and importing the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of performing the animation clip file. Therefore, when the file to be loaded aiming at the Unity engine is received, the animation clip file is utilized as the file which is actually imported and executed, so that the content in the file to be loaded is replaced and can be actually and reliably executed. By the mode, the application range of the file format of the Unity engine can be improved, and the execution stability of the Unity engine can be guaranteed.
In an actual scenario, the execution body of the method may be a user device, or a device formed by integrating the user device and a network device through a network, or may also be an application running on the device, where the user device includes, but is not limited to, various terminal devices such as a computer, a mobile phone, a tablet computer, a smart watch, a bracelet, and the network device includes, but is not limited to, a network host, a single network server, a plurality of network server sets, or a computer set based on cloud computing, and the network device may be implemented, for example, to implement a part of processing functions when setting an alarm clock. Here, the Cloud is composed of a large number of hosts or web servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, one virtual computer composed of a group of loosely coupled computer sets.
Fig. 1 shows a process 100 for importing files according to an embodiment of the present application, where the process 100 includes at least the following processing steps:
step S101, a file to be loaded for the Unity engine is obtained.
In an embodiment of the present application, an execution body obtains a file to be loaded for a Unity engine. In some scenarios, in order to facilitate the user to use the Unity engine, the execution body that obtains the file to be loaded may be a device for configuring the Unity engine, thereby enabling the user to use the Unity engine directly at the execution body itself. In some embodiments, the execution body may also be the "Unity engine" itself, i.e., the execution body may be a component of the Unity engine (for example, it is a unit of the Unity engine), so that the Unity engine has a corresponding processing capability in the local machine, so as to achieve the purpose of simplifying configuration. In some embodiments, the Unity engine may be in an operating state, so that the application may provide an importing manner of a subsequent description to the Unity engine in the operating state, so as to improve the use efficiency of the Unity engine.
In embodiments of the present application, a user may provide any form of file to be loaded based on their actual needs, such as, for example, the. Fbx (Filmbox),. Obj (Wavefront OBJ),. Blend (Blender), and the. Dae (Collada) format files. Fbx is a generic three-dimensional model file format that supports model exchanges between the various software and platforms that hold the Unity engine. The fbx file may include information of geometric data, materials, animations, bones, etc. of the virtual object. Obj is a three-dimensional model file format, which is a text file format that can be used to describe information such as geometry, texture, and texture coordinates of the model. The blend is a native file format of blend software, and the blend file may contain information such as geometric data, texture, animation, skeleton, etc. of the model. In the Unity engine, the end file can be directly imported for editing and use. Dae is an open three-dimensional model file format that supports model exchanges between a variety of software and platforms, including the Unity engine. The dae file may contain geometric data, materials, animation, skeleton information, etc. of the model.
In some embodiments, the user may also provide VRM (VirtualRealityMarkupLangu age) a data format type file to be loaded. VRM is an open source file format based on glTF (GL Transmiss ion Format) and is widely used to create and share three-dimensional character models, particularly in the field of Virtual Reality (VR), augmented Reality (AR), and three-dimensional (3D) animation. VR M models typically contain shape, texture, skeletal information, and animations. glTF, a file format for 3D scenes and models, is described as "JPEG for 3D". The glTF defines a standard file format, can store geometric information, textures, materials, animation and other information of the 3D model, and can efficiently and transparently transmit 3D graphic contents.
Step S102, if the file type of the file to be loaded is the target type, the file to be loaded is unpacked, and a unpacking result is obtained.
In the embodiment of the present application, after the execution body obtains the file to be loaded based on step S101, the execution body may parse the type of the file to be loaded. For example, the execution body may determine a file type of the file to be loaded based on the file format. Further, if the execution body determines that the file type of the file to be loaded is the target type, it may decapsulate the file to be loaded to obtain a decapsulation result. In the embodiment of the disclosure, the target type may be configured in advance, and typically the target type may include a file type that cannot be directly imported or operated by the Unity engine, or that may have an adverse effect on the security of the Unity engine. In some embodiments, the target type may also have low suitability for the Unity engine, and may not be the file type handled by the Unity engine.
In some embodiments, because the Unity engine needs to resort to the VRM model to parse, for example, animation data, motion data, etc. when processing the VRM data format type, the VRM data format type data may be difficult to parse, run, and use completely by the Unity engine during operation of the Unity engine in the absence of the VRM model. In this case, the VRM data format type may be determined as a target type in place of directly executing the file of the VRM data format type by converting it to another file format that can be better used by the Unity engine.
Further, if the execution body determines that the file type of the file to be loaded is the target type, the file to be loaded may be unpacked to obtain a unpacking result of video data including at least the file to be loaded. For example, the execution body may extract video data (e.g., video frames) and the like in the file to be loaded through a decapsulation operation of the file to be loaded, so as to extract corresponding video data therefrom and obtain essential content of the file to be loaded. In some embodiments, the decapsulation result may further include, for example, audio data, audio tracks, subtitle information, subtitle tracks, and so forth.
In some embodiments, the video data in the encapsulated result may be a key frame (or set of key frames) of the video. Accordingly, the obtained decapsulation result further includes description information corresponding to the key frames, so as to use the description information to indicate the time points of the corresponding key frame data (for example, the playing time position of the key frames, the position of the key frames in the video playing track) and the action information of the key points included in the key frame data (for example, the skeleton points included in the key frames, actions performed by the skeleton points, the change tracks of the skeleton points between the key frames, etc.). Thus, the "video content" may be provided by way of key frames and descriptive information to facilitate subsequent restoration of actions involved in the video (e.g., actions performed by the virtual object) based on the "key frames".
In some embodiments, the unpacking operation is not actually performed by the Unity engine, or the unpacking operation does not affect the running condition of the Unity engine. Therefore, the execution body can also load the file to be loaded by using the resource importer for the Unity engine. For example, for providing an executable file for a Unity engine, or a resource importer local to the Unity engine, for example, support capability, resolution authority for multiple file formats (e.g., more extensive file formats) may be pre-assigned such that the resource importer for the Unity engine performs processing (e.g., decapsulation) for more file formats. Thus, the execution body can utilize the resource importer for the Unity engine to unpack the file to be loaded to simplify the configuration requirements.
For ease of understanding, an example is given of a file of VRM data format type (which will be referred to simply as VRM file for ease of description). The data in the VRM file may include, for example, geometric information, texture information, animation data, and other related attributes of the character model, which may be packaged as a file for storage. For example, VRM files may typically use binary or JSON formats to store the encapsulated results of these data. In some embodiments, the animation data format in the VRM file may also default to a binary format, e.g., the VRM file may be based on the glTF to store the animation data using the characteristics of the glTF file format itself to support the use of the binary format. Accordingly, the executing body may provide a way to decapsulate the VRM file to obtain the animation data therein.
For ease of understanding, reference may also be made to fig. 2 simultaneously. FIG. 2 illustrates a process 200 for generating an animation clip file provided by an embodiment of the present application.
In process 200, when a file to be loaded (e.g., VRM file 210) of a VRM data format type, for VRM file 210 belonging to a target file type (e.g., VRM data format type), the executing entity may decapsulate VRM file 210.
For example, in process 200, after VRM file 210 is unpackaged, at least a set of key frames 220, a description of the key frames 230 may be obtained.
Step S103, generating an animation clip file based on the unpacking result.
In the embodiment of the present application, the execution body may generate the animation clip file using the decapsulation result (e.g., video data) after obtaining the decapsulation result based on the above step S102. An animation clip file (animation clip) is a format for storing and managing animation data, and can be used in a game engine and animation software. The animation clip file is a type of resource in the Unity engine that may include, for example, animation information (e.g., key frames) of a virtual object, as well as other related attributes.
In some embodiments, generating the animation clip file based on the decapsulation result includes: processing the keyframes into Unity keyframes of the Unity engine; creating an initial animation clip file; and adding the Unity key frame to the initial animation clip file to generate an animation clip file. In particular, the execution body may process the keyframes of the video data in the decapsulation result to convert them into Unity keyframes that may be identified and used by the Unity engine (e.g., the keyframes may be adjusted to Unity keyframes by format conversion of the keyframes, adjustment of parameter information of the keyframes). Further, the executing body may create an initial animation clip file, and then obtain an animation clip file actually including the key true content of the file to be loaded by inserting each Unity key frame into the initial animation clip file. The animation clip file may utilize the Unity keyframe to define changes in properties such as transformations, displacements, rotations, scaling, etc. of virtual objects during animation based on the concept of keyframe animation. In some embodiments, the execution body may also smoothly transition the properties of the object by interpolation on the time axis based on the Unity keyframe. In an animation clip file, a "Unity keyframe" may be associated with curves of multiple attributes to enable content such as position, rotation, scaling, etc. Each attribute curve defines how the attribute changes during the animation according to the timestamp and value of the Unity keyframe. Further, the animation clip file may be used to characterize the animation state of the avatar over a period of time by storing the timestamp and attribute value of the Unity keyframe. For example, a Unity keyframe may include values of one or more attributes for describing the state of different attributes of an object at that point in time. Thus, by adjusting and editing the attribute curves in the animation clip file, such as adjusting the creep between Unity key frames, the tangent type of the rotation curve, etc., the effect and behavior of the animation can be precisely controlled.
It should be appreciated that for some file formats, the keyframes may be directly satisfactory for use by Unity, in which case the Unity keyframes and keyframes may be virtually identical.
In some embodiments, the animation clip file may also be set with parameters such as play speed, circulation mode, duration, etc. to adjust and configure the play mode and time range of the animation for the avatar. In some embodiments, the animation clip file is a resource type of game engine or animation software that may also be associated and managed with other resources (e.g., models, textures). In this case, the animation clip file is assigned to a game object or character model in such a manner that an animation can be played and applied in a game or animation system.
Thus, by converting the animation data in the VRM model file into the animation clip file at runtime, a developer can conveniently process the file to be loaded, such as the VRM data format type, by using the Unity engine without knowing the details of the VRM model file.
For example, reference may be continued to FIG. 2. In process 200, the executing body may, after acquiring a set of key frames 220 and corresponding description information 230, generate an animation clip file 250' by continuously inserting key frames into the initial animation clip file 250.
In some embodiments, when the execution body unpacks the file to be loaded and obtains the unpacking result, audio data in the file to be loaded is also obtained. Thus, content loss caused by file format conversion is avoided, so that other types of data can be normally used.
In some embodiments, if the decapsulation result further includes audio data of the file to be loaded, the execution body may further acquire a video play track in which the video data is located in the animation clip file and an audio play track of the audio data. For example, the execution body may acquire a video play track in which video data is located in an animation clip file, and an audio play track for instructing the audio data to play. Further, the execution body may add audio data to the animation clip file with reference to the aligned result after aligning the video play track and the audio play track based on, for example, the play time. For example, after acquiring the video playback track, the executing body may align the playback positions of the audio corresponding to the playback frames based on the playback positions of the respective key frames indicated therein, thereby aligning the audio playback track. Therefore, the method can avoid 'sound and picture asynchronization' caused by adjusting the playing position of a key frame when the animation clip file is generated, and restore the presentation effect which can be brought by directly processing and using the file to be loaded based on the video playing track and the audio playing track used by the file to be loaded in the animation clip file.
For example, reference may be continued to FIG. 2. In process 200, the executing body may also obtain audio playback track 240 and audio data 250 as a result of the decapsulation by decapsulating VRM file 210.
Further, the executing entity, upon deriving the animation clip file 250 'based on the set of key frames 220 and the description information 230, may also adjust the audio playback track 240 (e.g., adjust the temporal position of the audio playback indicated therein) with the video playback track to obtain an adjusted audio playback track 240'. Further, the execution body may insert audio data 250 into the animation clip file 250' based on the audio play track 240.
Step S104, importing the animation clip file into the Unity engine.
In the embodiment of the present application, the execution subject may import the animation clip file to the Unity engine after obtaining the animation clip file based on the above step S103. Further, the execution body may instruct the Unity engine to actually execute the animation clip file instead of executing the file to be loaded, so that the Unity engine executes the animation clip file instead of executing the file to be loaded. Therefore, for the file to be loaded, although the source file cannot be executed by the Unity engine or is refused to be executed by the Unity engine, the content of the source file can be used and processed by the Unity engine, so that the application range of the file format of the Unity engine is improved, and the execution stability of the Unity engine is ensured. For example, for an Animation clip file, it may be used, played by the Unity engine through Animation or an Animation component, instead of directly using, playing the file to be loaded.
Then, the file importing method provided by the application acquires the file to be loaded aiming at the Unity engine; if the file type of the file to be loaded is the target type, the file to be loaded is unpacked to obtain an unpacking result, wherein the unpacking result at least comprises video data of the file to be loaded; generating an animation clip file based on the decapsulation result; and importing the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of performing the animation clip file. Therefore, when the file to be loaded aiming at the Unity engine is received, the animation clip file is utilized as the file which is actually imported and executed, so that the content in the file to be loaded is replaced and can be actually and reliably executed. By the mode, the application range of the file format of the Unity engine can be improved, and the execution stability of the Unity engine can be guaranteed.
The embodiment of the application also provides a device for importing files, and the structure of the device is shown as a device 300 in fig. 3. The apparatus 300 includes: an obtaining module 310 configured to obtain a file to be loaded for the Unity engine; the decapsulation module 320 is configured to decapsulate the file to be loaded if the file type of the file to be loaded is a target type, so as to obtain a decapsulation result, where the decapsulation result at least includes video data of the file to be loaded; a generation module 330 configured to generate an animation clip file based on the decapsulation result; and an import module 340 configured to import the animation clip file to the Unity engine so that the Unity engine performs the file to be loaded instead of executing the animation clip file.
In some embodiments, unpacking a file to be loaded includes: and loading the file to be loaded by using a resource importer aiming at the Unity engine.
In some embodiments, the video data includes a key frame, and the decapsulation result further includes description information corresponding to the key frame, where the description information is used to indicate a time point of the corresponding key frame data and action information of the key point included in the key frame data.
In some embodiments, generating the animation clip file based on the decapsulation result includes: processing the keyframes into Unity keyframes of the Unity engine; creating an initial animation clip file; and adding the Unity key frame to the initial animation clip file to generate an animation clip file.
In some embodiments, the unpacking result further includes audio data of the file to be loaded.
In some embodiments, if the decapsulation result further includes audio data of the file to be loaded, the apparatus 300 further includes: an adding module configured to acquire a video play track in which video data is located in an animation clip file and an audio play track in which audio data is located; audio data is added to the animation clip file based on the alignment result of the video play track and the audio play track.
In some embodiments, the target type includes a VRM data format type.
Based on the same inventive concept, an electronic device is also provided in the embodiments of the present application, and the method corresponding to the electronic device may be the method for importing files in the foregoing embodiments, and the principle of solving the problem is similar to that of the method. The electronic device provided by the embodiment of the application comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods and/or techniques of the various embodiments of the present application described above.
The electronic device may be a user device, or a device formed by integrating the user device and a network device through a network, or may also be an application running on the device, where the user device includes, but is not limited to, various terminal devices such as a computer, a mobile phone, a tablet computer, a smart watch, a bracelet, and the network device includes, but is not limited to, a network host, a single network server, a plurality of network server sets, or a computer set based on cloud computing, and the network device may be implemented, for example, to implement a part of processing functions when setting an alarm clock. Here, the Cloud is composed of a large number of hosts or web servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, one virtual computer composed of a group of loosely coupled computer sets.
Fig. 4 shows a structure of an electronic device suitable for implementing the method and/or technical solution in the embodiments of the present application, the electronic device 400 includes a central processing unit (CPU, central Processing Unit) 401, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a random access Memory (RAM, random Access Memory) 403. In the RAM 403, various programs and data required for the system operation are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An Input/Output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, a touch panel, a microphone, an infrared sensor, and the like; an output portion 407 including a display such as a Cathode Ray Tube (CRT), a liquid crystal display (LCD, liquid Crystal Display), an LED display, an OLED display, and a speaker; a storage portion 408 comprising one or more computer-readable media of hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 409 including a network interface card such as a LAN (local area network ) card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet.
In particular, the methods and/or embodiments of the present application may be implemented as a computer software program. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 401.
Another embodiment of the present application also provides a computer readable storage medium having stored thereon computer program instructions executable by a processor to implement the method and/or the technical solution of any one or more of the embodiments of the present application described above.
In particular, the present embodiments may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, a system, apparatus, or device that includes, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowchart or block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the partitioning of elements is merely a logical functional partitioning, and there may be additional partitioning in actual implementation, e.g., multiple elements or page components may be combined or integrated into another system, or some features may be omitted, or not implemented. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.

Claims (10)

1. A method of importing a file, comprising:
acquiring a file to be loaded aiming at a Unity engine;
if the file type of the file to be loaded is the target type, decapsulating the file to be loaded to obtain a decapsulation result, wherein the decapsulation result at least comprises video data of the file to be loaded;
generating an animation clip file based on the decapsulation result; and
and importing the animation clip file to the Unity engine so that the Unity engine can execute the file to be loaded instead of executing the animation clip file.
2. The method of claim 1, wherein decapsulating the file to be loaded comprises:
and loading the file to be loaded by using a resource importer aiming at the Unity engine.
3. The method of claim 2, wherein the video data includes a key frame, and the decapsulation result further includes description information corresponding to the key frame, the description information indicating a time point of the corresponding key frame data and action information of the key point included in the key frame data.
4. A method according to claim 3, wherein said generating an animation clip file based on said decapsulation result comprises:
processing the key frame into a Unity key frame of the Unity engine;
creating an initial animation clip file; and
and adding the Unity key frame to the initial animation clip file to generate an animation clip file.
5. The method of claim 1, wherein the decapsulation result further includes audio data of the file to be loaded.
6. The method of claim 4, further comprising, if the decapsulation result further includes audio data of the file to be loaded:
acquiring a video playing track of the video data in the animation clip file and an audio playing track of the audio data;
the audio data is added to the animation clip file based on the alignment result of the video play track and the audio play track.
7. The method of any of claims 1-6, wherein the target type comprises a VRM data format type.
8. An apparatus for importing a file, comprising:
the acquisition module is configured to acquire a file to be loaded aiming at the Unity engine;
the unpacking module is configured to unpack the file to be loaded to obtain a unpacking result if the file type of the file to be loaded is a target type, wherein the unpacking result at least comprises video data of the file to be loaded;
a generation module configured to generate an animation clip file based on the decapsulation result; and
and the importing module is configured to import the animation clip file to the Unity engine so that the Unity engine can execute the file to be loaded instead of executing the animation clip file.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
10. A computer readable medium having stored thereon computer program instructions executable by a processor to implement the method of any of claims 1 to 7.
CN202311651679.6A 2023-12-04 2023-12-04 Method, device, electronic equipment and computer readable medium for importing files Pending CN117873972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311651679.6A CN117873972A (en) 2023-12-04 2023-12-04 Method, device, electronic equipment and computer readable medium for importing files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311651679.6A CN117873972A (en) 2023-12-04 2023-12-04 Method, device, electronic equipment and computer readable medium for importing files

Publications (1)

Publication Number Publication Date
CN117873972A true CN117873972A (en) 2024-04-12

Family

ID=90581959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311651679.6A Pending CN117873972A (en) 2023-12-04 2023-12-04 Method, device, electronic equipment and computer readable medium for importing files

Country Status (1)

Country Link
CN (1) CN117873972A (en)

Similar Documents

Publication Publication Date Title
CN107832108B (en) Rendering method and device of 3D canvas webpage elements and electronic equipment
CN107393013B (en) Virtual roaming file generation and display method, device, medium, equipment and system
CN111669623B (en) Video special effect processing method and device and electronic equipment
CN112235604B (en) Rendering method and device, computer readable storage medium and electronic device
EP3311565B1 (en) Low latency application streaming using temporal frame transformation
CN110968395B (en) Method for processing rendering instruction in simulator and mobile terminal
Zorrilla et al. HTML5-based system for interoperable 3D digital home applications
EP4088193A1 (en) Method and apparatus for media scene description
CN112700519A (en) Animation display method and device, electronic equipment and computer readable storage medium
CN114866801B (en) Video data processing method, device, equipment and computer readable storage medium
CN110719493A (en) Barrage display method and device, electronic equipment and readable storage medium
CN117873972A (en) Method, device, electronic equipment and computer readable medium for importing files
US11797475B2 (en) Method and apparatus for media scene description
CN116962807A (en) Video rendering method, device, equipment and storage medium
CN114281773A (en) Animation display method and device, electronic equipment and computer readable storage medium
CN117065357A (en) Media data processing method, device, computer equipment and storage medium
US10917679B2 (en) Video recording of a display device
CN115174993B (en) Method, apparatus, device and storage medium for video production
CN113082720A (en) Prompt message determination method and device and electronic equipment
CN115643462B (en) Interactive animation display method and device, computer equipment and storage medium
US20240111496A1 (en) Method for running instance, computer device, and storage medium
CN112988276B (en) Resource package generation method and device, electronic equipment and storage medium
CN116055540B (en) Virtual content display system, method, apparatus and computer readable medium
CN117097933A (en) Method, apparatus, device and computer readable medium for generating video
CN116915976A (en) Method, apparatus, device and computer readable medium for testing platform

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