Model data processing method and device, electronic equipment and storage medium

By classifying the target file set and setting the projection matrix, the conversion of CSV files to FBX files is automated, solving the problem of cumbersome manual operation in existing technologies and achieving efficient format conversion.

CN119669148BActive Publication Date: 2026-02-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411430018.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2026-02-13
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

Existing methods for converting CSV files to FBX files require multiple manual operations, resulting in low efficiency for large-scale data conversion, high operational costs, and high requirements for artist proficiency.

Method used

By classifying the target file set, setting grid attributes and generating a projection matrix, and performing format conversion based on the projection matrix, an automated and batch processing method is achieved.

Benefits of technology

This eliminates the need for multiple manual operations, improving the conversion efficiency of CSV files to FBX files, reducing computational load, and enhancing processing accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669148B_ABST
    Figure CN119669148B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computer, and provides a model data processing method and device, electronic equipment and storage medium; wherein the method comprises: classifying a target file set to obtain classified files, wherein each file in the target file set is used to store point data of a three-dimensional model; setting a mesh attribute of each file, wherein the mesh attribute is a data set constituting a three-dimensional model mesh; generating a projection matrix based on the mesh attribute of each file; and performing format conversion on each file based on the projection matrix to obtain model data of a target format corresponding to each file. The method sets the mesh attribute and the projection matrix for each classified file, and performs format conversion based on the projection matrix, without manual multiple operations, thereby realizing an automatic and batch processing mode and improving the conversion efficiency of converting a CSV file into an FBX file.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly to a model data processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] In some scenarios, for example, three-dimensional graphics processing or game development scenarios, it is often necessary to export related data in CSV format to capture and analyze rendering data, and then optimize performance and solve visual problems. However, only point data in the CSV file cannot be directly placed in a 3D modeling software or engine for intuitive visualization and editing, and the CSV file needs to be converted into FBX format. At present, the original data in the CSV file is gradually converted into geometric body information by creating and linking various nodes, and then exported as an FBX file.

[0003] However, in the existing method of converting the CSV file into the FBX file, manual multiple operations are required, which is too time-consuming for large amounts of data conversion, thereby resulting in low conversion efficiency of the CSV file into the FBX file. SUMMARY

[0004] Therefore, the purpose of the present disclosure is to provide a model data processing method and device, electronic equipment and storage medium, which sets the grid attribute and projection matrix of each group of files after classification, and performs format conversion based on the projection matrix, without manual multiple operations, thereby realizing automatic and batch processing, and improving the conversion efficiency of the CSV file into the FBX file.

[0005] In a first aspect, the embodiments of the present disclosure provide a model data processing method, which comprises:

[0006] classifying a target file set to obtain each group of files after classification, wherein each file in the target file set is used to store point data of a three-dimensional model;

[0007] setting a grid attribute of each group of files, wherein the grid attribute is a data set constituting a three-dimensional model grid;

[0008] generating a projection matrix based on the grid attribute of each group of files;

[0009] performing format conversion on each group of files based on the projection matrix to obtain model data of each file in a target format.

[0010] In a second aspect, the embodiments of the present disclosure provide a model data processing device, which comprises:

[0011] The classification module is configured to classify the target file set to obtain classified files.

[0012] The setting module is configured to extract attributes of data in the classified files to obtain extracted data attributes.

[0013] The generation module is configured to generate a projection matrix based on the mesh attributes of the files.

[0014] The conversion module is configured to perform format conversion on the files based on the projection matrix to obtain model data in a target format corresponding to the files.

[0015] In a third aspect, an electronic device is provided, which includes a processor and a memory. The memory stores machine executable instructions capable of being executed by the processor. The processor executes the machine executable instructions to implement the model data processing method.

[0016] In a fourth aspect, a computer readable storage medium is provided, which stores computer executable instructions. When the computer executable instructions are invoked and executed by a processor, the computer executable instructions cause the processor to implement the model data processing method.

[0017] The embodiments of the present disclosure have the following beneficial effects:

[0018] The model data processing method, device, electronic device and storage medium classify a target file set to obtain classified files. Each file in the target file set is used to store point data of a three-dimensional model. Mesh attributes of the files are set. The mesh attributes are data sets constituting a mesh of the three-dimensional model. A projection matrix is generated based on the mesh attributes of the files. Format conversion is performed on the files based on the projection matrix to obtain model data in a target format corresponding to the files. In the method, mesh attribute setting and projection matrix setting are performed on the classified files, and format conversion is performed based on the projection matrix. Manual multiple operations are not required, and an automatic and batch processing mode is achieved, thereby improving the conversion efficiency of CSV files to FBX files.

[0019] Other features and advantages of the present disclosure will be described in the following description, and will become apparent from the description, or will be learned from the practice of the present disclosure. The purposes and other advantages of the present disclosure will be realized and achieved by the structures particularly pointed out in the description, claims, and drawings.

[0020] In order to make the above objectives, characteristics and advantages of the present disclosure more obvious and easy to understand, the following preferred embodiments are specifically described below, and the accompanying drawings are referred to for a detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the specific embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without any creative work on the basis of these drawings.

[0022] Figure 1 An embodiment schematic diagram of the model data processing method provided by the embodiment of the present disclosure;

[0023] Figure 2 An embodiment schematic diagram of the layout of each group of components in the graphical user interface provided by the embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram of a model data processing device provided by the embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram of an electronic device provided by the embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present embodiment more obvious, the technical solutions of the present disclosure will be described clearly and completely in the following with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present disclosure, not all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without any creative work fall within the scope of protection of the present disclosure.

