CN115779437A - Model file exporting method, device, equipment and storage medium - Google Patents

Model file exporting method, device, equipment and storage medium Download PDF

Info

Publication number
CN115779437A
CN115779437A CN202211374424.5A CN202211374424A CN115779437A CN 115779437 A CN115779437 A CN 115779437A CN 202211374424 A CN202211374424 A CN 202211374424A CN 115779437 A CN115779437 A CN 115779437A
Authority
CN
China
Prior art keywords
model
file
data
target
target model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211374424.5A
Other languages
Chinese (zh)
Inventor
余华茁
黄丽华
杜思嘉
苏晓江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202211374424.5A priority Critical patent/CN115779437A/en
Publication of CN115779437A publication Critical patent/CN115779437A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a device, equipment and a storage medium for exporting a model file, wherein the method comprises the following steps: obtaining model data corresponding to the target model and material data corresponding to the target model, wherein the material data at least comprises the following components: mapping relation between the map data corresponding to the target model and the map data and the model data; generating a model file in a specified format corresponding to the target model based on the model data; generating a map file in a specified format corresponding to the target model based on the map data; and generating and exporting the model file of the target model in a specified format based on the model file, the map file and the mapping relation. In the method, the mapping file of the model in the phantom engine is written into the model file to generate a new model file, and the model with mapping information in the phantom engine is imported into the digital content generation platform, so that the UE assets can be conveniently edited, and the problem that the model exported by the phantom engine is not provided with mapping links and needs to be linked again in target software is solved.

Description

模型文件的导出方法、装置、设备及存储介质Model file export method, device, equipment and storage medium

技术领域technical field

本发明涉及游戏技术领域,尤其涉及一种模型文件的导出方法、装置、设备及存储介质。The present invention relates to the technical field of games, in particular to a method, device, equipment and storage medium for exporting model files.

背景技术Background technique

现有的游戏制作过程中,大量场景和模型是直接用UE(Unreal Engine,虚幻引擎)组装的,或者下载的UE工程素材,为了能在Maya,Blender等DCC(Digital ContentCreation,数字内容生成)软件中进行二次编辑,就需要将模型贴图从UE中导出,然后导入DCC软件中,例如导入至Maya中,然后由艺术家一一手动对照在maya里把贴图连上。In the existing game production process, a large number of scenes and models are directly assembled with UE (Unreal Engine, Unreal Engine), or downloaded UE engineering materials, in order to be able to use DCC (Digital Content Creation, digital content generation) software such as Maya, Blender, etc. For secondary editing in , it is necessary to export the model textures from UE, and then import them into DCC software, such as Maya, and then manually compare the textures in Maya by the artist one by one.

然而,由于在游戏制作过程中,一个场景一般都是几十上百个材质,需要几小时才能做好一个,而且因为贴图太多了,还可能有连错的,这样可能造成场景错误导致后期返工的情况发生,导致游戏制作效率降低,游戏发售延期。However, in the process of game production, a scene generally has tens or hundreds of materials, and it takes several hours to complete one, and because there are too many textures, there may be errors in the connection, which may cause scene errors and lead to post-processing Rework occurred, resulting in a decrease in game production efficiency and a delay in game release.

发明内容Contents of the invention

本发明的主要目的在于解决现有的游戏制作过程中需要将模型和模型的贴图导出后再到DCC软件中连接导致场景错误的技术问题。The main purpose of the present invention is to solve the technical problem that in the existing game production process, the model and the texture map of the model need to be exported and then connected to the DCC software, resulting in scene errors.

本发明第一方面提供了一种模型文件的导出方法,方法包括:The first aspect of the present invention provides a method for exporting a model file, the method comprising:

在虚幻引擎中确定目标模型;Determine the target model in Unreal Engine;

响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;Responding to a model file export instruction for the target model, acquiring model data corresponding to the target model and material data corresponding to the target model; wherein the material data includes at least: textures corresponding to the target model data, the mapping relationship between the texture data and the model data;

基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;Based on the model data, generate a model file in a specified format corresponding to the target model;

基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;generating a texture file in a specified format corresponding to the target model based on the texture data;

基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。Based on the mapping relationship between the model file, the texture file, the texture data and the model data, generate and export the model file of the target model in the specified format; wherein, the reference format is at least Includes FBX format.

本发明第二方面提供了一种模型文件的导出装置,包括:The second aspect of the present invention provides a device for exporting model files, including:

模型确定模块,用于在虚幻引擎中确定目标模型;Model determination module, used to determine the target model in Unreal Engine;

获取模块,用于响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;An acquisition module, configured to respond to a model file export instruction for the target model, and acquire model data corresponding to the target model and material data corresponding to the target model; wherein, the material data at least includes: texture data corresponding to the target model, and a mapping relationship between the texture data and the model data;

模型文件生成模块,用于基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;A model file generation module, configured to generate a model file in a specified format corresponding to the target model based on the model data;

贴图文件生成模块,用于基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;A texture file generation module, configured to generate a texture file in a specified format corresponding to the target model based on the texture data;

导出模块,用于基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。An export module, configured to generate and export a model file of the target model in the specified format based on the model file, the texture file, the mapping relationship between the texture data and the model data; wherein, the The referencing formats include at least the FBX format.

本发明第三方面提供了一种模型文件的导出装置,包括:存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互连;所述至少一个处理器调用所述存储器中的所述指令,以使得所述模型文件的导出设备执行上述的模型文件的导出方法的步骤。The third aspect of the present invention provides a device for exporting model files, including: a memory and at least one processor, instructions are stored in the memory, and the memory and the at least one processor are interconnected through lines; the at least A processor calls the instruction in the memory, so that the device for exporting the model file executes the steps of the above-mentioned method for exporting the model file.

本发明的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述的模型文件的导出方法的步骤。A fourth aspect of the present invention provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, it causes the computer to execute the steps of the above-mentioned method for exporting a model file.

上述模型文件的导出方法、装置、设备及存储介质,通过在虚幻引擎中确定目标模型;响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。本方式中,通过将虚幻引擎中模型的贴图文件写入模型文件中,生成新的模型文件,把虚幻引擎中的模型带贴图信息导入至数字内容生成平台里,方便UE资产再编辑,解决了虚幻引擎导出的模型不带贴图链接,需要在目标软件中再次链接问题。The above-mentioned export method, device, device and storage medium of the model file determine the target model in the Unreal Engine; respond to the model file export instruction for the target model, obtain the model data corresponding to the target model, and the target model Material data corresponding to the model; wherein, the material data at least includes: texture data corresponding to the target model, and a mapping relationship between the texture data and the model data; based on the model data, generating the A model file in a specified format corresponding to the target model; based on the texture data, generate a texture file in a specified format corresponding to the target model; based on the model file, the texture file, the texture data and the model data The mapping relationship between, generate and export the model file of the target model in the specified format; wherein, the reference format includes at least FBX format. In this method, a new model file is generated by writing the texture file of the model in the Unreal Engine into the model file, and the model with texture information in the Unreal Engine is imported into the digital content generation platform to facilitate re-editing of UE assets. The model exported by Unreal Engine does not have texture links, and the problem needs to be linked again in the target software.

