Model processing method, device, terminal and storage medium

文档序号:87752 发布日期:2021-10-08 浏览:19次 中文

阅读说明:本技术 一种模型处理方法、装置、终端及存储介质 (Model processing method, device, terminal and storage medium ) 是由 阮清朋 卫宣安 姜坤 吴闽华 于 2021-06-25 设计创作,主要内容包括:本发明公开了一种模型处理方法、装置、终端及存储介质,方法包括:获取待处理模型;通过blender应用软件接收第一操作指令,根据所述第一操作指令将所述待处理模型的着色器属性修改为背景,生成目标模型;将所述目标模型导入至业务场景中。本发明提供的模型处理方法,通过blender将模型的着色器属性修改为背景再导入至业务场景中,而blender中的背景节点专门用来渲染除了厂家内的物体之外的背景材质,当背景着色器用于普通物体时,不会被其他光所影响,维持在一个恒定的渲染数值,从而实现了场景中模型不受光影响的效果。(The invention discloses a model processing method, a model processing device, a terminal and a storage medium, wherein the method comprises the following steps: obtaining a model to be processed; receiving a first operation instruction through a blender application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction, and generating a target model; and importing the target model into a business scene. According to the model processing method provided by the invention, the shader attribute of the model is modified into the background through the blender and then the background is introduced into the service scene, the background node in the blender is specially used for rendering the background material except the object in the manufacturer, when the background shader is used for the common object, the background material is not influenced by other light and is maintained at a constant rendering value, and therefore, the effect that the model in the scene is not influenced by light is realized.)

1. A method of model processing, the method comprising:

obtaining a model to be processed;

receiving a first operation instruction through a blender application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction, and generating a target model;

and importing the target model into a business scene.

2. The model processing method according to claim 1, wherein the obtaining of the model to be processed comprises:

and receiving a modeling operation instruction through the blender application software to draw the model to be processed.

3. The model processing method of claim 1, wherein prior to the generating the target model, the method further comprises:

and receiving a second operation instruction through the blend application software, modifying the material setting attribute of the model to be processed into Alpha mixture according to the second operation instruction, and modifying the transparency of the model to be processed.

4. The model processing method of claim 1, wherein prior to the generating the target model, the method further comprises:

and receiving a third operation instruction through the blend application software, and modifying the image texture attribute of the model to be processed into a background according to the third operation instruction.

5. The model processing method according to claim 1, wherein the importing the object model into a business scenario comprises:

the target model is derived from the blender application software in a gltf format;

and loading the target model into a service scene of the webgis system through a gltf loader.

6. The model processing method of claim 1, wherein prior to said loading of said target model into a business scenario of a webgis system by a gltf loader, said method further comprises:

preparing a gltf loader file;

the gltf loader file is introduced into the model loader file of the webgis system.

7. The model processing method of claim 6, wherein said loading the target model into a business scenario of a webgis system by a gltf loader comprises:

and after the loading parameters of the target model are set in the model loader file, loading the target model into the service scene through the model loader file.

8. A model processing apparatus, comprising:

the model acquisition module to be processed is used for acquiring a model to be processed;

the target model generation module is used for receiving a first operation instruction through blend application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction and generating a target model;

and the importing module is used for importing the target model into a service scene.

9. A terminal, characterized in that the terminal comprises: a processor, a computer readable storage medium communicatively connected to the processor, the computer readable storage medium adapted to store a plurality of operational instructions, the processor adapted to invoke the operational instructions in the computer readable storage medium to perform the steps of implementing the model processing method of any of the above claims 1-7.

10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs which are executable by one or more processors to implement the steps of the model processing method according to any one of claims 1 to 7.

Technical Field

The invention relates to the technical field of live-action maps, in particular to a model processing method, a model processing device, a model processing terminal and a storage medium.

Background

Various 3D precision model data need to be imported into a webgis system of smart city business, for example, a corresponding landmark building model is needed in a city scene, so that the support of the 3D model data is needed, and after the 3D model is imported, parameters need to be modified to realize a required visual effect. However, when some science-fiction-style map effects are produced, a real diffuse reflection effect is not generally needed, but a visual effect which is not affected by any scene light, namely a light-free effect, is needed, and a realization method capable of realizing the light-free effect of the model in a business scene does not exist in the prior art.

Thus, there is a need for improvements and enhancements in the art.

Disclosure of Invention