[0027] In some scenarios, for example, three-dimensional (3D) graphics processing or game development scenarios, it is often necessary to export relevant data in CSV format to capture and analyze rendering data, thereby optimizing performance and solving visual problems. Among them, the open source graphics debugging tool RenderDoc can record and store the rendering instructions and point data of the application program at a specific frame, and export them in CSV format, which is often applied. However, only point data (such as vertex position, normal, texture map (UV) coordinates, etc.) in the exported CSV file cannot be directly placed in a 3D modeling software or engine for intuitive visualization and editing, which requires converting the CSV file to FBX format. At present, by creating and linking various nodes to gradually convert the original data in the CSV file into geometry information and export it as an FBX file, for example, by using a pre-written script in the tool Houdini, the point data (such as vertex position, normal, UV coordinates, etc.) in the CSV file is parsed and loaded into the working environment of Houdini, and then various nodes are created and linked to gradually convert these original data into geometry information of Houdini, and finally the processed geometry information is exported as an FBX file through the export function of Houdini.

[0028] However, in the existing method of converting a CSV file to an FBX file, a high operation cost is required, an artist needs to be proficient in using the difficult-to-learn Houdini, and manual multiple operations are required, which is too time-consuming for large amounts of data conversion, thereby resulting in low conversion efficiency of the CSV file to the FBX file.

[0029] The embodiment provides a model data processing method and device, electronic equipment and a storage medium. It can be applied to the processing of model data, especially the processing of game model data.

[0030] The model data processing method in one embodiment of the present disclosure can run on a terminal device or a server. The terminal device can be a local terminal device. When the model data processing method runs on the server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0031] For ease of understanding, the specific process of the embodiment is described below. Please refer to Figure 1 One embodiment of the model data processing method in the embodiment includes the following steps:

[0032] Step 101, classifying a target file set to obtain classified files in each group, wherein each file in the target file set is used to store point data of a three-dimensional model;

[0033] The target file set includes more than one file to be processed, and each file in the target file set is a file storing point data constituting a three-dimensional model, and the point data includes but is not limited to vertex data, normal data, and UV coordinates and other key information. In addition, the point data can also include vertex color and tangent information and other data that have a significant impact on rendering effect.

[0034] Each file in the target file set can be a file storing point data of each model in the same scene, or a file storing point data of each model in different scenes.

[0035] As an example but not limitation, the target file set is identified and classified based on a preset classification rule to obtain classified groups of files, wherein the preset classification rule is a classification strategy set to avoid problems caused by subsequent parameter (attribute) setting during batch export, and the preset classification rule can be the number of columns of the file, the type of the file content, or the identity of the file information, and the specific implementation is not limited herein.

[0036] In step 102, the mesh attributes of each group of files are set, wherein the mesh attribute is a data set constituting a three-dimensional model mesh.

[0037] The mesh attribute includes but is not limited to vertex information, normal information, and texture map coordinate information.

[0038] As an example but not limitation, when setting the mesh attribute of each group of files, the attribute information in each group of files can be obtained; in response to a mesh attribute setting instruction, the parameter value corresponding to the mesh attribute of each group of files is obtained; based on the attribute information, it is determined whether the parameter value meets a preset condition, wherein the preset condition includes but is not limited to data integrity, data format, data range, and data consistency; if yes, the setting is completed, and the parameter value is taken as the set mesh attribute of each group of files; if not, the result is fed back, and the parameter value corresponding to the mesh attribute of each group of files is re-obtained.

[0039] In step 103, a projection matrix is generated based on the mesh attribute of each group of files.

[0040] As an example but not limitation, in generating a projection matrix based on the mesh attribute of each group of files, the mesh attribute of each group of files can be integrated to obtain a target attribute; the projection type and visual parameters are determined, wherein the projection type can be an orthogonal projection or a perspective projection, and the visual parameters include but are not limited to a view angle parameter, a field of view parameter, a near clipping plane parameter, and a far clipping plane parameter; and a projection matrix is generated based on the target attribute, the projection type, and the visual parameters.

[0041] As an example but not limitation, in generating a projection matrix based on the mesh attributes of each group of files, a parameter value can also be obtained, wherein the parameter value can be a numerical value of a visual parameter or other numerical value for generating the projection matrix; the parameter value is reasonably detected based on the mesh attributes of each group of files, to obtain a detected parameter value, wherein the detected parameter value is used to indicate that the parameter value passes the reasonableness detection; and a projection matrix is generated based on the parameter value.

[0042] Wherein, the target file set shares one projection matrix, that is, the projection matrix corresponding to all files in the target file set is the same projection matrix.

[0043] Step 104, based on the projection matrix, format conversion is performed on each group of files to obtain model data of each file in the target format.

[0044] Wherein, as an example but not limitation, inverse matrix transformation operation is performed based on the projection matrix to obtain transformed point data (for example, transformed vertex position); mesh construction and mesh information filling are performed based on the transformed point data to obtain model data of each file in the target format, wherein the mesh information filled in the mesh information includes but is not limited to normal information and texture mapping coordinate information.

[0045] Wherein, batch processing is performed on each group of files, that is, the files in the same group perform the format conversion processing flow in parallel to obtain the model data of each file in the target format in the same group.

[0046] The above model data processing method sets the mesh attributes and projection matrix for each group of classified files, and performs format conversion based on the projection matrix, without manual multiple operations, realizes an automatic and batch processing mode, and improves the conversion efficiency of CSV file to FBX file.