本发明的其他特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

为使本发明的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present invention more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.

附图说明Description of drawings

图1为本发明实施例中模型文件的导出方法的第一个实施例示意图;Fig. 1 is the schematic diagram of the first embodiment of the derivation method of the model file in the embodiment of the present invention;

图2为本发明实施例中模型文件的导出方法的第二个实施例示意图;Fig. 2 is the schematic diagram of the second embodiment of the derivation method of the model file in the embodiment of the present invention;

图3为本发明实施例中模型文件的导出装置的一个实施例示意图;Fig. 3 is a schematic diagram of an embodiment of a device for deriving a model file in an embodiment of the present invention;

图4为本发明实施例中模型文件的导出装置的另一个实施例示意图;Fig. 4 is a schematic diagram of another embodiment of the exporting device of the model file in the embodiment of the present invention;

图5为本发明实施例中模型文件的导出设备的一个实施例示意图。Fig. 5 is a schematic diagram of an embodiment of a device for exporting a model file in an embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例提供一种模型文件的导出方法、装置、设备及存储介质,通过在虚幻引擎中确定目标模型;响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。本方式中,通过将虚幻引擎中模型的贴图文件写入模型文件中,生成新的模型文件,把虚幻引擎中的模型带贴图信息导入至数字内容生成平台里,方便UE资产再编辑,解决了虚幻引擎导出的模型不带贴图链接,需要在目标软件中再次链接问题。An embodiment of the present invention provides a method, device, device, and storage medium for exporting a model file, by determining the target model in the Unreal Engine; responding to a model file export command for the target model, and obtaining the model corresponding to the target model Data, material data corresponding to the target model; wherein, the material data at least includes: texture data corresponding to the target model, a mapping relationship between the texture data and the model data; based on the model data, generating a model file in a specified format corresponding to the target model; generating a texture file in a specified format corresponding to the target model based on the texture data; based on the model file, the texture file, and the texture The mapping relationship between the data and the model data is to generate and export the model file of the target model in the specified format; wherein, the reference format includes at least FBX format. In this method, a new model file is generated by writing the texture file of the model in the Unreal Engine into the model file, and the model with texture information in the Unreal Engine is imported into the digital content generation platform to facilitate re-editing of UE assets. The model exported by Unreal Engine does not have texture links, and the problem needs to be linked again in the target software.

本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”或“具有”及其任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and not necessarily Used to describe a specific sequence or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the term "comprising" or "having" and any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to those explicitly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

为便于理解,下面对本发明实施例的具体流程进行描述,请参阅图1,本发明实施例中模型文件的导出方法的第一个实施例包括:For ease of understanding, the following describes the specific process of the embodiment of the present invention, please refer to Figure 1, the first embodiment of the export method of the model file in the embodiment of the present invention includes:

101、在虚幻引擎中确定目标模型;101. Determine the target model in Unreal Engine;

可以理解的是,本发明的执行主体可以为模型文件的导出装置,还可以是终端或者服务器,具体此处不做限定。本发明实施例以服务器为执行主体为例进行说明。It can be understood that the subject of execution of the present invention may be an exporting device of a model file, and may also be a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as an execution subject as an example.

在实际应用中,一般3dsmax是可以直接导出到别的DCC软件中的,在本实施例中,主要进行UE的导出,这是因为UE工程可能是从别的工作室获取或者外部下载的,并没有3dsmax源文件,或者有3dsmax源文件,但是进UE后有二次修改和原始3dsmax文件的信息并不一致,只能从UE导出,当存在3dsmax源文件时,3D模型的建模工作主要由美术师在3dsmax上进行,然后从3dsmax中导出模型到UE,当前主流游戏开发中还是采用手动从3dsmax导出fbx,再手动导入到UE中,然后在UE中再手动将模型的相对位置进行对齐还原,通过对导入到UE中的模型组装成场景后,还需要导出至在Maya,Blender等DCC中进行二次编辑,在本实施例中,虚幻引擎中的目标模型即是通过美术师在3dsmax上进行建模后导入至UE中得到的,此外,当不存在3dsmax源文件时,虚幻引擎中的目标模型是从别的工作室获取或者外部下载的,本申请对虚幻引擎中的目标模型的来源不作限定。In practical applications, generally 3dsmax can be directly exported to other DCC software. In this embodiment, the UE is mainly exported, because the UE project may be obtained from other studios or downloaded externally, and There is no 3dsmax source file, or there is a 3dsmax source file, but after entering UE, there is a secondary modification and the information of the original 3dsmax file is inconsistent, so it can only be exported from UE. When there is a 3dsmax source file, the modeling work of the 3D model is mainly done by the artist. The division is carried out on 3dsmax, and then the model is exported from 3dsmax to UE. In the current mainstream game development, the fbx is manually exported from 3dsmax, and then manually imported into UE, and then the relative position of the model is manually aligned and restored in UE. After the model imported into UE is assembled into a scene, it needs to be exported to DCC such as Maya and Blender for secondary editing. In this embodiment, the target model in Unreal Engine is created by an artist on 3dsmax It is obtained after modeling and imported into UE. In addition, when there is no 3dsmax source file, the target model in Unreal Engine is obtained from other studios or downloaded externally. This application does not make any reference to the source of the target model in Unreal Engine. limited.

