Scene file processing method and device, electronic equipment and storage medium

By exporting and generating a description file in the drawing tool, the problem of time-consuming and operational errors in cross-departmental collaboration in the main scene production process of 2D games is solved, and more efficient scene production and teamwork are achieved.

CN119478080APending Publication Date: 2025-02-18BEIJING JINGJIA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411353068.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the existing 2D game main scene production process, cross-departmental collaboration between art, client programmers and planning consumes a lot of time and communication costs, and is prone to personnel operation errors.

Method used

Provides a scene file processing method, by drawing and completing scene construction in the drawing tool, selectively exporting target scene elements based on demand information, and generating description files, supporting automated export and description file generation.

Benefits of technology

Improves the flexibility and efficiency of scene production, supports cross-platform or cross-tool scene reuse, reduces graph cutting errors and blanking problems, simplifies the scene reconstruction process, improves teamwork efficiency, and enhances data maintenance Sex and traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478080A_ABST
    Figure CN119478080A_ABST
Patent Text Reader

Abstract

The invention provides a scene file processing method and device, electronic equipment and a storage medium, and the method comprises the steps: determining and marking a target scene element according to demand information after a scene is built in a drawing tool; by triggering the target plug-in in the drawing tool, the marked target scene element is automatically exported to a specified position, and a corresponding description file is generated, so that the scene is subsequently reused and reconstructed in different platforms or tools. The processing efficiency of the scene file can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of file processing technology, and in particular to a scene file processing method, device, electronic device and storage medium. Background Art

[0002] The existing 2D game main scene production process is as follows: (1) The artist draws and completes the scene construction in Photoshop, and then the artist needs to split the scene elements and export the cut-outs (the purpose of cutting is to display the main scene content according to the progress of the game, rather than directly displaying it to the player at one time, and many individual contents will be animated later, so the large picture cannot be used directly as the final output). (2) The exported cut-outs are sent by the artist to the client programmer, who imports them into Unity and makes them into prefabs one by one, and submits them to the Git repository. (3) Finally, the planner will use the prefabs to restore the original design drawings of the artist in the Unity scene according to the artist's design drawings (place the prefabs in the designed positions) and upload the scene to the Git repository.

[0003] In this process, art cut-out export, client-side prefab creation, and planning to restore it in the Unity scene require cross-departmental collaboration among three departments, which will consume a lot of time and communication costs, and human operational errors may occur in the intermediate process. Summary of the invention

[0004] In view of this, embodiments of the present application provide a scene file processing method, device, electronic device and storage medium, which can improve the processing efficiency of scene files.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a scene file processing method, the method comprising:

[0007] Draw and complete the scene construction in a drawing tool to obtain a first target scene; wherein the first target scene includes at least one scene element;

[0008] Determine a target scene element from the at least one scene element based on the demand information, and add a target identifier to the target scene element;

[0009] In response to a triggering operation on a target plug-in in the drawing tool, the target scene element is exported to a target location based on the target identifier, and a description file for the target scene element is generated at the target location.

[0010] In a second aspect, an embodiment of the present application further provides a scene file processing device, the device comprising:

[0011] A drawing module, used to draw and complete scene construction in a drawing tool to obtain a first target scene; wherein the first target scene includes at least one scene element;

[0012] A determination module, configured to determine a target scene element from the at least one scene element based on the demand information, and add a target identifier to the target scene element;

[0013] The export module is used to respond to the trigger operation of the target plug-in in the drawing tool, export the target scene element to the target location based on the target identifier, and generate a description file for the target scene element at the target location.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to execute the scene file processing method described in any one of the first aspects.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the scene file processing method described in any one of the first aspects is executed.

[0016] The embodiments of the present application have the following beneficial effects:

[0017] (1) Improve the flexibility and efficiency of scene production: By drawing and completing the scene construction in the drawing tool, and then selectively exporting the target scene elements based on the required information, the flexibility of scene production is greatly improved. At the same time, the automated export and description file generation process reduces manual operations and improves production efficiency.

[0018] (2) Support cross-platform or cross-tool scene reuse: Through the import function of the description file, the target scene elements in the first target scene can be easily imported into different types of production tools to achieve cross-platform or cross-tool scene reuse. This helps to share and transfer scene data between different development stages or different teams.