[0047] In one implementation, in generating model data of each file in the target format based on the projection matrix, the initial mesh body of each file can be constructed based on the vertex position in each file and the projection matrix; the vertex index data, normal information and texture mapping coordinates in each file can be obtained; the normal information in each file is written into the initial mesh body of each file according to the vertex index data in each file, to obtain the to-be-processed mesh body of each file; the texture mapping coordinates in each file are written into the to-be-processed mesh body of each file according to the vertex index data in each file, to obtain the model data of each file in the target format.

[0048] The vertex positions in each file in each group of files and the projection matrix are used to perform operations to obtain vertex positions of an initial mesh body of each file, the vertex positions are filled into a pre-created empty mesh, and polygons are created to construct the initial mesh body of each file. According to the vertex index data in each file, the normal information and texture map (UV) coordinates in each file are written into the initial mesh body of each file to complete the initial mesh body of each file, and model data in a target format corresponding to each file is obtained.

[0049] The execution process of the format conversion of each group of files based on the projection matrix is performed in parallel, that is, the model data in the target format corresponding to all files in the target file set is obtained at the same time.

[0050] By constructing the initial mesh body based on the vertex positions and the projection matrix, and writing the normal information and the texture map coordinates in each file into the initial mesh body according to the vertex index data in each file, the batch files can be uniformly and automatically processed, and the problems such as parameter adjustment error and configuration omission are avoided, thereby improving the conversion efficiency and accuracy.

[0051] In an implementation manner, when the initial mesh body of each file is constructed based on the vertex positions in each file in each group of files and the projection matrix, an empty mesh can be created, the vertex positions in each file in each group of files are mapped to a two-dimensional screen through the projection matrix to obtain mapped vertex positions, inverse matrix transformation of the projection matrix is performed on the mapped vertex positions to obtain transformed vertex positions, the transformed vertex positions are set to corresponding vertices in the empty mesh to obtain a mesh with constructed vertex information, and polygons are constructed based on the vertices in each file, and the constructed polygons are added to the mesh with constructed vertex information to obtain the initial mesh body of each file.

[0052] By way of example and not limitation, when the vertex positions in each file in each group of files are mapped to a two-dimensional screen through the projection matrix to obtain mapped vertex positions, a first vector can be created through a preset calculation function, and a second vector can be created based on the vertex positions in each file in each group of files, wherein the first vector is a four-dimensional vector (zero vector with a length of 4) all of which are 0, and the second vector is a one-dimensional array with a length of 4; the first vector is used as an initial value of a result vector, the product of each element in the projection matrix and the corresponding element in the second vector is calculated (that is, the projection matrix is subjected to nested loop, and the current row in the loop traversal in the projection matrix and the corresponding element in the second vector are subjected to multiplication operation), an operation result is obtained, and the operation result is accumulated to the corresponding position of the first vector to obtain the mapped vertex positions.

[0053] As an example but not limitation, when the inverse matrix transformation of the projection matrix is performed on the mapped vertex position to obtain the transformed vertex position, the inverse matrix of the projection matrix can be calculated through a preset first setting function, wherein the first setting function is used to set the vertex position of the mesh; the mapped vertex position of each row except the first row is traversed, and the inverse matrix transformation of the projection matrix is performed on the vertex position of each row based on the inverse matrix to obtain the transformed vertex position.

[0054] Wherein, the transformation of the projection matrix ensures that the position of the mesh in the world space (the position in the converted model data in the target format) is consistent with the position stored in the target file set.

[0055] As an example but not limitation, when the polygon is constructed based on the vertex in each file, and the constructed polygon is added to the mesh after the vertex information is constructed to obtain the initial mesh of each file, the preset second setting function can be used, wherein the second setting function is used to set the polygon of the mesh; each three rows in each file are traversed, a polygon is constructed according to the traversed vertex of each three rows, and the constructed polygon is added to the mesh after the vertex information is constructed to obtain the initial mesh of each file.

[0056] By calculating the product of the projection matrix and the vector, and setting the vertex position and the polygon of the mesh, the unified processing of the batch files is facilitated, the accuracy of the texture mapping is improved, the calculation amount is reduced, the processing efficiency is improved, and the quality and usability of the converted model data (FBX file) corresponding to each file in the target format are improved.

[0057] In an implementation manner, when the normal information in each file is written into the initial mesh of each file according to the vertex index data in each file to obtain the to-be-processed mesh of each file, the normal layer of the initial mesh of each file can be created, and the mode of the normal layer is set to obtain the first mesh of each file; the static array of the normal layer in the first mesh and the number of elements in each file are obtained; the size of the static array is adjusted based on the number of elements to obtain an adjusted static array; the normal information of each file is written into the corresponding vertex in the first mesh of each file according to the vertex index data of each file, and the normal information of each file is added to the corresponding position in the adjusted static array to obtain the to-be-processed mesh of each file.

[0058] As an example but not limitation, when creating a normal layer of an initial mesh of each file, setting a mode of the normal layer, and obtaining a first mesh of each file, a new normal layer corresponding to the initial mesh of each file can be created, and the first normal element can be removed from the initial mesh; the first mapping mode and the first reference mode of the normal layer can be set, wherein the first mapping mode is used to indicate that each control point has a corresponding normal, for example, eByControlPoint, and the first reference mode is used to indicate that the normal data is directly stored in an array, for example, eDirect.

[0059] As an example but not limitation, the static array can also be a direct array, for example, normal array. The number of elements in each file can be understood as the length of the table in the file. After obtaining the static array of the normal layer of the first mesh and the number of elements in each file, the number of elements is stored in a specific variable (for example, count), and the size of the static array is adjusted to the size of the specific variable.

[0060] As an example but not limitation, the vertex index data in each file includes the vertex index data (ID_idx) of each row (except the first row), and the normal information of each file includes the normal information of each row (except the first row).