在本实施例中,事先通过贴图绘制软件确定每个目标模型的贴图文件,其中贴图绘制软件可以是Substance Painter、Photoshop等,可以将模型文件导入贴图绘制软件。针对目标模型,服务器可以响应于针对目标模型的模型文件的贴图绘制指令,在贴图绘制软件中为模型文件生成若干种贴图文件。这里,贴图文件可以是固有色、粗糙度、金属度、法线等一种或多种属性的贴图文件,基于目标模型的显示效果而定。贴图绘制指令用于指示贴图绘制软件生成相应的贴图文件。贴图绘制软件可以生成满足PBR(Physically-BasedRendering,基于实物的呈现)标准的贴图文件,便于作为3D模型资产导出,并导入至渲染引擎,从而可大大降低后续渲染得到虚拟场景的时间成本,在3dsmax中获得模型文件以及模型文件对应的若干贴图文件之后,服务器可以将各模型文件及其对应的贴图文件,导入虚幻引擎中。In this embodiment, the texture file of each target model is determined in advance by texture drawing software, wherein the texture drawing software can be Substance Painter, Photoshop, etc., and the model file can be imported into the texture drawing software. For the target model, the server may generate several kinds of texture files for the model file in the texture drawing software in response to a texture drawing instruction for the model file of the target model. Here, the texture file may be a texture file with one or more attributes such as intrinsic color, roughness, metalness, normal, etc., which is determined based on the display effect of the target model. The texture drawing command is used to instruct the texture drawing software to generate corresponding texture files. Texture drawing software can generate texture files that meet the PBR (Physically-Based Rendering, based on physical rendering) standard, which can be easily exported as 3D model assets and imported into the rendering engine, which can greatly reduce the time cost of subsequent rendering to obtain virtual scenes. In 3dsmax After obtaining the model file and several texture files corresponding to the model file, the server can import each model file and its corresponding texture file into Unreal Engine.

在本实施例中,通过虚幻引擎中的API和导出界面设置,生成模型选择指令,服务器响应于模型选择指令,确定模型选择指令对应的所有目标模型,并通过函数mesh.static_mesh_component.get_materials获取目标模型的材质信息,并通过函数material.texture_parameter_valUEs基于材质信息获取目标模型的贴图文件。In this embodiment, the model selection instruction is generated through the API and export interface settings in the Unreal Engine, and the server responds to the model selection instruction to determine all target models corresponding to the model selection instruction, and obtains the target model through the function mesh.static_mesh_component.get_materials The material information of the target model, and obtain the texture file of the target model based on the material information through the function material.texture_parameter_valUEs.

102、响应针对于目标模型的模型文件导出指令,获取目标模型对应的模型数据、与目标模型对应的材质数据;其中,材质数据至少包括:与目标模型对应的贴图数据、贴图数据与模型数据之间的映射关系;102. Respond to the model file export instruction for the target model, and obtain the model data corresponding to the target model and the material data corresponding to the target model; wherein, the material data at least includes: texture data corresponding to the target model, and the relationship between the texture data and the model data The mapping relationship between;

在本实施例中,所述响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据包括:响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据,并基于所述虚幻引擎中预设的函数获取所述目标模型的材质信息;根据所述材质信息获取所述目标模型的贴图数据以及所述贴图数据与所述模型数据之间的映射关系。In this embodiment, in response to the model file export instruction for the target model, obtaining the model data corresponding to the target model and the material data corresponding to the target model includes: responding to the target model A model file export command to obtain the model data corresponding to the target model, and obtain the material information of the target model based on the preset function in the Unreal Engine; obtain the texture data of the target model and the texture data of the target model according to the material information The mapping relationship between the texture data and the model data.

103、基于模型数据,生成与目标模型对应的指定格式的模型文件;103. Based on the model data, generate a model file in a specified format corresponding to the target model;

在本实施例中,所述指定格式主要为格式,格式是一种3D通用模型文件格式,文件中可以包含动画、材质特性、贴图、骨骼动画、灯光、摄像机等信息。通过用虚幻引擎的插件AssetExportTask将模型数据导出为FBX格式文件,作为模型文件,该模型文件由于是常规导出,所有并不含有贴图信息。In this embodiment, the specified format is mainly a format, which is a general 3D model file format, and the file may contain information such as animation, material properties, textures, skeletal animation, lighting, and cameras. The model data is exported as a FBX format file by using the plugin AssetExportTask of the Unreal Engine, as a model file. Since the model file is a conventional export, it does not contain texture information.

104、基于贴图数据,生成与目标模型对应的指定格式的贴图文件;104. Based on the texture data, generate a texture file in a specified format corresponding to the target model;

在本实施例中,通过虚幻引擎的插件AssetExportTask将目标模型中的所有贴图文件批量导出,主要导出为tga格式的贴图文件,tga格式的结构比较简单,属于一种图形、图像数据的通用格式,在多媒体领域有很大影响,是计算机生成图像向电视转换的一种首选格式。In this embodiment, all texture files in the target model are exported in batches through the Unreal Engine plug-in AssetExportTask, mainly as texture files in the tga format. The structure of the tga format is relatively simple, and it belongs to a general format for graphics and image data. It has had a great impact in the multimedia field and is a preferred format for the conversion of computer-generated images to television.

105、基于模型文件、贴图文件、贴图数据与模型数据之间的映射关系,以指定格式生成并导出目标模型的模型文件;其中,指代格式至少包括FBX格式。105. Based on the mapping relationship between the model file, the texture file, and the texture data and the model data, generate and export the model file of the target model in a specified format; wherein, the format at least includes the FBX format.

在本实施例中,通过预设的FBX插件fbx.FbxFileTexture贴图数据与模型数据之间的映射关系将对应贴图文件写入模型数据生成的模型文件内,生成新的模型文件。In this embodiment, a new model file is generated by writing the corresponding texture file into the model file generated from the model data through the preset mapping relationship between the FBX plug-in fbx.FbxFileTexture texture data and the model data.

在本实施例中,在所述基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件之前,还包括:将所述目标模型的坐标进行归零处理。In this embodiment, based on the mapping relationship between the model file, the texture file, the texture data and the model data, the model file of the target model is generated and exported in the specified format Before, it also includes: zeroing the coordinates of the target model.

具体的,在一些DCC软件中,对模型计算默认是以原点为基准,将模型的坐标归零,有助于减少软件运行内存,如果导入模型,导入后模型位置及大小不一定是在理想状态,归零有助于很快找到模型。Specifically, in some DCC software, the default calculation of the model is based on the origin, and the coordinates of the model are reset to zero, which helps to reduce the running memory of the software. If the model is imported, the position and size of the model after importing may not be in an ideal state. , zeroing helps to find the model very quickly.

在本实施例中,在所述基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件之后,还包括:响应针对于以所述指定格式导出的模型文件的文件导入指令,确定需导入以所述指定格式导出的模型文件的数字内容生成平台;根据所述数字内容生成平台的平台类型对以所述指定格式导出的模型文件中的贴图文件进行重命名。In this embodiment, based on the mapping relationship between the model file, the texture file, the texture data and the model data, the model file of the target model is generated and exported in the specified format After that, it also includes: responding to the file import instruction for the model file exported in the specified format, determining the digital content generation platform that needs to import the model file exported in the specified format; according to the platform type of the digital content generation platform Renames texture files in model files exported in the specified format.