In view of the above drawbacks in the prior art, the present invention provides a model processing method, an apparatus, a terminal and a storage medium, which are intended to solve the problem that no implementation method capable of implementing the light-insensitive effect of a model in a service scene exists in the prior art.

In order to solve the technical problems, the technical scheme adopted by the invention is as follows:

in a first aspect of the present invention, a model processing method is provided, where the method includes:

obtaining a model to be processed;

receiving a first operation instruction through a blender application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction, and generating a target model;

and importing the target model into a business scene.

The model processing method, wherein the obtaining of the model to be processed, includes:

and receiving a modeling operation instruction through the blender application software to draw the model to be processed.

The model processing method, wherein before generating the target model, the method further comprises:

and receiving a second operation instruction through the blend application software, modifying the material setting attribute of the model to be processed into Alpha mixture according to the second operation instruction, and modifying the transparency of the model to be processed.

The model processing method, wherein before generating the target model, the method further comprises:

and receiving a third operation instruction through the blend application software, and modifying the image texture attribute of the model to be processed into a background according to the third operation instruction.

The model processing method, wherein the importing the target model into a business scenario, includes:

the target model is derived from the blender application software in a gltf format;

and loading the target model into a service scene of the webgis system through a gltf loader.

Before the target model is loaded into a business scenario of the webgis system by the gltf loader, the model processing method further includes:

preparing a gltf loader file;

the gltf loader file is introduced into the model loader file of the webgis system.

The model processing method, wherein the loading the target model into the service scene of the webgis system by the gltf loader, includes:

and after the loading parameters of the target model are set in the model loader file, loading the target model into the service scene through the model loader file.

In a second aspect of the present invention, there is provided a model processing apparatus comprising:

the model acquisition module to be processed is used for acquiring a model to be processed;

the target model generation module is used for receiving a first operation instruction through blend application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction and generating a target model;

and the importing module is used for importing the target model into a service scene.

In a third aspect of the present invention, a terminal is provided, where the terminal includes a processor, and a computer-readable storage medium communicatively connected to the processor, the computer-readable storage medium is adapted to store a plurality of operating instructions, and the processor is adapted to call the operating instructions in the computer-readable storage medium to execute the steps of implementing any one of the above-mentioned model processing methods.

In a fourth aspect of the present invention, there is provided a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the model processing method of any one of the above.

Compared with the prior art, the invention provides a model processing method, a device, a terminal and a storage medium, the model processing method modifies the attribute of a shader of a model into a background through a blender and then introduces the background into a service scene, a background node in the blender is specially used for rendering background materials except objects in a manufacturer, when the background shader is used for common objects, the background shader cannot be influenced by other light and is maintained at a constant rendering value, and therefore the effect that the model in the scene is not influenced by the light is achieved.

Drawings

FIG. 1 is a flow diagram of an embodiment of a model processing method provided by the present invention;

FIG. 2 is a schematic node function diagram of a Blender application software in an embodiment of a model processing method provided by the present invention;

FIG. 3 is a first diagram illustrating modification of model shader attributes according to an embodiment of the model processing method provided by the present invention;

FIG. 4 is a second schematic diagram illustrating modification of model shader attributes according to an embodiment of the model processing method provided in the present invention;

FIG. 5 is a first diagram illustrating the transparency of a modified model in an embodiment of the model processing method provided by the present invention;

FIG. 6 is a second schematic diagram illustrating modification of model transparency according to an embodiment of the model processing method provided in the present invention;

FIG. 7 is a diagram illustrating modification of texture properties of an image according to an embodiment of a model processing method provided in the present invention;

FIG. 8 is a schematic diagram of deriving a target model in an embodiment of a model processing method provided by the present invention;

fig. 9 is a first schematic view illustrating an effect of a model in a service scene in an embodiment of a model processing method provided by the present invention;

FIG. 10 is a schematic diagram illustrating an effect of a model in a service scene in an embodiment of a model processing method provided by the present invention;

FIG. 11 is a schematic diagram of a model processing apparatus according to an embodiment of the present invention;

fig. 12 is a schematic diagram of an embodiment of a terminal provided in the present invention.

Detailed Description

In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

The model processing method provided by the invention can be executed by a terminal, and the terminal includes but is not limited to various computers, mobile phones, tablet computers, wearable devices and the like.

Example one

As shown in fig. 1, in one embodiment of the model processing method, the method includes the steps of:

and S100, obtaining a model to be processed.

The model to be processed may be drawn by three-dimensional modeling software, and specifically, in this embodiment, drawing the model to be processed by a blender, that is, obtaining the model to be processed includes:

and receiving a modeling operation instruction through the blender application software to draw the model to be processed.

Specifically, a user can click a menu option of application software through a mouse or use a shortcut key of the application software through a keyboard to input an operation instruction, when the model to be processed is generated, the user inputs a modeling operation instruction, and the terminal draws the model to be processed according to the modeling operation instruction after receiving the modeling operation instruction.

S200, receiving a first operation instruction through the blender application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction, and generating a target model.

And after the model to be processed is obtained, processing the model to be processed in a blender application software, wherein the blender is an open-source cross-platform all-around three-dimensional animation software, has the capability of directly exporting a gltf format model with high compatibility at a web end, and provides good stable material output. When the model to be processed is drawn through the blender, the model to be processed can be directly opened in the blender, and when the model to be processed is not drawn through the blender, the model to be processed can be opened through the blender after format conversion processing.

The blend provides a node function for setting the model material and texture, if the complex material and texture are to be realized, the node function is needed, as shown in fig. 2, the left side of each node is used as input, the right side is used as output, the nodes are influenced with each other progressively, the latter is influenced, finally the desired effect is obtained, and the complex material effect can be realized by the nodes. In this embodiment, the setting of the light-free material is realized through a "background" node, and specifically, as shown in fig. 3 and 4, a user may open a shader option in a blender and select the "background" node to issue the first operation instruction, so as to modify the shader attribute of the to-be-processed model into a background. The "background" node is only used for the output of the world surface, that is, the node is used for rendering the background material except the objects in the scene, but when the background shader is used for the ordinary objects, the background shader has the effect of being free from light, so that the background is not affected by any other light and is always kept at a constant infection value. Changing the shader node of the model to be processed into a background node can make the target model be made of a light-free material, so that the effect of light-free is achieved after the target model is led into a business scene.

Although the background node does not support diffuse reflection or color rendering of a metal surface, but supports change of transparency, in a possible implementation manner, in order to adjust a display effect of the model to be processed, before generating the target model, the model processing method provided by this embodiment further includes the steps of:

and receiving a second operation instruction through the blend application software, modifying the material setting attribute of the model to be processed into Alpha mixture according to the second operation instruction, and modifying the transparency of the model to be processed.

As shown in fig. 5 and 6, if the transparency of the model to be processed is to be adjusted, the blending mode in the material setting may be changed to Alpha blending, specifically, after the blending mode in the material setting is modified to "Alpha" blending in the blender, the transparency of the model to be processed may be changed by adjusting the value of a in the rgba parameter in the color. It should be noted that, at present, modifying the transparency of the to-be-processed model according to the second operation instruction is only used in the blend 2.82 and the blend 2.83, and other versions are not applicable, so that if the non-light-receiving effect of the translucent model needs to be achieved, one of the two versions, i.e., the blend 2.82 and the blend 2.83, needs to be used.

In another possible implementation manner, in addition to setting a shader as a background node, as shown in fig. 7, a texture of a picture may be added, so that the set texture of the picture also becomes light-insensitive, that is, before the target model is generated, the method further includes the steps of:

and receiving a third operation instruction through the blend application software, and modifying the image texture attribute of the model to be processed into a background according to the third operation instruction.

And after the model to be processed is subjected to the processing by the blender, generating a target model, namely, the target model is the model to be processed with the changed attribute parameters. Referring to fig. 1 again, the model processing method provided in this embodiment further includes the steps of:

s300, importing the target model into a service scene.

Specifically, the importing the target model into the service scenario includes:

s310, exporting the target model from the Blender application software in a gltf format;

s320, loading the target model into a service scene of the webgis system through a gltf loader.

The compatibility of the gltf format at the web end is very high, the model to be processed is processed by the blender to obtain the target model, and then the target model is derived from the blender in the gltf format, as shown in fig. 8.

After the target model in the gltf format is obtained, a file in the gltf format needs to be loaded through a gltflader (gltf loader) in the tree, and in order to load the target model into a service scene of the webgis system, the gltflader needs to be embedded into a model loader file of the gis system, so that the target model in the gltf format is loaded into the gis system. Specifically, before the target model is loaded into the service scene of the webgis system by the gltf loader, the model processing method provided in this embodiment further includes the steps of:

preparing a gltf loader file;

the gltf loader file is introduced into the model loader file of the webgis system.

The gltf loader file can be downloaded in the tree official website, specifically, the tree official website provides the gltf loader file, and the tree gltfloader () is introduced into the model loader file of gis system by combining the case code in the file of the official website download document, so that the target model in the gltf format can be loaded through the model loader of gis system.

Specifically, the loading the target model into a business scenario of the webgis system through a gltf loader includes:

and after the loading parameters of the target model are set in the model loader file, loading the target model into the service scene through the model loader file.

After the gltf loader file is introduced into the model loader file of the webgis system, before the target model is loaded, relevant loading parameters such as model position, size, height and the like need to be introduced, so that the target model can be successfully imported into a scene.

As shown in fig. 9, the target model (the right model in fig. 9) with modified shader attributes as the background and the model (the left model in fig. 9) which is not processed by the light effect implementation method provided by the present invention are imported into the scene, when there is no white scene light, the left side has diffuse reflection effect, and after adding the white scene light, as shown in fig. 10, the left model becomes all white after receiving illumination of a white scene, etc., while the right model remains unchanged and is not affected by illumination.

In summary, the embodiment provides a model processing method, where a shader attribute of a model is modified into a background by a blender and then is imported into a service scene, and a background node in the blender is specifically used for rendering a background material except for an object in a manufacturer, and when a background shader is used for a common object, the background material is not affected by other light and is maintained at a constant rendering value, so that a light-free effect of the model in the scene is achieved.

It should be understood that, although the steps in the flowcharts shown in the figures of the present specification are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by operating hardware associated with instructions via a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

Example two

Based on the foregoing embodiments, the present invention further provides a model processing apparatus, as shown in fig. 11, where the model processing apparatus includes:

a to-be-processed model obtaining module, configured to obtain a to-be-processed model, as described in embodiment one;

a target model generation module, configured to receive a first operation instruction through blend application software, modify a shader attribute of the to-be-processed model into a background according to the first operation instruction, and generate a target model, which is specifically described in embodiment one;

an importing module, configured to import the target model into a business scenario, as described in embodiment one.

EXAMPLE III

Based on the above embodiments, the present invention further provides a terminal, as shown in fig. 12, where the terminal includes a processor 10 and a memory 20. Fig. 12 shows only some of the components of the terminal, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.

The memory 20 may in some embodiments be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the terminal. The memory 20 is used for storing application software installed in the terminal and various data. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a model processing program 30, and the model processing program 30 can be executed by the processor 10 to implement the model processing method of the present application.

The processor 10 may be a Central Processing Unit (CPU), microprocessor or other chip in some embodiments, and is used for running program codes stored in the memory 20 or Processing data, such as executing the model Processing method.

In one embodiment, the following steps are implemented when the processor 10 executes the model handler 30 in the memory 20:

obtaining a model to be processed;

receiving a first operation instruction through a blender application software, modifying the shader attribute of the model to be processed into a background according to the first operation instruction, and generating a target model;

and importing the target model into a business scene.

Wherein, the obtaining the model to be processed comprises:

and receiving a modeling operation instruction through the blender application software to draw the model to be processed.

Wherein, prior to the generating the target model, the method further comprises:

and receiving a second operation instruction through the blend application software, modifying the material setting attribute of the model to be processed into Alpha mixture according to the second operation instruction, and modifying the transparency of the model to be processed.

Wherein, prior to the generating the target model, the method further comprises:

and receiving a third operation instruction through the blend application software, and modifying the image texture attribute of the model to be processed into a background according to the third operation instruction.

Wherein the importing the target model into a business scenario includes:

the target model is derived from the blender application software in a gltf format;

and loading the target model into a service scene of the webgis system through a gltf loader.

Wherein before the loading the target model into the business scenario of the webgis system by the gltf loader, the method further comprises:

preparing a gltf loader file;

the gltf loader file is introduced into the model loader file of the webgis system.

Loading the target model into a service scene of the webgis system through a gltf loader, wherein the loading comprises:

and after the loading parameters of the target model are set in the model loader file, loading the target model into the service scene through the model loader file.

Example four

The present invention also provides a computer readable storage medium in which one or more programs are stored, the one or more programs being executable by one or more processors to implement the steps of the model processing method as described above.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种三维场景切换控制方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!