[0061] By creating a normal layer of an initial mesh and setting a mode, and adding normal information of each file to a corresponding position in a static array adjusted in size based on the number of elements and a corresponding vertex in the mesh, the authenticity and accuracy of the mesh are improved, resource occupation is reduced, dynamic adjustment is facilitated, processing flexibility is enhanced, and the universality of application scenarios is enhanced.

[0062] In an implementation manner, when writing texture map coordinates in each file into a to-be-processed mesh of each file according to vertex index data in each file, to obtain model data in a target format corresponding to each file, a texture coordinate layer of the to-be-processed mesh in each file can be created, and a mode of the texture coordinate layer is set, to obtain a second mesh in each file; a static array and an index array of a normal layer in the second mesh, and the number of elements in each file are obtained; sizes of the static array and the index array are respectively adjusted based on the number of elements, to obtain an adjusted static array and an adjusted index array; the texture map coordinates of each file are written into a corresponding position in the adjusted static array, and the vertex index data of each file is added to a corresponding position in the adjusted index array, to obtain the model data in the target format corresponding to each file.

[0063] As an example but not limitation, a texture coordinate layer of the to-be-processed mesh body in each file is created, and a target name corresponding to the texture coordinate layer is set, where the target name is the name of the texture coordinate layer plus the name after the index name; a second mapping mode and a second reference mode of the texture coordinate layer are set, where the second mapping mode is used to indicate that each polygon vertex has a corresponding texture coordinate, for example, eByPolygonVertex, and the second reference mode is used to indicate that the texture coordinate data is referenced through an index array, for example, uv_index_array. After obtaining the static array and the index array of the normal layer in the second mesh body and the number of elements in each file, the number of elements is stored in a specific variable (for example, count), the size of the static array is adjusted to the size after the specific variable is reduced by 1 (that is, count-1), and the size of the index array is adjusted to the size after the specific variable is reduced by 1 (that is, count-1).

[0064] Wherein, the vertex index data in each file includes the vertex index data (ID_idx) of each row (except the first row), and the texture map coordinates of each file include the texture map coordinates of each row (except the first row).

[0065] By creating a texture coordinate layer of the initial mesh body and setting the mode, and adding the texture map coordinates of each file to the corresponding position in the static array after the size is adjusted based on the number of elements and adding the vertex index data of each file to the corresponding position in the index array after the size is adjusted, there is a certain dynamic adjustment capability, which can adapt to different sizes of textures and vertex data, realizes accurate mapping of textures, efficient use of resources, and centralized management and updating of data.

[0066] In an implementation manner, when the target file set is classified to obtain classified files, the following can be performed: the files in the target file set are parsed to obtain parsed file data; and the files in the target file set are classified based on the types of the parsed file data to obtain the classified files, where each file in each group of files has the same number of columns.

[0067] As an example but not limitation, before the files in the target file set are parsed, the file path of the target file set is obtained, and the target file set is imported based on the file path. After the target file set is imported based on the file path, the files in the target file set are parsed to obtain parsed file data, where the parsed file data can be draw data of a virtual model; the files corresponding to the same data type and / or having the same information in the parsed file data are classified into the same group of files, so as to obtain the classified files.

[0068] Each file has different column numbers due to different models, each column represents a specific attribute or dimension, such as vertex data, normal data, UV coordinates, color data, and other related attributes, and the data items in each column (i.e., the values in the row) correspond to the specific value of all elements or entities in the three-dimensional model in the attribute, and each column provides a specific perspective or dimension of the model data. Each file includes draw data of the three-dimensional model.

[0069] By classifying the files in the target file set, the problem of batch export caused by parameter adjustment can be avoided, and the problem of model data error and data mismatch caused by inconsistent data information after format conversion of each group of files can be avoided, thereby improving the quality of model data in the target format and ensuring the efficiency and accuracy of batch format conversion of each group of files.

[0070] In an implementation manner, a graphical user interface is provided by the terminal device, and the graphical user interface includes: a first group of components for triggering a classification instruction to classify the target file set; a second group of components for triggering a grid attribute setting instruction to set the grid attribute; a third group of components for triggering a matrix generation instruction to generate a projection matrix based on the grid attribute of each group of files; and a fourth group of components for triggering a format conversion instruction to convert the format of each group of files.

[0071] The components are arranged and displayed in the graphical user interface in a preset order, and the preset order corresponds to the order of the processing flow of the model data, for example, from top to bottom. The components in the graphical user interface can be as shown in the figure.

[0072] In addition, as an example but not limitation, the graphical user interface further includes a sixth group of components for setting a file path of the target file set and importing the target file set based on the file path. Each group of components in the graphical user interface can include at least one component, each component in the graphical user interface can be an interactive control, and the touch operation of each component can be a preset operation such as clicking, editing input, sliding, etc. The specific operation is not limited here and can be set according to actual needs, for example, the sixth group of components, the second group of components, and the fourth group of components can all perform text input operations, and the first group of components and the third group of components can all perform clicking operations.

[0073] By arranging multiple groups of components in the graphical user interface, a UI interface with higher user friendliness is provided, which is convenient to operate and helps to reduce parameter adjustment errors, missing parameters, and other problems that cause the fbx model data to be incorrect, thereby improving the operation efficiency and further helping to improve the conversion efficiency and accuracy of the conversion of the CSV file to the FBX file.

[0074] In an implementation manner, as shown inFigure 2 As shown, the graphical user interface further includes: a fifth set of components for triggering attribute acquisition instructions to acquire data attributes in each classified group of files, and in setting the grid attributes of each group of files, the data attributes in each classified group of files can be extracted through the fifth set of components, and the extracted data attributes are displayed; in response to the triggering operation on the second set of components, the grid attributes to be edited of each group of files are acquired; and the grid attributes to be edited are displayed through the second set of components.