具体的,在实际应用中,存在不同的DCC软件,例如maya、3dsmax和houdini等,不同的DCC软件对贴图文件的命名存在对应的命名规范,在DCC软件导入模型文件前,提前对模型文件的文件名进行统一重命名,以使得模型文件符合需要导入的DCC软件的贴图命名规范。Specifically, in practical applications, there are different DCC software, such as maya, 3dsmax, and houdini, etc., and different DCC software has corresponding naming conventions for the naming of texture files. The file names are uniformly renamed so that the model files conform to the texture naming convention of the DCC software that needs to be imported.

在本实施例中,在所述基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件之后,还包括:将以所述指定格式导出的模型文件的文件导入至所述数字内容生成平台中,通过所述数字内容生成平台,将以所述指定格式导出的模型文件转换为可编辑数据;通过所述数字内容生成平台显示所述可编辑数据中的贴图信息。In this embodiment, based on the mapping relationship between the model file, the texture file, the texture data and the model data, the model file of the target model is generated and exported in the specified format After that, it also includes: importing the model file exported in the specified format into the digital content generation platform, and converting the model file exported in the specified format into editable data through the digital content generation platform ; Displaying the map information in the editable data through the digital content generation platform.

在本实施例中,其它DCC软件都支持FBX格式的文件,直接将FBX文件导入DCC软件会自动解析成DCC的可编辑数据,在maya和max中按点击视图上的显示贴图按钮即可显示贴图,在blender切换到Shading模式就可以看到贴图,进行二次编辑工作。In this embodiment, other DCC software supports files in FBX format. Directly importing FBX files into DCC software will automatically parse them into editable data of DCC. In maya and max, click the display map button on the view to display the map , switch to Shading mode in blender and you can see the texture for secondary editing.

在本实施例中,通过在虚幻引擎中确定目标模型;响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。本方式中,通过将虚幻引擎中模型的贴图文件写入模型文件中,生成新的模型文件,把虚幻引擎中的模型带贴图信息导入至数字内容生成平台里,方便UE资产再编辑,解决了虚幻引擎导出的模型不带贴图链接,需要在目标软件中再次链接问题。In this embodiment, by determining the target model in the Unreal Engine; in response to the model file export instruction for the target model, the model data corresponding to the target model and the material data corresponding to the target model are obtained; wherein, The material data at least includes: texture data corresponding to the target model, a mapping relationship between the texture data and the model data; based on the model data, a model in a specified format corresponding to the target model is generated file; based on the texture data, generate a texture file in a specified format corresponding to the target model; based on the mapping relationship between the model file, the texture file, the texture data and the model data, the The specified format is used to generate and export the model file of the target model; wherein, the specified format includes at least FBX format. In this method, a new model file is generated by writing the texture file of the model in the Unreal Engine into the model file, and the model with texture information in the Unreal Engine is imported into the digital content generation platform to facilitate re-editing of UE assets. The model exported by Unreal Engine does not have texture links, and the problem needs to be linked again in the target software.

请参阅图2,本发明实施例中模型文件的导出方法的第二个实施例包括:Referring to Fig. 2, the second embodiment of the export method of the model file in the embodiment of the present invention comprises:

201、在虚幻引擎中确定目标模型;201. Determine the target model in Unreal Engine;

202、响应针对于目标模型的模型文件导出指令,获取目标模型对应的模型数据;202. Acquire model data corresponding to the target model in response to a model file export instruction for the target model;

203、调用虚幻引擎中的网格变量,并根据网格变量获取目标模型的模型实例;203. Call the grid variable in Unreal Engine, and obtain the model instance of the target model according to the grid variable;

204、确定网格变量中的静态网格组件,并通过静态网格组件中的材质获取函数获取模型实例的材质信息作为目标模型的材质信息;204. Determine the static grid component in the grid variable, and obtain the material information of the model instance as the material information of the target model through the material acquisition function in the static grid component;

在本实施例中,材质获取函数主要是虚幻引擎中的mesh.static_mesh_component.get_materials函数,通过材质获取函数获取目标模型的材质信息,mesh.static_mesh_component.get_materials是UE自带的python API的一个函数,其中,mesh是获取的UE的模型实例的一个变量,它有个属性是static_mesh_component这个是它的组件,是用于上材质的,它有个专属的函数是get_materials,这个函数可以获取当前模型被赋予的材质。In this embodiment, the material acquisition function is mainly the mesh.static_mesh_component.get_materials function in Unreal Engine, and the material information of the target model is obtained through the material acquisition function. mesh.static_mesh_component.get_materials is a function of the python API that comes with UE, where , mesh is a variable of the obtained model instance of UE. It has an attribute static_mesh_component, which is its component and is used for adding materials. It has a dedicated function get_materials, which can get the current model. material.

205、调用虚拟引擎的材质变量,根据材质变量获取材质信息的材质实例;205. Call the material variable of the virtual engine, and obtain the material instance of the material information according to the material variable;

206、根据材质变量的纹理参数函数获取材质实例的贴图数据作为目标模型的贴图数据,并生成贴图数据与模型数据之间的映射关系;206. Obtain the texture data of the material instance according to the texture parameter function of the material variable as the texture data of the target model, and generate a mapping relationship between the texture data and the model data;

在本实施例中,纹理参数函数主要是虚幻引擎中的material.texture_parameter_valUEs函数,通过纹理参数函数进行贴图数据的获取,其中material.texture_parameter_valUEs是UE自带的python API的一个函数,material是上文get_materials方法获取的UE的材质实例的一个变量,它有个专属的函数是texture_parameter_valUEs,这个函数可以获取当前材质的所有贴图的贴图数据。In this embodiment, the texture parameter function is mainly the material.texture_parameter_valUEs function in the Unreal Engine, and the texture data is obtained through the texture parameter function, where material.texture_parameter_valUEs is a function of the python API that comes with UE, and material is the above get_materials A variable of the UE material instance obtained by the method, it has a dedicated function texture_parameter_valUEs, this function can obtain the texture data of all the textures of the current material.

207、基于模型数据,生成与目标模型对应的指定格式的模型文件;207. Based on the model data, generate a model file in a specified format corresponding to the target model;

208、基于贴图数据,生成与目标模型对应的指定格式的贴图文件;208. Based on the texture data, generate a texture file in a specified format corresponding to the target model;

209、基于模型文件、贴图文件、贴图数据与模型数据之间的映射关系,以指定格式生成并导出目标模型的模型文件;其中,指代格式至少包括FBX格式。209. Based on the mapping relationship between the model file, the texture file, and the texture data and the model data, generate and export the model file of the target model in a specified format; wherein, the format at least includes an FBX format.

