Camera data export method, device, equipment and storage medium
By copying, processing attributes, and baking keyframes on camera data, we solved the motion error problems caused by the diversity of camera binding systems and inconsistencies in coordinate systems, and achieved correct import and efficient motion data transfer across software.
Patent Information
- Application Number
- CN202211139653.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-09-19
AI Technical Summary
Due to the diversity of camera binding systems and the inconsistency of DCC software coordinate systems, camera motion data is prone to motion errors when imported into other software, resulting in low efficiency.
By copying the first camera data, the second camera data that inherits the static parameters is generated, and its parent-child relationship, child nodes and locked attributes are deleted and modified. The attribute connection table is generated, attribute connection and parent-child constraints are performed, and finally the keyframes are baked and exported to the target software.
The camera motion data can be correctly imported between different DCC software, avoiding motion errors and improving export efficiency.
Smart Images

Figure CN115904225B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of animation production technology, and in particular to a camera data exporting method, device, equipment and storage medium. Background Art
[0002] In film, television, and game production, a large number of shot layouts and animations are created in Maya. After the animation is completed, the camera motion data needs to be exported to other DCC software for subsequent processing. For complex camera rigs, these camera motion data files are prone to import errors in other DCC software.
[0003] Therefore, a unified method that is independent of the camera binding method is needed to handle the camera data export method, so that each studio, each process, and each software can easily and correctly use the lens and camera movement data set by the upstream process.
[0004] Since Fbx and ABC are currently the mainstream intermediate formats used by various software and are supported by all DCC software, there are currently two main methods for camera export. One method is to bake all the motion information of all parent-child transforms contained in the camera for each frame during the shot time using keyframes, and then use Fbx or ABC file formats as data carriers to save the camera motion data. However, due to the diversity of camera binding systems and the inconsistency of DCC software coordinate systems, camera motion files exported using this method often exhibit motion errors when imported into other DCC software, resulting in high data distortion errors and low efficiency. Summary of the Invention
[0005] The main purpose of the present invention is to solve the existing technical problem that due to the diversity of camera binding systems and the inconsistency of the coordinate system of DCC software, the exported camera motion files often have motion errors when imported into other DCC software.
[0006] A first aspect of the present invention provides a camera data export method, the method comprising:
[0007] Copying the first camera data as a target object in the first digital content generation software to obtain second camera data, wherein the second camera data inherits the static parameters of the first camera data;
[0008] Performing corresponding deletion and modification processing on the parent-child relationship, child nodes and / or locked attributes of the second camera data;
[0009] Obtaining transformation attributes of the first camera data and source object attributes of a source object in the first digital content generation software, and generating an attribute connection table based on dynamic attributes of the first camera data other than the transformation attributes and the source object attributes;
[0010] Performing attribute connection on the second camera data after the deletion and modification process and the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except the transformation attributes;
[0011] Performing parent-child constraints on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attribute of the first camera data;
[0012] The dynamic attributes and static attributes of the second camera data after the parent-child constraint are keyframe baked according to a preset output time domain, and exported to the second digital content generation software according to a preset file format.
[0013] Optionally, in a first implementation of the first aspect of the present invention, the performing corresponding deletion and modification processing on the parent-child relationship, child nodes, and locked attributes of the second camera data includes:
[0014] Release the parent-child relationship in the second camera data, expose the second camera data under the world root node of the first digital content generation software, and / or delete the child nodes in the second camera data, retain the single-layer nodes of the second camera data, and / or determine the locked attributes in the second camera data and unlock the locked attributes.
[0015] Optionally, in a second implementation of the first aspect of the present invention, generating an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes includes:
[0016] determining a connected attribute from the dynamic attributes of the first camera data excluding the transformation attribute;
[0017] Determining a source object attribute in the source object that is connected to the connected attribute;
[0018] Taking the source object attributes and the corresponding connected attributes as a set of arrays, a plurality of arrays are obtained;
[0019] Each group of arrays is regarded as a sub-element data, and the attribute connection table is generated according to the sub-element data.
[0020] Optionally, in a third implementation of the first aspect of the present invention, performing attribute connection on the deleted and modified second camera data with the source object based on the attribute connection table includes:
[0021] Performing field replacement on all sub-element data in the attribute connection table, replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field;
[0022] The connected attribute in the attribute connection table after the field replacement is connected with the source object attribute of the source object.
[0023] Optionally, in a fourth implementation of the first aspect of the present invention, after performing field replacement on all sub-element data in the attribute connection table and replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field, the method further includes:
[0024] A connected attribute array is generated based on all connected attributes replaced with the second camera data field.
[0025] Optionally, in a fifth implementation of the first aspect of the present invention, before key-frame baking the dynamic and static properties of the second camera data after the parent-child constraint according to a preset output time domain and exporting the key-frames to the second digital content generation software in a preset file format, the method further includes:
[0026] traversing the connected attribute array and the transformed attribute of each frame in the output time domain of the second camera data based on a preset subframe sampling rate to generate a numerical information dictionary of the attribute of the second camera data in the output time domain;
[0027] generating an animation curve in the output time domain based on the numerical information attribute table, and connecting the animation curve with the second camera data;
[0028] Euler filtering is performed on the animation curve connected to the second camera data.
[0029] Optionally, in a sixth implementation of the first aspect of the present invention, generating the animation curve in the output time domain based on the numerical information attribute table and connecting the animation curve with the second camera data includes:
[0030] generating a plurality of curve points according to the time data values in the time data array and the object attribute values in the object attribute value array in the numerical information attribute table, wherein the time data is a subframe calculated based on the subframe sampling rate and each frame in the output time domain, and the object attribute is the value of the connected attribute and the value of the changed attribute of the second camera data in the subframe;
[0031] Connect the curve points to obtain the animation curve in the output time domain;
[0032] Connecting the animation curve to the second camera data.
[0033] A second aspect of the present invention provides a camera data exporting device, comprising: a copying module, configured to copy first camera data as a target object in first digital content generation software to obtain second camera data, wherein the second camera data inherits static parameters of the first camera data;
[0034] a deletion and modification module, configured to perform corresponding deletion and modification processing on the parent-child relationship, child nodes and / or locked attributes of the second camera data;
[0035] an attribute table generating module, configured to obtain the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generating software, and generate an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes;
[0036] an attribute connection module, configured to perform attribute connection on the second camera data after deletion and modification with the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except the transformation attributes;
[0037] a constraint module, configured to perform parent-child constraints on the second camera data after the attributes are connected through the first camera data, so that the second camera data obtains the transformation attributes of the first camera data;
[0038] The export module is used to bake the dynamic and static properties of the second camera data after the parent-child constraints into key frames according to a preset output time domain, and export them to the second digital content generation software in a preset file format.
[0039] Optionally, in a first implementation of the second aspect of the present invention, the deletion and modification module is specifically configured to:
[0040] Release the parent-child relationship in the second camera data, expose the second camera data under the world root node of the first digital content generation software, and / or delete the child nodes in the second camera data, retain the single-layer nodes of the second camera data, and / or determine the locked attributes in the second camera data and unlock the locked attributes.
[0041] Optionally, in a second implementation of the second aspect of the present invention, the attribute table generating module is specifically configured to:
[0042] determining a connected attribute from the dynamic attributes of the first camera data excluding the transformation attribute;
[0043] Determining a source object attribute in the source object that is connected to the connected attribute;
[0044] Taking the source object attributes and the corresponding connected attributes as a set of arrays, a plurality of arrays are obtained;
[0045] Each group of arrays is regarded as a sub-element data, and the attribute connection table is generated according to the sub-element data.
[0046] Optionally, in a third implementation of the second aspect of the present invention, the attribute connection module is specifically configured to:
[0047] Performing field replacement on all sub-element data in the attribute connection table, replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field;
[0048] The connected attribute in the attribute connection table after the field replacement is connected with the source object attribute of the source object.
[0049] Optionally, in a fourth implementation of the second aspect of the present invention, the camera data exporting apparatus further includes an array generation module, wherein the array generation module is specifically configured to:
[0050] A connected attribute array is generated based on all connected attributes replaced with the second camera data field.
[0051] Optionally, in a fifth implementation of the second aspect of the present invention, the camera data exporting device further includes a curve filtering module, and the curve filtering module specifically includes:
[0052] a dictionary generating unit, configured to traverse the connected attribute array and the transformed attributes of each frame in the output time domain of the second camera data based on a preset subframe sampling rate to generate a numerical information dictionary of the attributes of the second camera data in the output time domain;
[0053] a curve generating unit, configured to generate an animation curve in the output time domain based on the numerical information attribute table, and connect the animation curve with the second camera data;
[0054] A filtering unit is used to perform Euler filtering on the animation curve connected to the second camera data.
[0055] Optionally, in a sixth implementation of the second aspect of the present invention, the curve generating unit is specifically configured to:
[0056] generating a plurality of curve points according to the time data values in the time data array and the object attribute values in the object attribute value array in the numerical information attribute table, wherein the time data is a subframe calculated based on the subframe sampling rate and each frame in the output time domain, and the object attribute is the value of the connected attribute and the value of the changed attribute of the second camera data in the subframe;
[0057] Connect the curve points to obtain the animation curve in the output time domain;
[0058] Connecting the animation curve to the second camera data.
[0059] A third aspect of the present invention provides a camera data export device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the instructions in the memory so that the camera data export device executes the steps of the above-mentioned camera data export method.
[0060] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned camera data exporting method.
[0061] The above-mentioned camera data export method, device, equipment and storage medium obtain second camera data by copying the first camera data as the target object in the first digital content generation software, wherein the second camera data inherits the static parameters of the first camera data; performs corresponding deletion and modification processing on the parent-child relationship, child node and lock attribute of the second camera data; obtains the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generation software, and generates an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes; based on the attribute connection table, the second camera data after the deletion and modification is attribute-connected with the source object, so that the second camera data inherits the dynamic attributes of the first camera data other than the transformation attributes; performs parent-child constraints on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attributes of the first camera data; the dynamic attributes and static attributes of the second camera data after the parent-child constraints are keyframe baked according to a preset output time domain, and are exported to the second digital content generation software according to a preset file format. In this method, by copying the camera whose motion data needs to be exported, all the additional custom settings of the original camera are obtained, and the changing properties are baked out by baking keyframes per frame. The motion information of the original camera can be mapped to the camera in world coordinates, and a camera motion information file that is universal for all DCC software can be obtained.
[0062] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A schematic diagram of an embodiment of a method for exporting camera data according to an embodiment of the present invention;
[0065] Figure 2 A schematic diagram of an embodiment of a device for exporting camera data according to an embodiment of the present invention;
[0066] Figure 3 2 is a schematic diagram of another embodiment of a device for exporting camera data according to an embodiment of the present invention;
[0067] Figure 4 Schematic diagram of an embodiment of a camera data export device in an embodiment of the present invention. DETAILED DESCRIPTION
[0068] An embodiment of the present invention provides a camera data export method, apparatus, device and storage medium, which obtains second camera data by copying first camera data as a target object in first digital content generation software, wherein the second camera data inherits the static parameters of the first camera data; performs corresponding deletion and modification processing on the parent-child relationship, child nodes and locked attributes of the second camera data; obtains the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generation software, and generates an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes; based on the attribute connection table, attributes of the second camera data after the deletion and modification processing are connected with the source object, so that the second camera data inherits the dynamic attributes of the first camera data other than the transformation attributes; parent-child constraints are performed on the second camera data after the attributes are connected through the first camera data, so that the second camera data obtains the transformation attributes of the first camera data; keyframes are baked on the dynamic attributes and static attributes of the second camera data after the parent-child constraints according to a preset output time domain, and the data are exported to the second digital content generation software according to a preset file format. In this method, by copying the camera whose motion data needs to be exported, all the additional custom settings of the original camera are obtained, and the changing properties are baked out by baking keyframes per frame. The motion information of the original camera can be mapped to the camera in world coordinates, and a camera motion information file that is universal for all DCC software can be obtained.
[0069] The terms "first," "second," "third," "fourth," and the like (if any) in the description and claims of the present invention and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0070] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 The first embodiment of the camera data export method in the embodiment of the present invention includes:
[0071] 101. Copy the first camera data serving as the target object in the first digital content generation software to obtain second camera data, wherein the second camera data inherits the static parameters of the first camera data;
[0072] It is understandable that the execution subject of the present invention may be a camera data exporting device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0073] In actual applications, digital content generation software is DCC (Digital Content Creation) software, including software tools such as Maya, Houdini, Nuke, and Unreal Engine. In this embodiment, the first digital content generation software can be any one of the above software, and the present invention is not limited to this. In this embodiment, the first digital content generation software is mainly taken as Maya as an example, and the camera in Maya needs to be exported to the digital content generation software of the next animation production link.
[0074] In actual applications, the first digital content generation software contains a source object and a target object. In the first digital content generation software, only when the source object changes its motion state will the target object move or be inhibited accordingly. When the target object's motion state changes, neither object is affected; both objects continue to maintain the source object's motion state. In this embodiment, the first camera data captured by the first digital content generation software following the source object is used as the target object, and changes with the source object's motion state. This first camera data is denoted as CamA.
[0075] In this embodiment, the copied second camera data inherits the static parameters of the first camera data, and the copied second camera data is recorded as CamB. Dynamic parameters can also be copied through copying, but if dynamic parameters are copied, it means that there may be dependencies on upstream node strings. The dependency of upstream nodes is similar to that some dynamic parameters of the camera need to depend on data of other nodes. A specific example is that if the camera is set to follow a person, then the camera position's dependency on the upstream node is the position of the person being followed. For the sake of file simplicity, there is no need to copy dynamic parameters here. Instead, the method of baking dynamic parameter keyframes is used later to disconnect the dependencies of additional upstream node strings.
[0076] Static parameters refer to data without keyframes. The same parameter can be either static or dynamic, depending on the production designer's settings. Similar to a camera's translation, a static parameter means the camera remains stationary within the timeframe of the shot. A dynamic parameter means the camera changes over time within the timeframe of the shot.
[0077] 102. Perform corresponding deletion and modification processing on the parent-child relationship, child nodes, and / or locked attributes of the second camera data;
[0078] In this embodiment, the parent-child relationship, child nodes and locking attributes of the second camera data can be deleted or modified accordingly as needed, or any one or any two of the parent-child relationship, child nodes and locking attributes can be deleted or modified, and this invention does not limit this.
[0079] In this embodiment, the corresponding deletion and modification processing of the parent-child relationship, child nodes and / or locked attributes of the second camera data includes: releasing the parent-child relationship in the second camera data, exposing the second camera data under the world root node of the first digital content generation software, and / or deleting the child nodes in the second camera data, retaining the single-layer nodes of the second camera data, and / or determining the locked attributes in the second camera data and unlocking the locked attributes.
[0080] Specifically, the parent-child relationship of the second camera data is released mainly because in the downstream links and software production process, only the motion information of the single-layer node of the camera is needed. There is no need to modify the camera motion. The software used in the subsequent links only needs to restore the camera motion. Therefore, there is no need to retain the camera binding. The camera DAG level, which is very prone to errors, can be collapsed. DAG actually refers to the DAG hierarchy (also known as the object hierarchy), which refers to the parent-child relationship of all nodes that constitute an object. DAG stands for directed acyclic graph, which is similar to a node tree of the parent level of a node.
[0081] Specifically, the child nodes of the second camera data are deleted because when Maya copies the node, it will copy all the nodes below the node. However, the final output actually only requires a single-layer camera node, so the redundant nodes can be deleted to obtain a clean single-layer camera node.
[0082] Specifically, the locked attributes are determined according to the requirements of camera binding. When making binding, some cameras will deliberately lock certain attributes, such as Translate, Rotate, FocalLength, etc., in order to ensure that the bound camera can only be controlled by certain settings and not be controlled by unnecessary things due to production errors. However, for the final output single-layer camera node, since camera binding is not required, the originally locked attributes need to be unlocked to ensure that all parameters of the output camera can be set and connected to the keyframe data.
[0083] 103. Obtain transformation attributes of the first camera data and source object attributes of the source object in the first digital content generation software, and generate an attribute connection table based on dynamic attributes of the first camera data except the transformation attributes and the source object attributes;
[0084] In this embodiment, generating an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes includes: determining the connected attributes from the dynamic attributes of the first camera data other than the transformation attributes; determining the source object attributes in the source object that are connected to the connected attributes; treating the source object attributes and the corresponding connected attributes as a group of arrays to obtain multiple groups of arrays; treating each group of arrays as a sub-element data, and generating the attribute connection table based on the sub-element data.
[0085] Specifically, the transformation attributes in DCC software mainly include three types of transformation data: Translate, Rotate, and Scale. The source object attributes of the source object and the linked object, that is, the target object attributes of the first camera data, are used together to generate the attribute connection table ConnectList, where the attribute connection table ConnectList is an array data type. Each sub-element data in the array is a sub-array, and the two elements inside the sub-array are the name data of the source attribute and the target attribute, similar to [[source object attribute 1, target object attribute 1], [source object attribute 2, target object attribute 2], ...], representing a connection from the source object attribute 1 to the target object attribute 1. For example, ConnectList is [[Source1.output, CamA.focalLength], [Source2.output, CamA.focusDistance], ...], where [Source1.output, CamA.focalLength] represents the connection from the attribute Source1.output to the attribute CamA.focalLength.
[0086] 104. Perform attribute connection on the deleted and modified second camera data and the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except for the transformation attributes;
[0087] In this embodiment, the attribute connection of the second camera data after deletion and modification with the source object based on the attribute connection table includes: replacing the fields of all sub-element data in the attribute connection table, replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field; and connecting the connected attribute in the attribute connection table after the field replacement with the source object attribute of the source object.
[0088] Specifically, to connect the source object to the second camera data, you first need to replace the fields related to the first camera data in the attribute connection table with the second camera data. For example, if ConnectList is [[Source1.output, CamA.focalLength], [Source2.output, CamA.focusDistance], ...], then replace the first camera data field CamA with the second camera data field CamB, resulting in a new ConnectList of [[Source1.output, CamB.focalLength], [Source2.output, CamB.focusDistance], ...], and then perform attribute connections based on the updated attribute connection table. For example, if the first data in ConnectList is [Source1.output, CamB.focalLength], then the Source1.output attribute will be linked to CamB.focalLength. The second data is [Source2.output, CamB.focusDistance], then the Source2.output attribute will be linked to CamB.focalDistance. And so on, processing the entire ConnectList data.
[0089] Furthermore, after performing field replacement on all sub-element data in the attribute connection table and replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field, the method further includes: generating a connected attribute array based on all connected attributes replaced with the second camera data field.
[0090] Specifically, the attributes for field replacement are all connected attributes, that is, the second data of each element group in ConnectList. These attributes are combined to form a new array to obtain BakeAttrList. BakeAttrList is an array data type, and each element of the array is a connected attribute of CamB.
[0091] 105. Perform parent-child constraints on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attribute of the first camera data;
[0092] In this embodiment, the first camera data is used to impose a parent-child constraint on the second camera data without position deviation, so that the first camera data constrains the position and rotation of the second camera data. The second camera data behaves like a child object of the first camera data and completely inherits the Translate and Rotate information of the first camera data. The main difference between a parent-child relationship and a parent-child constraint is that the child object in the parent-child relationship can still move freely.
[0093] In the parent-child constraint, the child object cannot be moved. Even if it moves, if the parent object is moved again, it will return to the position when it was constrained, unless the offset value of the child object is adjusted separately. The parent-child relationship affects the displacement, rotation, and scaling of the child object, and the parent-child constraint only affects the displacement and rotation of the child object. Because it is a single-layer camera node, scaling has no effect on the final motion and visual effects of CamB, so it is not processed, so the parent-child constraint can be used.
[0094] In this embodiment, before keyframe baking of the dynamic attributes and static attributes of the second camera data after the parent-child constraint is performed according to a preset output time domain and exporting to the second digital content generation software according to a preset file format, the method further includes: traversing the connected attribute array and transformation attributes of each frame in the output time domain of the second camera data based on a preset subframe sampling rate to generate a numerical information dictionary of the attributes of the second camera data in the output time domain; generating an animation curve in the output time domain based on the numerical information attribute table, and connecting the animation curve with the second camera data; and performing Euler filtering on the animation curve connected to the second camera data.
[0095] Specifically, the output time domain refers to the time range in which animation data needs to be output. The sub-frame sampling rate determines the sampling time interval between every two frames in the time of output animation data. For example, if the sub-frame sampling rate is 4, it means that sampling will be performed once every 1 / 4 = 0.25 frames between the two frames, and a total of sampling will be performed at these three time points: 0.25, 0.5, and 0.75.
[0096] Specifically, by traversing each frame in the output time domain and the required subf intermediate frames, accessing the attributes in BakeAttrList and the transformation attributes of CamB, and recording the attributes and the corresponding frame numbers, a numerical information dictionary ValDict of the object attributes within the time range is generated. The numerical information dictionary ValDict mainly contains the numerical information of the object attributes within the time range. Its specific structure is as follows:
[0097]
[0098] Specifically, the animation curve Time-Val is an animation curve with Time as the X-axis and Val as the Y-axis. It is equivalent to a function that can input time and obtain the Val value at the corresponding time.
[0099] Specifically, when baking key frames for a single-layer camera, the gimbal lock problem is prone to occur, which causes a cliff-like change in the value of the single-axis key frame, resulting in errors in the camera's movement in the middle frames. Gimbal lock is a phenomenon that refers to when the two connected rotation surfaces of the gyroscope are coplanar, rotating the outer ring cannot change the posture of the inner ring, and the degree of freedom is lost. In order to avoid the problem of a cliff-like change in the value of the single-axis key frame in a single-layer camera due to the gimbal lock problem, which causes errors in the camera's movement in the middle frames, the animation curves of rotateX, rotateY, and rotateZ in the animation curve connected to CamB are subjected to Euler filtering. Euler filtering is a function provided by Maya to filter and repair object rotation curves, which can repair the problem of cliff-like values caused by continuous rotation of more than 360 degrees on a single axis.
[0100] Furthermore, generating the animation curve in the output time domain based on the numerical information attribute table and connecting the animation curve with the second camera data includes: generating multiple curve points according to the time data values in the time data array and the object attribute values in the object attribute value array in the numerical information attribute table, wherein the time data is a subframe calculated based on the subframe sampling rate and each frame in the output time domain, and the object attribute is the value of the connected attribute and the value of the changing attribute of the second camera data in the subframe; connecting the curve points to obtain the animation curve in the output time domain; and connecting the animation curve with the second camera data.
[0101] Specifically, by querying the dictionary ValDict to obtain the time data array value of time and the data array of each object attribute value in objAttrValInfo, a new Time-Val animation curve is regenerated for each curve point in the one-to-one mode of the elements in the array, and finally the entire Time-Val animation curve AnimCurve is generated, and these AnimCurves are connected back to the attribute values in objAttrValInfo respectively.
[0102] 106. Keyframe baking is performed on the dynamic attributes and static attributes of the second camera data after the parent-child constraint according to a preset output time domain, and the keyframes are exported to the second digital content generation software according to a preset file format.
[0103] In this example, after keyframe baking, CamB inherits all static and dynamic properties of CamA and collapses the parent-child hierarchy, retaining only the single-layer camera node. Select CamB and, depending on the needs of subsequent workflows, choose to export an Fbx or ABC file. This will yield a camera animation data file that can be correctly imported into subsequent steps. In practice, Fbx files are 3D model, rig, and animation files saved in the Autodesk Filmbox format, and can be used for 3D data exchange between DCC software. Alembic files are a computer graphics interchange file format commonly used by visual effects and animation professionals. They can be used to extract complex animation scenes, yielding a set of non-procedural, application-independent baked geometry.
[0104] In this embodiment, second camera data is obtained by copying first camera data as a target object in first digital content generation software, wherein the second camera data inherits static parameters of the first camera data; corresponding deletion and modification processing is performed on the parent-child relationship, child nodes, and locked attributes of the second camera data; transformation attributes of the first camera data and source object attributes of the source object in the first digital content generation software are obtained, and an attribute connection table is generated based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes; attribute connection is performed on the second camera data after the deletion and modification processing and the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data other than the transformation attributes; parent-child constraints are performed on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attributes of the first camera data; the dynamic attributes and static attributes of the second camera data after the parent-child constraints are keyframe baked according to a preset output time domain, and exported to the second digital content generation software according to a preset file format. In this method, by copying the camera whose motion data needs to be exported, all the additional custom settings of the original camera are obtained, and the changing properties are baked out by baking keyframes per frame. The motion information of the original camera can be mapped to the camera in world coordinates, and a camera motion information file that is universal for all DCC software can be obtained.
[0105] The above describes the camera data export method in the embodiment of the present invention. The following describes the camera data export device in the embodiment of the present invention. Figure 2 In one embodiment of the present invention, a device for exporting camera data includes:
[0106] A copy module 201 is configured to copy the first camera data as a target object in the first digital content generation software to obtain second camera data, wherein the second camera data inherits the static parameters of the first camera data;
[0107] A deletion and modification module 202 is configured to perform corresponding deletion and modification processing on the parent-child relationship, child nodes and / or locked attributes of the second camera data;
[0108] an attribute table generating module 203 for acquiring the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generating software, and generating an attribute connection table based on the dynamic attributes of the first camera data except the transformation attributes and the source object attributes;
[0109] an attribute connection module 204 for performing attribute connection on the second camera data after deletion and modification and the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except the transformation attributes;
[0110] A constraint module 205 is configured to perform a parent-child constraint on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attribute of the first camera data;
[0111] The export module 206 is used to perform keyframe baking on the dynamic attributes and static attributes of the second camera data after the parent-child constraint according to a preset output time domain, and export them to the second digital content generation software according to a preset file format.
[0112] In an embodiment of the present invention, the camera data exporting device runs the above-mentioned camera data exporting method. The camera data exporting device obtains second camera data by copying the first camera data as a target object in the first digital content generation software, wherein the second camera data inherits the static parameters of the first camera data; performs corresponding deletion and modification processing on the parent-child relationship, child nodes, and locked attributes of the second camera data; obtains the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generation software, and generates an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes; based on the attribute connection table, attributes are connected between the second camera data after the deletion and modification processing and the source object, so that the second camera data inherits the dynamic attributes of the first camera data other than the transformation attributes; parent-child constraints are performed on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attributes of the first camera data; dynamic attributes and static attributes of the second camera data after the parent-child constraints are keyframe baked according to a preset output time domain, and exported to the second digital content generation software according to a preset file format. In this method, by copying the camera whose motion data needs to be exported, all the additional custom settings of the original camera are obtained, and the changing properties are baked out by baking keyframes per frame. The motion information of the original camera can be mapped to the camera in world coordinates, and a camera motion information file that is universal for all DCC software can be obtained.
[0113] See also Figure 4 The second embodiment of the camera data exporting device in the embodiment of the present invention includes:
[0114] A copy module 201 is configured to copy the first camera data as a target object in the first digital content generation software to obtain second camera data, wherein the second camera data inherits the static parameters of the first camera data;
[0115] A deletion and modification module 202 is configured to perform corresponding deletion and modification processing on the parent-child relationship, child nodes and / or locked attributes of the second camera data;
[0116] an attribute table generating module 203 for acquiring the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generating software, and generating an attribute connection table based on the dynamic attributes of the first camera data except the transformation attributes and the source object attributes;
[0117] an attribute connection module 204 for performing attribute connection on the second camera data after deletion and modification and the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except the transformation attributes;
[0118] A constraint module 205 is configured to perform a parent-child constraint on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attribute of the first camera data;
[0119] The export module 206 is used to perform keyframe baking on the dynamic attributes and static attributes of the second camera data after the parent-child constraint according to a preset output time domain, and export them to the second digital content generation software according to a preset file format.
[0120] In this embodiment, the deletion and modification module 202 is specifically configured to:
[0121] Release the parent-child relationship in the second camera data, expose the second camera data under the world root node of the first digital content generation software, and / or delete the child nodes in the second camera data, retain the single-layer nodes of the second camera data, and / or determine the locked attributes in the second camera data and unlock the locked attributes.
[0122] In this embodiment, the attribute table generating module 203 is specifically used to:
[0123] determining a connected attribute from the dynamic attributes of the first camera data excluding the transformation attribute;
[0124] Determining a source object attribute in the source object that is connected to the connected attribute;
[0125] Taking the source object attributes and the corresponding connected attributes as a set of arrays, a plurality of arrays are obtained;
[0126] Each group of arrays is regarded as a sub-element data, and the attribute connection table is generated according to the sub-element data.
[0127] In this embodiment, the attribute connection module 204 is specifically used to:
[0128] Performing field replacement on all sub-element data in the attribute connection table, replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field;
[0129] The connected attribute in the attribute connection table after the field replacement is connected with the source object attribute of the source object.
[0130] In this embodiment, the camera data exporting device further includes an array generation module 207, and the array generation module 207 is specifically configured to:
[0131] A connected attribute array is generated based on all connected attributes replaced with the second camera data field.
[0132] In this embodiment, the camera data exporting device further includes a curve filtering module 208, and the curve filtering module 208 specifically includes:
[0133] The dictionary generating unit 2081 is configured to traverse the connected attribute array and the transformed attributes of each frame in the output time domain of the second camera data based on a preset subframe sampling rate to generate a numerical information dictionary of the attributes of the second camera data in the output time domain;
[0134] A curve generating unit 2082, configured to generate an animation curve in the output time domain based on the numerical information attribute table, and connect the animation curve with the second camera data;
[0135] The filtering unit 2083 is configured to perform Euler filtering on the animation curve connected to the second camera data.
[0136] In this embodiment, the curve generating unit 2082 is specifically configured to:
[0137] generating a plurality of curve points according to the time data values in the time data array and the object attribute values in the object attribute value array in the numerical information attribute table, wherein the time data is a subframe calculated based on the subframe sampling rate and each frame in the output time domain, and the object attribute is the value of the connected attribute and the value of the changed attribute of the second camera data in the subframe;
[0138] Connect the curve points to obtain the animation curve in the output time domain;
[0139] Connecting the animation curve to the second camera data.
[0140] This embodiment, based on the previous embodiment, describes in detail the specific functions of each module and the unit structure of some modules. By duplicating the camera for which motion data needs to be exported, obtaining all additional custom settings of the original camera, and baking out the changing attributes by baking keyframes per frame, the original camera's motion information can be mapped to the camera in world coordinates, resulting in a camera motion information file that is universal for all DCC software. Animation curves are then generated and Euler filtered to correct the problem of cliff-like values caused by continuous rotation of more than 360 degrees on a single axis.
[0141] above Figure 2 and Figure 3 The camera data exporting apparatus in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The camera data exporting device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0142] Figure 4 FIG2 is a schematic diagram of the structure of a camera data export device provided in an embodiment of the present invention. The camera data export device 400 may vary significantly due to different configurations or performance. The device may include one or more central processing units (CPUs) 410 (e.g., one or more processors), a memory 420, and one or more storage media 430 (e.g., one or more mass storage devices) storing applications 433 or data 432. The memory 420 and storage medium 430 may be either transient or persistent storage. The program stored in the storage medium 430 may include one or more modules (not shown), each of which may include a series of instruction operations within the camera data export device 400. Furthermore, the processor 410 may be configured to communicate with the storage medium 430, and the camera data export device 400 may execute the series of instruction operations stored in the storage medium 430 to implement the steps of the above-described camera data export method.
[0143] The camera data export device 400 may further include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input and output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be understood by those skilled in the art that Figure 4 The illustrated camera data exporting device structure does not constitute a limitation on the camera data exporting device provided by the present invention, and may include more or fewer components than illustrated, or combine certain components, or arrange the components differently.
[0144] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, which, when executed on a computer, cause the computer to execute the steps of the camera data export method.
[0145] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0146] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., various media that can store program code.
[0147] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A camera data export method, characterized in that: The method comprises: Copying the first camera data as a target object in the first digital content generation software to obtain second camera data, wherein the second camera data inherits the static parameters of the first camera data; Performing corresponding deletion and modification processing on the parent-child relationship, child nodes and / or locked attributes of the second camera data; Obtaining transformation attributes of the first camera data and source object attributes of a source object in the first digital content generation software, and generating an attribute connection table based on dynamic attributes of the first camera data other than the transformation attributes and the source object attributes; Performing attribute connection on the second camera data after the deletion and modification process and the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except the transformation attributes; Performing parent-child constraints on the second camera data after the attribute connection through the first camera data, so that the second camera data obtains the transformation attribute of the first camera data; The dynamic attributes and static attributes of the second camera data after the parent-child constraint are keyframe baked according to a preset output time domain, and exported to the second digital content generation software according to a preset file format.
2. The camera data export method according to claim 1, characterized in that: The corresponding deletion and modification processing of the parent-child relationship, child nodes and / or locked attributes of the second camera data includes: Release the parent-child relationship in the second camera data, expose the second camera data under the world root node of the first digital content generation software, and / or delete the child nodes in the second camera data, retain the single-layer nodes of the second camera data, and / or determine the locked attributes in the second camera data and unlock the locked attributes.
3. The camera data exporting method according to claim 1, wherein: Generating an attribute connection table based on the dynamic attributes other than the transformation attributes of the first camera data and the attributes of the source object includes: determining a connected attribute from the dynamic attributes of the first camera data excluding the transformation attribute; Determining a source object attribute in the source object that is connected to the connected attribute; Taking the source object attributes and the corresponding connected attributes as a set of arrays, a plurality of arrays are obtained; Each group of arrays is regarded as a sub-element data, and the attribute connection table is generated according to the sub-element data.
4. The camera data exporting method according to claim 3, wherein: The performing attribute connection between the second camera data after deletion and modification and the source object based on the attribute connection table includes: Performing field replacement on all sub-element data in the attribute connection table, replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field; The connected attribute in the attribute connection table after the field replacement is connected with the source object attribute of the source object.
5. The camera data exporting method according to claim 4, characterized in that: After replacing fields of all sub-element data in the attribute connection table and replacing the first camera data field of the connected attribute in the sub-element data with the second camera data field, the method further includes: A connected attribute array is generated based on all connected attributes replaced with the second camera data field.
6. The camera data exporting method according to claim 5, characterized in that: Before key-frame baking of the dynamic and static properties of the second camera data after the parent-child constraint according to a preset output time domain and exporting to the second digital content generation software according to a preset file format, the process further includes: traversing the connected attribute array and the transformed attribute of each frame in the output time domain of the second camera data based on a preset subframe sampling rate to generate a numerical information dictionary of the attribute of the second camera data in the output time domain; generating an animation curve in the output time domain based on the numerical information attribute table, and connecting the animation curve with the second camera data; Euler filtering is performed on the animation curve connected to the second camera data.
7. The camera data exporting method according to claim 6, characterized in that: Generating the animation curve in the output time domain based on the numerical information attribute table and connecting the animation curve with the second camera data includes: generating a plurality of curve points according to the time data values in the time data array and the object attribute values in the object attribute value array in the numerical information attribute table, wherein the time data is a subframe calculated based on the subframe sampling rate and each frame in the output time domain, and the object attribute is the value of the connected attribute and the value of the changed attribute of the second camera data in the subframe; Connect the curve points to obtain the animation curve in the output time domain; Connecting the animation curve to the second camera data.
8. A camera data export device, characterized in that: The camera data exporting device comprises: a copy module, configured to copy the first camera data as a target object in the first digital content generation software to obtain second camera data, wherein the second camera data inherits static parameters of the first camera data; a deletion and modification module, configured to perform corresponding deletion and modification processing on the parent-child relationship, child nodes and / or locked attributes of the second camera data; an attribute table generating module, configured to obtain the transformation attributes of the first camera data and the source object attributes of the source object in the first digital content generating software, and generate an attribute connection table based on the dynamic attributes of the first camera data other than the transformation attributes and the source object attributes; an attribute connection module, configured to perform attribute connection on the second camera data after deletion and modification with the source object based on the attribute connection table, so that the second camera data inherits the dynamic attributes of the first camera data except the transformation attributes; a constraint module, configured to perform parent-child constraints on the second camera data after the attributes are connected through the first camera data, so that the second camera data obtains the transformation attributes of the first camera data; The export module is used to bake the dynamic and static properties of the second camera data after the parent-child constraints into key frames according to a preset output time domain, and export them to the second digital content generation software in a preset file format.
9. A camera data export device, characterized in that: The camera data export device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instructions in the memory to enable the camera data exporting device to perform the steps of the camera data exporting method according to any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the steps of the camera data exporting method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Rendering engine, implementation method and producing tools for 3D web game
CN105354872A
Functional object-oriented networks for manipulation learning
US10789543B1