[0075] By way of example but not limitation, the extracted data attributes are displayed in the positions corresponding to the respective preset items in the graphical user interface through the fifth set of components; after the grid attributes to be edited of each group of files are acquired, it is checked whether the grid attributes to be edited meet preset rules, wherein the preset rules are used to indicate data integrity, data format standardization, data range rationality, data consistency and feasibility; if yes, the grid attributes to be edited are displayed through the second set of components; if not, the checking result is fed back through the graphical user interface, and in response to the retriggering operation on the second set of components, the grid attributes to be edited of each group of files are reacquired.

[0076] The extracted data attributes are displayed through the fifth set of components, and the grid attributes to be edited are displayed through the second set of components, without the need for manual one-by-one opening operation of each file, facilitating the user to read the target file set and judge and confirm the related data according to the file content, improving the parameter adjustment efficiency when the CSV file is converted into the FBX file, and further improving the conversion efficiency of the CSV file into the FBX file.

[0077] Corresponding to the method embodiment, refer to Figure 3 As shown in a schematic diagram of a model data processing device, the device includes:

[0078] The classification module 301 is configured to classify the target file set to obtain each classified group of files, wherein each file in the target file set is configured to store point data of a three-dimensional model;

[0079] The setting module 302 is configured to extract the attributes of the data in the classified files to obtain the extracted data attributes;

[0080] The generation module 303 is configured to generate a projection matrix based on the grid attributes of each group of files;

[0081] The conversion module 304 is configured to perform format conversion on each group of files based on the projection matrix to obtain model data in a target format corresponding to each file.

[0082] The processing device of the model data sets a grid attribute and a projection matrix for each group of files after classification, and performs format conversion based on the projection matrix, without manual multiple operations, so that an automatic and batch processing mode is realized, and the conversion efficiency of the CSV file to the FBX file is improved.

[0083] Optionally, the conversion module 304 can also be configured to:

[0084] construct an initial mesh body of each file based on the vertex position in each file in each group of files and the projection matrix;

[0085] obtain vertex index data, normal information and texture mapping coordinates in each file in each group of files;

[0086] write the normal information in each file into the initial mesh body of each file according to the vertex index data in each file, to obtain a to-be-processed mesh body of each file;

[0087] write the texture mapping coordinates in each file into the to-be-processed mesh body of each file according to the vertex index data in each file, to obtain the model data in the target format corresponding to each file.

[0088] Optionally, the conversion module 304 can also be configured to:

[0089] create an empty mesh;

[0090] map the vertex position in each file in each group of files to a two-dimensional screen through the projection matrix, to obtain a mapped vertex position;

[0091] perform inverse matrix transformation processing on the mapped vertex position through the projection matrix, to obtain a transformed vertex position;

[0092] set the transformed vertex position to a corresponding vertex in the empty mesh, to obtain a mesh with constructed vertex information;

[0093] construct a polygon based on the vertex in each file, and add the constructed polygon to the mesh with constructed vertex information, to obtain an initial mesh body of each file.

[0094] Optionally, the conversion module 304 can also be configured to:

[0095] create a normal layer of the initial mesh body of each file, and set a mode of the normal layer, to obtain a first mesh body of each file;

[0096] obtain a static array of the normal layer in the first mesh body and an element quantity in each file;

[0097] adjust the size of the static array based on the element quantity, to obtain an adjusted static array;

[0098] write the normal information of each file into corresponding vertices in the first mesh body of each file according to the vertex index data of each file, and add the normal information of each file to corresponding positions in the adjusted static array, to obtain a to-be-processed mesh body of each file.

[0099] Optionally, the conversion module 304 can also be configured to:

[0100] create a texture coordinate layer of the to-be-processed mesh body in each file, and set a mode of the texture coordinate layer, to obtain a second mesh body in each file;

[0101] obtain a static array and an index array of the normal layer in the second mesh body, and an element quantity in each file;

[0102] adjust sizes of the static array and the index array based on the element quantity, to obtain an adjusted static array and an adjusted index array;

[0103] write texture map coordinates of each file into corresponding positions in the adjusted static array, and add vertex index data of each file to corresponding positions in the adjusted index array, to obtain model data of a target format corresponding to each file.

[0104] Optionally, the classification module 301 can also be configured to:

[0105] analyze each file in the target file set to obtain analyzed file data;

[0106] classify each file in the target file set based on types of the analyzed file data, to obtain classified groups of files, wherein each file in each group of files has the same number of columns.

[0107] Optionally, a graphical user interface is provided through a terminal device, and the graphical user interface includes:

[0108] a first group of components configured to trigger a classification instruction to classify the target file set;

[0109] a second group of components configured to trigger a mesh attribute setting instruction to set mesh attributes;

[0110] a third group of components configured to trigger a matrix generation instruction to generate a projection matrix based on the mesh attributes of each group of files;

[0111] a fourth group of components configured to trigger a format conversion instruction to perform format conversion on each group of files.

[0112] Optionally, the graphical user interface further includes a fifth group of components configured to trigger an attribute acquisition instruction to acquire data attributes in each group of classified files;

[0113] The fifth set of components extracts data attributes in the classified files in each set, and displays the extracted data attributes;

[0114] In response to a triggering operation on the second set of components, the grid attributes to be edited in the files in each set are obtained;

[0115] The second set of components displays the grid attributes to be edited.

[0116] The embodiment also provides an electronic device including a processor and a memory, the memory storing machine executable instructions capable of being executed by the processor, and the processor executing the machine executable instructions to implement the model data processing method described above. The electronic device can be a server or a terminal device.