在本实施例中,所述基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件包括:分别将所述模型文件和所述贴图文件批量导出;通过预设的文件写入接口根据所述映射关系将导出的贴图文件写入对应的导出的模型文件中,以生成所述目标模型指定格式的模型文件。In this embodiment, based on the mapping relationship between the model file, the texture file, the texture data and the model data, generating and exporting the model file of the target model in the specified format includes : respectively exporting the model files and the texture files in batches; writing the exported texture files into the corresponding exported model files through the preset file writing interface according to the mapping relationship, so as to generate the specified target model format model file.

进一步的,所述通过预设的文件写入接口根据所述映射关系将导出的贴图文件写入对应的导出的模型文件中,生成指定格式的所述目标模型的模型文件包括:通过预设的文件写入接口分别生成导出的模型文件的材质信息对应的材质节点和所述贴图文件对应的贴图节点;通过预设的链接函数和所述映射关系,将所述贴图节点链接至所述材质节点上,使得所述贴图文件写入导出的模型文件中;通过预设的保存函数将写入贴图文件的模型文件进行保存,生成指定格式的所述目标模型的模型文件。Further, writing the exported map file into the corresponding exported model file according to the mapping relationship through the preset file writing interface, and generating the model file of the target model in a specified format includes: The file writing interface respectively generates the material node corresponding to the material information of the exported model file and the texture node corresponding to the texture file; through the preset link function and the mapping relationship, the texture node is linked to the material node above, the texture file is written into the exported model file; the model file written into the texture file is saved through a preset saving function, and a model file of the target model in a specified format is generated.

具体的,根据上文获取到的材质信息和贴图文件,首先通过fbxpythonapi的scene.GetMaterial方法到对应的材质节点,然后使用fbxpythonapi的fbx.FbxFileTexture.Create函数创建贴图节点,再使用材质节点的ConnectSrcObject方法将贴图链接到材质上,这样贴图文件就写入到模型文件内了。最后使用fbxpythonapi的FbxCommon.SaveScene函数将模型文件保存以FBX格式保存,得到新的模型文件。因为导出的FBX模型和材质是已经连好的了,所以只需将贴图文件写入即可。Specifically, according to the material information and texture files obtained above, first go to the corresponding material node through the scene.GetMaterial method of fbxpythonapi, and then use the fbx.FbxFileTexture.Create function of fbxpythonapi to create a texture node, and then use the ConnectSrcObject method of the material node Link the texture to the material so that the texture file is written into the model file. Finally, use the FbxCommon.SaveScene function of fbxpythonapi to save the model file in FBX format to obtain a new model file. Because the exported FBX model and material are already connected, it is only necessary to write the texture file.

在本实施例中,在在所述将所述第二FBX文件导出之后,还包括:将导出的所述第二FBX文件导入至DCC软件中,通过所述DCC软件,将所述第二FBX文件转换为可编辑数据;通过所述DCC软件显示所述可编辑数据中的贴图信息。In this embodiment, after exporting the second FBX file, it further includes: importing the exported second FBX file into DCC software, and using the DCC software to import the second FBX file The file is converted into editable data; the texture information in the editable data is displayed through the DCC software.

具体的,直接将fbx导入DCC软件会自动解析成DCC的可编辑数据。在maya和max中按点击视图上的显示贴图按钮即可显示贴图,在blender切换到Shading模式就可以看到贴图。Specifically, directly importing fbx into DCC software will automatically parse it into editable data of DCC. In maya and max, click the display texture button on the view to display the texture, and switch to the Shading mode in blender to see the texture.

本实施例在上一实施例的基础上,详细描写了获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据的过程,通过获取所述目标模型对应的模型数据,并基于所述虚幻引擎中预设的函数获取所述目标模型的材质信息;根据所述材质信息获取所述目标模型的贴图数据以及所述贴图数据与所述模型数据之间的映射关系。本方式中,通过将虚幻引擎中模型的贴图文件写入模型文件中,生成新的模型文件,把虚幻引擎中的模型带贴图信息导入至数字内容生成平台里,方便UE资产再编辑,解决了虚幻引擎导出的模型不带贴图链接,需要在目标软件中再次链接问题。On the basis of the previous embodiment, this embodiment describes in detail the process of obtaining the model data corresponding to the target model and the material data corresponding to the target model. By obtaining the model data corresponding to the target model, and based on The preset function in the Unreal Engine obtains the material information of the target model; obtains the texture data of the target model and the mapping relationship between the texture data and the model data according to the material information. In this method, a new model file is generated by writing the texture file of the model in the Unreal Engine into the model file, and the model with texture information in the Unreal Engine is imported into the digital content generation platform to facilitate re-editing of UE assets. The model exported by Unreal Engine does not have texture links, and the problem needs to be linked again in the target software.

上面对本发明实施例中模型文件的导出方法进行了描述,下面对本发明实施例中模型文件的导出装置进行描述,请参阅图3,本发明实施例中模型文件的导出装置一个实施例包括:The method for deriving the model file in the embodiment of the present invention has been described above, and the device for deriving the model file in the embodiment of the present invention is described below. Please refer to FIG. 3 . An embodiment of the device for deriving the model file in the embodiment of the present invention includes:

模型确定模块301,用于在虚幻引擎中确定目标模型;Model determination module 301, used to determine the target model in Unreal Engine;

获取模块302,用于响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;The obtaining module 302 is configured to obtain model data corresponding to the target model and material data corresponding to the target model in response to a model file export instruction for the target model; wherein the material data at least includes: The texture data corresponding to the target model, the mapping relationship between the texture data and the model data;

模型文件生成模块303,用于基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;A model file generation module 303, configured to generate a model file in a specified format corresponding to the target model based on the model data;

贴图文件生成模块304,用于基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;A texture file generation module 304, configured to generate a texture file in a specified format corresponding to the target model based on the texture data;

导出模块305,用于基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。An export module 305, configured to generate and export a model file of the target model in the specified format based on the mapping relationship between the model file, the texture file, the texture data and the model data; wherein, The reference format includes at least FBX format.

