Preview method and device of FBX media file, electronic equipment and storage medium

CN115828843BActive Publication Date: 2026-08-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

由于DCC软件制作的文件格式特殊,通常需要特定的DCC软件才能打开对应文件格式的媒体文件,但是,由于DCC软件的功能庞大,打开文件所耗费的时间长,在仅需预览文件的情况下,等待时间拉长了媒体的制作周期

Benefits of technology

[0010]上述FBX媒体文件的预览方法、装置、电子设备和存储介质,响应于FBX媒体文件的预览指令,对所述FBX媒体文件进行数据修正和格式转换,得到图形语言传输格式的第一媒体文件;对所述第一媒体文件的骨骼节点进行动画曲线平滑处理,得到第二媒体文件;基于所述第二媒体文件的骨骼节点信息进行骨架重构,得到目标媒体文件;在网页页面中渲染所述目标媒体文件,并在渲染的过程中,基于所述目标媒体文件的类型,确定目标相机位置参数;基于所述目标相机位置参数,在所述网页页面显示所述目标媒体文件。该方法中,首先对FBX媒体文件进行修正和格式转换,得到标准化的读取更快速图形语言传输格式文件,再对骨骼节点进行平滑处理,能够避免骨骼节点错误导致骨骼异常抖动的问题。接着,再进行骨架重构,能够避免蒙皮错乱的问题,通过相机位置参数的重确定,能够避免文件内容失焦产生的场景空白错觉,并且在网页页面中预览能够提升预览的效率,使得FBX媒体文件的预览效果在多方面得以提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115828843B_ABST
    Figure CN115828843B_ABST
Patent Text Reader

Abstract

This invention provides a preview method, apparatus, electronic device, and storage medium for FBX media files. The method includes: responding to a preview command for an FBX media file, performing data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; performing animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; reconstructing the skeleton based on the skeletal node information of the second media file to obtain a target media file; rendering the target media file on a webpage, and during the rendering process, determining target camera position parameters based on the type of the target media file; and displaying the target media file on the webpage based on the target camera position parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of file preview technology, and in particular to a method, apparatus, electronic device, and storage medium for previewing FBX media files. Background Technology

[0002] Digital Content Creation (DCC) software is commonly used for creating digital art assets, such as 3ds Max, Maya, MotionBuilder, Houdini, and Blender. Because DCC software creates files in specific formats, dedicated DCC software is usually required to open these media files. However, due to the extensive functionality of DCC software, opening files takes a long time, which, when only a preview is needed, lengthens the media production cycle.

[0003] Existing preview technologies typically parse and render files directly using OpenGL (Open Graphics Library) and DirectX (Direct eXtension), or WebGL (Web Graphics Library). While these technologies offer improved file opening efficiency compared to DCC software, they cannot achieve preview effects comparable to DCC. Issues include distortion, misaligned skeleton skinning, blank scenes, and animation anomalies. Clearly, existing preview technologies suffer from poor preview quality. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a preview method, apparatus, electronic device and storage medium for FBX media files to improve the preview effect of FBX media files.

[0005] In a first aspect, embodiments of the present invention provide a preview method for FBX media files, the method comprising: responding to a preview command for an FBX media file, performing data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; performing animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; performing skeleton reconstruction based on the skeletal node information of the second media file to obtain a target media file; rendering the target media file on a webpage, and during the rendering process, determining target camera position parameters based on the type of the target media file; and displaying the target media file on the webpage based on the target camera position parameters.

[0006] Secondly, embodiments of the present invention provide a preview device for FBX media files. The device includes: a response module, configured to respond to a preview command for an FBX media file, perform data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; a smoothing module, configured to perform animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; a reconstruction module, configured to perform skeleton reconstruction based on the skeletal node information of the second media file to obtain a target media file; a rendering module, configured to render the target media file on a webpage, and during the rendering process, determine target camera position parameters based on the type of the target media file; and a display module, configured to display the target media file on the webpage based on the target camera position parameters.

[0007] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described preview method for FBX media files.

[0008] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described preview method for FBX media files.

[0009] The embodiments of the present invention bring the following beneficial effects:

[0010] The aforementioned preview method, apparatus, electronic device, and storage medium for FBX media files, in response to a preview command for an FBX media file, perform data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; perform animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; perform skeleton reconstruction based on the skeletal node information of the second media file to obtain a target media file; render the target media file on a webpage, and during the rendering process, determine the target camera position parameters based on the type of the target media file; and display the target media file on the webpage based on the target camera position parameters. In this method, firstly, the FBX media file is corrected and converted to obtain a standardized graphical language transmission format file that is easier to read; then, the skeletal nodes are smoothed to avoid abnormal skeletal jitter caused by errors in the skeletal nodes. Next, skeleton reconstruction is performed to avoid skinning errors; the re-determination of camera position parameters avoids the illusion of scene blankness caused by out-of-focus file content; and previewing on a webpage improves preview efficiency, thus enhancing the preview effect of FBX media files in multiple ways.

[0011] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0014] Figure 1 This is a flowchart of one embodiment of the preview method for FBX media files in this invention;

[0015] Figure 2 This is a flowchart of another embodiment of the preview method for FBX media files in this invention;

[0016] Figure 3 A schematic diagram of a preview device for FBX media files provided in an embodiment of the present invention;

[0017] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the preview method for FBX media files in this invention includes:

[0020] Step S10: In response to the preview command of the FBX media file, perform data correction and format conversion on the FBX media file to obtain the first media file in the graphics language transmission format;

[0021] In one embodiment, before step S10, the method further includes converting the art resource file to be previewed into FBX format to obtain an FBX media file. The art resource file refers to a file created by DCC software. This invention can preview files created by any DCC software, such as 3ds Max (i.e., 3D Studio Max), Maya (i.e., Autodesk Maya), MotionBuilder (i.e., Autodesk MotionBuilder), Houdini, and Blender. DCC software can create and generate files containing different art resource elements, including but not limited to skeletons, skins, skinning, textures, and animations. Therefore, a file created by DCC (i.e., an art resource file) can contain one or any combination of the above-mentioned art resource elements. For example, based on whether the art resource elements of the file contain animation, the type of art resource file can be divided into animated model files and static model files; based on whether the art resource elements of the file only contain skeletons, the type of art resource file can be divided into pure skeleton files and non-pure skeleton files. In one embodiment, the art resource file is used to indicate a two-dimensional or three-dimensional model file created by DCC software, which is commonly referred to as a file generated by modeling using DCC software.

[0022] It should be noted that different DCC software creates art resource files in various formats. For example, 3ds Max creates files in formats such as .max, .obj, and .fbx, while Houdini creates files in formats such as .hipnc, .hiplc, and .hip. Because art resource file formats are specific and diverse, before step S10, the format of the art resource file to be previewed is converted to a universal file format, resulting in an FBX media file. This universal file format is one that supports different DCC software; specifically, it is the FBX format. FBX is an inherent file format of MotionBuilder (formerly FilmBox) software. FBX files can be imported and exported between different DCC software programs, sharing data and exhibiting strong versatility. This universal file format conversion standardizes the file preview process, thereby improving the efficiency and quality of file previews.

[0023] In one implementation, because the FBX media file format is relatively closed, which is not conducive to reading, writing, and processing, in order to improve the efficiency of file preview, in step S10, the FBX media file is modified and converted to Graphics Language Transmission Format (GLTF) according to the data specifications of the Graphics Language Transmission Format, thereby obtaining a first media file in GLTF format. In this implementation, since GLTF is a relatively open file format with fast read and write speeds, GLTF file format conversion can standardize the format of art resource files created by different DCC software, standardize the file preview processing flow, and thus improve the efficiency and effect of file preview.

[0024] In one implementation, step S10 includes: performing data correction and graphical language transmission format conversion on the FBX media file using a preset format conversion tool to obtain a first media file in graphical language transmission format. Specifically, the FBX media file is parsed, then a unified coordinate system and unified unit conversion is performed, and finally, the first media file is generated according to the graphical language transmission format specification. This results in an open graphical language transmission format file with faster read and write speeds, improving file preview efficiency and effects.

[0025] Step S20: Perform animation curve smoothing on the skeletal nodes of the first media file to obtain the second media file;

[0026] In one implementation, for media files with a large number of animation frames and complex animation curves, existing preview technologies suffer from unstable previews and abnormal bone jitter, resulting in a significant difference between the preview effect and the actual effect when opened in DCC software. Therefore, to eliminate this problem, the skeletal nodes of the first media file are subjected to animation curve smoothing processing to obtain the second media file. Specifically, the skeletal nodes of the first media file are smoothed using a preset animation curve smoothing algorithm to obtain the second media file.