[0117] Referring to Figure 4 The electronic device includes a processor 400 and a memory 401, the memory 401 storing machine executable instructions capable of being executed by the processor 400, and the processor 400 executing the machine executable instructions to implement the model data processing method described above.

[0118] Further, Figure 4 The electronic device shown also includes a bus 402 and a communication interface 403, and the processor 400, the communication interface 403 and the memory 401 are connected through the bus 402.

[0119] The memory 401 can include a high-speed random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory. The communication between the system network element and at least one other network element is realized through at least one communication interface 403 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 402 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the figure to represent only one bus or only one type of bus.

[0120] The processor 400 can be an integrated circuit chip with processing capability of signals. In the implementation process, each step of the above method can be completed by integrated logic circuits or instructions in the form of software in the processor 400. The processor 400 described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; It can 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 gates or transistor logic devices, discrete hardware components. Each method, step and logic block disclosed in the embodiment can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory 401, and the processor 400 reads the information in the memory 401, and combines the hardware to complete the following steps:

[0121] Classify the target file set to obtain classified files, wherein each file in the target file set is used to store point data of a three-dimensional model;

[0122] Set the grid attribute of each group of files, wherein the grid attribute is a data set constituting the grid of the three-dimensional model;

[0123] Generate a projection matrix based on the grid attribute of each group of files;

[0124] Format conversion is performed on each group of files based on the projection matrix to obtain model data of a target format corresponding to each file.

[0125] Through grid attribute setting and projection matrix setting of the classified files, and format conversion based on the projection matrix, manual multiple operations are not required, and an automatic and batch processing mode is realized, and the conversion efficiency of CSV files to FBX files is improved.

[0126] The above step of format conversion of each group of files based on the projection matrix to obtain model data of a target format corresponding to each file comprises:

[0127] constructing an initial mesh body of each file based on the vertex position and the projection matrix in each file in each group of files;

[0128] obtaining vertex index data, normal information and texture mapping coordinates in each file in each group of files;

[0129] writing the normal information in each file into the initial mesh body of each file according to the vertex index data in each file, to obtain a to-be-processed mesh body of each file;

[0130] writing the texture mapping coordinates in each file into the to-be-processed mesh body of each file according to the vertex index data in each file, to obtain model data in a target format corresponding to each file.

[0131] The step of constructing the initial mesh body of each file based on the vertex position and the projection matrix in each file in each group of files comprises:

[0132] creating an empty mesh;

[0133] mapping the vertex position in each file in each group of files to a two-dimensional screen through the projection matrix, to obtain a mapped vertex position;

[0134] performing inverse matrix transformation processing on the mapped vertex position through the projection matrix, to obtain a transformed vertex position;

[0135] setting the transformed vertex position to a corresponding vertex in the empty mesh, to obtain a mesh after constructing vertex information;

[0136] constructing a polygon based on the vertex in each file, and adding the constructed polygon to the mesh after constructing vertex information, to obtain the initial mesh body of each file.

[0137] The step of writing the normal information in each file into the initial mesh body of each file according to the vertex index data in each file, to obtain the to-be-processed mesh body of each file comprises:

[0138] creating a normal layer of the initial mesh body of each file, and setting a mode of the normal layer, to obtain a first mesh body of each file;

[0139] obtaining a static array of the normal layer in the first mesh body and an element quantity in each file;

[0140] adjusting a size of the static array based on the element quantity, to obtain an adjusted static array;

[0141] writing the normal information of each file into a corresponding vertex in the first mesh body of each file according to the vertex index data of each file, and adding the normal information of each file to a corresponding position in the adjusted static array, to obtain the to-be-processed mesh body of each file.

[0142] The step of writing the texture mapping coordinates in each file into the to-be-processed mesh body of each file according to the vertex index data in each file to obtain the model data in the target format corresponding to each file comprises:

[0143] A texture coordinate layer of the to-be-processed mesh body in each file is created, and a mode of the texture coordinate layer is set to obtain a second mesh body in each file;

[0144] A static array and an index array of the normal layer in the second mesh body and the number of elements in each file are obtained;

[0145] The sizes of the static array and the index array are adjusted based on the number of elements to obtain an adjusted static array and an adjusted index array;

[0146] The texture mapping coordinates of each file are written into corresponding positions in the adjusted static array, and the vertex index data of each file is added to corresponding positions in the adjusted index array to obtain the model data in the target format corresponding to each file.

[0147] The step of classifying the target file set to obtain the classified groups of files comprises:

[0148] Each file in the target file set is parsed to obtain parsed file data;

[0149] Each file in the target file set is classified based on the type of the parsed file data to obtain the classified groups of files, wherein each file in each group of files has the same number of columns.

[0150] A graphical user interface is provided through a terminal device, and the graphical user interface comprises:

[0151] A first group of components are configured to trigger a classification instruction to classify the target file set;

[0152] A second group of components are configured to trigger a mesh attribute setting instruction to set mesh attributes;

[0153] A third group of components are configured to trigger a matrix generation instruction to generate a projection matrix based on the mesh attributes of each group of files;

[0154] A fourth group of components are configured to trigger a format conversion instruction to perform format conversion on each group of files.

[0155] The graphical user interface further comprises a fifth group of components configured to trigger an attribute acquisition instruction to acquire data attributes in each group of classified files, and the step of setting the mesh attributes of each group of files comprises:

[0156] The fifth set of components extracts data attributes in the classified files in each group, and displays the extracted data attributes;

[0157] In response to a triggering operation on the second set of components, the grid attributes to be edited in the files in each group are obtained;