本发明实施例中,所述模型文件的导出装置运行上述模型文件的导出方法,所述模型文件的导出装置通过在虚幻引擎中确定目标模型;响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。本方式中,通过将虚幻引擎中模型的贴图文件写入模型文件中,生成新的模型文件,把虚幻引擎中的模型带贴图信息导入至数字内容生成平台里,方便UE资产再编辑,解决了虚幻引擎导出的模型不带贴图链接,需要在目标软件中再次链接问题。In the embodiment of the present invention, the exporting device of the model file runs the above-mentioned exporting method of the model file, and the exporting device of the model file determines the target model in the Unreal Engine; in response to the model file export command for the target model, Acquiring model data corresponding to the target model and material data corresponding to the target model; wherein, the material data at least includes: texture data corresponding to the target model, a gap between the texture data and the model data mapping relationship; based on the model data, generate a model file in a specified format corresponding to the target model; based on the texture data, generate a texture file in a specified format corresponding to the target model; based on the model file, The mapping relationship between the texture file, the texture data and the model data is to generate and export the model file of the target model in the specified format; wherein, the reference format includes at least FBX format. In this method, a new model file is generated by writing the texture file of the model in the Unreal Engine into the model file, and the model with texture information in the Unreal Engine is imported into the digital content generation platform to facilitate re-editing of UE assets. The model exported by Unreal Engine does not have texture links, and the problem needs to be linked again in the target software.

请参阅图4,本发明实施例中模型文件的导出装置的第二个实施例包括:Referring to Fig. 4, the second embodiment of the exporting device of the model file in the embodiment of the present invention comprises:

模型确定模块301,用于在虚幻引擎中确定目标模型;Model determination module 301, used to determine the target model in Unreal Engine;

获取模块302,用于响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据、与所述目标模型对应的材质数据;其中,所述材质数据至少包括:与所述目标模型对应的贴图数据、所述贴图数据与所述模型数据之间的映射关系;The obtaining module 302 is configured to obtain model data corresponding to the target model and material data corresponding to the target model in response to a model file export instruction for the target model; wherein the material data at least includes: The texture data corresponding to the target model, the mapping relationship between the texture data and the model data;

模型文件生成模块303,用于基于所述模型数据,生成与所述目标模型对应的指定格式的模型文件;A model file generation module 303, configured to generate a model file in a specified format corresponding to the target model based on the model data;

贴图文件生成模块304,用于基于所述贴图数据,生成与所述目标模型对应的指定格式的贴图文件;A texture file generation module 304, configured to generate a texture file in a specified format corresponding to the target model based on the texture data;

导出模块305,用于基于所述模型文件、所述贴图文件、所述贴图数据与所述模型数据之间的映射关系,以所述指定格式生成并导出所述目标模型的模型文件;其中,所述指代格式至少包括FBX格式。An export module 305, configured to generate and export a model file of the target model in the specified format based on the mapping relationship between the model file, the texture file, the texture data and the model data; wherein, The reference format includes at least FBX format.

在本实施例中,所述获取模块302包括:In this embodiment, the acquisition module 302 includes:

材质数据获取单元3021,用于响应针对于所述目标模型的模型文件导出指令,获取所述目标模型对应的模型数据,并基于所述虚幻引擎中预设的函数获取所述目标模型的材质信息;The material data obtaining unit 3021 is configured to respond to the model file export instruction for the target model, obtain the model data corresponding to the target model, and obtain the material information of the target model based on the function preset in the Unreal Engine ;

贴图数据获取单元3022,用于根据所述材质信息获取所述目标模型的贴图数据以及所述贴图数据与所述模型数据之间的映射关系。The texture data obtaining unit 3022 is configured to obtain texture data of the target model and a mapping relationship between the texture data and the model data according to the material information.

在本实施例中,所述材质数据获取单元3021具体用于:In this embodiment, the material data acquisition unit 3021 is specifically used for:

获取所述目标模型对应的模型数据;Acquiring model data corresponding to the target model;

调用所述虚幻引擎中的网格变量,并根据所述网格变量获取所述目标模型的模型实例;call the grid variable in the Unreal Engine, and obtain the model instance of the target model according to the grid variable;

确定所述网格变量中的静态网格组件,并通过所述静态网格组件中的材质获取函数获取所述模型实例的材质信息作为所述目标模型的材质信息。Determine the static grid component in the grid variable, and obtain the material information of the model instance as the material information of the target model through the material acquisition function in the static grid component.

在本实施例中,所述贴图数据获取单元3022具体用于:In this embodiment, the texture data acquisition unit 3022 is specifically used for:

调用所述虚拟引擎的材质变量,根据所述材质变量获取所述材质信息的材质实例;calling the material variable of the virtual engine, and obtaining the material instance of the material information according to the material variable;

根据所述材质变量的纹理参数函数获取所述材质实例的贴图数据生成所述目标模型的贴图文件。Acquiring the texture data of the material instance according to the texture parameter function of the material variable to generate the texture file of the target model.

在本实施例中,所述导出模块305具体包括:In this embodiment, the export module 305 specifically includes:

批量导出单元3051,用于分别将所述模型文件和所述贴图文件批量导出;A batch export unit 3051, configured to export the model files and the map files in batches respectively;

写入单元3052,用于通过预设的文件写入接口根据所述映射关系将导出的贴图文件写入对应的导出的模型文件中,以生成所述目标模型指定格式的模型文件。The writing unit 3052 is configured to write the exported map file into the corresponding exported model file according to the mapping relationship through a preset file writing interface, so as to generate a model file in the specified format of the target model.

在本实施例中,所述写入单元3052具体用于:In this embodiment, the writing unit 3052 is specifically used for:

通过预设的文件写入接口分别生成导出的模型文件的材质信息对应的材质节点和所述贴图文件对应的贴图节点;Generate a material node corresponding to the material information of the exported model file and a texture node corresponding to the texture file through a preset file writing interface;

通过预设的链接函数和所述映射关系,将所述贴图节点链接至所述材质节点上,使得所述贴图文件写入导出的模型文件中;Linking the texture node to the material node through the preset link function and the mapping relationship, so that the texture file is written into the exported model file;

通过预设的保存函数将写入贴图文件的模型文件进行保存,生成指定格式的所述目标模型的模型文件。The model file written into the map file is saved through a preset saving function, and a model file of the target model in a specified format is generated.

在本实施例中,所述模型文件的导出装置还包括坐标归零模块306,所述指标归零模块306具体用于:In this embodiment, the device for deriving the model file further includes a coordinate zeroing module 306, and the index zeroing module 306 is specifically used for:

将所述目标模型的坐标进行归零处理。The coordinates of the target model are reset to zero.

在本实施例中,所述模型文件的导出装置还包括重命名模块307,所述重命名模块307具体用于:In this embodiment, the device for exporting the model file further includes a renaming module 307, and the renaming module 307 is specifically used for:

响应针对于以所述指定格式导出的模型文件的文件导入指令,确定需导入以所述指定格式导出的模型文件的数字内容生成平台;Responding to the file import instruction for the model file exported in the specified format, determine the digital content generation platform that needs to import the model file exported in the specified format;

根据所述数字内容生成平台的平台类型对以所述指定格式导出的模型文件中的贴图文件进行重命名。According to the platform type of the digital content generation platform, rename the texture file in the model file exported in the specified format.