[0027] In this step, to make the animation curves of the media file smoother and avoid abnormal jitter during preview caused by excessive frame rate, in one implementation, the curve data of each bone node in the first media file is first obtained, and then the curve data is smoothed using a preset weighted average algorithm to obtain the second media file. The curve data of each bone node can be obtained through the getTransform interface of the media file rendering script. Furthermore, to avoid the curve data being too smooth, the curve data is smoothed a preset number of times using a preset weighted average algorithm to obtain the second media file, for example, 15 times. The specific number of smoothing operations is not limited here.

[0028] Understandably, the curve data includes rotation, displacement, and scaling data of each bone node in each frame of animation, used to indicate the motion curve of the bone node. To smooth the animation curve of the bone nodes, the rotation data of each bone node in each frame of animation is stored as a quaternion, and a dot product operation is performed on the quaternion to obtain the dot product result. Illegal flipping data is then filtered based on the dot product result to obtain a filtered quaternion. This filtered quaternion is then subjected to animation curve smoothing to obtain the second media file. This implementation method uses dot product operations to remove some illegal data, improving the accuracy of animation curve smoothing and resulting in a smoother preview animation effect.

[0029] Step S30: Reconstruct the skeleton based on the skeletal node information of the second media file to obtain the target media file;

[0030] In this step, due to the diversity of bone types and the complexity of bone links, if bone nodes are not corrected, bone misalignment can easily occur during preview, leading to skinning errors and affecting the preview effect. Furthermore, during the creation of media files, creators typically define different types of bones, such as Biped and Bone bones in 3ds Max, and HumanIK and Adv bones in Maya. While using specific bone types can improve the artistic effect, the diversity of bone types and the complexity of links can easily lead to bone skinning errors during file parsing. Therefore, to address these issues, this step improves the preview effect through skeleton reconstruction. Skeleton reconstruction refers to reassigning the parent-child relationships of bone nodes and rebinding skinning information, which avoids problems arising from parsing based on bone type and improves the preview effect. In one implementation, step S30 includes: reconstructing the skeleton of the second media file based on the parent-child relationship information in the bone node information to obtain a new skeleton; and then skinning and binding the new skeleton based on the skinning information in the bone node information to obtain the target media file.

[0031] Understandably, because existing preview technologies do not specifically process skeletal nodes, problems such as animation jitter, overly dark scenes making objects unclear, jagged object edges, stale and distorted colors, and object deformation occur during previewing, resulting in poor preview quality, especially for media files with special skeletons and high animation frame rates. Therefore, to optimize the preview effect of FBX media files, this step includes: preprocessing the second media file by correcting its skeletal nodes to obtain the target media file. In one implementation, based on the skeleton type of the second media file, a skeletal node correction algorithm corresponding to the skeleton type is used to preprocess the second media file by correcting its skeletal nodes to obtain the target media file. Here, the skeleton type indicates whether the skeletal nodes belong to a special skeleton type, and a special skeleton type indicates a skeleton type other than the human skeleton type.

[0032] Step S40: Render the target media file on the webpage, and during the rendering process, determine the target camera position parameters based on the type of the target media file;

[0033] In this embodiment, to achieve better animation rendering effects quickly, the animation rendering is not performed directly through native WebGL. Instead, a pre-packaged media file rendering script written in a web scripting language is used to render the target media file. Here, the web scripting language refers to JavaScript (JS), a lightweight, interpreted or just-in-time compiled programming language that supports browser environments and prioritizes functions. Media file rendering scripts used to render the target media file include 3D rendering frameworks such as Three.js, Layabox.js, Scene.js, and Thing.js. In one embodiment, the media file rendering script is a third-party WebGL library written in JS.

[0034] In one implementation, a media file rendering script sequentially initializes the target media file, adapts the page window, initializes the lighting, initializes the camera, loads the model, and updates the current animation to display the target media file on the webpage. In this implementation, during the rendering process—that is, after camera initialization and before model loading—the target camera position parameters are determined based on the type of the target media file. It is understood that the target media file contains original camera position parameters, which are inherent attributes of the FBX media file. For most FBX media files, the original camera position parameters are centered on the model, allowing the page to initially view the entire FBX media file from a suitable angle. However, for some types of FBX media files, the original camera position parameters may deviate during preview, causing the FBX media file to go out of focus and creating the illusion of a blank scene for the viewer, affecting the preview effect. Therefore, for these types of FBX media files, the camera position parameters are recalculated during camera initialization to obtain the target camera position parameters, allowing the media file to be re-focused, thereby improving the preview experience.

[0035] Based on the above, during the rendering process, the type of the target media file is first obtained. If the target media file is of a preset target type, the camera position parameters of the target media file are recalculated to obtain the target camera position parameters. Specifically, recalculating the camera position parameters of the target media file includes: constructing the minimum bounding box of the target media file based on the position information of all skeletal nodes in the first frame of the target media file, and determining the target camera position parameters based on the radius and center position of the minimum bounding box; wherein, the target camera position parameters include the camera position and the camera orientation. This implementation can re-aggregate media files of specific types, thereby improving the preview experience of FBX media files.

[0036] Step S50: Based on the target camera position parameters, display the target media file on the webpage.

[0037] In one implementation, after determining the target camera position parameters, the target media file is rendered using a media file rendering script and then displayed on a webpage. It should be noted that the webpage runs in a browser. To improve the preview effect of the FBX media file, the browser functionality of the target application is developed using the QWebEngineView application development framework, and the webpage displaying the target media file is then achieved through the browser within the target application. Here, the application development framework refers to the cross-platform C++ graphical user interface application development framework Qt. This implementation enables the media file to be displayed in a cross-platform application with improved display quality.

[0038] The preview method for FBX media files provided in the above embodiments first corrects and converts the FBX media file to obtain a standardized graphics language transmission format file that is easier to read. Then, it smooths the skeletal nodes to avoid abnormal skeletal jitter caused by errors in the skeletal nodes. Next, it reconstructs the skeleton to avoid skinning errors. By re-determining the camera position parameters, it avoids the illusion of a blank scene caused by out-of-focus file content. Furthermore, previewing on a web page improves preview efficiency, thus enhancing the preview effect of FBX media files in multiple ways.

[0039] Please see Figure 2 Another embodiment of the preview method for FBX media files in this invention includes:

[0040] Step S201: In response to the preview command of the FBX media file, perform data correction and format conversion on the FBX media file to obtain the first media file in the graphics language transmission format;

[0041] Specifically, step S201 includes: responding to the preview command of the FBX media file, performing a unified conversion of the coordinate system, units, and texture file format of the FBX media file, and converting it into corrected data in the original data structure format; converting the corrected data into a graphics language transmission format to obtain the first media file. In this embodiment, different DCC software has different file standards, and the content of FBX media files obtained by converting files created by different DCC software will naturally be different. Therefore, in order to achieve the same standard, the coordinate system, units, and texture file format of the FBX media file are uniformly converted to obtain data of the same standard. For example, the coordinate system is uniformly converted to the MayaUp coordinate system, the units are uniformly converted to centimeters, and the texture file format is uniformly converted to DDS, etc., and the specifics are not limited here. Next, the data of the same standard is assembled into corrected data in RawData format, and finally the corrected data in RawData format is converted into GLTF format file according to the GLTF format specification to obtain the first media file.

[0042] Step S202: Perform animation curve smoothing on the skeletal nodes of the first media file to obtain the second media file;

[0043] Specifically, step S202 includes: determining whether the first media file is a motion capture file based on the number of animation frames in the first media file; a motion capture file is used to indicate a media file obtained through motion capture of a real person; if the first media file is a motion capture file, then the skeletal nodes of the first media file are subjected to animation curve smoothing processing to obtain a second media file. It is understood that motion capture (Mocap) is a technology for recording and processing the movements of real people or other objects, and a motion capture file refers to a media file obtained through this technology. Typically, due to the characteristics of motion capture technology, motion capture files have more frames than non-motion capture files, resulting in more complex animation curves and a greater likelihood of animation jitter during preview. Therefore, smoothing the animation curves is more effective for motion capture files. In this embodiment, after obtaining the number of animation frames in the first media file, it is determined whether the number of animation frames is greater than a preset frame count threshold to determine whether the first media file is a motion capture file. If the number of animation frames is greater than the preset frame count threshold, the first media file is determined to be a motion capture file, and only the skeletal nodes of the motion capture file are subjected to animation curve smoothing processing to obtain a second media file. This implementation method can smooth the animation curves of motion-captured files that are more prone to animation jitter, while other non-motion-captured files do not need to undergo animation curve smoothing. This makes the preview processing of FBX media files more targeted, improving both the preview effect and preview efficiency.