[0019] (3) Reduce image cutting errors and blank space issues: For images that need to be cut, specific pixels are added to the blank space to indicate the blank space boundary, effectively avoiding the problem of mistakenly cutting off transparent areas during the image cutting process. This improves the accuracy and quality of image cutting and reduces subsequent adjustment work.

[0020] (4) Simplify the scene reconstruction process: Through the image and prefab tags in the description file, the production tool can automatically read and reconstruct the second target scene. This method not only simplifies the scene reconstruction process, but also ensures that the reconstructed scene is consistent with the original scene in structure and content.

[0021] (5) Support for complex scene structures and hierarchical relationships: The description file supports tree-structured recording, so that even complex scene structures and hierarchical relationships can be accurately recorded and reconstructed. This helps maintain the integrity and completeness of the scene.

[0022] (6) Improve teamwork efficiency: Team members can collaborate based on a unified description file format, each responsible for the production and export of different parts, and then merge and integrate scenes by importing description files. This method improves the efficiency and accuracy of teamwork.

[0023] (7) Enhanced data maintainability and traceability: Through automated export and description file generation, the original information of scene elements and key steps in the production process can be retained. This helps to quickly locate and solve problems during subsequent development and maintenance, and improves data maintainability and traceability. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 is a flowchart of steps S101-S103 provided in an embodiment of the present application;

[0026] Figure 2 It is a flowchart of steps S201-S202 provided in an embodiment of the present application;

[0027] Figure 3 It is a flowchart of steps S301-S302 provided in an embodiment of the present application;

[0028] Figure 4 It is a flowchart of steps S401-S404 provided in an embodiment of the present application;

[0029] Figure 5 is a structural schematic diagram of a scene file processing device provided in an embodiment of the present application;

[0030] Figure 6It is a schematic diagram of the composition structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0031] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0032] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0033] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0034] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0035] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0037] See also Figure 1 , Figure 1 is a flow chart of steps S101-S103 of the scene file processing method provided in the embodiment of the present application, which will be combined with Figure 1 Steps S101-S103 are shown for explanation.

[0038] In step S101, a scene is drawn and constructed in a drawing tool to obtain a first target scene; wherein the first target scene includes at least one scene element.

[0039] Here, the drawing tool may be Photoshop, in which the user constructs a complete scene, i.e., the first target scene, by combining different graphics, images, texts and other elements. This scene may be a game level, an advertisement layout, a web page interface, etc. The first target scene contains multiple scene elements, which are the basic units that constitute the scene, such as background images, buttons, icons, text boxes, etc.

[0040] In step S102, a target scene element is determined from the at least one scene element based on the demand information, and a target identifier is added to the target scene element.

[0041] Here, according to the specific requirements or design specifications of the project, it can be determined which scene elements need to be exported and further processed. These requirement information may come from customers, project managers, design documents, etc. Based on the requirement information, the user selects the scene elements that need special attention or processing from the first target scene, namely the target scene elements. In order to easily identify the target scene elements in the subsequent export and processing process, the user or the system will add specific identifiers to these elements. These identifiers can be name suffixes, special layer properties, etc.

[0042] In step S103, in response to a triggering operation on a target plug-in in the drawing tool, the target scene element is exported to a target location based on the target identifier, and a description file for the target scene element is generated at the target location.

[0043] Here, in order to automate the export process, the user needs to install or enable the target plug-in in the drawing tool. This plug-in is responsible for identifying the target identifier and performing the export operation. The user triggers the target plug-in by clicking a button, selecting a menu item, etc. Once triggered, the plug-in will begin to execute its predefined functions. The plug-in extracts the target scene elements from the first target scene based on the target identifier and exports them to the target location specified by the user. This location is usually the working directory or resource library of another software environment. During the export process, the plug-in will also generate a description file. This file records in detail the information of the exported target scene elements, such as name, type, attributes, position relationship, hierarchical structure, etc. The format of the description file is usually easy to parse and process, such as XML, JSON, etc.

[0044] In some embodiments, the method further comprises:

[0045] In response to an import operation for the description file, the description file is imported into a production tool, so that the production tool automatically reads the target scene elements according to the description file and produces a second target scene based on the target scene elements, wherein the second target scene is different from the first target scene in scene type.