在本实施例中,所述模型文件的导出装置还包括导入模块308,所述导入模块308具体用于:In this embodiment, the device for exporting the model file further includes an import module 308, and the import module 308 is specifically used for:

将以所述指定格式导出的模型文件的文件导入至所述数字内容生成平台中,通过所述数字内容生成平台,将以所述指定格式导出的模型文件转换为可编辑数据;importing the model file exported in the specified format into the digital content generation platform, and converting the model file exported in the specified format into editable data through the digital content generation platform;

通过所述数字内容生成平台显示所述可编辑数据中的贴图信息。The map information in the editable data is displayed through the digital content generation platform.

本实施例在上一实施例的基础上,详细描述了各个模块的具体功能以及部分模块的单元构成,通过将虚幻引擎中模型的贴图文件写入模型文件中,生成新的模型文件,把虚幻引擎中的模型带贴图信息导入至数字内容生成平台里,方便UE资产再编辑,解决了虚幻引擎导出的模型不带贴图链接,需要在目标软件中再次链接问题。On the basis of the previous embodiment, this embodiment describes in detail the specific functions of each module and the unit structure of some modules. By writing the texture file of the model in the Unreal Engine into the model file, a new model file is generated, and the Unreal The model in the engine with texture information is imported into the digital content generation platform, which is convenient for re-editing UE assets, and solves the problem that the model exported by Unreal Engine does not have texture links and needs to be linked again in the target software.

上面图4和图5从模块化功能实体的角度对本发明实施例中的中模型文件的导出装置进行详细描述,下面从硬件处理的角度对本发明实施例中模型文件的导出设备进行详细描述。Figure 4 and Figure 5 above describe the model file exporting device in the embodiment of the present invention in detail from the perspective of modular functional entities, and the following describes the model file exporting device in the embodiment of the present invention in detail from the perspective of hardware processing.