[0044] Furthermore, step S202 also includes: storing the rotation data of each bone node in the first media file as a quaternion; the quaternion is used to indicate the rotation data of each bone node in the curve data of the first media file in each frame of animation; performing weighted average and interpolation calculations on the quaternion to obtain a second media file with a smooth animation curve. It is understood that, in order to reduce the error caused by the weighted average algorithm, this embodiment combines weighted average with interpolation calculations to obtain a media file with a more ideal smoothing result, resulting in a better preview effect. In this embodiment, the rotation data of each bone node in the curve data of the first media file in each frame of animation is first stored as a quaternion, such as (x, y, z, w), where x, y, and z are the position coordinates of the bone node, and w is the rotation angle of the bone node; the specific value is not limited here. Next, a weighted average is calculated for the quaternions of the same bone node in adjacent frames to obtain a weighted average result. Then, the weighted average result is interpolated with the corresponding quaternion to complete one round of weighted averaging and interpolation calculations. After a preset number of weighted averaging and interpolation calculations, a second media file with a smoothed animation curve is obtained. It should be noted that the interpolation calculation can be linear interpolation (Lerp), smooth step interpolation, normalized linear interpolation (NLerp), or spherical linear interpolation (Slerp), etc., and the specific method is not limited here.

[0045] Specifically, the process of performing weighted averaging and interpolation on quaternions to obtain a second media file with a smoothed animation curve includes: determining whether the quaternions meet preset filtering conditions; if the quaternions do not meet the preset filtering conditions, performing weighted averaging on the quaternions of adjacent frames of the same bone node to obtain a weighted average result corresponding to each group of adjacent frame quaternions; and performing spherical linear interpolation on the weighted average result corresponding to each group of adjacent frame quaternions until the preset smoothing conditions are met, thus obtaining a second media file with a smoothed animation curve. In this embodiment, to avoid errors in animation curve smoothing caused by illegal quaternions and to avoid overly smoothed animation curves, before performing weighted averaging and interpolation on the quaternions, it is first determined whether the quaternions meet the preset filtering conditions. In one embodiment, the preset filtering conditions are used to indicate that the quaternions are valid data and the smoothness is less than the preset smoothness. If the quaternions meet the preset filtering conditions, weighted averaging and spherical linear interpolation are performed on the quaternions until a preset smoothing condition is met. The preset smoothing condition can indicate that the spherical linear interpolation result is less than a preset smoothing threshold, whether each quaternion meets the preset smoothing condition, or other conditions that determine whether the animation curve is smooth. In one implementation, the preset smoothing condition indicates whether a preset number of weighted averaging and spherical linear interpolation calculations have been completed. This means that a weighted average is performed on the quaternions of adjacent frames of the same bone node to obtain the weighted average result corresponding to each group of adjacent frame quaternions. Spherical linear interpolation is then performed on the weighted average result corresponding to each group of adjacent frame quaternions, which is considered as completing one weighted averaging and spherical linear interpolation calculation. Once a preset number of weighted averaging and spherical linear interpolation calculations have been completed, the preset smoothing condition is met. For example, after 15 weighted averaging and spherical linear interpolation calculations, the preset smoothing condition is met, resulting in a second media file with a smooth animation curve. This implementation method can avoid over-smoothing of animation curves and obtain ideal smoothing results, thereby avoiding animation jitter during preview and improving the preview effect.

[0046] Specifically, determining whether a quaternion meets the preset filtering conditions includes: performing a dot product operation on each target quaternion with other quaternions to obtain a first operation result for each target quaternion; the target quaternion is used to indicate one of all quaternions; the other quaternions are used to indicate quaternions other than the target quaternion among all quaternions; the first operation result is used to indicate whether the corresponding target quaternion is flipped; if the target quaternion is flipped, the vector of the target quaternion is inverted to obtain an unflipped quaternion; the first four vectors of the unflipped quaternion are multiplied to obtain a second operation result; the second operation result is used to indicate whether the quaternion is smooth; and the quaternion is determined to meet the preset filtering conditions based on the second operation result. In this embodiment, the validity of a quaternion is determined by whether it is flipped. Specifically, each target quaternion is multiplied by other quaternions to obtain a first operation result for each target quaternion. For example, if all quaternions include A, B, C, and D, then A is multiplied by B, C, and D to obtain the first operation result for A; B is multiplied by A, C, and D to obtain the first operation result for B; C is multiplied by A, B, and D to obtain the first operation result for C; and D is multiplied by A, B, and C to obtain the first operation result for D. Then, the first operation result for each target quaternion is used to determine whether the corresponding target quaternion is flipped. For example, the first operation result for A is used to determine whether A is flipped. In one embodiment, if the first operation result is less than 0, the corresponding target quaternion is determined to be flipped; if the first operation result is greater than or equal to 0, the corresponding target quaternion is determined not to be flipped. It is understandable that if the corresponding target quaternion is flipped, then the vector of each flipped target quaternion is inverted one by one until all flipped target quaternions are no longer flipped, thus obtaining a non-flipped quaternion. That is, a non-flipped quaternion means that all quaternions are not flipped. Here, vector inversion means transposing the quaternion.

[0047] In this embodiment, after ensuring all quaternions are unflipped, to determine whether each quaternion is smooth and to avoid overly smoothed animation curves affecting the preview effect, a dot product operation is performed on the first four vectors of each unflipped quaternion to obtain the second operation result corresponding to each quaternion. It can be understood that, assuming the quaternion is (x, y, z, w), the dot product operation of the first four vectors is x*x + y*y + z*z + w*w, and the resulting value is the second operation result corresponding to that quaternion. Based on this second operation result, it can be determined whether each quaternion is smooth, that is, whether each quaternion meets the preset filtering conditions. In one embodiment, it can be directly determined whether the second operation result is greater than a preset smoothing threshold to determine whether the quaternion meets the preset filtering conditions. If the second operation result is greater than the preset smoothing threshold, then the quaternion is determined to meet the preset filtering conditions. Alternatively, further mathematical operations can be performed on the second operation result, and the quaternion can be determined to meet the preset filtering conditions based on the mathematical operation result. For example, the second operation result can be square rooted, multiplied by a decimal, or divided by an integer to obtain the mathematical operation result. In one implementation, the quaternion is determined to meet the preset filtering conditions by judging whether the result of the mathematical operation is greater than a preset smoothing threshold.

[0048] Step S203: Reconstruct the skeleton based on the skeletal node information of the second media file to obtain the target media file.

[0049] Specifically, step S203 includes: reading the hierarchical information from the skeletal node information of the second media file; the skeletal node information includes the hierarchical information and skinning information of each skeletal node; traversing the hierarchical information of each skeletal node, and creating new bones during the traversal to obtain a new skeleton; synchronizing the skinning information of each skeletal node to the corresponding bones of the new skeleton to obtain the target media file. It can be understood that the skeletal node information includes the hierarchical information and skinning information of the skeletal nodes. The hierarchical information is used to indicate the parent-child relationship of the skeletal nodes. The skeletal nodes are traversed according to the hierarchical information, and during the traversal, a new bone corresponding to each skeletal node is created. After all skeletal nodes have been traversed, the skeleton construction is completed, a new skeleton is obtained, and then the skinning information of each skeletal node is bound to the corresponding new bone to obtain the target media file. In one implementation, the skeletal node information also includes other information related to the skeletal nodes besides hierarchical and skinning information, such as the position, rotation, and scaling of each skeletal node. Therefore, after obtaining the new skeleton, the skinning information and related information of each skeletal node are synchronized to the corresponding bones of the new skeleton to obtain the target media file. This implementation avoids the problems of skeletal and skinning misalignment caused by parsing based on bone type, thereby improving the preview effect.

[0050] Step S204: Read the original camera position parameters of the target media file and construct the initial bounding box using the original camera position parameters;

[0051] In this step, since the target media file contains built-in camera position parameters (i.e., raw camera position parameters), these parameters can be directly read from the target media file through the media file rendering script interface. Based on these raw camera position parameters, a bounding box is constructed through the media file rendering script interface to obtain the initial bounding box. The camera position parameters (including the raw camera position parameters and the target camera position parameters) are used to indicate the camera's LookAt matrix (i.e., the observation matrix).

[0052] Step S205: Determine whether the target media file is a pure skeleton file based on the node type of the target media file; a pure skeleton file is used to indicate a media file whose node type only contains the skeleton type.

[0053] It is understandable that although the target media file contains camera position parameters, for pure skeletal media files, the bone position information read during preview parsing is usually local coordinates, not global coordinates. This can lead to incorrect aggregation when previewing pure skeletal files, giving users the illusion of a blank scene. Therefore, for target media files of the pure skeletal type, it is necessary to verify whether the original camera position parameters are correct and reset any incorrect original camera position parameters to ensure that the pure skeletal file can be correctly aggregated, thus improving the preview effect. In this embodiment, the type of the target media file is determined by the node type of the target media file. It is understood that node types include bone type and mesh type. Specifically, the node types of the target media file are traversed to obtain the node type corresponding to each node, and it is determined whether all nodes contain nodes with the mesh type. If all nodes contain nodes with the mesh type, the target media file is determined to be a non-pure skeletal file; if all nodes do not contain nodes with the mesh type, the target media file is determined to be a pure skeletal file.

[0054] Step S206: If the target media file is a pure skeleton file, the initial bounding box is verified and reset to obtain the minimum bounding box, and the target camera position parameters are calculated based on the minimum bounding box.

[0055] Understandably, if the target media file is a pure skeleton file, then it is necessary to verify whether the original camera position parameters are correct. Specifically, it is necessary to verify whether the radius and center position of the initial bounding box are correct. If the radius and center position of the initial bounding box are incorrect, then the target media file is reconstructed to obtain the minimum bounding box, and the target camera position parameters are determined based on the radius and center position of the minimum bounding box.

[0056] In one implementation, if the target media file is a pure skeleton file, the bounding box of the target media file can be reset directly based on the position information of each skeleton node in the target media file to obtain the minimum bounding box, thereby eliminating the verification step and improving preview efficiency.

[0057] Specifically, the initial bounding box is verified and reset to obtain the minimum bounding box. This includes: determining the boundary values ​​of the target media file based on the position information of each skeletal node in the target media file; determining whether the initial bounding box is too large based on the boundary values; and if the initial bounding box is too large, recalculating it to obtain the minimum bounding box. In this embodiment, to verify whether the initial bounding box is correct and reasonable, the position information of all skeletal nodes in the target media file is traversed, and the maximum value in the position information is determined as the boundary value of the target media file. For example, if the position information includes coordinate values ​​on the x-axis, y-axis, and z-axis, then the maximum value on the x-axis, the maximum value on the y-axis, and the maximum value on the z-axis are combined to obtain the boundary value (x, y, z). In one embodiment, each coordinate value in the boundary value can be compared with the boundary value of the initial bounding box to determine whether the initial bounding box is too large. If any coordinate value in the boundary value is greater than the boundary value of the initial bounding box, then the initial bounding box is determined to be too large. In another implementation, determining whether the initial bounding box is too large based on boundary values ​​includes: calculating the radius of the target media file based on the boundary values; comparing the radius of the target media file with the radius of the initial bounding box; and determining whether the initial bounding box is too large based on the comparison result. In this implementation, the radius of the target media file is calculated based on the boundary values, and then the radius of the target media file is compared with the initial bounding box to determine whether the initial bounding box is too large. If the radius of the target media file is greater than the initial bounding box, it is determined that the initial bounding box is too large; if the radius of the target media file is less than or equal to the initial bounding box, it is determined that the initial bounding box is correct, and the initial bounding box is determined as the minimum bounding box of the target media file.

[0058] In this embodiment, if the initial bounding box is too large, the target media file is reconstructed to avoid the illusion of a blank scene, thus obtaining the minimum bounding box. Specifically, the radius and center position of the target media file can be calculated based on its boundary values ​​to obtain the minimum bounding box.

[0059] Furthermore, the excessively large initial bounding box is recalculated to obtain the minimum bounding box. This includes: acquiring information from any frame in the curve data of the target media file; the information from any frame includes the position information of each skeletal node in the corresponding frame; determining the maximum and minimum values ​​of the skeletal node positions based on the position information; and calculating the minimum bounding box of the target media file based on the maximum and minimum values. In this embodiment, to avoid the increased computational load and reduced preview speed caused by directly calculating the minimum bounding box from the curve data, and to avoid the inability to calculate the bounding box for some media files without curve data, this embodiment does not directly calculate the minimum bounding box from the curve data. Instead, it extracts any frame from the curve data and calculates the minimum bounding box of the target media file using the skeletal position information of each skeletal node in that frame. The information from any frame includes the skeletal position information of any frame in the curve data, such as the first frame, the last frame, the nth frame, etc. Based on the position information of each skeletal node in any frame, the maximum and minimum values ​​of the skeletal node positions can be determined. Finally, the minimum bounding box of the target media file can be calculated based on the maximum and minimum values. For example, assuming the maximum values ​​of the skeletal node positions are Xmax, Ymax, and Zmax, and the minimum values ​​are Xmin, Ymin, and Zmin, then the radius of the bounding box is max((Xmax-Xmin) / 2,(Ymax-Ymin) / 2,(Zmax-Zmin) / 2), and the center position of the bounding box is ((Xmin+Xmax),(Ymin+Ymax),(Zmax+Zmin)). The specific values ​​are not limited here.

[0060] Step S207: If the target media file is a non-pure skeleton file, then determine the initial bounding box as the minimum bounding box and the original camera position parameters as the target camera position parameters.

[0061] In this step, for target media files that are not pure skeleton files, the initial bounding box is directly determined as the minimum bounding box, and the original camera position parameters are determined as the target camera position parameters.

[0062] Understandably, to improve the preview experience, this invention can also integrate some basic functions into the webpage, such as animated image generation, drag-and-drop functionality, static model splitting functionality, and perspective transformation functionality. The following describes one implementation of the animated image generation and static model splitting functions. After step S50 above, the animated image generation and static model splitting functions can be triggered respectively:

[0063] (1) The animation generation function includes: responding to the animation generation command of the target media file from the target perspective, generating and downloading the animation of the target media file based on the communication mechanism between the target application and the browser, and obtaining the target animation from the target perspective; the browser is used to display the information web page; the browser is embedded in the target application.

[0064] Understandably, to facilitate the demonstration of resource effects, most animators use animated GIFs to showcase their animations. Users can trigger GIF generation commands through the GIF generation control on the webpage. If no generation perspective is specified, the target perspective is the default perspective, such as directly in front. Since the webpage is displayed in a browser, and the browser is integrated into the target application, based on the communication mechanism between the target application and the browser, animated GIFs can be generated and downloaded from the target media file, thus obtaining the target animated GIF from the target perspective. This implementation method allows obtaining the desired GIF without opening DCC software or through complex settings, improving the preview experience.

[0065] In one implementation, generating and downloading a target media file to obtain a target animated image from the target perspective includes: reading the animation frame rate of the target media file, creating an animated image container based on the animation frame rate using a preset animated image generation script, and playing a preset number of animation frames from the target media file within the animated image container; adding all animation frames from the target media file back into the animated image container to obtain the target animated image from the target perspective; setting the resource download path through the browser's kernel, and downloading the generated target animated image from the target perspective to the resource download path. In this implementation, due to differences in device performance, directly adding all animation frames to the animated image container may cause abnormalities in a certain number of frames, such as a black screen in the first 20 frames, affecting the final generated GIF effect. Therefore, this implementation first plays a preset number of animation frames in the animated image container, then clears the animation frames in the animated image container, and then replays all the animation frames in the animated image container to obtain a stable and normal target animated image. In this embodiment, to improve the efficiency of animated GIF generation, after generating the animated GIF from the target perspective using a preset animated GIF generation script, such as gif.js, a resource download path is set based on QWebEngineView (i.e., the browser's kernel) in the application development framework. This resource download path is used to save the generated target animated GIF. In one embodiment, after downloading the generated target animated GIF from the target perspective to the resource download path, a folder window of the resource download path can be opened via a system interface for the user to view the target animated GIF.

[0066] In one implementation, the target viewpoint includes multiple preset viewpoints. The process involves generating and downloading a target media file to obtain a target animated image for each preset viewpoint. This includes: creating a rendering task corresponding to each preset viewpoint and adding the rendering task to a preset rendering queue; each rendering task includes a resource download address and viewpoint parameters corresponding to the preset viewpoint; encapsulating command-line parameters for each rendering task in the preset rendering queue to obtain the command-line parameters corresponding to each rendering task; and starting the rendering process corresponding to each command-line parameter via a sub-thread to obtain the target animated image for each preset viewpoint. It is understood that users can also specify multiple viewpoints for the animated image to be generated, such as 45°, 60°, 180°, etc., through the animated image generation control on the webpage. That is, the target viewpoint can include multiple preset viewpoints, and when generating and downloading animated images for multiple preset viewpoints, the rendering tasks can be executed in parallel using a multi-threaded task execution method. Specifically, firstly, a rendering task corresponding to each preset viewpoint is created. Each rendering task contains the corresponding resource download address and the viewpoint parameters of the corresponding preset viewpoint, such as 45°, 60°, 180°, etc. Next, the rendering tasks are added to the preset rendering queue in sequence. When the preset rendering queue is not empty, the rendering tasks are dequeued in the order of enqueueing. The task to be performed by the rendering task is to encapsulate the corresponding resource download address and the viewpoint parameters of the corresponding preset viewpoint into a command line, and start a sub-thread to execute the command line, thereby completing the rendering process of dynamic image generation through the sub-thread and obtaining the target dynamic image for each preset viewpoint.

