Model processing method and device, electronic equipment and computer readable storage medium
By implementing the normal editing mode and real-time rendering function in the material editing interface, the problem of low efficiency in normal map production is solved, and fast and accurate editing of normal maps is achieved.
Patent Information
- Application Number
- CN202411443406.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-21
AI Technical Summary
In the prior art, the production efficiency of normal maps is low, and users need to manually draw and import 3D animation production software multiple times for rendering, resulting in cumbersome and inefficient.
Display the material editing interface through the graphic user interface, including object model, drawing mode control and display control, in response to the trigger operation of the drawing mode control, the control object model is in the legal line editing mode, adjust the method line and display the post -adjustment object model and method in real time The color value of the line sticker.
Real-time editing and rendering of normal maps is realized. Users can instantly view the effect of normal map editing without the need to import the software multiple times, which significantly improves the production efficiency of normal maps.
Smart Images

Figure CN119339039A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of rendering technology, and in particular to a model processing method, device, electronic device and computer-readable storage medium. Background Art
[0002] A normal map is a texture map used to simulate bumpy details. It simulates the bumpy effect on the surface of an object by changing the normal direction of the pixel, thereby increasing the details and realism of the model during the rendering process.
[0003] Currently, users need to manually draw normal maps using digital drawing tools (such as Photoshop), and then import the normal maps into 3D animation production software for rendering. Only based on the rendering results can it be determined whether the normal maps meet the requirements. When the normal maps do not meet the requirements, users need to modify the normal maps again using digital drawing tools, and then import them into the 3D animation production software, which reduces the production efficiency of normal maps. Summary of the invention
[0004] The embodiments of the present application provide a model processing method, device, electronic device and computer-readable storage medium, which can improve the efficiency of normal map production.
[0005] In a first aspect, an embodiment of the present application provides a model processing method, the method comprising:
[0006] Displaying a material editing interface through a graphical user interface, wherein the material editing interface includes an object model, a drawing mode control, and a display control;
[0007] In response to a triggering operation on the drawing mode control, controlling the object model to be in a normal editing mode;
[0008] In response to the normal editing operation on the object model, adjusting the normal of the object model, and displaying the adjusted object model;
[0009] In response to a triggering operation on the display control, the normal of the adjusted object model is displayed through a color value.
[0010] In a second aspect, an embodiment of the present application further provides a model processing device, the device comprising:
[0011] A first display module, used to display a material editing interface through a graphical user interface, wherein the material editing interface includes an object model, a drawing mode control, and a display control;
[0012] A mode control module, configured to control the object model to be in a normal editing mode in response to a triggering operation on the drawing mode control;
[0013] A normal adjustment module, configured to adjust the normal of the object model in response to a normal editing operation on the object model, and display the adjusted object model;
[0014] The second display module is used to display the normal of the adjusted object model through color values in response to the triggering operation of the display control.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; the above-mentioned processor loads instructions from the above-mentioned memory to execute any one of the model processing methods provided in the embodiments of the present application.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute any model processing method provided in the embodiment of the present application.
[0017] In an embodiment of the present application, a material editing interface is displayed through a graphical user interface, and the material editing interface includes an object model, a drawing mode control, and a display control. In response to a trigger operation on the drawing mode control, the object model is controlled to be in a normal editing mode. In response to a normal editing operation on the object model, the normal of the object model is adjusted, and the adjusted object model is displayed. In response to a trigger operation on the display control, the normal of the adjusted object model is displayed through a color value, so that the adjusted object model after normal editing and the color value corresponding to the normal map of the adjusted object model can be viewed in real time, so that whether the normal map meets the requirements can be judged according to the adjusted object model and the displayed color value, without the need to import additional software to judge whether the normal map meets the requirements, thereby improving the production efficiency of the normal map. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a schematic diagram of a model processing system provided in an embodiment of the present application;
[0020] Figure 2 This is a flow chart of an embodiment of the model processing method provided in the embodiment of the present application;
[0021] Figure 3 is a schematic diagram of a drawing mode control and a display control provided in an embodiment of the present application;
[0022] Figure 4 is a schematic diagram of a drawing interface provided in an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of a material editing interface provided in an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of a blank texture map provided in an embodiment of the present application;
[0025] Figure 7 is a schematic diagram of a baking sub-window provided in an embodiment of the present application;
[0026] Figure 8 is a schematic diagram of a normal map provided in an embodiment of the present application;
[0027] Fig. 9 is a schematic diagram of an object model provided in an embodiment of the present application;
[0028] Fig.10 is a schematic diagram of an adjusted object model provided in an embodiment of the present application;
[0029] Fig.11 is another schematic diagram of the adjusted object model provided in the embodiment of the present application;
[0030] Fig.12 is a schematic diagram of the color values displayed provided in the embodiments of the present application;
[0031] Fig.13 is a schematic diagram of an observation interface provided in an embodiment of the present application;
[0032] Fig.14 It is another embodiment flow chart of the model processing method provided in the embodiment of the present application;
[0033] Fig.15 is a structural schematic diagram of a model processing device provided in an embodiment of the present application;
[0034] Fig.16 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0036] Before explaining the embodiments of the present application in detail, some terms involved in the embodiments of the present application are first explained.
[0037] Among them, in the description of the embodiments of the present application, the terms "first", "second", etc. may be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] The embodiments of the present application provide a model processing method, device, electronic device and computer-readable storage medium. Specifically, the model processing method of the embodiments of the present application can be executed by an electronic device, wherein the electronic device can be a terminal or a server.
[0039] The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, etc.
[0040] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.
[0041] For example, Figure 1As shown, the electronic device is described by taking a terminal 10 as an example. The terminal 10 can display a material editing interface through a graphical user interface. The material editing interface includes an object model, a drawing mode control, and a display control. In response to a trigger operation on the drawing mode control, the object model is controlled to be in a normal editing mode. In response to a normal editing operation on the object model, editing information corresponding to the normal editing operation is sent to the server 20. The server 20 adjusts the normal of the object model based on the editing information, generates a target normal map based on the adjusted normal, re-renders the object model based on the target normal map, obtains an adjusted object model, and sends the adjusted object model and the target normal map to the terminal 10. The terminal 10 displays the adjusted object model, and in response to a trigger operation on the display control, displays the normal of the adjusted object model through the color value corresponding to the target normal map.
[0042] The following is a detailed description of the embodiments in conjunction with the accompanying drawings. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.
[0043] In this embodiment, a terminal is taken as an example for explanation. This embodiment provides a model processing method, such as Figure 2 As shown, the specific process of the model processing method can be as follows:
[0044] 201. Displaying a material editing interface through a graphical user interface, the material editing interface includes an object model, a drawing mode control, and a display control.
[0045] The graphical user interface (GUI) refers to an electronic device operation user interface that is displayed in a graphical manner, through which a user can interact with the electronic device.
[0046] The material editing interface is an interface for editing the material of the object model. Optionally, the material editing interface can be an interface in the target client.
[0047] The target client refers to the 3D animation production software, which can be a client developed by the developer himself, or it can also be a client developed by other manufacturers. When the target client is a client developed by other manufacturers, the model processing method provided by the embodiment of the present application can be integrated in a custom plug-in, and the custom plug-in is loaded into the target client, so as to implement the model processing method provided by the embodiment of the present application in the target client.
[0048] When the target client is a client developed by other manufacturers, the target client can be selected according to actual conditions. For example, the target client can be blender or Maya, which is not limited in the embodiments of the present application.
[0049] The type of the target client can be set according to actual conditions. For example, the target client can be an application, a mini-program or a web page, which is not limited in the embodiments of the present application.
[0050] An object model refers to a geometric description of an object. The object can be a virtual object or a real object. The types of virtual objects and real objects can be set according to actual conditions. For example, a virtual object can be a virtual game character or a game prop, and a real object can be a ball or a cloud. This embodiment of the present application does not limit this.
[0051] Optionally, the terminal may select the object model before displaying the material editing interface, or may select the object model after displaying the material editing interface.
[0052] The drawing mode control refers to the control used to control the object model to be in the normal editing mode. When the object model is in the normal editing mode, the normal of the object model can be adjusted. The display control refers to the control used to control the display of the normal through the color value.
[0053] In some embodiments, the display method of the drawing mode controls and display controls in the material editing interface can be set according to actual conditions. For example, the normal editing panel can be displayed on the material editing interface, and the drawing mode controls and display controls can be displayed on the normal editing panel. Alternatively, the drawing mode controls and display controls can be displayed directly on the material editing interface. The embodiments of the present application are not limited here.
[0054] When the Normal Edit Panel is in the Material Editing Interface, and the Draw Mode Controls and Display Controls are displayed on the Normal Editing Panel, the Normal Editing Panel, Draw Mode Controls, and Display Controls on the Material Editing Interface can be displayed as follows: Figure 3 shown.
[0055] 202. In response to a triggering operation on a drawing mode control, control the object model to be in a normal editing mode.
[0056] Among them, the type of trigger operation for the drawing mode control can be set according to actual conditions. For example, the trigger operation for the drawing mode control can be a click operation or a long press operation, which is not limited in the embodiments of the present application.
[0057] When the object model is in the normal editing mode, it means that the normal of the object model can be edited. Optionally, the terminal can directly control the object model on the material editing interface to be in the normal editing mode, that is, at this time, the object model on the material editing interface is in the normal editing mode, or the terminal can also respond to the triggering operation of the drawing mode control to display the drawing interface of the object model, and the object model on the drawing interface is in the normal editing mode.
[0058] When the drawing interface of the object model is displayed in response to the triggering operation of the drawing mode control to control the object model to be in the normal editing mode, the drawing interface can be as follows: Figure 4 As shown (the drawing interface includes object models, but Figure 4 The object model is not shown).
[0059] In some embodiments, the object model may be a model with normals, or the object model may be a model without normals. When the object model has normals and the object model is selected after the material editing interface is displayed, before the object model is controlled to be in normal editing mode in response to a trigger operation on the drawing mode control, the method further includes:
[0060] Get a blank texture map;
[0061] Bake the normals of the initial object model onto a blank texture map to get a normal map;
[0062] Based on the normal map, the initial object model is rendered to obtain the object model;
[0063] Display the object model on the material editing interface.
[0064] The initial object model may be selected before the material editing interface is displayed, or the initial object model may be selected after the material editing interface is displayed. The initial object model is a model of the object model before it is rendered.
[0065] Optionally, the material editing interface may include a model subwindow and a material subwindow. The terminal may set a blank texture map in the material subwindow, bake the normals of the initial object model onto the blank texture map to obtain a normal map, render the initial object model based on the normal map to obtain an object model, and display the object model on the model subwindow.
[0066] For example, the material editing interface may include a model sub-window and a material editor control. In response to a trigger operation on the material editor control, the material sub-window is displayed. In the material sub-window, in response to a new material creation operation on the initial object model, a material node and a texture node of the initial object model are created on the material sub-window. At this time, the material sub-window may be displayed as follows: Figure 5As shown, the texture node includes a blank texture map, which can be Figure 6 As shown, then in response to the triggering operation of the texture node, the baking sub-window is displayed on the material editing interface, and the baking sub-window can be as follows Figure 7 As shown, in response to the baking operation of the baking subwindow, the normal of the initial object model is baked onto the blank texture map to obtain a normal map. The normal map can be, for example, Figure 8 As shown, then replace "BakeNormal" in the material sub-window with "normalpaint" to create a normal map node in the material sub-window, and through the normal map node, convert the color value of the normal map in the texture node into the direction of the normal, pass the direction of the normal to the material node, and through the material node, render the initial object model according to the direction of the normal to obtain the object model, and display the object model in the model sub-window. At this time, the material editing interface can be as follows Fig. 9 shown.
[0067] 203. In response to the normal editing operation on the object model, adjust the normal of the object model, and display the adjusted object model.
[0068] When the object model is in the normal editing mode, it means that the normal of the object model can be edited. Therefore, in response to the normal editing operation on the object model, the normal of the object model can be adjusted and the adjusted object model can be displayed.
[0069] The process of adjusting the normal of an object model is also the process of adjusting the normal map of the object model.
[0070] The type of normal editing operation on the object model can be set according to actual conditions. For example, when an object model in a normal editing mode is displayed through a drawing interface, the drawing interface may include a functional control, and the normal editing operation on the object model may be a triggering operation on the functional control. The functional control may be, for example, a brush or a paintbrush. At this time, the brush or the paintbrush may be selected, and in response to an operation to move the brush or the paintbrush, the brush or the paintbrush may be moved to at least a partial area in the object model. In response to a drawing operation on at least a partial area, the partial area may be drawn with the brush or the paintbrush, thereby changing the normal of the partial area. Alternatively, a partial area of the object model may be selected, and a direction value of the normal of the partial area may be displayed on a material editing interface. In response to an operation to modify the direction value, a modified direction value may be determined, and the normal of the partial area may be adjusted based on the modified direction value. The embodiments of the present application are not limited here.
[0071] After adjusting the normals of the object model, a target normal map can be generated based on the adjusted normals, and the object model can be rendered based on the target normal map to obtain the adjusted object model, so that the object model can be rendered in real time according to the adjusted normals, so that the adjusted normals can be displayed in real time.
[0072] For example, an object model can be Fig. 9 As shown, after adjusting the normal of the object model, the adjusted object model can be as follows Fig.10 shown.
[0073] 204. In response to a triggering operation on the display control, display the normal of the adjusted object model through a color value.
[0074] Among them, the type of trigger operation for the display control can be set according to the actual situation. For example, the trigger operation for the display control can be a click operation or a long press operation, which is not limited in the embodiment of the present application.
[0075] Since the normal map usually stores the direction of the normal through the color channel, the direction of the normal can be represented by the color value. Therefore, displaying the normal of the adjusted object model through the color value can be understood as determining the color value corresponding to the direction of the normal of the adjusted object model and displaying the corresponding color value.
[0076] Since the color value corresponding to the direction of the normal can be used to determine the correctness of the normal direction and eliminate bugs, the adjusted object model can be used to observe the rendering result of the normal map. Therefore, it is possible to determine whether the normal map meets the requirements through the displayed color value and the adjusted object model.
[0077] For example, when the adjusted object model is Fig.11 When the normal direction of the object model is adjusted, the color value corresponding to the normal direction of the object model can be as follows: Fig.12 shown.
[0078] It can be understood that when the normals of an object model are adjusted in the drawing interface, the drawing interface may include a display control, and the adjusted normals of the object model may be displayed through color values by triggering the display control in the drawing interface. Alternatively, the drawing interface may be exited first and returned to the material editing interface, and the adjusted normals of the object model may be displayed through color values by triggering the display control in the material editing interface.
[0079] In the embodiments of the present application, the normals of the object model can be adjusted in real time through drawing mode controls and display controls. The object model can be rendered in real time based on the adjusted normals and the color values corresponding to the adjusted normals can be displayed. This allows the normal map of the object model to be produced, the rendering effect corresponding to the normal map to be displayed, and the normals to be represented by color values, without the need for additional operations or implementation through multiple clients, thereby improving the efficiency of normal map production.
[0080] In some embodiments, while the normal of the adjusted object model is displayed by color value, the adjusted object model may still be displayed, or the adjusted object model may be canceled. When the normal of the adjusted object model is still displayed by color value, in response to the triggering operation of the display control, the normal of the adjusted object model is displayed by color value, including:
[0081] In response to a triggering operation on the display control, an observation interface is displayed on the graphical user interface, wherein the observation interface includes a first sub-window and a second sub-window;
[0082] The adjusted object model is displayed on the first sub-window, and the normal of the adjusted object model is displayed on the second sub-window through the color value.
[0083] The shapes of the first sub-window and the second sub-window and their positions on the observation interface can be set according to actual conditions, and are not limited in this embodiment of the present application.
[0084] For example, the observation interface, the first sub-window and the second sub-window are as follows Fig.13 As shown, at this time, the shapes of the first sub-window and the second sub-window are both rectangular, the first sub-window is located on the left half area of the observation interface, and the second sub-window is located on the right half area of the observation interface.
[0085] In an embodiment of the present application, in response to a trigger operation on a display control, an observation interface is displayed on a graphical user interface, the observation interface including a first sub-window and a second sub-window, the adjusted object model is displayed on the first sub-window, and the normal of the adjusted object model is displayed on the second sub-window through a color value, so that the adjusted object model and the color value corresponding to the direction of the normal of the adjusted object model are displayed simultaneously, so that the user can observe the adjusted object model and the normal displayed by the color value at the same time, thereby more quickly judging whether the normal map meets the requirements, further improving the production efficiency of the normal map.
[0086] In some embodiments, the modes of the adjusted object model on the first sub-window may include multiple modes. For example, the adjusted object model on the first sub-window may still be in the normal editing mode. At this time, the normal of the adjusted object model on the first sub-window may be adjusted, and the color value on the second sub-window may be updated according to the adjusted normal, so that the displayed color value may change in real time with the change of the normal. Alternatively, the adjusted object model on the first sub-window may be in the observation mode, and the normal of the adjusted object model in the observation mode cannot be edited.
[0087] It can be understood that when the adjusted object model on the first sub-window is in the normal editing mode, when it is detected that the normal of the adjusted object model on the first sub-window is adjusted, the color value on the second sub-window is updated according to the adjusted normal, or, the observation interface includes a display control, and after the normal of the adjusted object model on the first sub-window is adjusted, the color value on the second sub-window can be updated according to the adjusted normal in response to a triggering operation on the display control.
[0088] In some embodiments, displaying the normal of the adjusted object model on the second sub-window by color value includes:
[0089] Get the display viewing angle corresponding to the first sub-window;
[0090] Determine a target viewing angle of a virtual camera of a second sub-window based on the display viewing angle;
[0091] Based on the target viewing angle, the normals of the adjusted object model are displayed in the second sub-window through color values.
[0092] The display viewing angle corresponding to the first sub-window refers to the viewing angle of the adjusted object model displayed in the first sub-window, which also refers to the angle at which the user views the adjusted object model. When the display viewing angle changes, it means that the angle at which the user views the adjusted object model changes.
[0093] After acquiring the display viewing angle, the terminal determines the display viewing angle as the target viewing angle of the virtual camera of the second sub-window, so that the virtual camera shoots the adjusted object model based on the target viewing angle, and displays the color value corresponding to the direction of the normal of the photographed adjusted object model, so that the target viewing angle of the virtual camera changes with the change of the display viewing angle of the first sub-window, so that the color value displayed in the second sub-window changes in real time with the change of the display viewing angle of the first sub-window, ensuring that the user observes the adjusted object model and the observed display color value The perspective is consistent, further improving the production efficiency of the normal map.
[0094] It can be understood that after the normal of the adjusted object model is displayed on the second sub-window through the color value based on the target viewing angle, if the adjusted object model on the first sub-window is in the normal editing mode, since the display viewing angle of the adjusted object model may be changed when the normal of the adjusted object model in the first sub-window is adjusted, the changed display viewing angle of the first sub-window can be obtained while the color value of the second sub-window is updated according to the adjusted normal of the adjusted object model, and the target viewing angle can be updated according to the changed display viewing angle. Alternatively, when a change in the display viewing angle is detected, the target viewing angle can be updated according to the changed display viewing angle. If the adjusted object model on the first sub-window is in the observation mode, the target viewing angle can be updated according to the changed display viewing angle when a change in the display viewing angle is detected.
[0095] After obtaining the updated target viewing angle, the terminal updates the viewing angle of the second sub-window displaying the color value based on the updated target viewing angle.
[0096] In some embodiments, the adjusted object model in the first sub-window is in an observation mode, and the observation interface further includes a drawing mode control, and after the adjusted object model is displayed on the first sub-window, the following further includes:
[0097] In response to a triggering operation on the drawing mode control, the adjusted object model in the first sub-window is controlled to switch from the observation mode to the normal editing mode, so as to edit the normal of the adjusted object model in the first sub-window.
[0098] The drawing mode control included in the observation interface may be located on the first sub-window, or on the second sub-window, or at a location other than the first sub-window and the second sub-window in the observation interface.
[0099] Optionally, the observation interface may further include a display control. After the terminal switches the adjusted object model in the first subwindow from the observation mode to the normal editing mode, it may also switch the adjusted object model in the first subwindow from the normal editing mode to the observation mode in response to a trigger operation on the display control.
[0100] In an embodiment of the present application, the adjusted object model in the first sub-window is in an observation mode, and the observation interface also includes a drawing mode control. In response to a trigger operation on the drawing mode control, the adjusted object model in the first sub-window is controlled to switch from the observation mode to the normal editing mode to edit the normals of the adjusted object model in the first sub-window, so that the adjusted object model in the first sub-window can be in the normal editing mode or the observation mode, thereby improving the flexibility of processing the adjusted object model in the first sub-window.
[0101] In some embodiments, the drawing mode control and the display control are implemented by a custom plug-in, and before the material editing interface is displayed through the graphical user interface, the following is further included:
[0102] Load the custom plugin into the target client;
[0103] Displays the material editing interface via a graphical user interface, including:
[0104] Display the material editing interface of the target client through the graphical user interface;
[0105] Displays draw mode controls and display controls on the material editing interface via a custom plugin in the target client.
[0106] When the drawing mode control and the display control are located on the normal editing panel, the drawing mode control and the display control are implemented by a custom plug-in, which can be understood as the normal editing panel being implemented by a custom plug-in. At this time, the target client is the developed client.
[0107] In an embodiment of the present application, a drawing mode control and a display control are implemented through a custom plug-in, which is loaded into a target client, and a material editing interface of the target client is displayed through a graphical user interface. Through the custom plug-in in the target client, a drawing mode control and a display control are displayed on the material editing interface, so that the model processing method provided in the embodiment of the present application can be implemented through a plug-in without the need to develop a new client separately, thereby not only improving the efficiency of making normal maps, but also improving the efficiency of code development of the model processing method provided in the embodiment of the present application.
[0108] In some embodiments, in response to a triggering operation on a drawing mode control, controlling the object model to be in a normal editing mode includes:
[0109] In response to a trigger operation on the drawing mode control, calling a drawing function in the target client through a first operation class in the custom plug-in;
[0110] Through the drawing function, the drawing interface of the object model is displayed to control the object model to be in the normal editing mode. The drawing interface displays the function controls corresponding to the drawing function, and the function controls are used to edit the normals;
[0111] In response to a normal editing operation on an object model, adjusting the normal of the object model and displaying the adjusted object model, comprising:
[0112] Through the first operation class, in response to the triggering operation on the function control, the drawing function is called, the normal of the object model is adjusted, and the adjusted object model is displayed.
[0113] The first operation class refers to a class set in the custom plug-in for calling the drawing function in the target client. Since the drawing function in the target client can be used to edit normals, the first operation class can be defined in the custom plug-in so that the drawing function in the target client can be called through the first operation class to realize the function of editing the normals of the object model without setting the code corresponding to the drawing function in the custom plug-in.
[0114] Since the target client's drawing function includes various tools for drawing normals, displaying the drawing interface of the object model through the drawing function can be understood as displaying the drawing interface, and displaying the function controls corresponding to the various tools in the drawing function on the drawing interface, so that the tools in the drawing function can be called through the function controls to edit the normals of the object model.
[0115] Specifically, the terminal can obtain the label and ID of each tool in the drawing function through the first operation class, and display the label as the name of the function control corresponding to each tool on the drawing interface. Then, the terminal responds to the trigger operation of the function control through the first operation class, calls the corresponding tool in the drawing function based on the ID corresponding to the label of the function control, adjusts the normal of the object model, and displays the adjusted object model.
[0116] Optionally, the terminal may also display prompt information corresponding to each functional control on the drawing interface through the first operation type, so that the user can understand the function and operation method of the functional control based on the prompt information.
[0117] In an embodiment of the present application, in response to a triggering operation on a drawing mode control, a drawing function in a target client is called through a first operation class in a custom plug-in, and a drawing interface of an object model is displayed through the drawing function to control the object model to be in a normal editing mode. The drawing interface displays a function control corresponding to the drawing function, and the function control is used to edit the normal. Through the first operation class, in response to a triggering operation on the function control, the drawing function is called to adjust the normal of the object model, and the adjusted object model is displayed, thereby realizing editing of the normal of the object model by calling the drawing function in the target client through the custom plug-in, simplifying the code in the custom plug-in, and further improving the development efficiency of the custom plug-in.
[0118] In some embodiments, in response to a triggering operation on a display control, displaying the normal of the adjusted object model by a color value includes:
[0119] In response to a trigger operation on the display control, a camera function in the target client is called through a second operation class in the custom plug-in;
[0120] The camera function is used to display an observation interface, and on the observation interface, the normal of the adjusted object model is displayed through color values.
[0121] The second operation class refers to a class set in the custom plug-in for calling the camera function in the target client. Since the camera function in the target client can be used to observe the color value corresponding to the direction of the normal, the second operation class can be defined in the custom plug-in so that the camera function in the target client can be called through the second operation class to display the color value corresponding to the normal of the adjusted object model without setting the code corresponding to the camera function in the custom plug-in.
[0122] Optionally, since the camera function of the target client includes not only a tool for displaying the color value corresponding to the direction of the normal, but also other tools, when the terminal calls the camera function in the target client to display the color value through the second operation class, it can also call other tools in the camera function, and display the target function controls corresponding to the other tools in the camera function on the observation interface, so that the target function controls can be used to call other tools in the camera function to process the color value corresponding to the normal.
[0123] Specifically, the terminal can obtain the labels and IDs of each other tool in the camera function through the second operation class, and display the labels as the names of the target function controls corresponding to each other tool on the observation interface. Then, the terminal, through the second operation class, responds to the trigger operation of the target function control, calls the corresponding other tools in the camera function based on the ID corresponding to the label of the target function control, and processes the displayed color value.
[0124] Optionally, the terminal may also display prompt information corresponding to each target function control on the observation interface through the second operation type, so that the user can understand the function and operation method of the target function control based on the prompt information.
[0125] In an embodiment of the present application, through the second operation class in the custom plug-in, in response to the trigger operation of the display control, the camera function in the target client is called, and the observation interface is displayed through the camera function. On the observation interface, the normal of the adjusted object model is displayed through the color value, so that the color value corresponding to the direction of the normal of the object model after adjustment is displayed by calling the camera function in the target client through the custom plug-in, simplifying the code in the custom plug-in and further improving the development efficiency of the custom plug-in.
[0126] It can be understood that when the drawing mode control and the display control are displayed on the normal editing panel, the panel class can be set in the custom plug-in, and the context object, the first row layout and the second row layout are added to the panel class, wherein the first row layout is used to add the drawing mode control corresponding to the first operation class so that the first operation class can be called through the drawing mode control, the second row layout is used to add the display control corresponding to the second operation class so that the second operation class can be called through the display control, and the context object is used to obtain the objects involved in the operations in the first operation class and the second operation class.
[0127] It is understandable that in the process of developing a plug-in, there is some information that must be set, such as the basic information of the plug-in and various necessary modules. Therefore, in a custom plug-in, basic plug-in information and necessary modules can also be added. The basic plug-in information may include, for example, the plug-in name, author, version, target client version, location, description, warning, document URL, and category.
[0128] It is understandable that, since the custom plug-in needs to be loaded into the target client, the custom plug-in may also include a registration function and a deregistration function, so that the custom plug-in can be loaded into the target client through the registration function and uninstalled from the target client through the deregistration function.
[0129] As can be seen from the above content, in an embodiment of the present application, a material editing interface is displayed through a graphical user interface, and the material editing interface includes an object model, a drawing mode control and a display control. In response to a trigger operation on the drawing mode control, the object model is controlled to be in a normal editing mode. In response to a normal editing operation on the object model, the normal of the object model is adjusted, and the adjusted object model is displayed. In response to a trigger operation on the display control, the normal of the adjusted object model is displayed through a color value, so that the adjusted object model after normal editing and the color value corresponding to the normal map of the adjusted object model can be viewed in real time, so that the normal map can be judged whether the requirements are met based on the adjusted object model and the displayed color value, without the need to import additional software to judge whether the normal map meets the requirements, thereby improving the production efficiency of the normal map.
[0130] According to the following Fig.14 , the model processing method provided in this application is further explained.
[0131] 1401. The terminal displays the material editing interface of the target client through a graphical user interface, and displays the normal editing panel on the material editing interface through a panel class in a custom plug-in. The normal editing panel includes a drawing mode control and a display control.
[0132] 1402. In response to a selection operation on the material editing interface, the terminal displays an initial object model on the material editing interface.
[0133] 1403. The terminal sets a blank texture map through a material editing interface, bakes the normal of the initial object model onto the blank texture map to obtain a normal map, and renders the initial object model based on the normal map to obtain an object model.
[0134] 1404. The terminal displays the object model on the material editing interface.
[0135] 1405. In response to the triggering operation on the drawing mode control, the terminal calls a drawing function in the target client through the first operation class in the custom plug-in.
[0136] 1406. The terminal displays a drawing interface of the object model through a drawing function to control the object model to be in a normal editing mode. The drawing interface displays a function control corresponding to the drawing function and a normal editing panel. The function control is used to edit the normal.
[0137] 1407. The terminal calls a drawing function in response to a triggering operation on the function control through the first operation class, adjusts the normal of the object model, and displays the adjusted object model on the drawing interface.
[0138] 1408. In response to the triggering operation on the display control, the terminal calls a camera function in the target client through the second operation class in the custom plug-in.
[0139] 1409. Through the camera function, the display viewing angle of the adjusted object model in the drawing interface is determined as the display viewing angle corresponding to the first sub-window in the observation interface, and based on the display viewing angle corresponding to the first sub-window, the target viewing angle of the virtual camera of the second sub-window is determined, and the color value of the direction of the normal of the adjusted object model in the second sub-window is determined through the target viewing angle.
[0140] 14010. Through the camera function, an observation interface is generated based on the first sub-window and the second sub-window, and the observation interface is displayed, the first sub-window on the observation interface displays the adjusted object model, and the second sub-window on the observation interface displays the color value corresponding to the normal of the adjusted object model determined based on the target viewing angle.
[0141] Among them, the observation interface also includes a normal editing panel. After the observation interface is displayed, the adjusted object model in the first sub-window is in the observation mode. At this time, in response to the trigger operation of the drawing mode control, the first operation class is called to switch the adjusted object model in the first sub-window from the observation mode to the normal editing mode.
[0142] In the related technology, although normal maps can be automatically generated, automatically generated normal maps often pursue realistic effects and cannot meet the needs of stylized art. Therefore, stylized normal maps need to be manually generated. However, the current process of manually generating stylized normal maps is relatively cumbersome, requires superb skills and experience, is prone to errors, and has low efficiency.
[0143] In an embodiment of the present application, a custom plug-in is loaded into a target client, and through the custom plug-in, the drawing function and the camera function in the target client are called to realize the normal map production process, so that not only the production effect of the normal map can be observed in real time, so that the user can accurately control the artistic effect of the normal map, but also the process of making normal maps in the target client can be simplified, and the production efficiency of normal maps can be improved. Moreover, inexperienced users can also make normal maps, reducing the probability of normal map errors and improving the accuracy of normal maps, thereby ensuring the visual effect of the model rendered based on the normal map.
[0144] The explanation of terms, specific implementation methods and corresponding beneficial effects of this embodiment can be specifically referred to the above-mentioned model processing method embodiment, and this embodiment will not be repeated here.
[0145] In order to better implement the above method, an embodiment of the present application also provides a model processing device, which can be specifically integrated into an electronic device, such as a computer device, which can be a terminal, a server, or other device.
[0146] Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer and other devices; the server can be a single server or a server cluster composed of multiple servers.
[0147] For example, in this embodiment, the method of the embodiment of the present application is described in detail by taking the model processing device specifically integrated in the terminal as an example. This embodiment provides a model processing device, such as Fig.15 As shown, the model processing device may include:
[0148] The first display module 1501 is used to display a material editing interface through a graphical user interface. The material editing interface includes an object model, a drawing mode control, and a display control.
[0149] The mode control module 1502 is used to control the object model to be in a normal editing mode in response to a triggering operation on the drawing mode control.
[0150] The normal adjustment module 1503 is used to adjust the normal of the object model in response to the normal editing operation on the object model, and display the adjusted object model.
[0151] The second display module 1504 is used to display the normal of the adjusted object model through color values in response to a triggering operation on the display control.
[0152] In some embodiments, the second display module 1504 is specifically used for:
[0153] In response to a triggering operation on the display control, an observation interface is displayed on the graphical user interface, wherein the observation interface includes a first sub-window and a second sub-window;
[0154] The adjusted object model is displayed on the first sub-window, and the normal of the adjusted object model is displayed on the second sub-window through the color value.
[0155] In some embodiments, the second display module 1504 is specifically used for:
[0156] Get the display viewing angle corresponding to the first sub-window;
[0157] Determine a target viewing angle of a virtual camera of a second sub-window based on the display viewing angle;
[0158] Based on the target viewing angle, the normals of the adjusted object model are displayed in the second sub-window through color values.
[0159] In some embodiments, the adjusted object model in the first sub-window is in observation mode, the observation interface further includes a drawing mode control, and the mode control module 1502 is further used to:
[0160] In response to a triggering operation on the drawing mode control, the adjusted object model in the first sub-window is controlled to switch from the observation mode to the normal editing mode, so as to edit the normal of the adjusted object model in the first sub-window.
[0161] In some embodiments, the drawing mode control and the display control are implemented by a custom plug-in, and the first display module 1501 is used to execute:
[0162] Load the custom plugin into the target client;
[0163] Display the material editing interface of the target client through the graphical user interface;
[0164] Displays draw mode controls and display controls on the material editing interface via a custom plugin in the target client.
[0165] In some embodiments, the mode control module 1502 is specifically configured to:
[0166] In response to a trigger operation on the drawing mode control, calling a drawing function in the target client through a first operation class in the custom plug-in;
[0167] Through the drawing function, the drawing interface of the object model is displayed to control the object model to be in the normal editing mode. The drawing interface displays the function controls corresponding to the drawing function, and the function controls are used to edit the normals.
[0168] The normal adjustment module 1503 is specifically used for:
[0169] Through the first operation class, in response to the triggering operation on the function control, the drawing function is called, the normal of the object model is adjusted, and the adjusted object model is displayed.
[0170] In some embodiments, the second display module 1504 is specifically used for:
[0171] In response to a trigger operation on the display control, a camera function in the target client is called through a second operation class in the custom plug-in;
[0172] The camera function is used to display an observation interface, and on the observation interface, the normal of the adjusted object model is displayed through color values.
[0173] In some embodiments, the first display module 1501 is further used for:
[0174] Get a blank texture map;
[0175] Bake the normals of the initial object model onto a blank texture map to get a normal map;
[0176] Based on the normal map, the initial object model is rendered to obtain the object model;
[0177] Display the object model on the material editing interface.
[0178] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments, which will not be repeated here.
[0179] Accordingly, the embodiment of the present application also provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Fig.16 As shown, Fig.16A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1600 includes a processor 1601 having one or more processing cores, a memory 1602 having one or more computer-readable storage media, and a computer program stored in the memory 1602 and executable on the processor. The processor 1601 is electrically connected to the memory 1602. It will be understood by those skilled in the art that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.
[0180] Processor 1601 is the control center of electronic device 1600. It uses various interfaces and lines to connect various parts of the entire electronic device 1600, executes various functions of electronic device 1600 and processes data by running or loading software programs and / or modules stored in memory 1602, and calling data stored in memory 1602, thereby monitoring electronic device 1600 as a whole.
[0181] In the embodiment of the present application, the processor 1601 in the electronic device 1600 will load instructions corresponding to the processes of one or more application programs into the memory 1602 according to the following steps, and the processor 1601 will run the application programs stored in the memory 1602 to implement various functions, such as:
[0182] Displaying a material editing interface through a graphical user interface, the material editing interface including an object model, a drawing mode control, and a display control;
[0183] In response to a trigger operation on a drawing mode control, controlling the object model to be in a normal editing mode;
[0184] In response to a normal editing operation on the object model, adjusting the normal of the object model, and displaying the adjusted object model;
[0185] In response to a triggering operation on the display control, the normal of the adjusted object model is displayed through a color value.
[0186] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the detailed description of the model processing method above, which will not be elaborated here.
[0187] Optional, such as Fig.16 As shown, the electronic device 1600 further includes: a touch screen 1603, a radio frequency circuit 1604, an audio circuit 1605, an input unit 1606, and a power supply 1607. The processor 1601 is electrically connected to the touch screen 1603, the radio frequency circuit 1604, the audio circuit 1605, the input unit 1606, and the power supply 1607, respectively. Those skilled in the art can understand that Fig.16 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0188] The touch display screen 1603 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1603 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-EmittingDiode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 1601, and can receive the command sent by the processor 1601 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1601 to determine the type of touch event, and then the processor 1601 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 1603 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 1603 can also be used as a part of the input unit 1606 to realize the input function.
[0189] The radio frequency circuit 1604 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.
[0190] The audio circuit 1605 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 1605 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1605 and converted into audio data, and then the audio data is output to the processor 1601 for processing, and then sent to another electronic device through the radio frequency circuit 1604, or the audio data is output to the memory 1602 for further processing. The audio circuit 1605 may also include an earplug jack to provide communication between an external headset and an electronic device.
[0191] The input unit 1606 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0192] The power supply 1607 is used to supply power to various components of the electronic device 1600. Optionally, the power supply 1607 can be logically connected to the processor 1601 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 1607 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0193] although Fig.16 Not shown, the electronic device 1600 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0194] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0195] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0196] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any model processing method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0197] Displaying a material editing interface through a graphical user interface, the material editing interface including an object model, a drawing mode control, and a display control;
[0198] In response to a trigger operation on a drawing mode control, controlling the object model to be in a normal editing mode;
[0199] In response to a normal editing operation on the object model, adjusting the normal of the object model, and displaying the adjusted object model;
[0200] In response to a triggering operation on the display control, the normal of the adjusted object model is displayed through a color value.
[0201] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the detailed description of the model processing method above, which will not be elaborated here.
[0202] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0203] Since the computer program stored in the computer-readable storage medium can execute any one of the model processing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the model processing methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0204] The above is a detailed introduction to a model processing method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A model processing method, characterized in that: The method comprises: Displaying a material editing interface through a graphical user interface, wherein the material editing interface includes an object model, a drawing mode control, and a display control; In response to a triggering operation on the drawing mode control, controlling the object model to be in a normal editing mode; In response to a normal editing operation on the object model, adjusting the normal of the object model, and displaying the adjusted object model; In response to a triggering operation on the display control, the normal of the adjusted object model is displayed through a color value.
2. The model processing method according to claim 1, characterized in that: The step of displaying the normal of the adjusted object model by a color value in response to a triggering operation on the display control includes: In response to a triggering operation on the display control, displaying an observation interface on the graphical user interface, the observation interface comprising a first sub-window and a second sub-window; The adjusted object model is displayed on the first sub-window, and the normal of the adjusted object model is displayed on the second sub-window through color values.
3. The model processing method according to claim 2, characterized in that: The step of displaying the normal of the adjusted object model on the second sub-window by using a color value includes: Obtaining a display viewing angle corresponding to the first sub-window; Based on the display viewing angle, determining a target viewing angle of the virtual camera of the second sub-window; Based on the target viewing angle, the normal of the adjusted object model is displayed on the second sub-window by a color value.
4. The model processing method according to claim 2, characterized in that: The adjusted object model in the first sub-window is in observation mode, the observation interface further includes the drawing mode control, and after the adjusted object model is displayed on the first sub-window, further includes: In response to a triggering operation on the drawing mode control, the adjusted object model in the first sub-window is controlled to switch from the observation mode to the normal editing mode to edit the normal of the adjusted object model in the first sub-window.
5. The model processing method according to claim 1, characterized in that: The drawing mode control and the display control are implemented by a custom plug-in, and before the material editing interface is displayed through the graphical user interface, the method further includes: Loading the custom plug-in into the target client; The method of displaying the material editing interface through a graphical user interface includes: Displaying the material editing interface of the target client through a graphical user interface; The drawing mode control and the display control are displayed on the material editing interface through the custom plug-in in the target client.
6. The model processing method according to claim 5, characterized in that: In response to the triggering operation on the drawing mode control, controlling the object model to be in a normal editing mode includes: In response to a triggering operation on the drawing mode control, calling a drawing function in the target client through a first operation class in the custom plug-in; Through the drawing function, a drawing interface of the object model is displayed to control the object model to be in a normal editing mode, wherein the drawing interface displays a function control corresponding to the drawing function, and the function control is used to edit the normal; In response to the normal editing operation on the object model, adjusting the normal of the object model and displaying the adjusted object model comprises: Through the first operation class, in response to a triggering operation on the function control, the drawing function is called, the normal of the object model is adjusted, and the adjusted object model is displayed.
7. The model processing method according to claim 5, characterized in that: The step of displaying the normal of the adjusted object model by a color value in response to a triggering operation on the display control includes: In response to a trigger operation on the display control, calling a camera function in the target client through a second operation class in the custom plug-in; An observation interface is displayed through the camera function, and the normal of the adjusted object model is displayed on the observation interface through color values.
8. The model processing method according to any one of claims 1 to 7, characterized in that: Before controlling the object model to be in normal editing mode in response to the triggering operation on the drawing mode control, the method further includes: Get a blank texture map; Baking the normal of the initial object model onto the blank texture map to obtain a normal map; Rendering the initial object model based on the normal map to obtain the object model; The object model is displayed on the material editing interface.
9. A model processing device, characterized in that: The device comprises: A first display module, used to display a material editing interface through a graphical user interface, wherein the material editing interface includes an object model, a drawing mode control, and a display control; A mode control module, configured to control the object model to be in a normal editing mode in response to a triggering operation on the drawing mode control; A normal adjustment module, configured to adjust the normal of the object model in response to a normal editing operation on the object model, and display the adjusted object model; The second display module is used to display the normal of the adjusted object model through color values in response to a triggering operation on the display control.
10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the model processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the model processing method according to any one of claims 1 to 8.