[0158] The second set of components displays the grid attributes to be edited.

[0159] The embodiment also provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the following steps of the model data processing method:

[0160] The target file set is classified to obtain classified files in each group, wherein each file in the target file set is used to store point data of a three-dimensional model;

[0161] The grid attributes of each file are set, wherein the grid attributes are data sets constituting a grid of the three-dimensional model;

[0162] A projection matrix is generated based on the grid attributes of each file;

[0163] Each file is format-converted based on the projection matrix to obtain model data in a target format corresponding to each file.

[0164] Through the grid attribute setting and the projection matrix setting on the classified files in each group, and the format conversion based on the projection matrix, the automatic and batch processing mode is realized without manual multiple operations, and the conversion efficiency of the CSV file to the FBX file is improved.

[0165] The above step of format-converting each file based on the projection matrix to obtain model data in a target format corresponding to each file includes:

[0166] An initial mesh body of each file is constructed based on the vertex position in each file and the projection matrix;

[0167] Vertex index data, normal information and texture map coordinates in each file are obtained;

[0168] The normal information in each file is written into the initial mesh body of each file according to the vertex index data in each file, to obtain a to-be-processed mesh body of each file;

[0169] The texture map coordinates in each file are written into the to-be-processed mesh body of each file according to the vertex index data in each file, to obtain model data in a target format corresponding to each file.

[0170] The step of constructing the initial mesh body of each file based on the vertex position in each file in each group file and the projection matrix comprises:

[0171] creating an empty mesh;

[0172] mapping the vertex position in each file in each group file to a two-dimensional screen through the projection matrix to obtain a mapped vertex position;

[0173] performing inverse matrix transformation processing on the mapped vertex position to obtain a transformed vertex position;

[0174] setting the transformed vertex position to a corresponding vertex in the empty mesh to obtain a mesh with constructed vertex information;

[0175] constructing a polygon based on the vertex in each file and adding the constructed polygon to the mesh with constructed vertex information to obtain an initial mesh body of each file.

[0176] The step of writing the normal information in each file into the initial mesh body of each file according to the vertex index data in each file to obtain a to-be-processed mesh body of each file comprises:

[0177] creating a normal layer of the initial mesh body of each file and setting a mode of the normal layer to obtain a first mesh body of each file;

[0178] obtaining a static array of the normal layer in the first mesh body and an element quantity in each file;

[0179] adjusting the size of the static array based on the element quantity to obtain an adjusted static array;

[0180] writing the normal information of each file into a corresponding vertex in the first mesh body of each file according to the vertex index data of each file and adding the normal information of each file to a corresponding position in the adjusted static array to obtain a to-be-processed mesh body of each file.

[0181] The step of writing the texture map coordinates in each file into the to-be-processed mesh body of each file according to the vertex index data in each file to obtain model data in a target format corresponding to each file comprises:

[0182] creating a texture coordinate layer of the to-be-processed mesh body in each file and setting a mode of the texture coordinate layer to obtain a second mesh body in each file;

[0183] obtaining a static array and an index array of the normal layer in the second mesh body and an element quantity in each file;

[0184] adjusting the sizes of the static array and the index array based on the element quantity, respectively, to obtain an adjusted static array and an adjusted index array;

[0185] write the texture map coordinates of each file into the corresponding position in the adjusted static array, and add the vertex index data of each file to the corresponding position in the adjusted index array to obtain the model data of each file in the target format.

[0186] The step of classifying the target file set to obtain the classified groups of files includes:

[0187] parsing each file in the target file set to obtain parsed file data;

[0188] classifying each file in the target file set based on the type of the parsed file data to obtain the classified groups of files, wherein each file in each group of files has the same number of columns.

[0189] providing a graphical user interface through the terminal device, the graphical user interface including:

[0190] a first group of components for triggering a classification instruction to classify the target file set;

[0191] a second group of components for triggering a grid attribute setting instruction to set the grid attribute;

[0192] a third group of components for triggering a matrix generation instruction to generate a projection matrix based on the grid attribute of each group of files;

[0193] a fourth group of components for triggering a format conversion instruction to convert the format of each group of files.

[0194] The graphical user interface further includes a fifth group of components for triggering an attribute acquisition instruction to acquire the data attribute in each group of classified files, and the step of setting the grid attribute of each group of files includes:

[0195] extracting the data attribute in each group of classified files through the fifth group of components and displaying the extracted data attribute;

[0196] in response to a triggering operation on the second group of components, acquiring the grid attribute to be edited of each group of files;

[0197] displaying the grid attribute to be edited through the second group of components.

[0198] The model data processing method and device, electronic equipment and computer program product of the storage medium provided in the embodiment include a computer readable storage medium storing program codes, the instructions included in the program codes can be used to execute the method described in the foregoing method embodiments, and the specific implementation can be referred to the method embodiments, which will not be described here.

[0199] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0200] In addition, in the description of the present embodiment, unless explicitly specified and limited, the terms "mounting", "connection", "connecting" should be understood broadly, for example, can be fixedly connected, can be detachably connected, or integrally connected; can be mechanically connected, or electrically connected; can be directly connected, or indirectly connected through an intermediate medium, or can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present disclosure can be understood according to the specific circumstances.

[0201] The functions, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present disclosure essentially or the part of the prior art or the part of the technical solutions of the present disclosure can be embodied in the form of software product, and the computer software product is stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present disclosure. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various program code storage media.