[0067] (2) The static model splitting function includes: responding to the drag command of any target sub-model in the target media file, splitting the target media file into multiple sub-models; the multiple sub-models include the target sub-model; the drag command is used to instruct the target sub-model to be dragged away from the web page; the application to which the target sub-model is dragged is identified through the window handle; if the application to which the target sub-model is dragged is digital content generation software, the target sub-model is opened in the application.

[0068] Understandably, for resource organization, artists often place multiple similar static models in a single resource file, but only need one for use. While opening DCC software and saving one model as a new resource file is feasible, it's extremely time-consuming. Therefore, the static model splitting function allows you to extract the required sub-model while previewing, and then open the split sub-model with DCC software, greatly simplifying media file creation. This implementation uses a drag-and-drop sub-model method to determine the sub-model to be split and the application it will be applied to. Specifically, in response to a drag command for any target sub-model in the target media file, the target media file is split into multiple sub-models, each containing the target sub-model. Then, the application corresponding to the dragged position of the target sub-model is monitored via the window handle. If the application corresponding to the dragged position is DCC software, then the target sub-model is opened in DCC software. The window handle is a reference to an internal system data structure. For example, when you manipulate a window, or a form, the system will give you a handle to that window and issue a notification: window number 142 is being manipulated. The application can then request the system to perform operations on window number 142—moving the window, changing the window size, minimizing the window, and so on.

[0069] In one implementation, a target media file is split into multiple sub-models, including: determining at least one segmentation node based on the node hierarchy information of the target media file; the segmentation node indicates the next level node of the root node in the target media file; traversing the segmentation nodes, and during the traversal, deleting segmentation nodes other than the current segmentation node, and saving the target media file after deleting the segmentation nodes as a sub-model file, resulting in multiple sub-models; each sub-model includes a segmentation node and all child nodes under the segmentation node. In this implementation, the sub-model relationship of the target media file is first analyzed based on the node hierarchy information of the target media file to determine at least one segmentation node. Since most media files distinguish different sub-models by first-level nodes, each sub-model is located first by traversing the first-level nodes (i.e., the next level node of the root node), and the first node is determined as the segmentation node, used as the segmentation point for subsequent sub-model splitting. The split sub-models contain the corresponding segmentation node and all child nodes under the segmentation node. This implementation can accurately segment sub-models, especially for static sub-models, achieving better segmentation results. In this embodiment, to avoid issues such as skinning misalignment or positional misalignment after splitting complex sub-models, this solution does not generate sub-models by reconstructing them based on node hierarchy information. Instead, it regenerates the split resource files by deleting all nodes except the ones that are retained, thus obtaining each sub-model file (i.e., sub-model). Specifically, it deletes all segmentation nodes except the segmentation nodes and saves the target media file after deleting the segmentation nodes as a sub-model file, resulting in multiple sub-models. For example, assuming the segmentation nodes include A and B, and a1 and a2 are child nodes of A, and b1 and b2 are child nodes of B, then deleting all segmentation nodes except A means deleting both B and B's child nodes b1 and b2, resulting in a sub-model containing A and A's child nodes a1 and a2. This embodiment avoids the accidental deletion of scene-related information in the media file, which could lead to problems such as missing sub-models, skinning misalignment, or positional misalignment.

[0070] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 3The diagram illustrates a preview device for an FBX media file. The device includes: a response module 30, configured to, in response to a preview command for the FBX media file, perform data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; a smoothing module 32, configured to perform animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; a reconstruction module 34, configured to perform skeleton reconstruction based on the skeletal node information of the second media file to obtain a target media file; a rendering module 36, configured to render the target media file on a webpage, and during the rendering process, determine target camera position parameters based on the type of the target media file; and a display module 38, configured to display the target media file on the webpage based on the target camera position parameters.

[0071] The aforementioned preview device for FBX media files first corrects and converts the FBX media files to obtain a standardized, faster-reading graphics language transmission format. Then, it smooths the skeletal nodes to avoid abnormal skeletal jitter caused by errors in the skeletal nodes. Next, it reconstructs the skeleton to avoid skinning misalignment. By re-determining the camera position parameters, it avoids the illusion of a blank scene caused by out-of-focus file content. Furthermore, previewing on a webpage improves preview efficiency, thus enhancing the preview effect of FBX media files in multiple ways.

[0072] The aforementioned response module is also used to: respond to the preview command of the FBX media file, perform a unified conversion of the coordinate system, units, and texture file format of the FBX media file, and convert it into corrected data in the original data structure format; convert the corrected data into a graphics language transmission format to obtain the first media file.

[0073] The smoothing module described above is also used to: determine whether the first media file is a motion capture file based on the number of animation frames of the first media file; the motion capture file is used to indicate a media file obtained through motion capture of a real person; if the first media file is a motion capture file, then the skeletal nodes of the first media file are subjected to animation curve smoothing processing to obtain the second media file.

[0074] The smoothing module described above is also used to: store the rotation data of each bone node in the first media file as a quaternion; the quaternion is used to indicate the rotation data of each bone node in the curve data of the first media file in each frame of animation; and perform weighted average and interpolation calculations on the quaternion to obtain a second media file with smoothed animation curves.

[0075] The smoothing module described above is also used to: determine whether the quaternion meets the preset filtering conditions; if the quaternion does not meet the preset filtering conditions, then perform a weighted average of the quaternions of adjacent frames of the same bone node to obtain the weighted average result corresponding to each group of adjacent frame quaternions; perform spherical linear interpolation calculation with the weighted average result corresponding to each group of adjacent frame quaternions until the preset smoothing conditions are met, and obtain a second media file with smoothed animation curves.

[0076] The smoothing module described above is further configured to: perform a dot product operation on each target quaternion with other quaternions to obtain a first operation result corresponding to each target quaternion; the target quaternion is used to indicate one of all quaternions; the other quaternions are used to indicate quaternions other than the target quaternion among all quaternions; the first operation result is used to indicate whether the corresponding target quaternion is flipped; if the target quaternion is flipped, the vector of the target quaternion is inverted to obtain an unflipped quaternion; the dot product operation of the first four vectors of the unflipped quaternion is performed to obtain a second operation result; the second operation result is used to indicate whether the quaternion is smoothed; and determine whether the quaternion meets the preset filtering conditions based on the second operation result.

[0077] The aforementioned reconstruction module is also used to: read the hierarchical information in the skeletal node information of the second media file; the skeletal node information includes the hierarchical information and skinning information of each skeletal node; traverse the hierarchical information of each skeletal node, and create new bones during the traversal process to obtain a new skeleton; synchronize the skinning information of each skeletal node to the bones corresponding to the new skeleton to obtain the target media file.

[0078] The rendering module described above is also used to: read the original camera position parameters of the target media file and construct an initial bounding box using the original camera position parameters; determine whether the target media file is a pure skeleton file based on the node type of the target media file; a pure skeleton file is used to indicate a media file whose node type only contains skeleton types; if the target media file is a pure skeleton file, the initial bounding box is verified and reset to obtain a minimum bounding box, and the target camera position parameters are calculated based on the minimum bounding box; if the target media file is not a pure skeleton file, the initial bounding box is determined to be the minimum bounding box, and the original camera position parameters are determined to be the target camera position parameters.

[0079] The rendering module described above is also used to: determine the boundary values ​​of the target media file based on the position information of each skeletal node in the target media file; determine whether the initial bounding box is too large based on the boundary values; if the initial bounding box is too large, recalculate the excessively large initial bounding box to obtain the minimum bounding box.

[0080] The rendering module described above is also used to: obtain any frame information from the curve data of the target media file; any frame information includes the position information of each bone node in the corresponding frame; determine the maximum and minimum values ​​of the bone node positions based on the position information, and calculate the minimum bounding box of the target media file based on the maximum and minimum values.

[0081] The rendering module described above is also used to: calculate the radius of the target media file based on the boundary value; compare the radius of the target media file with the radius of the initial bounding box; and determine whether the initial bounding box is too large based on the comparison result.

[0082] The aforementioned device further includes: an animation generation module, used to: respond to the animation generation command of the target media file from the target perspective, and generate and download the animation of the target media file based on the communication mechanism between the target application and the browser to obtain the target animation from the target perspective; the browser is used to display the information web page; the browser is embedded in the target application.

