Model data processing methods, devices and electronic equipment
By acquiring and processing the associated data in the model data and adopting a size adjustment method that adapts to different skeleton types, the problems of complicated model size adjustment and deformation in the existing technology are solved, and efficient and convenient model scaling is achieved.
Patent Information
- Application Number
- CN202310378778.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-03-31
AI Technical Summary
Existing technologies for adjusting the size of character models after skinning and binding involve complicated steps, high labor costs, and deformation problems. In particular, the scaling process is incorrect when dealing with diverse skeleton combinations, leading to model or bone deformation.
By acquiring associated data from the model data, including skeletal data, skinning data, and animation data, the size is adjusted based on the size adjustment parameters and attribute parameters. Different scaling methods are used to process the skeletal, skinning, and animation data to ensure that no deformation occurs during the size adjustment process.
It improves the efficiency and effectiveness of model size adjustment, enables convenient and fast non-linear model scaling, reduces working time costs, and is applicable to various skeleton construction methods.
Smart Images

Figure CN116524075B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of animation technology, and more specifically, to a method, apparatus, and electronic device for processing model data. Background Technology
[0002] In the 3ds Max character model creation stage of game development, generating the model, skinning and binding it to the model, and then generating animation is generally an irreversible linear production process. If scaling or adjusting an already skinned character model is required, it typically necessitates first resizing the model during character creation, then adjusting the bone position and size during rigging, then reskinning or inheriting the old skin, and finally exporting the completed animation data back to the resized and bound new model. This method is complex and labor-intensive. While script plugins can be used to scale skinned models, when the model uses diverse skeleton combinations, different types of skeleton elements may require different scaling methods. Using a generic script alignment for scaling can lead to deformation of the model or bones after scaling. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, apparatus and electronic device for processing model data, so as to improve the efficiency and effect of model size adjustment.
[0004] In a first aspect, embodiments of the present invention provide a method for processing model data, comprising: acquiring model data; the model data including skeletal data, skinning data, and animation data; determining at least one set of associated data from the model data; wherein the associated data includes skeletal data, and skinning data and animation data having a mapping relationship with the skeletal data; acquiring size adjustment parameters of target associated data; and performing size adjustment processing on the target associated data based on the size adjustment parameters and attribute parameters of the target associated data in at least one set of associated data to obtain processed target associated data; wherein the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data.
[0005] Secondly, embodiments of the present invention provide a model data processing apparatus, comprising: a model data acquisition module for acquiring model data; the model data including skeletal data, skinning data, and animation data; an associated data determination module for determining at least one set of associated data from the model data; wherein the associated data includes skeletal data, and skinning data and animation data having a mapping relationship with the skeletal data; and a size adjustment module for acquiring size adjustment parameters of target associated data, and performing size adjustment processing on the target associated data based on the size adjustment parameters and attribute parameters of the target associated data in at least one set of associated data to obtain processed target associated data; wherein the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data.
[0006] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described method for processing model data.
[0007] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for processing model data.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] The aforementioned method, apparatus, and electronic device for processing model data involve: acquiring model data, including skeletal data, skinning data, and animation data; determining at least one set of associated data from the model data, wherein the associated data includes skeletal data, and skinning data and animation data that have a mapping relationship with the skeletal data; acquiring size adjustment parameters for target associated data; and performing size adjustment processing on the target associated data based on the size adjustment parameters and attribute parameters of the target associated data from at least one set of associated data, to obtain processed target associated data; wherein the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data. This method performs size adjustment processing on the model data based on the attribute parameters of the model data, ensuring that the model does not deform during the size adjustment process, thereby improving the efficiency and effect of model size adjustment.
[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for processing model data provided in an embodiment of the present invention;
[0014] Figure 2 A schematic diagram of a graphical user interface displaying a parameter input window and associated data selection controls provided in an embodiment of the present invention;
[0015] Figure 3 This is a schematic diagram of the structure of a model data processing device provided in an embodiment of the present invention;
[0016] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] In game development, characters are typically created using 3D modeling software such as 3ds Max. Creating a character model, skinning and rigging it, and generating animation effects is a largely irreversible linear production process. Scaling and adjusting an already skinned character model is also an irreversible step. In traditional production workflows, if the size of an already skinned character needs to be adjusted, the model size must first be readjusted during character creation, then the bone position and size must be adjusted during rigging, then the old skinning must be re-skinned or inherited, and finally, the animation data from the completed animation must be exported to the newly resized and rigged model. This overall process is cumbersome, essentially requiring a complete re-creation of the rigging and animation stages by manpower, resulting in excessive time costs and very low cost-effectiveness.
[0019] Some existing script plugins can scale already skinned models, with most using the software's built-in model resizing tools. However, due to the relative complexity of skeletal structures in character creation, they cannot meet the scaling requirements of model animation. For example, when character models are bound, various object combinations are used as skeletons, such as the Biped skeleton system, Bone skeleton, and Helper. The diverse skeleton combinations or different scaling methods of the scripts can lead to incorrect results from existing scaling scripts, resulting in strange deformations in the scaled model or skeleton. Furthermore, the scripts are poorly designed, processing only one file at a time, which fails to meet the requirements for rapid scaling iterations.
[0020] Based on this, the present invention provides a method, apparatus and electronic device for processing model data, which can be applied to scenarios where the size of a 3D model needs to be adjusted.
[0021] See Figure 1 First, a method for processing model data provided by an embodiment of the present invention will be introduced, which includes the following steps:
[0022] Step S102: Obtain model data; model data includes skeletal data, skinning data, and animation data.
[0023] The model data mentioned above is typically 3D model data, which can be generated by relevant personnel using 3D modeling software. This model data can be for a single character model or a 3D scene model. A 3D scene model usually includes one or more character models, environment models, and camera models. The character models are usually animated; correspondingly, they possess skeletal data, skinning data, and animation data. The environment models can refer to natural environments, such as the sky and grass, or artificial environments, such as buildings. Environment models are typically static models, do not move, and do not have corresponding skeletons; they usually only contain vertex data used to generate the model's surface.
[0024] Based on this model data, the corresponding character model can be displayed in a 3D virtual scene. The aforementioned skeletal data is typically used to record the individual bones of the character model, as well as the hierarchical and connection relationships between them. The aforementioned skinning data is typically used to generate the model surface of the character model. Skinning data records which bones(s) influence each position on the model surface, and parameters such as the weight of each bone's influence on the model's position. The aforementioned animation data is typically used to record the character model's animation poses at various animation moments; these animation poses can be recorded using the position parameters of each bone in the character model at the corresponding moment.
[0025] Step S104: Determine at least one set of associated data from the model data; wherein the associated data includes skeletal data, skinning data and animation data that have a mapping relationship with the skeletal data.
[0026] Typically, a character model contains skeletal data, skinning data, and animation data. Since a character model usually has multiple bones with interconnected relationships, the first step is to find the bone data representing the interconnected bones from the model data.
[0027] Skinned objects are typically represented in a specific format, such as being saved as skin objects. Therefore, the skinning data can be determined from the model data based on its data format. Since the skinning data records the influence of the skeleton on various model positions on the model surface, there is a mapping relationship between the skinning data and the skeleton data. Therefore, it is also easy to determine the skinning data of the character model from the skinning data in the model data based on this mapping relationship.
[0028] Animation data typically includes local pose data and global pose data, and has a fixed storage format. For example, local pose data is the posture and position data of a child bone relative to its parent bone, stored in SQT format (scalequaternion translation). Animation data can be retrieved from the skinning data based on the animation data format. Then, based on the mapping relationship between the character model's bone data and animation data, the animation data for that character model can be determined from the animation data within the skinning data.
[0029] Furthermore, the skeletal data, skinning data, and animation data of each character model corresponding to this model data can be identified as a set of associated data. When it is necessary to scale down or up a character model corresponding to the model data, it is only necessary to adjust the size of the associated data corresponding to that character model.
[0030] Step S106: Obtain the size adjustment parameters of the target associated data; based on the size adjustment parameters and the attribute parameters of the target associated data in at least one set of associated data, perform size adjustment processing on the target associated data to obtain the processed target associated data; wherein, the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data.
[0031] The aforementioned size adjustment parameters are typically reduction or enlargement factors, which can be set by relevant personnel according to their needs. When setting the size adjustment parameters, relevant personnel usually specify the character model that needs to be adjusted. The aforementioned target association data refers to the target association data corresponding to the character model that needs size adjustment.
[0032] Skeletal data, skinning data, and animation data typically have corresponding sizing methods due to their different properties. These sizing methods refer to different approaches for adjusting the dimensions of skeletal data, skinning data, and animation data. For example, for skinning data, sizing is usually performed with reference to the root bone coordinate system of the character model.
[0033] The skeletal data corresponds to various bone types, such as root bones, parent bones, and child bones. Different types of bones typically require different coordinate systems when undergoing size transformations. For example, root bones usually reference the world coordinate system, while child bones reference a local coordinate system related to their parent bones. The aforementioned size adjustment method refers to the reference coordinate system used in size processing.
[0034] The aforementioned method for processing model data involves: acquiring model data, including skeletal data, skinning data, and animation data; determining at least one set of associated data from the model data, wherein the associated data includes skeletal data, and skinning data and animation data that have a mapping relationship with the skeletal data; acquiring size adjustment parameters for the target associated data; and performing size adjustment processing on the target associated data based on the size adjustment parameters and attribute parameters of the target associated data from the at least one set of associated data, thereby obtaining the processed target associated data; wherein the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data. This method performs size adjustment processing on the model data based on the attribute parameters of the model data, ensuring that the model does not deform during the size adjustment process, thus improving the efficiency and effect of model size adjustment.
[0035] The following embodiments provide an implementation for determining at least one set of associated data from model data.
[0036] Specifically, at least one dataset can be established first based on the model data. This dataset includes multiple skeleton data sets with interrelationships within the model data. These interrelationships indicate the connections between the model skeletons represented by the multiple skeleton data sets; that is, these skeleton data sets belong to the same character model, and the represented model skeletons are interconnected to form the skeleton of the character model. Then, for each dataset in the at least one dataset, skinning data and animation data that have a mapping relationship with the skeleton data in the dataset can be identified as data within that dataset. The skeleton data, skinning data, and animation data in each of the at least one dataset can be identified as a set of associated data.
[0037] In some model data, model data belonging to the same character model have their identifier parameters added during the generation process. When determining related data, model data with the same character model identifier parameters can be directly identified as related data for that character model. Then, based on the different storage formats of skeletal data, skinning data, and animation data, the various types of data within the related data can be distinguished.
[0038] The following embodiments provide an implementation method for performing size adjustment processing on target associated data based on size adjustment parameters and attribute parameters of target associated data in at least one set of associated data.
[0039] Specifically, the sizing of the skeletal data, skinning data, and animation data can be adjusted sequentially. First, based on the sizing adjustment parameters, the skeletal data in the target associated data is sizing adjusted according to the sizing adjustment method indicated by the attribute parameters of the skeletal data. Then, based on the sizing adjustment parameters and the root bone coordinate system corresponding to the skeletal data, the skinning data in the target associated data is sizing adjusted. Finally, based on the target pose parameters and sizing adjustment parameters corresponding to the skinning data, the animation data in the target associated data is sizing adjusted.
[0040] For skeletal data, the first step is to determine the corresponding bone type based on the attribute parameters of the skeletal data in the target associated data. Bone types typically include root bones, parent bones, child bones, and auxiliary objects, where auxiliary objects can be non-skeletal items connected to the bones, such as weapons held by the character model. Then, based on the size adjustment parameters and the reference coordinate system corresponding to the bone type, the skeletal data is sizing. Specifically, this process usually involves performing a linear transformation on the skeletal data based on the reference coordinate system to ensure that the model's skeleton represented by the skeletal data conforms to the display size corresponding to the size adjustment parameters.
[0041] Animation data typically consists of various pose parameters. The parameters corresponding to the multiple poses represented by the animation data can be called initial pose parameters. For animation data, based on the target pose parameters corresponding to the skinning data, the animation data in the target-related data needs to undergo pose transformation processing to obtain processed animation data. The processed animation data corresponds to the target pose parameters; for example, the target pose parameters corresponding to the skinning data indicate that the character model is in a standing pose. However, since animation data contains multiple poses, such as running and flying poses, the pose represented by the animation data first needs to be restored to a standing pose. Then, based on the size adjustment parameters, the processed animation data is sized to obtain sized animation data. Finally, based on the initial pose parameters corresponding to the animation data and the sized animation data, updated animation data is generated. The updated animation data corresponds to the initial pose parameters and matches the size adjustment parameters.
[0042] The aforementioned size adjustment parameters are typically set by relevant personnel. A parameter input window, along with selection controls corresponding to each set of associated data in at least one set of associated data, can be displayed on the graphical user interface of the terminal device. Figure 2 As shown. Users can edit the parameter input window, entering size adjustment parameters, such as 20, which means magnification by 20 times. In response to the editing operation on the parameter input window, the size adjustment parameters are determined based on the edited content. Then, in response to the triggering operation of the selection control corresponding to the first associated data in at least one set of associated data, the first associated data is determined as the target associated data.
[0043] To facilitate user verification of whether the resized model meets their needs, the graphical user interface described above can display the first virtual model corresponding to the associated data and the resized second virtual model. Specifically, after obtaining the resized parameters, a copy of the target associated data can be generated; then, the copy is resized based on the resized parameters to obtain the processed copy data. This process is similar to the resized data of the target associated data and will not be repeated here; finally, the second virtual model is displayed based on the processed copy data; the second virtual model matches the resized parameters.
[0044] This invention also provides another method for processing model data, which... Figure 1 Implemented based on the method shown.
[0045] This method first organizes the animation data into mapping relationships usable during scaling. Each data structure generally consists of: a root bone, a list of skinned models, a list of bone trees, and a list of bones. Then, different scaling methods are selected based on the different attributes of different data within the data structure, scaling each with a uniform scaling factor but different scaling methods. Specifically, the biped bone system is scaled by adjusting its own height; the bone / helper bone chain is scaled based on the coordinate system of its attached biped parent; and the skinned model is scaled based on the corresponding root bone coordinate system (local coordinate system). Finally, a batch scaling method for animation files is applied. Compared to scaling skinned files, the animation files are first processed into the binding poses corresponding to the original skinned data before scaling, and then the animation data is restored after scaling.
[0046] To simplify the scaling process, the above methods can be implemented as a software plugin. The plugin's scaling process mainly consists of two parts: scaling the rigging files (i.e., skinning data and corresponding bone data) and scaling the animation files (i.e., animation data). Scaling the rigging files involves using the rigging files as the adjustment target, comparing them to the original model size reference to adjust the scaling factor, and then executing and saving the adjustment results. Scaling the animation files allows for batch adjustment of animation files after confirming the adjustment parameters. Finally, the scaled files are automatically stored in a preset folder within the current asset storage path.
[0047] The steps for using the plugin built based on the above method are as follows:
[0048] 1. Enter the asset storage path, and the plugin will identify the skinning file and animation file based on the file name identifier.
[0049] 2. Scale the bound files. Based on the original model's reference size ratio, adjust the scaling factor to achieve the required scale. During the scaling factor adjustment process, both the original model and the model after the scaling factor adjustment are displayed in the graphical user interface so that the user can view the scaling effect and continue adjusting the scaling factor based on the scaling effect.
[0050] 3. Scale the animation file. After confirming the scaling factor, check the "is scale animation file" option, select the animation file to be scaled from the animation list, and batch process the scaling of the skinned file and the animation file.
[0051] In the above process, the data within the .max file is first organized during the scaling process of the binding file. This process includes data collection and classification, establishing relationship chains (also known as "skeleton trees"), and classification based on object attributes. Specifically, based on the binding file, all objects in each .max file are collected and classified using search and classification algorithms, categorized into skeletons, auxiliary objects, skinned objects, and unskinned objects. After organizing all skeletons, they are classified into various skeleton trees, starting with the root object at the top, ordered according to parent-child relationships and corresponding skinned objects, and categorized according to each object's attributes, forming a specific structure that serves as input data for the scaling program. The structure includes the following: root bone, root bone type, list of skinned models under the root skeleton tree, skeleton tree list, bone names in the skeleton tree, bone list, and bone names, etc.
[0052] Then, the scaling logic is applied to the above-categorized datasets. Based on the relationship chain of each root skeleton, objects with different attributes are scaled using the same scaling parameters but different scaling methods.
[0053] Perform the following operations by traversing the skeletal tree as a unit:
[0054] 1. Back up the skinning information of the object that is skinned using this bone tree, and then remove the skinning modifier from the object.
[0055] 2. Scaling of biped skeletal system objects: Scaling is achieved by adjusting the height of the skeletal system itself. 3. Scaling of bone / helper objects: Scaling is performed on each bone chain and helper object attached to the biped based on the position in the biped's parent coordinate system (local coordinate system).
[0056] 4. Scale the skinned model, then scale it based on the corresponding root bone coordinate system (local coordinate system) in the skinned object, and finally copy the old skinning information into the skinned object.
[0057] Finally, the scaling of other non-skinned models and objects such as the camera is processed, and scaled in the world coordinate system. At this point, the above traversal has correctly scaled the bound file, and simultaneously completed the scaling adjustments for both skinned and non-skinned objects within the file.
[0058] In the animation file scaling process, all selected animation files are scaled according to the determined scaling factor. The difference from scaling bound files is that before scaling, the files are first processed into the binding pose (TPose or APose) corresponding to the bound file. After scaling, the binding pose is removed and the animation data is restored.
[0059] This method has the following advantages:
[0060] 1. Adjust the visualization to compare the effect before and after scaling when adjusting the zoom, allowing for fine-tuning;
[0061] 2. Batch adjustment: After confirming the scaling ratio, it can quickly process bound files and animation files in batches with one click according to the determined scaling parameters, and accurately and quickly scale them proportionally.
[0062] 3. Applicable to all skeleton building methods, covering and supporting skinned model scaling for all bone matching methods.
[0063] 4. A user-friendly interface allows art students in any role to operate comfortably and quickly through the GUI interface;
[0064] 5. A reversible non-linear production process allows for real-time adjustment of model scaling during the modeling, skinning, and animation stages.
[0065] The above method allows for convenient scaling and adjustment of already skinned objects in the 3ds Max character creation workflow for game development, and also enables batch adjustments of already created animation files. It transforms the scaling and adjustment of already skinned objects into a reversible and non-linear process, facilitating faster game development. Traditional scaling methods, requiring adjustments to already skinned and animated assets, can take approximately 1-2 days per character; using the above method, scaling already skinned rigging and animation files only takes 1-5 minutes.
[0066] For the above method embodiments, see Figure 3 The embodiment of the present invention shown provides a model data processing apparatus, which includes:
[0067] The model data acquisition module 302 is used to acquire model data; the model data includes skeletal data, skinning data, and animation data.
[0068] The associated data determination module 304 is used to determine at least one set of associated data from the model data; wherein, the associated data includes skeletal data, as well as skinning data and animation data that have a mapping relationship with the skeletal data;
[0069] The size adjustment module 306 is used to obtain the size adjustment parameters of the target associated data, and perform size adjustment processing on the target associated data based on the size adjustment parameters and the attribute parameters of the target associated data in at least one set of associated data to obtain the processed target associated data; wherein, the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data.
[0070] The aforementioned model data processing apparatus acquires model data, including skeletal data, skinning data, and animation data; determines at least one set of associated data from the model data, wherein the associated data includes skeletal data, and skinning data and animation data that have a mapping relationship with the skeletal data; acquires size adjustment parameters for target associated data; and performs size adjustment processing on the target associated data based on the size adjustment parameters and attribute parameters of the target associated data in the at least one set of associated data, to obtain processed target associated data; wherein the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data. This method performs size adjustment processing on the model data based on the attribute parameters of the model data, ensuring that the model does not deform during the size adjustment process, thereby improving the efficiency and effect of model size adjustment.
[0071] The aforementioned associated data determination module is further configured to: establish at least one data set based on model data; the data set includes multiple skeleton data that have an association relationship in the model data; the association relationship is used to indicate the connection relationship between the model skeletons represented by the multiple skeleton data; for each data set in the at least one data set, determine the skinning data and animation data in the model data that have a mapping relationship with the skeleton data in the data set as data in the data set; and determine the skeleton data, skinning data, and animation data in each data set in the at least one data set as a set of associated data.
[0072] The aforementioned size adjustment module is also used for: adjusting the size of the bone data in the target associated data according to the size adjustment method indicated by the attribute parameters of the bone data based on the size adjustment parameters; adjusting the size of the skinning data in the target associated data based on the size adjustment parameters and the root bone coordinate system corresponding to the bone data; and adjusting the size of the animation data in the target associated data based on the target pose parameters and size adjustment parameters corresponding to the skinning data.
[0073] The aforementioned size adjustment module is also used to: determine the bone type corresponding to the bone data based on the attribute parameters of the bone data in the target associated data; and perform size adjustment processing on the bone data based on the size adjustment parameters and the reference coordinate system corresponding to the bone type.
[0074] The aforementioned animation data corresponds to the initial pose parameters; the aforementioned size adjustment module is also used to: perform pose transformation processing on the animation data in the target associated data based on the target pose parameters corresponding to the skinning data, to obtain processed animation data; the processed animation data corresponds to the target pose parameters; perform size adjustment processing on the processed animation data based on the size adjustment parameters, to obtain size-adjusted animation data; generate updated animation data based on the initial pose parameters corresponding to the animation data and the size-adjusted animation data; the updated animation data corresponds to the initial pose parameters and matches the size adjustment parameters.
[0075] The aforementioned device provides a graphical user interface via a terminal device; the graphical user interface includes a parameter input window and a selection control corresponding to each set of associated data in at least one set of associated data; the aforementioned size adjustment module is further configured to: in response to an editing operation on the parameter input window, determine size adjustment parameters based on the editing content corresponding to the editing operation; and in response to a triggering operation on the selection control corresponding to the first associated data in at least one set of associated data, determine the first associated data as the target associated data.
[0076] The aforementioned device provides a graphical user interface via a terminal device; the graphical user interface displays a first virtual model corresponding to the associated data; the aforementioned method further includes: a data copying module for generating copied data of the target associated data; a size adjustment processing module for performing size adjustment processing on the copied data based on size adjustment parameters to obtain processed copied data; and a second virtual model display module for displaying a second virtual model based on the processed copied data; the second virtual model is matched with the size adjustment parameters.
[0077] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for processing model data. Specifically:
[0078] Acquire model data; the model data includes skeletal data, skinning data, and animation data; determine at least one set of associated data from the model data; wherein, the associated data includes skeletal data, and skinning data and animation data that have a mapping relationship with the skeletal data; acquire the size adjustment parameters of the target associated data, and perform size adjustment processing on the target associated data based on the size adjustment parameters and the attribute parameters of the target associated data in at least one set of associated data to obtain the processed target associated data; wherein, the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data.
[0079] The above method adjusts the size of the model data based on the attribute parameters of the model data, so that the model will not be deformed during the size adjustment process, thus improving the efficiency and effect of the size adjustment.
[0080] Optionally, the step of determining at least one set of associated data from the model data includes: establishing at least one data set based on the model data; the data set includes multiple skeleton data that have an association relationship in the model data; the association relationship is used to indicate the connection relationship between the model skeletons represented by the multiple skeleton data; for each data set in the at least one data set, determining the skinning data and animation data in the model data that have a mapping relationship with the skeleton data in the data set as data in the data set; and determining the skeleton data, skinning data, and animation data in each data set in the at least one data set as a set of associated data.
[0081] Optionally, the above-mentioned step of adjusting the size of the target associated data based on the size adjustment parameters and the attribute parameters of the target associated data in at least one set of associated data includes: adjusting the size of the skeletal data in the target associated data according to the size adjustment method indicated by the attribute parameters of the skeletal data based on the size adjustment parameters; adjusting the size of the skinning data in the target associated data based on the size adjustment parameters and the root bone coordinate system corresponding to the skeletal data; and adjusting the size of the animation data in the target associated data based on the target pose parameters and size adjustment parameters corresponding to the skinning data.
[0082] Optionally, the above steps of adjusting the size of the skeletal data in the target associated data according to the size adjustment method indicated by the attribute parameters of the skeletal data based on the size adjustment parameters include: determining the bone type corresponding to the skeletal data based on the attribute parameters of the skeletal data in the target associated data; and adjusting the size of the skeletal data based on the size adjustment parameters and the reference coordinate system corresponding to the bone type.
[0083] Optionally, the aforementioned animation data corresponds to initial pose parameters; the step of adjusting the size of the animation data in the target-related data based on the target pose parameters and size adjustment parameters corresponding to the skinning data includes: performing pose transformation processing on the animation data in the target-related data based on the target pose parameters corresponding to the skinning data to obtain processed animation data; the processed animation data corresponds to the target pose parameters; performing size adjustment processing on the processed animation data based on the size adjustment parameters to obtain size-adjusted animation data; generating updated animation data based on the initial pose parameters and size-adjusted animation data corresponding to the animation data; the updated animation data corresponds to the initial pose parameters and matches the size adjustment parameters.
[0084] Optionally, the above method provides a graphical user interface via a terminal device; the graphical user interface includes a parameter input window and a selection control corresponding to each set of associated data in at least one set of associated data; the step of obtaining the size adjustment parameter of the target associated data includes: in response to an editing operation on the parameter input window, determining the size adjustment parameter based on the editing content corresponding to the editing operation; in response to a triggering operation on the selection control corresponding to the first associated data in at least one set of associated data, determining the first associated data as the target associated data.
[0085] Optionally, the above method provides a graphical user interface through a terminal device; the graphical user interface displays a first virtual model corresponding to the associated data; after obtaining the size adjustment parameters of the target associated data, the method further includes: generating copy data of the target associated data; performing size adjustment processing on the copy data based on the size adjustment parameters to obtain processed copy data; displaying a second virtual model based on the processed copy data; and matching the second virtual model with the size adjustment parameters.
[0086] See Figure 4 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described model data processing method.
[0087] Furthermore, Figure 4 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.
[0088] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0089] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0090] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for processing model data.
[0091] The present invention provides a method, apparatus, and electronic device for processing model data, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. Specifically:
[0092] Acquire model data; the model data includes skeletal data, skinning data, and animation data; determine at least one set of associated data from the model data; wherein, the associated data includes skeletal data, and skinning data and animation data that have a mapping relationship with the skeletal data; acquire the size adjustment parameters of the target associated data, and perform size adjustment processing on the target associated data based on the size adjustment parameters and the attribute parameters of the target associated data in at least one set of associated data to obtain the processed target associated data; wherein, the attribute parameters are used to indicate the size adjustment method corresponding to the target associated data.
[0093] The above method adjusts the size of the model data based on the attribute parameters of the model data, so that the model will not be deformed during the size adjustment process, thus improving the efficiency and effect of the size adjustment.
[0094] Optionally, the step of determining at least one set of associated data from the model data includes: establishing at least one data set based on the model data; the data set includes multiple skeleton data that have an association relationship in the model data; the association relationship is used to indicate the connection relationship between the model skeletons represented by the multiple skeleton data; for each data set in the at least one data set, determining the skinning data and animation data in the model data that have a mapping relationship with the skeleton data in the data set as data in the data set; and determining the skeleton data, skinning data, and animation data in each data set in the at least one data set as a set of associated data.
[0095] Optionally, the above-mentioned step of adjusting the size of the target associated data based on the size adjustment parameters and the attribute parameters of the target associated data in at least one set of associated data includes: adjusting the size of the skeletal data in the target associated data according to the size adjustment method indicated by the attribute parameters of the skeletal data based on the size adjustment parameters; adjusting the size of the skinning data in the target associated data based on the size adjustment parameters and the root bone coordinate system corresponding to the skeletal data; and adjusting the size of the animation data in the target associated data based on the target pose parameters and size adjustment parameters corresponding to the skinning data.
[0096] Optionally, the above steps of adjusting the size of the skeletal data in the target associated data according to the size adjustment method indicated by the attribute parameters of the skeletal data based on the size adjustment parameters include: determining the bone type corresponding to the skeletal data based on the attribute parameters of the skeletal data in the target associated data; and adjusting the size of the skeletal data based on the size adjustment parameters and the reference coordinate system corresponding to the bone type.
[0097] Optionally, the aforementioned animation data corresponds to initial pose parameters; the step of adjusting the size of the animation data in the target-related data based on the target pose parameters and size adjustment parameters corresponding to the skinning data includes: performing pose transformation processing on the animation data in the target-related data based on the target pose parameters corresponding to the skinning data to obtain processed animation data; the processed animation data corresponds to the target pose parameters; performing size adjustment processing on the processed animation data based on the size adjustment parameters to obtain size-adjusted animation data; generating updated animation data based on the initial pose parameters and size-adjusted animation data corresponding to the animation data; the updated animation data corresponds to the initial pose parameters and matches the size adjustment parameters.
[0098] Optionally, the above method provides a graphical user interface via a terminal device; the graphical user interface includes a parameter input window and a selection control corresponding to each set of associated data in at least one set of associated data; the step of obtaining the size adjustment parameter of the target associated data includes: in response to an editing operation on the parameter input window, determining the size adjustment parameter based on the editing content corresponding to the editing operation; in response to a triggering operation on the selection control corresponding to the first associated data in at least one set of associated data, determining the first associated data as the target associated data.
[0099] Optionally, the above method provides a graphical user interface through a terminal device; the graphical user interface displays a first virtual model corresponding to the associated data; after obtaining the size adjustment parameters of the target associated data, the method further includes: generating copy data of the target associated data; performing size adjustment processing on the copy data based on the size adjustment parameters to obtain processed copy data; displaying a second virtual model based on the processed copy data; and matching the second virtual model with the size adjustment parameters.
[0100] See Figure 4 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described model data processing method.
[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0102] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0103] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0104] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0105] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for processing model data, characterized in that, include: Acquire model data; the model data includes skeletal data, skinning data, and animation data. Determine at least one set of associated data from the model data; wherein the associated data includes skeletal data, skinning data and animation data that have a mapping relationship with the skeletal data; Obtain the size adjustment parameters of the target associated data, and determine the bone type corresponding to the bone data based on the attribute parameters of the bone data in the target associated data; Based on the size adjustment parameters and the reference coordinate system corresponding to the bone type, the bone data is subjected to size adjustment processing; Based on the size adjustment parameters and the root bone coordinate system corresponding to the bone data, the skin data in the target associated data is subjected to size adjustment processing; Based on the target pose parameters corresponding to the skinning data and the size adjustment parameters, the animation data in the target association data is subjected to size adjustment processing to obtain the processed target association data; wherein, the attribute parameters are used to indicate the size adjustment method corresponding to the target association data; The animation data corresponds to the initial pose parameters; The step of adjusting the size of the animation data in the target-related data based on the target pose parameters corresponding to the skinning data and the size adjustment parameters includes: Based on the target pose parameters corresponding to the skinning data, the animation data in the target-related data is subjected to pose transformation processing to obtain processed animation data; the processed animation data corresponds to the target pose parameters. Based on the size adjustment parameters, the processed animation data is subjected to size adjustment processing to obtain size-adjusted animation data; Based on the initial pose parameters corresponding to the animation data and the size-adjusted animation data, updated animation data is generated; the updated animation data corresponds to the initial pose parameters and matches the size adjustment parameters.
2. The method according to claim 1, characterized in that, The step of determining at least one set of associated data from the model data includes: Based on the model data, at least one data set is established; the data set includes multiple skeleton data that have an association relationship in the model data; the association relationship is used to indicate the connection relationship between the model skeletons represented by the multiple skeleton data; For each of the at least one data set, skinning data and animation data in the model data that have a mapping relationship with the skeletal data in the data set are determined as data in the data set; The skeletal data, skinning data, and animation data in each of the at least one data set are identified as a set of associated data.
3. The method according to claim 1, characterized in that, A graphical user interface is provided through a terminal device; the graphical user interface includes a parameter input window and a selection control corresponding to each set of associated data in at least one set of associated data; The steps for obtaining the size adjustment parameters of the target associated data include: In response to an editing operation on the parameter input window, the size adjustment parameters are determined based on the editing content corresponding to the editing operation; In response to a trigger operation on a selection control corresponding to a first associated data in the at least one set of associated data, the first associated data is determined as the target associated data.
4. The method according to claim 1, characterized in that, A graphical user interface is provided through a terminal device; the graphical user interface displays a first virtual model corresponding to the associated data; After obtaining the size adjustment parameters of the target associated data, the method further includes: Generate a copy of the target associated data; The copied data is resized based on the size adjustment parameters to obtain the processed copied data. Based on the processed copy data, a second virtual model is displayed; the second virtual model is matched with the size adjustment parameters.
5. A device for processing model data, characterized in that, include: The model data acquisition module is used to acquire model data, which includes skeletal data, skinning data, and animation data. The associated data determination module is used to determine at least one set of associated data from the model data; wherein, the associated data includes skeletal data, skinning data and animation data that have a mapping relationship with the skeletal data; The size adjustment module is used to: obtain size adjustment parameters of the target associated data, and determine the bone type corresponding to the bone data based on the attribute parameters of the bone data in the target associated data; Based on the size adjustment parameters and the reference coordinate system corresponding to the bone type, the bone data is subjected to size adjustment processing; Based on the size adjustment parameters and the root bone coordinate system corresponding to the bone data, the skin data in the target associated data is subjected to size adjustment processing; Based on the target pose parameters corresponding to the skinning data and the size adjustment parameters, the animation data in the target association data is subjected to size adjustment processing to obtain the processed target association data; wherein, the attribute parameters are used to indicate the size adjustment method corresponding to the target association data; The animation data corresponds to the initial pose parameters; the size adjustment module is also used for: Based on the target pose parameters corresponding to the skinning data, the animation data in the target-related data is subjected to pose transformation processing to obtain processed animation data; the processed animation data corresponds to the target pose parameters. Based on the size adjustment parameters, the processed animation data is subjected to size adjustment processing to obtain size-adjusted animation data; Based on the initial pose parameters corresponding to the animation data and the size-adjusted animation data, updated animation data is generated; the updated animation data corresponds to the initial pose parameters and matches the size adjustment parameters.
6. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the model data processing method according to any one of claims 1-4.
7. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the model data processing method according to any one of claims 1-4.