[0202] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present disclosure. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0203] Finally, it should be noted that the above examples are merely specific embodiments of the present disclosure, used to illustrate the technical solutions of the present disclosure, and are not intended to limit the present disclosure. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing examples, those skilled in the art should understand that any person skilled in the art can still make modifications or easily think of changes to the technical solutions recorded in the foregoing examples, or make equivalent replacements to some of the technical features, within the technical scope disclosed by the present disclosure. Such modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the present embodiment, and should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A method for processing model data, characterized in that, The method includes: The target file set is classified to obtain the classified files, wherein each file in the target file set is used to store the point data of the three-dimensional model; Set the mesh attributes for each group of files, where the mesh attributes are the dataset that constitutes the mesh of the 3D model; A projection matrix is ​​generated based on the grid attributes of each group of files; Based on the projection matrix, the format of each group of files is converted to obtain the model data of the target format corresponding to each file; The step of converting the format of each group of files based on the projection matrix to obtain the model data of the target format corresponding to each file includes: The initial mesh of each file is constructed based on the vertex positions in each file and the projection matrix in each group of files; Obtain the vertex index data, normal information, and texture map coordinates of each file in each group of files; Based on the vertex index data in each file, the normal information in each file is written into the initial mesh of each file to obtain the mesh to be processed in each file; Based on the vertex index data in each file, the texture map coordinates in each file are written into the mesh to be processed in each file, thus obtaining the model data in the target format corresponding to each file.

2. The method according to claim 1, characterized in that, The step of constructing the initial mesh volume of each file based on the vertex positions in each file of each group of files and the projection matrix includes: Create an empty grid; The vertex positions in each file of each group of files are mapped to a two-dimensional screen using the projection matrix to obtain the mapped vertex positions. The mapped vertex positions are subjected to an inverse matrix transformation of the projection matrix to obtain the transformed vertex positions; The transformed vertex positions are set to the corresponding vertices in the empty mesh to obtain the mesh after constructing the vertex information; Polygons are constructed based on the vertices in each file, and the constructed polygons are added to the mesh after the vertex information is constructed to obtain the initial mesh volume of each file.

3. The method according to claim 1, characterized in that, The step of writing the normal information of each file into the initial mesh of each file according to the vertex index data in each file to obtain the mesh to be processed in each file includes: Create the normal layer of the initial mesh for each file and set the mode of the normal layer to obtain the first mesh for each file; Obtain the static array of the normal layer in the first mesh and the number of elements in each file; The size of the static array is adjusted based on the number of elements to obtain the adjusted static array; According to the vertex index data of each file, the normal information of each file is written into the corresponding vertex of the first mesh of each file, and the normal information of each file is added to the corresponding position in the adjusted static array to obtain the mesh to be processed for each file.

4. The method according to claim 1, characterized in that, The step of writing the texture map coordinates from each file into the mesh to be processed in each file according to the vertex index data in each file, to obtain the model data in the target format corresponding to each file, includes: Create texture coordinate layers for the meshes to be processed in each file, and set the mode of the texture coordinate layers to obtain the second meshes in each file; Obtain the static array and index array of the normal layer in the second mesh volume, as well as the number of elements in each file; The sizes of the static array and the index array are adjusted based on the number of elements to obtain the adjusted static array and the adjusted index array. The texture map coordinates of each file are written into the corresponding positions in the adjusted static array, and the vertex index data of each file is added to the corresponding positions in the adjusted index array to obtain the model data of the target format corresponding to each file.

5. The method according to claim 1, characterized in that, The step of classifying the target file set to obtain the classified groups of files includes: The files in the target file set are parsed to obtain the parsed file data; Based on the type of the parsed file data, each file in the target file set is classified to obtain classified groups of files, wherein each file in each group has the same number of columns.

6. The method according to any one of claims 1-5, characterized in that, A graphical user interface is provided through a terminal device, the graphical user interface including: The first set of components is used to trigger classification instructions to classify the target file set; The second set of components is used to trigger mesh property setting instructions to set mesh properties; The third set of components is used to trigger matrix generation instructions to generate a projection matrix based on the grid properties of the files in each set. The fourth group of components is used to trigger format conversion instructions to convert the formats of each group of files.

7. The method according to claim 6, characterized in that, The graphical user interface further includes: a fifth set of components for triggering attribute retrieval instructions to obtain data attributes from each group of categorized files; the step of setting the grid attributes of each group of files includes: The fifth set of components extracts the data attributes from each group of classified files and displays the extracted data attributes. In response to a trigger operation on the second group of components, obtain the grid properties to be edited for each group of files; The grid properties to be edited are displayed through the second set of components.

8. A device for processing model data, characterized in that, The device for processing the model data includes: The classification module is used to classify the target file set to obtain the classified files, wherein each file in the target file set is used to store the point data of the three-dimensional model; The setting module is used to extract the attributes of the data in each group of files after classification, and to obtain the extracted data attributes. The generation module is used to generate a projection matrix based on the grid attributes of each group of files; The conversion module is used to convert the format of each group of files based on the projection matrix to obtain the model data of the target format corresponding to each file; The conversion module can also be used for: The initial mesh of each file is constructed based on the vertex positions in each file and the projection matrix in each group of files; Obtain the vertex index data, normal information, and texture map coordinates of each file in each group of files; Based on the vertex index data in each file, the normal information in each file is written into the initial mesh of each file to obtain the mesh to be processed in each file; Based on the vertex index data in each file, the texture map coordinates in each file are written into the mesh to be processed in each file, thus obtaining the model data in the target format corresponding to each file.

9. An electronic device, characterized in that, It 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 model data processing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for processing model data according to any one of claims 1-7.

Citation Information

Patent Citations

  • File format conversion method and device and computer storage medium

    CN114359461A

  • Map data conversion method and device, computer equipment and storage medium

    CN115858644A