[0083] The aforementioned animated GIF generation module is also used to: read the animation frame rate of the target media file, and based on the animation frame rate, create an animated GIF container using a preset animated GIF generation script, and play the animation frames of the target media file with a preset number of frames in the animated GIF container; add all the animation frames of the target media file back into the animated GIF container to obtain the target animated GIF from the target perspective; set the resource download path through the browser kernel, and download the generated target animated GIF from the target perspective to the resource download path.

[0084] The aforementioned animated GIF generation module is also used to: create rendering tasks corresponding to each preset viewpoint and add the rendering tasks to the preset rendering queue; each rendering task includes a resource download address and viewpoint parameters corresponding to the preset viewpoint; encapsulate command-line parameters for each rendering task in the preset rendering queue to obtain the command-line parameters corresponding to each rendering task, and start the rendering process corresponding to each command-line parameter through a sub-thread to obtain the target animated GIF for each preset viewpoint.

[0085] The aforementioned device further includes: a drag-and-drop module, configured to: in response to a drag-and-drop instruction for any target sub-model in the target media file, split the target media file into multiple sub-models; the multiple sub-models include the target sub-model; the drag-and-drop instruction is used to instruct the target sub-model to be dragged away from the webpage; identify the application to which the target sub-model is dragged through the window handle; if the application to which the target sub-model is dragged through is digital content generation software, then open the target sub-model in the application.

[0086] The drag-and-drop module described above is also used to: determine at least one segmentation node based on the node hierarchy information of the target media file; the segmentation node is used to indicate the next level node of the root node in the target media file; traverse the segmentation nodes, and during the traversal, delete the segmentation nodes other than the current segmentation node, and save the target media file after deleting the segmentation nodes as a sub-model file to obtain multiple sub-models; each sub-model includes a segmentation node and all child nodes under the segmentation node.

[0087] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described preview method for FBX media files. This electronic device can be a server or a terminal device.

[0088] See Figure 4 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described preview method for FBX media files.

[0089] Furthermore, Figure 4 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0090] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0091] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101. The processor 100 reads information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments, for example:

[0092] In response to the preview command for the FBX media file, the system performs data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; it then performs animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; based on the skeletal node information of the second media file, it performs skeleton reconstruction to obtain a target media file; the target media file is rendered on the webpage, and during the rendering process, the target camera position parameters are determined based on the type of the target media file; finally, the target media file is displayed on the webpage based on the target camera position parameters.

[0093] The aforementioned electronic device for previewing FBX media files first corrects and converts the FBX media files to a standardized format for faster reading and transmission of graphics language files. Then, it smooths the skeletal nodes to avoid abnormal skeletal jitter caused by errors in the skeletal nodes. Next, it reconstructs the skeleton to avoid skinning misalignment. By re-determining the camera position parameters, it avoids the illusion of a blank scene caused by out-of-focus file content. Furthermore, previewing in a web page improves preview efficiency, thus enhancing the preview effect of FBX media files in multiple ways.

[0094] The above-mentioned response to the preview command of the FBX media file, performing data correction and format conversion on the FBX media file to obtain a first media file in the graphics language transmission format, includes: responding to the preview command of the FBX media file, performing a unified conversion of the coordinate system, units and texture file format of the FBX media file, and converting it into corrected data in the original data structure format; converting the corrected data into the graphics language transmission format to obtain the first media file.

[0095] The above-mentioned process of smoothing the skeletal nodes of the first media file to obtain the second media file includes: determining whether the first media file is a motion capture file based on the number of animation frames of the first media file; the motion capture file is used to indicate a media file obtained through motion capture of a real person; if the first media file is a motion capture file, then the skeletal nodes of the first media file are smoothed to obtain the second media file.

[0096] The above-mentioned process of smoothing the animation curves of the skeletal nodes of the first media file to obtain the second media file includes: storing the rotation data of each skeletal node in the first media file as a quaternion; the quaternion is used to indicate the rotation data of each skeletal node in the curve data of the first media file in each frame of animation; and performing weighted average and interpolation calculations on the quaternion to obtain the second media file with smoothed animation curves.

[0097] The above-mentioned weighted averaging and interpolation calculation of quaternions to obtain a second media file with a smooth animation curve includes: determining whether the quaternions meet the preset filtering conditions; if the quaternions do not meet the preset filtering conditions, then performing a weighted average of the quaternions of adjacent frames of the same bone node to obtain the weighted average result corresponding to each group of adjacent frame quaternions; performing spherical linear interpolation calculation between the weighted average result corresponding to each group of adjacent frame quaternions and the corresponding group of adjacent frame quaternions until the preset smoothing conditions are met, thus obtaining a second media file with a smooth animation curve.

[0098] The above-mentioned determination of whether a quaternion meets the preset filtering conditions includes: performing a dot product operation on each target quaternion with other quaternions to obtain a first operation result corresponding to each target quaternion; the target quaternion is used to indicate one of all quaternions; the other quaternions are used to indicate quaternions other than the target quaternion among all quaternions; the first operation result is used to indicate whether the corresponding target quaternion is flipped; if the target quaternion is flipped, the target quaternion is inverted to obtain an unflipped quaternion; the unflipped quaternion is multiplied by the first four vectors to obtain a second operation result; the second operation result is used to indicate whether the quaternion is smooth; and the quaternion is determined to meet the preset filtering conditions based on the second operation result.

[0099] The above-mentioned skeleton reconstruction based on the skeletal node information of the second media file to obtain the target media file includes: reading the hierarchical information in the skeletal node information of the second media file; the skeletal node information includes the hierarchical information and skinning information of each skeletal node; traversing the hierarchical information of each skeletal node, and creating new bones during the traversal process to obtain a new skeleton; synchronizing the skinning information of each skeletal node to the corresponding bones of the new skeleton to obtain the target media file.

[0100] The above-mentioned determination of target camera position parameters based on the type of target media file includes: reading the original camera position parameters of the target media file and constructing an initial bounding box using the original camera position parameters; determining whether the target media file is a pure skeleton file based on the node type of the target media file; a pure skeleton file is used to indicate a media file whose node type only contains skeleton types; if the target media file is a pure skeleton file, the initial bounding box is verified and reset to obtain a minimum bounding box, and the target camera position parameters are calculated based on the minimum bounding box; if the target media file is not a pure skeleton file, the initial bounding box is determined to be the minimum bounding box, and the original camera position parameters are determined to be the target camera position parameters.

[0101] The above-mentioned verification and resetting of the initial bounding box to obtain the minimum bounding box includes: determining the boundary value of the target media file based on the position information of each skeletal node in the target media file; judging whether the initial bounding box is too large based on the boundary value; if the initial bounding box is too large, then recalculating the excessively large initial bounding box to obtain the minimum bounding box.

[0102] The above-mentioned recalculation of the excessively large initial bounding box to obtain the minimum bounding box includes: obtaining any frame information from the curve data of the target media file; any frame information includes the position information of each skeletal node in the corresponding frame; determining the maximum and minimum values ​​of the skeletal node positions based on the position information, and calculating the minimum bounding box of the target media file based on the maximum and minimum values.

[0103] The above-mentioned method of determining whether the initial bounding box is too large based on boundary values ​​includes: calculating the radius of the target media file based on the boundary values; comparing the radius of the target media file with the radius of the initial bounding box; and determining whether the initial bounding box is too large based on the comparison result.

[0104] After displaying the target media file on the webpage based on the target camera position parameters, the process further includes: responding to the animation generation command of the target media file from the target's perspective, generating and downloading the animation of the target media file based on the communication mechanism between the target application and the browser to obtain the target animation from the target's perspective; the browser is used to display the information webpage; the browser is embedded in the target application.

[0105] The above-mentioned process of generating and downloading a target animated image from the target media file to obtain a target animated image from the target perspective includes: reading the animation frame rate of the target media file, creating an animated image container based on the animation frame rate using a preset animated image generation script, and playing the animation frames from the target media file with a preset number of frames in the animated image container; adding all the animation frames from the target media file back into the animated image container to obtain the target animated image from the target perspective; setting the resource download path through the browser's kernel, and downloading the generated target animated image from the target perspective to the resource download path.

[0106] The aforementioned target perspective includes multiple preset perspectives; the aforementioned generation and downloading of dynamic images from the target media files to obtain the target dynamic images for the target perspectives includes: creating rendering tasks corresponding to each preset perspective and adding the rendering tasks to a preset rendering queue; each rendering task includes a resource download address and perspective parameters corresponding to the preset perspective; encapsulating command-line parameters for each rendering task in the preset rendering queue to obtain the command-line parameters corresponding to each rendering task, and starting the rendering process corresponding to each command-line parameter through a sub-thread to obtain the target dynamic image for each preset perspective.

[0107] After displaying the target media file on the webpage based on the target camera position parameters, the method further includes: responding to a drag command of any target sub-model in the target media file, splitting the target media file into multiple sub-models; the multiple sub-models include the target sub-model; the drag command instructs the target sub-model to be dragged away from the webpage; identifying the application to which the target sub-model is dragged through the window handle; if the application to which the target sub-model is dragged through is digital content generation software, then opening the target sub-model in the application.

[0108] The above-mentioned sub-model splitting of the target media file yields multiple sub-models, including: determining at least one segmentation node based on the node hierarchy information of the target media file; the segmentation node is used to indicate the next level node of the root node in the target media file; traversing the segmentation nodes, and during the traversal, deleting the segmentation nodes other than the current segmentation node, and saving the target media file after deleting the segmentation nodes as a sub-model file, thus obtaining multiple sub-models; each sub-model includes a segmentation node and all child nodes under the segmentation node.

[0109] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned preview method for FBX media files. For example:

[0110] In response to a preview command for an FBX media file, the system performs data correction and format conversion on the FBX media file to obtain a first media file in a graphical language transmission format; it then performs animation curve smoothing on the skeletal nodes of the first media file to obtain a second media file; based on the skeletal node information of the second media file, it performs skeleton reconstruction to obtain a target media file; the system renders the target media file on a webpage, and during the rendering process, it determines the target camera position parameters based on the type of the target media file; finally, it displays the target media file on the webpage based on the target camera position parameters.

[0111] The aforementioned preview storage medium for FBX media files first corrects and converts the FBX media files to a standardized, faster-reading graphics language transmission format. Then, it smooths the skeletal nodes to avoid abnormal skeletal jitter caused by errors in the skeletal nodes. Next, it reconstructs the skeleton to avoid skinning misalignment. By re-determining the camera position parameters, it avoids the illusion of a blank scene caused by out-of-focus file content. Furthermore, previewing in a web page improves preview efficiency, thus enhancing the preview effect of FBX media files in multiple ways.

[0112] The above-mentioned response to the preview command of the FBX media file, performing data correction and format conversion on the FBX media file to obtain a first media file in the graphics language transmission format, includes: responding to the preview command of the FBX media file, performing a unified conversion of the coordinate system, units and texture file format of the FBX media file, and converting it into corrected data in the original data structure format; converting the corrected data into the graphics language transmission format to obtain the first media file.

[0113] The above-mentioned process of smoothing the skeletal nodes of the first media file to obtain the second media file includes: determining whether the first media file is a motion capture file based on the number of animation frames of the first media file; the motion capture file is used to indicate a media file obtained through motion capture of a real person; if the first media file is a motion capture file, then the skeletal nodes of the first media file are smoothed to obtain the second media file.

[0114] The above-mentioned process of smoothing the animation curves of the skeletal nodes of the first media file to obtain the second media file includes: storing the rotation data of each skeletal node in the first media file as a quaternion; the quaternion is used to indicate the rotation data of each skeletal node in the curve data of the first media file in each frame of animation; and performing weighted average and interpolation calculations on the quaternion to obtain the second media file with smoothed animation curves.

[0115] The above-mentioned weighted averaging and interpolation calculation of quaternions to obtain a second media file with a smooth animation curve includes: determining whether the quaternions meet the preset filtering conditions; if the quaternions do not meet the preset filtering conditions, then performing a weighted average of the quaternions of adjacent frames of the same bone node to obtain the weighted average result corresponding to each group of adjacent frame quaternions; performing spherical linear interpolation calculation between the weighted average result corresponding to each group of adjacent frame quaternions and the corresponding group of adjacent frame quaternions until the preset smoothing conditions are met, thus obtaining a second media file with a smooth animation curve.

[0116] The above-mentioned determination of whether a quaternion meets the preset filtering conditions includes: performing a dot product operation on each target quaternion with other quaternions to obtain a first operation result corresponding to each target quaternion; the target quaternion is used to indicate one of all quaternions; the other quaternions are used to indicate quaternions other than the target quaternion among all quaternions; the first operation result is used to indicate whether the corresponding target quaternion is flipped; if the target quaternion is flipped, the target quaternion is inverted to obtain an unflipped quaternion; the unflipped quaternion is multiplied by the first four vectors to obtain a second operation result; the second operation result is used to indicate whether the quaternion is smooth; and the quaternion is determined to meet the preset filtering conditions based on the second operation result.

[0117] The above-mentioned skeleton reconstruction based on the skeletal node information of the second media file to obtain the target media file includes: reading the hierarchical information in the skeletal node information of the second media file; the skeletal node information includes the hierarchical information and skinning information of each skeletal node; traversing the hierarchical information of each skeletal node, and creating new bones during the traversal process to obtain a new skeleton; synchronizing the skinning information of each skeletal node to the corresponding bones of the new skeleton to obtain the target media file.

[0118] The above-mentioned determination of target camera position parameters based on the type of target media file includes: reading the original camera position parameters of the target media file and constructing an initial bounding box using the original camera position parameters; determining whether the target media file is a pure skeleton file based on the node type of the target media file; a pure skeleton file is used to indicate a media file whose node type only contains skeleton types; if the target media file is a pure skeleton file, the initial bounding box is verified and reset to obtain a minimum bounding box, and the target camera position parameters are calculated based on the minimum bounding box; if the target media file is not a pure skeleton file, the initial bounding box is determined to be the minimum bounding box, and the original camera position parameters are determined to be the target camera position parameters.

[0119] The above-mentioned verification and resetting of the initial bounding box to obtain the minimum bounding box includes: determining the boundary value of the target media file based on the position information of each skeletal node in the target media file; judging whether the initial bounding box is too large based on the boundary value; if the initial bounding box is too large, then recalculating the excessively large initial bounding box to obtain the minimum bounding box.

[0120] The above-mentioned recalculation of the excessively large initial bounding box to obtain the minimum bounding box includes: obtaining any frame information from the curve data of the target media file; any frame information includes the position information of each skeletal node in the corresponding frame; determining the maximum and minimum values ​​of the skeletal node positions based on the position information, and calculating the minimum bounding box of the target media file based on the maximum and minimum values.

[0121] The above-mentioned method of determining whether the initial bounding box is too large based on boundary values ​​includes: calculating the radius of the target media file based on the boundary values; comparing the radius of the target media file with the radius of the initial bounding box; and determining whether the initial bounding box is too large based on the comparison result.

[0122] After displaying the target media file on the webpage based on the target camera position parameters, the process further includes: responding to the animation generation command of the target media file from the target's perspective, generating and downloading the animation of the target media file based on the communication mechanism between the target application and the browser to obtain the target animation from the target's perspective; the browser is used to display the information webpage; the browser is embedded in the target application.

[0123] The above-mentioned process of generating and downloading a target animated image from the target media file to obtain a target animated image from the target perspective includes: reading the animation frame rate of the target media file, creating an animated image container based on the animation frame rate using a preset animated image generation script, and playing the animation frames from the target media file with a preset number of frames in the animated image container; adding all the animation frames from the target media file back into the animated image container to obtain the target animated image from the target perspective; setting the resource download path through the browser's kernel, and downloading the generated target animated image from the target perspective to the resource download path.

[0124] The aforementioned target perspective includes multiple preset perspectives; the aforementioned generation and downloading of dynamic images from the target media files to obtain the target dynamic images for the target perspectives includes: creating rendering tasks corresponding to each preset perspective and adding the rendering tasks to a preset rendering queue; each rendering task includes a resource download address and perspective parameters corresponding to the preset perspective; encapsulating command-line parameters for each rendering task in the preset rendering queue to obtain the command-line parameters corresponding to each rendering task, and starting the rendering process corresponding to each command-line parameter through a sub-thread to obtain the target dynamic image for each preset perspective.

[0125] After displaying the target media file on the webpage based on the target camera position parameters, the method further includes: responding to a drag command of any target sub-model in the target media file, splitting the target media file into multiple sub-models; the multiple sub-models include the target sub-model; the drag command instructs the target sub-model to be dragged away from the webpage; identifying the application to which the target sub-model is dragged through the window handle; if the application to which the target sub-model is dragged through is digital content generation software, then opening the target sub-model in the application.

[0126] The above-mentioned sub-model splitting of the target media file yields multiple sub-models, including: determining at least one segmentation node based on the node hierarchy information of the target media file; the segmentation node is used to indicate the next level node of the root node in the target media file; traversing the segmentation nodes, and during the traversal, deleting the segmentation nodes other than the current segmentation node, and saving the target media file after deleting the segmentation nodes as a sub-model file, thus obtaining multiple sub-models; each sub-model includes a segmentation node and all child nodes under the segmentation node.

[0127] The computer program product of the preview method, apparatus, electronic device and storage medium for FBX media files provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0129] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0130] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0131] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0132] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for previewing FBX media files, characterized in that, The method includes: In response to the preview command of the FBX media file, the FBX media file is corrected and its format is converted to obtain a first media file in the graphics language transmission format; Based on the curve data of each bone node in the first media file, the bone nodes of the first media file are subjected to animation curve smoothing to obtain the second media file. The skeleton is reconstructed based on the skeletal node information of the second media file to obtain the target media file; wherein, skeleton reconstruction refers to reassigning the parent-child relationship of the skeletal nodes and rebinding the skinning information. The target media file is rendered on the webpage, and during the rendering process, the target camera position parameters are determined based on the type of the target media file. Based on the target camera position parameters, the target media file is displayed on the webpage.

2. The method according to claim 1, characterized in that, In response to a preview command for an FBX media file, the FBX media file undergoes data correction and format conversion to obtain a first media file in a graphical language transmission format, including: In response to the preview command of the FBX media file, the coordinate system, units and texture file format of the FBX media file are uniformly converted and converted into corrected data in the original data structure format; The corrected data is converted into a graphical language transmission format to obtain a first media file.

3. The method according to claim 1, characterized in that, The skeletal nodes of the first media file are subjected to animation curve smoothing to obtain the second media file, which includes: Based on the number of animation frames in the first media file, it is determined whether the first media file is a motion capture file; the motion capture file is used to indicate a media file obtained through real-person motion capture. If the first media file is a motion capture file, then the skeletal nodes of the first media file are subjected to animation curve smoothing processing to obtain the second media file.

4. The method according to claim 1 or 3, characterized in that, The skeletal nodes of the first media file are subjected to animation curve smoothing to obtain the second media file, which includes: The rotation data of each bone node in the first media file is stored as a quaternion; the quaternion is used to indicate the rotation data of each bone node in the curve data of the first media file in each frame of animation. The quaternions are weighted averaged and interpolated to obtain a second media file with a smooth animation curve.

5. The method according to claim 4, characterized in that, The quaternions are weighted and interpolated to obtain a second media file with a smoothed animation curve, including: Determine whether the quaternion meets the preset filtering conditions; If the quaternion does not meet the preset filtering conditions, then the quaternions of adjacent frames of the same bone node are weighted and averaged to obtain the weighted average result corresponding to each group of adjacent frame quaternions. The weighted average result of the quaternions of each group of adjacent frames is interpolated with the corresponding group of adjacent frames using spherical linear interpolation until the preset smoothing condition is met, resulting in a second media file with a smoothed animation curve.

6. The method according to claim 5, characterized in that, Determining whether the quaternion meets the preset filtering conditions includes: Perform a dot product operation between each target quaternion and the other quaternions to obtain a first operation result corresponding to each target quaternion; the target quaternion is used to indicate one of the quaternions; the other quaternions are used to indicate quaternions other than the target quaternion among all quaternions; the first operation result is used to indicate whether the corresponding target quaternion is flipped; If the target quaternion is flipped, then the target quaternion is vector-inverted to obtain an unflipped quaternion; Perform a dot product operation on the first four vectors of the unflipped quaternion to obtain a second operation result; the second operation result is used to indicate whether the quaternion is smooth. Based on the result of the second operation, determine whether the quaternion meets the preset filtering conditions.

7. The method according to claim 1, characterized in that, Based on the skeletal node information of the second media file, a skeleton reconstruction is performed to obtain the target media file, including: Read the hierarchical information from the skeletal node information of the second media file; the skeletal node information includes the hierarchical information and skinning information of each skeletal node; Iterate through the hierarchical information of each skeletal node and create new bones during the process to obtain a new skeleton; The skinning information of each bone node is synchronized to the corresponding bone of the new skeleton to obtain the target media file.

8. The method according to claim 1, characterized in that, Based on the type of the target media file, the target camera position parameters are determined, including: Read the original camera position parameters of the target media file, and construct an initial bounding box using the original camera position parameters; Based on the node type of the target media file, determine whether the target media file is a pure skeleton file; the pure skeleton file is used to indicate that the node type only contains media files of the skeleton type; If the target media file is a pure skeleton file, the initial bounding box is verified and reset to obtain the minimum bounding box, and the target camera position parameters are calculated based on the minimum bounding box. If the target media file is not a pure skeleton file, then the initial bounding box is determined to be the minimum bounding box, and the original camera position parameters are determined to be the target camera position parameters.

9. The method according to claim 8, characterized in that, The initial bounding box is verified and reset to obtain the minimum bounding box, including: Determine the boundary values ​​of the target media file based on the position information of each skeletal node in the target media file; Determine whether the initial bounding box is too large based on the boundary value; If the initial bounding box is too large, it is recalculated to obtain the minimum bounding box.

10. The method according to claim 9, characterized in that, The initial bounding box, which is too large, is recalculated to obtain the minimum bounding box, including: Obtain information from any frame of the curve data in the target media file; any frame information includes the position information of each skeletal node in the corresponding frame. The maximum and minimum values ​​of the skeletal node positions are determined based on the location information, and the minimum bounding box of the target media file is calculated based on the maximum and minimum values.

11. The method according to claim 9, characterized in that, Determining whether the initial bounding box is too large based on the boundary values ​​includes: Calculate the radius of the target media file based on the boundary values; The radius of the target media file is compared with the radius of the initial bounding box, and the initial bounding box is judged to be too large based on the comparison result.

12. The method according to claim 1, characterized in that, After displaying the target media file on the webpage based on the target camera position parameters, the method further includes: In response to the animation generation instruction of the target media file from the target perspective, the target application generates and downloads the animation of the target media file based on the communication mechanism between the target application and the browser, thereby obtaining the target animation from the target perspective; the browser is used to display the information webpage; the browser is embedded in the target application.

13. The method according to claim 12, characterized in that, The target media file is subjected to motion graph generation and download to obtain a target motion graph from the target perspective, including: Read the animation frame rate of the target media file, and based on the animation frame rate, create an animation container through a preset animation generation script, and play the animation frames of the target media file with a preset number of frames in the animation container; All animation frames in the target media file are re-added to the animation container to obtain the target animation from the target perspective; The browser's kernel sets the resource download path, and the generated target animation from the target perspective is downloaded to the resource download path.

14. The method according to claim 12 or 13, characterized in that, The target viewpoint includes multiple preset viewpoints; the target media file is used to generate and download a dynamic image to obtain a target dynamic image of the target viewpoint, including: Create a rendering task corresponding to each preset viewpoint and add the rendering task to the preset rendering queue; each rendering task includes a resource download address and viewpoint parameters corresponding to the preset viewpoint; Each rendering task in the preset rendering queue is encapsulated with command-line parameters to obtain the command-line parameters corresponding to each rendering task. Then, the rendering process corresponding to each command-line parameter is started through a sub-thread to obtain the target dynamic image of each preset viewpoint.

15. The method according to claim 1, characterized in that, After displaying the target media file on the webpage based on the target camera position parameters, the method further includes: In response to a drag command for any target sub-model in the target media file, the target media file is split into multiple sub-models; the multiple sub-models include the target sub-model; the drag command is used to instruct the target sub-model to be dragged away from the webpage. The application that the target sub-model is dragged to is identified by the window handle; If the application to which the target sub-model is dragged is digital content generation software, then the target sub-model is opened in that application.

16. The method according to claim 15, characterized in that, The target media file is split into multiple sub-models, including: Based on the node hierarchy information of the target media file, at least one segmentation node is determined; the segmentation node is used to indicate the next level node of the root node in the target media file; Traverse the segmentation nodes, and during the traversal, delete the segmentation nodes other than the current segmentation node, and save the target media file after the segmentation nodes are deleted as a sub-model file to obtain multiple sub-models; each sub-model includes a segmentation node and all child nodes under the segmentation node.

17. A preview device for FBX media files, characterized in that, The device includes: The response module is used to respond to the preview command of the FBX media file, perform data correction and format conversion on the FBX media file, and obtain a first media file in the graphics language transmission format; The smoothing module is used to perform animation curve smoothing on the bone nodes of the first media file based on the curve data on each bone node in the first media file, so as to obtain the second media file. The reconstruction module is used to reconstruct the skeleton based on the skeletal node information of the second media file to obtain the target media file; wherein, skeleton reconstruction refers to reassigning the parent-child relationship of the skeletal nodes and rebinding the skinning information. The rendering module is used to render the target media file in the web page, and during the rendering process, to determine the target camera position parameters based on the type of the target media file; The display module is used to display the target media file on the webpage based on the target camera position parameters.

18. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the preview method for FBX media files according to any one of claims 1-16.

19. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the preview method for FBX media files as described in any one of claims 1-16.

Citation Information

Patent Citations

  • Skeleton skin animation processing method and device, electronic equipment and storage medium

    CN110136232A

  • File format conversion method and device and computer storage medium

    CN114359459A