[0046] Here, the production tool can be Unity, which is a widely used game development engine that supports cross-platform game development. It provides rich features and tools to help developers create 3D and 2D games, interactive applications, and virtual reality experiences. In Unity, the user performs an import operation and selects the previously generated description file as input. Unity supports multiple file formats, but in this scenario, the description file is provided in a format that Unity can parse (such as JSON, XML, or a custom format).

[0047] Unity reads and parses the contents of the description file. The parser extracts the properties, types, locations, hierarchical structures, etc. of the target scene elements. Based on the extracted information, Unity automatically creates corresponding game objects (i.e. scene elements in Unity) in its environment and places them according to the layout and hierarchical structure in the description file. Once all game objects are created and their properties are set, they are integrated into the second target scene. Developers can preview the scene in the Unity editor and make further adjustments and optimizations to ensure that it meets the needs of the game or application.

[0048] In some embodiments, the target scene element includes layer information that needs to be made into a prefabricated body specified by the requirement information and a picture that needs to be cut specified by the requirement information; adding a target identifier to the target scene element includes:

[0049] A first suffix is ​​added to the layer information that needs to be made into a prefabricated body specified by the demand information, and a second suffix is ​​added to the picture that needs to be cut specified by the demand information, wherein the first suffix and the second suffix are different.

[0050] Here, the Prefab layer contains the elements that need to be made into prefabs in Unity. Prefabs are a concept in Unity that allows developers to save a game object and all its components, properties, and sub-objects as a reusable asset. Cutouts need to be split into multiple small images or sprites so that they can be managed and used more efficiently in Unity or other game engines. Cutouts are usually used for UI elements such as buttons, icons, etc. so that they can be scaled, rotated, and animated independently.

[0051] For the layer information that needs to be made into prefabs as specified by the requirement information, you can add a specific suffix (first suffix) to identify them. This suffix can be any string, but it should be unique enough to easily identify and process these layers when imported into Unity. For example, you can choose "@pre" as the suffix. For the images that need to be cut as specified by the requirement information, you can add another different suffix (second suffix) to distinguish them. This suffix should also be unique and different from the suffix of the prefab. For example, you can choose "@image" as the suffix.

[0052] In some embodiments, see Figure 2 , Figure 2 It is a flow chart of steps S201-S202 provided in an embodiment of the present application. The first target scene corresponds to a first PSD file. The target scene elements are exported to the target location based on the target identifier, and a description file for the target scene elements is generated at the target location. This can be achieved through steps S201-S202, which will be explained in combination with each step.

[0053] In step S201, the first PSD file is copied to obtain a second PSD file.

[0054] In step S202, all layers in the second PSD file are recursively traversed. During the recursive traversal, the layer information that needs to be made into a prefabricated body traversed according to the first suffix is ​​recorded in the description file generated at the target location, and the pictures that need to be cut that are traversed according to the second suffix are cut, the cut pictures are saved to the target location and the picture information of the cut pictures is recorded in the description file.

[0055] Here, first the first PSD file is copied to obtain a new PSD file (called the second PSD file). The purpose of doing so is to maintain the integrity of the original file while performing operations in a new file to avoid unnecessary modifications to the original file.

[0056] Next, all layers in the second PSD file are recursively traversed. Recursive traversal is a depth-first traversal method that allows you to access all layers in a PSD file, including nested layer groups. During the traversal, the program checks the name or properties of each layer to find out whether there are specific suffixes (first suffix and second suffix). These suffixes are used to indicate special processing requirements for layers or images.

[0057] For the layers traversed according to the first suffix (that is, the layers that need to be made into prefabs), the program will record this information in the description file generated at the target location. The description file may contain the name, type, properties of the layer, and any additional information that may be needed to rebuild these prefabs in Unity. For the images traversed according to the second suffix, the program will perform a cut operation. This usually means exporting the image as multiple small images or sprites and saving them to the target location. The program will then record the image information of these cut images in the description file, such as file name, path, size, location, etc., so that they can be referenced again in Unity.

[0058] In some embodiments, see Figure 3 , Figure 3 It is a flow chart of steps S301-S302 provided in an embodiment of the present application. All layers in the second PSD file are in a hidden state before recursive traversal, and the description file is an XML file. The recursive traversal can be implemented through steps S301-S302, which will be explained in combination with each step.

[0059] In step S301, all layers in the second PSD file are recursively traversed. If the layer name includes the first suffix, a prefab tag is created for the layer in the xml file, the layer node is set to a visible state and the recursion continues downward; after the recursion is backtracked, the layer is hidden again.

[0060] In step S302, if the layer name includes the second suffix, create an image tag to the xml file, recursively set the layer and its sublayers to be visible, and cut the image, save the cut image to the target location, and save the image information of the cut image to the corresponding image tag in the xml file.

[0061] First, you need to make sure that all layers in the second PSD file are hidden before the recursive traversal starts, and create a new XML file as a description file, setting the necessary root nodes and possible initial properties.

[0062] Next, starting from the top-level layer of the second PSD file, recursively traverse all layers. During the traversal process, check the name of each layer. If the name of the layer contains the first suffix (such as @pre, do the following: Create a prefab tag for the layer in the XML file and record the necessary information (such as layer name, position, size, etc.). Set the layer node to visible for possible subsequent preview or export operations. Continue to recursively traverse the sublayers of the layer (if any). When the recursion traces back to the layer, hide it again.

[0063] If the layer name contains a second suffix (such as @image), do the following: Create an image tag in the XML file for the image content. Recursively set the layer and all its sublayers to be visible to ensure that they can be correctly selected and rendered when performing a cut operation. Save the image to the target location (for example, a folder specifically prepared for cut images). Save the image information of the cut image (such as file name, path, size, etc.) to the corresponding image tag in the XML file.

[0064] In some embodiments, the at least one scene element includes a blank picture, which represents a picture with fully transparent edges due to the need for blank space as specified by art requirements, and pixel points for indicating the boundary range of the blank picture are added to the corners corresponding to the blank areas in the blank picture to avoid cutting off the transparent area during the cutting process.

[0065] Here, during the creation or editing of the blank image, the artist will add specific pixels to at least one corner of the blank area (usually all four corners) to mark the blank boundary. These pixels are opaque and invisible to the naked eye. When cutting or exporting images, automated scripts or tools will traverse the image and look for these specific pixels. Once these pixels are identified, the tool can calculate the boundary of the blank area and adjust the cutting area based on this boundary to ensure that the blank area is not cut off incorrectly.

[0066] In some embodiments, see Figure 4 , Figure 4 It is a flowchart of steps S401-S404 provided in an embodiment of the present application. The description file includes an image tag and a prefab tag. The production tool can produce the second target scene through steps S401-S404, which will be explained in combination with each step.

[0067] In step S401, the description file is read.

[0068] In step S402, for each image tag, it is determined whether the name of the image tag exists. If not, a sprite prefab is created, a sprite renderer is mounted, and the image reference is set to the corresponding image resource.

[0069] In step S403, for each prefab tag, an Item prefab is created, all child nodes under the prefab tag are traversed, a sprite prefab instance is created for each child node, and the sprite prefab instance is added to the Item prefab as a child object.

[0070] In step S404, the tree structure in the description file is determined, and for the prefab whose top level is prefab, a prefab instance object is created and the center position of its child node in the description file is calculated, the prefab instance object is placed at the center position in the scene, and the position of its child node is set to a relative position; for the prefab whose top level is image, a prefab instance object is created and placed in the scene according to the position information in the description file.

[0071] Here, the Unity plug-in reads the xml file exported by the above process, creates a sprite prefab according to the image tag in the file, mainly including operations such as mounting the sprite renderer and setting the image reference (images with the same name are not processed to ensure uniqueness); creates an Item prefab according to the prefab in the file, and mounts the sprite prefab for it. Then analyze the tree structure in the xml file, for prefabs with prefabs at the top level, creates a prefab instance object and calculates the center position of its child nodes in the xml, places it at the center position in the scene, and sets its child node position to a relative position (subtracting the instance object position from the original child node position); for prefabs with images at the top level, creates a prefab instance object and directly places it in the scene according to the position information in the xml.

[0072] In summary, the embodiments of the present application have the following beneficial effects:

[0073] (1) Improve the flexibility and efficiency of scene production: By drawing and completing the scene construction in the drawing tool, and then selectively exporting the target scene elements based on the required information, the flexibility of scene production is greatly improved. At the same time, the automated export and description file generation process reduces manual operations and improves production efficiency.

[0074] (2) Support cross-platform or cross-tool scene reuse: Through the import function of the description file, the target scene elements in the first target scene can be easily imported into different types of production tools to achieve cross-platform or cross-tool scene reuse. This helps to share and transfer scene data between different development stages or different teams.

[0075] (3) Reduce image cutting errors and blank space issues: For images that need to be cut, specific pixels are added to the blank space to indicate the blank space boundary, effectively avoiding the problem of mistakenly cutting off transparent areas during the image cutting process. This improves the accuracy and quality of image cutting and reduces subsequent adjustment work.

[0076] (4) Simplify the scene reconstruction process: Through the image and prefab tags in the description file, the production tool can automatically read and reconstruct the second target scene. This method not only simplifies the scene reconstruction process, but also ensures that the reconstructed scene is consistent with the original scene in structure and content.

[0077] (5) Support for complex scene structures and hierarchical relationships: The description file supports tree-structured recording, so that even complex scene structures and hierarchical relationships can be accurately recorded and reconstructed. This helps maintain the integrity and completeness of the scene.

[0078] (6) Improve teamwork efficiency: Team members can collaborate based on a unified description file format, each responsible for the production and export of different parts, and then merge and integrate scenes by importing description files. This method improves the efficiency and accuracy of teamwork.

[0079] (7) Enhanced data maintainability and traceability: Through automated export and description file generation, the original information of scene elements and key steps in the production process can be retained. This helps to quickly locate and solve problems during subsequent development and maintenance, and improves data maintainability and traceability.

[0080] Based on the same inventive concept, the embodiment of the present application also provides a scene file processing device corresponding to the scene file processing method in the first embodiment. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned scene file processing method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0081] like Figure 5 As shown, Figure 5 : is a schematic diagram of the structure of a scene file processing device 500 provided in an embodiment of the present application. The scene file processing device 500 includes:

[0082] A drawing module 501 is used to draw and complete scene construction in a drawing tool to obtain a first target scene; wherein the first target scene includes at least one scene element;

[0083] A determination module 502, configured to determine a target scene element from the at least one scene element based on the demand information, and add a target identifier to the target scene element;

[0084] The export module 503 is used to respond to the trigger operation on the target plug-in in the drawing tool, export the target scene element to a target location based on the target identifier, and generate a description file for the target scene element at the target location.

[0085] Those skilled in the art should understand that Figure 5 The implementation functions of each unit in the scene file processing device 500 shown can be understood by referring to the relevant description of the aforementioned scene file processing method. Figure 5 The functions of the various units in the scene file processing device 500 shown may be implemented by a program running on a processor, or may be implemented by a specific logic circuit.

[0086] In a possible implementation, the scene file processing device 500 further includes an import module 504, and the import module 504 further includes:

[0087] In response to an import operation for the description file, the description file is imported into a production tool, so that the production tool automatically reads the target scene elements according to the description file and produces a second target scene based on the target scene elements, wherein the second target scene is different from the first target scene in scene type.

[0088] In a possible implementation, the target scene element includes the layer information that needs to be made into a prefabricated body specified by the requirement information and the picture that needs to be cut specified by the requirement information; the determination module 502 adds a target identifier to the target scene element, including:

[0089] A first suffix is ​​added to the layer information that needs to be made into a prefabricated body specified by the demand information, and a second suffix is ​​added to the picture that needs to be cut specified by the demand information, wherein the first suffix and the second suffix are different.

[0090] In a possible implementation, the first target scene corresponds to a first PSD file, and the export module 503 exports the target scene element to a target location based on the target identifier, and generates a description file for the target scene element at the target location, including:

[0091] Copying the first PSD file to obtain a second PSD file;

[0092] Recursively traverse all layers in the second PSD file. During the recursive traversal, the layer information that needs to be made into a prefabricated body traversed according to the first suffix is ​​recorded in the description file generated at the target location, and the pictures that need to be cut that are traversed according to the second suffix are cut, the cut pictures are saved to the target location and the picture information of the cut pictures is recorded in the description file.

[0093] In a possible implementation manner, all layers in the second PSD file are in a hidden state before recursive traversal, and the description file is an XML file; the recursive traversal is implemented in the following manner:

[0094] Recursively traverse all layers in the second PSD file, if the layer name includes the first suffix, create a prefab tag for the layer to the XML file, set the layer node to a visible state and continue to recurse downward; after recursion backtracks, hide the layer again;

[0095] If the layer name includes the second suffix, create an image tag to the xml file, recursively set the layer and its sublayers to be visible, and cut the image, save the cut image to the target location, and save the image information of the cut image to the corresponding image tag in the xml file.

[0096] In a possible implementation, the at least one scene element includes a blank picture, which represents a picture with fully transparent edges due to the need for blank space as specified by art requirements, and pixel points for indicating the boundary range of the blank picture are added to the corners corresponding to the blank areas in the blank picture to avoid cutting off the transparent area during the cutting process.

[0097] In a possible implementation, the description file includes an image tag and a prefab tag, and the production tool produces the second target scene in the following manner:

[0098] Read the description file;

[0099] For each image tag, determine whether the name of the image tag exists. If not, create a sprite prefab, mount the sprite renderer, and set the image reference to the corresponding image resource;

[0100] For each prefab tag, create an Item prefab, traverse all child nodes under the prefab tag, create a sprite prefab instance for each child node, and add it to the Item prefab as a child object;

[0101] Determine the tree structure in the description file, create a prefab instance object for the prefab with the top level as prefab, calculate the center position of its child node in the description file, place the prefab instance object at the center position in the scene, and set the position of its child node as a relative position; for the prefab with the top level as image, create a prefab instance object and place the prefab instance object in the scene according to the position information in the description file.

[0102] The above scene file processing device has the following beneficial effects:

[0103] (1) Improve the flexibility and efficiency of scene production: By drawing and completing the scene construction in the drawing tool, and then selectively exporting the target scene elements based on the required information, the flexibility of scene production is greatly improved. At the same time, the automated export and description file generation process reduces manual operations and improves production efficiency.

[0104] (2) Support cross-platform or cross-tool scene reuse: Through the import function of the description file, the target scene elements in the first target scene can be easily imported into different types of production tools to achieve cross-platform or cross-tool scene reuse. This helps to share and transfer scene data between different development stages or different teams.

[0105] (3) Reduce image cutting errors and blank space issues: For images that need to be cut, specific pixels are added to the blank space to indicate the blank space boundary, effectively avoiding the problem of mistakenly cutting off transparent areas during the image cutting process. This improves the accuracy and quality of image cutting and reduces subsequent adjustment work.

[0106] (4) Simplify the scene reconstruction process: Through the image and prefab tags in the description file, the production tool can automatically read and reconstruct the second target scene. This method not only simplifies the scene reconstruction process, but also ensures that the reconstructed scene is consistent with the original scene in structure and content.

[0107] (5) Support for complex scene structures and hierarchical relationships: The description file supports tree-structured recording, so that even complex scene structures and hierarchical relationships can be accurately recorded and reconstructed. This helps maintain the integrity and completeness of the scene.

[0108] (6) Improve teamwork efficiency: Team members can collaborate based on a unified description file format, each responsible for the production and export of different parts, and then merge and integrate scenes by importing description files. This method improves the efficiency and accuracy of teamwork.

[0109] (7) Enhanced data maintainability and traceability: Through automated export and description file generation, the original information of scene elements and key steps in the production process can be retained. This helps to quickly locate and solve problems during subsequent development and maintenance, and improves data maintainability and traceability.

[0110] like Figure 6 As shown, Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 600, wherein the electronic device 600 includes:

[0111] A processor 601, a storage medium 602 and a bus 603, wherein the storage medium 602 stores machine-readable instructions executable by the processor 601. When the electronic device 600 is running, the processor 601 communicates with the storage medium 602 via the bus 603, and the processor 601 executes the machine-readable instructions to perform the steps of the scene file processing method described in the embodiment of the present application.

[0112] In actual application, the components in the electronic device 600 are coupled together via the bus 603. It is understood that the bus 603 is used to realize the connection and communication between these components. In addition to the data bus, the bus 603 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as bus 603.

[0113] The electronic device has the following beneficial effects:

[0114] (1) Improve the flexibility and efficiency of scene production: By drawing and completing the scene construction in the drawing tool, and then selectively exporting the target scene elements based on the required information, the flexibility of scene production is greatly improved. At the same time, the automated export and description file generation process reduces manual operations and improves production efficiency.

[0115] (2) Support cross-platform or cross-tool scene reuse: Through the import function of the description file, the target scene elements in the first target scene can be easily imported into different types of production tools to achieve cross-platform or cross-tool scene reuse. This helps to share and transfer scene data between different development stages or different teams.

[0116] (3) Reduce image cutting errors and blank space issues: For images that need to be cut, specific pixels are added to the blank space to indicate the blank space boundary, effectively avoiding the problem of mistakenly cutting off transparent areas during the image cutting process. This improves the accuracy and quality of image cutting and reduces subsequent adjustment work.

[0117] (4) Simplify the scene reconstruction process: Through the image and prefab tags in the description file, the production tool can automatically read and reconstruct the second target scene. This method not only simplifies the scene reconstruction process, but also ensures that the reconstructed scene is consistent with the original scene in structure and content.

[0118] (5) Support for complex scene structures and hierarchical relationships: The description file supports tree-structured recording, so that even complex scene structures and hierarchical relationships can be accurately recorded and reconstructed. This helps maintain the integrity and completeness of the scene.

[0119] (6) Improve teamwork efficiency: Team members can collaborate based on a unified description file format, each responsible for the production and export of different parts, and then merge and integrate scenes by importing description files. This method improves the efficiency and accuracy of teamwork.

[0120] (7) Enhanced data maintainability and traceability: Through automated export and description file generation, the original information of scene elements and key steps in the production process can be retained. This helps to quickly locate and solve problems during subsequent development and maintenance, and improves data maintainability and traceability.

[0121] The embodiment of the present application further provides a computer-readable storage medium, which stores executable instructions. When the executable instructions are executed by at least one processor 601, the scene file processing method described in the embodiment of the present application is implemented.

[0122] In some embodiments, the storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface storage, an optical disk, or a compact disc read-only memory (CD-ROM); it can also be various devices including one or any combination of the above memories.

[0123] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0124] As an example, executable instructions may, but do not necessarily, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (for example, files storing one or more modules, subroutines, or code portions).

[0125] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0126] The computer-readable storage medium has the following advantages:

[0127] (1) Improve the flexibility and efficiency of scene production: By drawing and completing the scene construction in the drawing tool, and then selectively exporting the target scene elements based on the required information, the flexibility of scene production is greatly improved. At the same time, the automated export and description file generation process reduces manual operations and improves production efficiency.

[0128] (2) Support cross-platform or cross-tool scene reuse: Through the import function of the description file, the target scene elements in the first target scene can be easily imported into different types of production tools to achieve cross-platform or cross-tool scene reuse. This helps to share and transfer scene data between different development stages or different teams.

[0129] (3) Reduce image cutting errors and blank space issues: For images that need to be cut, specific pixels are added to the blank space to indicate the blank space boundary, effectively avoiding the problem of mistakenly cutting off transparent areas during the image cutting process. This improves the accuracy and quality of image cutting and reduces subsequent adjustment work.

[0130] (4) Simplify the scene reconstruction process: Through the image and prefab tags in the description file, the production tool can automatically read and reconstruct the second target scene. This method not only simplifies the scene reconstruction process, but also ensures that the reconstructed scene is consistent with the original scene in structure and content.

[0131] (5) Support for complex scene structures and hierarchical relationships: The description file supports tree-structured recording, so that even complex scene structures and hierarchical relationships can be accurately recorded and reconstructed. This helps maintain the integrity and completeness of the scene.

[0132] (6) Improve teamwork efficiency: Team members can collaborate based on a unified description file format, each responsible for the production and export of different parts, and then merge and integrate scenes by importing description files. This method improves the efficiency and accuracy of teamwork.

[0133] (7) Enhanced data maintainability and traceability: Through automated export and description file generation, the original information of scene elements and key steps in the production process can be retained. This helps to quickly locate and solve problems during subsequent development and maintenance, and improves data maintainability and traceability.

[0134] In the several embodiments provided in the present application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0135] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0136] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0137] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0138] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A scene file processing method, characterized in that: The method comprises: Draw and complete the scene construction in a drawing tool to obtain a first target scene; wherein the first target scene includes at least one scene element; Determine a target scene element from the at least one scene element based on the demand information, and add a target identifier to the target scene element; In response to a triggering operation on a target plug-in in the drawing tool, the target scene element is exported to a target location based on the target identifier, and a description file for the target scene element is generated at the target location.

2. The method according to claim 1, characterized in that The method further comprises: In response to an import operation for the description file, the description file is imported into a production tool, so that the production tool automatically reads the target scene elements according to the description file and produces a second target scene based on the target scene elements, wherein the second target scene is different from the first target scene in scene type.

3. The method according to claim 1, characterized in that The target scene element includes the layer information that needs to be made into a prefabricated body specified by the requirement information and the picture that needs to be cut specified by the requirement information; adding a target identifier to the target scene element includes: A first suffix is ​​added to the layer information that needs to be made into a prefabricated body specified by the demand information, and a second suffix is ​​added to the picture that needs to be cut specified by the demand information, wherein the first suffix and the second suffix are different.

4. The method according to claim 3, characterized in that The first target scene corresponds to a first PSD file, and the exporting of the target scene element to a target location based on the target identifier and generating a description file for the target scene element at the target location include: Copying the first PSD file to obtain a second PSD file; Recursively traverse all layers in the second PSD file. During the recursive traversal, the layer information that needs to be made into a prefabricated body traversed according to the first suffix is ​​recorded in the description file generated at the target location, and the pictures that need to be cut that are traversed according to the second suffix are cut, the cut pictures are saved to the target location and the picture information of the cut pictures is recorded in the description file.

5. The method according to claim 4, characterized in that All layers in the second PSD file are in a hidden state before recursive traversal, and the description file is an XML file; the recursive traversal is implemented in the following manner: Recursively traverse all layers in the second PSD file, if the layer name includes the first suffix, create a prefab tag for the layer to the XML file, set the layer node to a visible state and continue to recurse downward; after recursion backtracks, hide the layer again; If the layer name includes the second suffix, create an image tag to the xml file, recursively set the layer and its sublayers to be visible, and cut the image, save the cut image to the target location, and save the image information of the cut image to the corresponding image tag in the xml file.

6. The method according to claim 5, characterized in that The at least one scene element includes a blank picture, which represents a picture with fully transparent edges due to the need for blank space as specified by art requirements, and pixel points for indicating the boundary range of the blank picture are added to the corners corresponding to the blank areas in the blank picture to avoid cutting off the transparent area during the cutting process.

7. The method according to claim 2, characterized in that: The description file includes an image tag and a prefab tag, and the production tool produces the second target scene in the following manner: Read the description file; For each image tag, determine whether the name of the image tag exists. If not, create a sprite prefab, mount the sprite renderer, and set the image reference to the corresponding image resource; For each prefab tag, create an Item prefab, traverse all child nodes under the prefab tag, create a sprite prefab instance for each child node, and add it to the Item prefab as a child object; Determine the tree structure in the description file, create a prefab instance object for the prefab with the top level as prefab, calculate the center position of its child node in the description file, place the prefab instance object at the center position in the scene, and set the position of its child node as a relative position; for the prefab with the top level as image, create a prefab instance object and place the prefab instance object in the scene according to the position information in the description file.

8. A scene file processing device, characterized in that: The device comprises: A drawing module, used to draw and complete scene construction in a drawing tool to obtain a first target scene; wherein the first target scene includes at least one scene element; A determination module, configured to determine a target scene element from the at least one scene element based on the demand information, and add a target identifier to the target scene element; The export module is used to respond to the trigger operation of the target plug-in in the drawing tool, export the target scene element to the target location based on the target identifier, and generate a description file for the target scene element at the target location.

9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to execute the scene file processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the scene file processing method according to any one of claims 1 to 7 is executed.