图5是本发明实施例提供的一种模型文件的导出设备的结构示意图,该模型文件的导出设备500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)510(例如,一个或一个以上处理器)和存储器520,一个或一个以上存储应用程序533或数据532的存储介质530(例如一个或一个以上海量存储设备)。其中,存储器520和存储介质530可以是短暂存储或持久存储。存储在存储介质530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对模型文件的导出设备500中的一系列指令操作。更进一步地,处理器510可以设置为与存储介质530通信,在模型文件的导出设备500上执行存储介质530中的一系列指令操作,以实现上述模型文件的导出方法的步骤。5 is a schematic structural diagram of a model file exporting device provided by an embodiment of the present invention. The model file exporting device 500 may have relatively large differences due to different configurations or performances, and may include one or more than one processor (central processing units (CPU) 510 (for example, one or more processors) and memory 520, one or more storage media 530 for storing application programs 533 or data 532 (for example, one or more mass storage devices). Wherein, the memory 520 and the storage medium 530 may be temporary storage or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the device 500 for exporting model files. Furthermore, the processor 510 may be configured to communicate with the storage medium 530, and execute a series of instruction operations in the storage medium 530 on the device 500 for exporting the model file, so as to realize the steps of the above-mentioned method for exporting the model file.

模型文件的导出设备500还可以包括一个或一个以上电源540,一个或一个以上有线或无线网络接口550,一个或一个以上输入输出接口560,和/或,一个或一个以上操作系统531,例如Windows Serve,Mac OS X,Unix,Linux,FreeBSD等等。本领域技术人员可以理解,图5示出的模型文件的导出设备结构并不构成对本发明提供的模型文件的导出设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The export device 500 of the model file may also include one or more power sources 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and/or, one or more operating systems 531, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and more. Those skilled in the art can understand that the exporting device structure of the model file shown in Figure 5 does not constitute a limitation to the exporting device of the model file provided by the present invention, and may include more or less components than those shown in the illustration, or combine some components, or different component arrangements.

本发明还提供一种计算机可读存储介质,该计算机可读存储介质可以为非易失性计算机可读存储介质,该计算机可读存储介质也可以为易失性计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行所述模型文件的导出方法的步骤。The present invention also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium may also be a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium, and when the instructions are run on the computer, the computer is made to execute the steps of the method for exporting the model file.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统或装置、单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the system, device, and unit described above can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other various media that can store program codes. .

以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions recorded in each embodiment are modified, or some of the technical features are replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (12)

1. An export method of a model file, which is applied to a ghost engine, and comprises the following steps:
determining a target model in the illusion engine;
responding to a model file export instruction aiming at the target model, and acquiring model data corresponding to the target model and material data corresponding to the target model; wherein the texture data at least comprises: mapping data corresponding to the target model and mapping relation between the mapping data and the model data;
generating a model file in a specified format corresponding to the target model based on the model data;
generating a map file in a specified format corresponding to the target model based on the map data;
generating and exporting a model file of the target model in the specified format based on the model file, the map data and the mapping relation between the model data; wherein the reference format comprises at least an FBX format.
2. The method according to claim 1, wherein the obtaining model data corresponding to the target model and material data corresponding to the target model in response to the model file export instruction for the target model comprises:
responding to a model file export instruction aiming at the target model, obtaining model data corresponding to the target model, and obtaining material information of the target model based on a preset function in the illusion engine;
and obtaining the mapping data of the target model and the mapping relation between the mapping data and the model data according to the material information.
3. The method for exporting the model file according to claim 2, wherein the obtaining of the model data corresponding to the target model and the obtaining of the material information of the target model based on the function preset in the phantom engine includes:
obtaining model data corresponding to the target model;
calling a grid variable in the illusion engine, and acquiring a model instance of the target model according to the grid variable;
and determining a static grid component in the grid variable, and acquiring the material information of the model instance as the material information of the target model through a material acquisition function in the static grid component.
4. The method for exporting the model file according to claim 2, wherein the obtaining of the mapping data of the target model and the mapping relationship between the mapping data and the model data according to the material information comprises:
calling a material variable of the virtual engine, and acquiring a material example of the material information according to the material variable;
and obtaining the mapping data of the material instance as the mapping data of the target model according to the texture parameter function of the material variable, and generating the mapping relation between the mapping data and the model data.
5. The method for exporting a model file according to claim 2, wherein said generating and exporting a model file of said target model in said specified format based on said model file, said map data and said model data comprises:
respectively exporting the model file and the map file in batches;
and writing the exported mapping file into a corresponding model file through a preset file writing interface according to the mapping relation so as to generate the model file in the target model specified format.
6. The method for exporting model files according to claim 5, wherein the step of writing the exported map files into the corresponding exported model files according to the mapping relationship through a preset file writing interface, and the step of generating the model files of the target model in the specified format comprises:
respectively generating a material node corresponding to the material information of the exported model file and a chartlet node corresponding to the chartlet file through a preset file writing interface;
linking the map node to the texture node through a preset link function and the mapping relation, so that the map file is written into an exported model file;
and saving the model file written in the map file through a preset saving function to generate the model file of the target model in the specified format.
7. The exporting method according to claim 1, wherein before the generating and exporting a model file of the target model in the specified format based on the mapping relationship among the model file, the map data and the model data, further comprises:
and carrying out zero treatment on the coordinates of the target model.
8. The exporting method according to any one of claims 1 to 7, further comprising, after the generating and exporting a model file of the target model in the specified format based on the mapping relationship among the model file, the map data and the model data, the step of:
responding to a file import instruction aiming at the model file exported in the specified format, and determining a digital content generation platform needing to import the model file exported in the specified format;
renaming the map file in the model file exported in the specified format according to the platform type of the digital content generation platform.
9. The exporting method according to claim 8, wherein after the generating and exporting the model file of the target model in the specified format based on the mapping relationship among the model file, the map data and the model data, further comprises:
importing the file of the model file exported in the specified format into the digital content generation platform, and converting the model file exported in the specified format into editable data through the digital content generation platform;
and displaying the mapping information in the editable data through the digital content generation platform.
10. An apparatus for exporting a model file, the apparatus comprising:
a model determination module for determining a target model in the illusion engine;
the acquisition module is used for responding to a model file export instruction aiming at the target model, and acquiring model data corresponding to the target model and material data corresponding to the target model; wherein the material data at least comprises: mapping data corresponding to the target model and mapping relation between the mapping data and the model data;
the model file generation module is used for generating a model file in a specified format corresponding to the target model based on the model data;
the map file generation module is used for generating a map file in a specified format corresponding to the target model based on the map data;
the export module is used for generating and exporting the model file of the target model in the specified format based on the model file, the map data and the mapping relation among the model data; wherein the reference format comprises at least an FBX format.
11. An export apparatus of a model file, characterized by comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the model file export device to perform the steps of the model file export method of any of claims 1-9.
12. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the steps of a method for exporting a model file according to any one of claims 1 to 9.
CN202211374424.5A 2022-11-04 2022-11-04 Model file exporting method, device, equipment and storage medium Pending CN115779437A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211374424.5A CN115779437A (en) 2022-11-04 2022-11-04 Model file exporting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211374424.5A CN115779437A (en) 2022-11-04 2022-11-04 Model file exporting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115779437A true CN115779437A (en) 2023-03-14

Family

ID=85435452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211374424.5A Pending CN115779437A (en) 2022-11-04 2022-11-04 Model file exporting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115779437A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120388135A (en) * 2025-04-15 2025-07-29 深圳市天擎数字有限责任公司 A system and conversion method supporting intelligent replacement of material modules

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108537891A (en) * 2017-03-01 2018-09-14 黎志毅 The method that three-dimensional material and textures data are automatically switched to UE4
CN111028361A (en) * 2019-11-18 2020-04-17 杭州群核信息技术有限公司 Three-dimensional model and material merging method, device, terminal, storage medium and rendering method
CN112037311A (en) * 2020-09-08 2020-12-04 腾讯科技(深圳)有限公司 Animation generation method, animation playing method and related device
CN112711783A (en) * 2021-01-07 2021-04-27 闫张宇 Jewelry design method and system based on three-dimensional software and illusion engine
US20210225076A1 (en) * 2020-01-22 2021-07-22 Vntana, Inc. Container for physically based rendering
CN114139248A (en) * 2021-11-08 2022-03-04 深圳须弥云图空间科技有限公司 Model material upgrading method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108537891A (en) * 2017-03-01 2018-09-14 黎志毅 The method that three-dimensional material and textures data are automatically switched to UE4
CN111028361A (en) * 2019-11-18 2020-04-17 杭州群核信息技术有限公司 Three-dimensional model and material merging method, device, terminal, storage medium and rendering method
US20210225076A1 (en) * 2020-01-22 2021-07-22 Vntana, Inc. Container for physically based rendering
CN112037311A (en) * 2020-09-08 2020-12-04 腾讯科技(深圳)有限公司 Animation generation method, animation playing method and related device
CN112711783A (en) * 2021-01-07 2021-04-27 闫张宇 Jewelry design method and system based on three-dimensional software and illusion engine
CN114139248A (en) * 2021-11-08 2022-03-04 深圳须弥云图空间科技有限公司 Model material upgrading method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120388135A (en) * 2025-04-15 2025-07-29 深圳市天擎数字有限责任公司 A system and conversion method supporting intelligent replacement of material modules

Similar Documents

Publication Publication Date Title
CN107393013B (en) Virtual roaming file generation and display method, device, medium, equipment and system
CN103885788B (en) Dynamic WEB 3D virtual reality scene construction method and system based on model componentization
CN115049811B (en) Editing method, system and storage medium of a digital twin virtual three-dimensional scene
WO2021098189A1 (en) Three-dimensional model and material merging method and device, terminal, storage medium, and rendering method
CN108597032B (en) Method and system for importing building information model into Unity3D for display
CN111275826B (en) An automatic conversion method of 3D model suitable for AR scenarios
CN111340926B (en) Rendering method and device
KR100503789B1 (en) A rendering system, rendering method, and recording medium therefor
CN111524231B (en) Virtual terrain processing method and device, electronic equipment and storage medium
CN110503709A (en) A method for realizing data center loading and presenting large-scale Web3D models
CN111950057A (en) A method and device for loading building information model BIM
CN111870949A (en) Object processing method and device in game scene and electronic equipment
CN110298136A (en) Application based on BIM technology scene method of construction and system and in garden landscape digital modeling
CN114820903A (en) Web end 3D effect synchronization method, device, equipment and medium based on Unity3D
CN114307158A (en) Three-dimensional virtual scene data generation method and device, storage medium and terminal
US8026910B2 (en) Offline optimization pipeline for 3D content in embedded devices
US11625900B2 (en) Broker for instancing
CN115779437A (en) Model file exporting method, device, equipment and storage medium
US11393180B2 (en) Applying non-destructive edits to nested instances for efficient rendering
CN111724480A (en) Model material construction method and device, electronic device, storage medium
CN114119925B (en) Game image modeling method and device and electronic equipment
CN113222905B (en) Opennsfm and thread.js-based structural damage information updating three-dimensional display method
CN115770394B (en) Blueprint plug-in application method based on hapi implementation
CN120689471B (en) Animation file processing method and system
CN116226969B (en) A method for lightweight data in Unity program production

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination