FbxGeometryConverter Class Reference
#include <fbxgeometryconverter.h>
This class provides the functionality to convert geometry nodes attributes (FbxMesh, FbxNurbs and FbxPatch) and mainly focuses on the two major categories: Triangulation and conversion between NURBS and Patches surfaces.
Definition at line 41 of file fbxgeometryconverter.h.
bool Triangulate |
( |
FbxScene * |
pScene, |
|
|
bool |
pReplace, |
|
|
bool |
pLegacy = false |
|
) |
| |
Triangulate all node attributes in the scene that can be triangulated.
- Parameters
-
pScene | The scene to iterate through to triangulate meshes. |
pReplace | If true , replace the original meshes with the new triangulated meshes on all the nodes, and delete the original meshes. Otherwise, original meshes are left untouched. |
pLegacy | If true , use legacy triangulation method that does not support holes in geometry. Provided for backward compatibility. |
- Returns
true
if all node attributes that can be triangulated were triangulated successfully.
Triangulate a node attribute, if supported, and preserve the skins and shapes animation channels.
- Parameters
-
pNodeAttribute | Pointer to the node containing the geometry to triangulate. |
pReplace | If true , replace the original geometry with the new triangulated geometry on the nodes, and delete the original geometry. Otherwise, the original geometry is left untouched, the new one is added to the nodes, and becomes the default one. |
pLegacy | If true , use legacy triangulation method that does not support holes in geometry. Provided for backward compatibility. |
- Returns
- The newly created node attribute if successful, otherwise NULL. If node attribute type is not supported by triangulation, it returns the original node attribute.
Compute a "vertex-correspondence" table that helps passing from source to destination geometry.
- Parameters
-
pSrcGeom | Pointer to the source geometry. |
pDstGeom | Pointer to the destination geometry. |
pSrcToDstWeightedMapping | Pointer to the weighted mapping table. |
pSwapUV | Set to true to swap UVs. |
- Returns
true
on success, false
if the function fails to compute the correspondence.
Convert from patch to nurb.
- Parameters
-
pPatch | Pointer to the patch to convert. |
- Returns
- Created nurb or
NULL
if the conversion fails.
bool ConvertPatchToNurbsInPlace |
( |
FbxNode * |
pNode | ) |
|
Convert a patch contained in a node to a nurb.
Use this function to preserve the patch's skins and shapes animation channels.
- Parameters
-
pNode | Pointer to the node containing the patch. |
- Returns
true
on success, false
if the node attribute is not a patch.
Convert a patch to nurb surface.
- Parameters
-
pPatch | Pointer to the patch to convert. |
- Returns
- Created nurb surface or
NULL
if conversion fails.
bool ConvertPatchToNurbsSurfaceInPlace |
( |
FbxNode * |
pNode | ) |
|
Convert a patch contained in a node to a nurb surface.
Use this function to preserve the patch's skins and shapes animation channels.
- Parameters
-
pNode | Pointer to the node containing the patch. |
- Returns
true
on success, false
if the node attribute is not a patch.
Convert a FbxNurbsSurface to a FbxNurbs.
- Parameters
-
pNurbs | Pointer to the original nurbs surface |
- Returns
- A FbxNurbs that is equivalent to the original nurbs surface.
bool ConvertNurbsToNurbsSurfaceInPlace |
( |
FbxNode * |
pNode | ) |
|
Convert a nurb, contained in a node, to a nurbs surface.
Use this function to preserve the nurb's skins and shapes animation channels.
- Parameters
-
pNode | Pointer to the node containing the nurb. |
- Returns
true
on success, false
otherwise
bool ConvertNurbsSurfaceToNurbsInPlace |
( |
FbxNode * |
pNode | ) |
|
Convert a nurb contained in a node to a nurbs surface.
Use this function to preserve the nurb's skins and shapes animation channels.
- Parameters
-
pNode | Pointer to the node containing the nurbs surface. |
- Returns
true
on success, false
otherwise
Flip UV and/or skin clusters of a nurb.
- Parameters
-
pNurbs | Pointer to the Source nurb. |
pSwapUV | Set to true to swap the UVs. |
pSwapClusters | Set to true to swap the control point indices of clusters. |
- Returns
- A flipped FbxNurbs, or
NULL
if the function fails.
Flip UV and/or skin clusters of a nurb surface.
- Parameters
-
pNurbs | Pointer to the Source nurb surface. |
pSwapUV | Set to true to swap the UVs. |
pSwapClusters | Set to true to swap the control point indices of clusters. |
- Returns
- A flipped FbxNurbsSurface, or
NULL
if the function fails.
bool EmulateNormalsByPolygonVertex |
( |
FbxMesh * |
pMesh | ) |
|
Emulate normals by polygon vertex mode for a mesh.
- Parameters
-
pMesh | Pointer to the mesh object. |
- Returns
true
on success, false
if the number of normals in the mesh and in its associated shapes don't match the number of polygon vertices.
bool ComputeEdgeSmoothingFromNormals |
( |
FbxMesh * |
pMesh | ) |
const |
Create edge smoothing information from polygon-vertex mapped normals.
Existing smoothing information is removed and edge data is created if none exists on the mesh.
- Parameters
-
pMesh | The mesh used to generate edge smoothing. |
- Returns
true
on success, false
otherwise.
bool ComputePolygonSmoothingFromEdgeSmoothing |
( |
FbxMesh * |
pMesh, |
|
|
int |
pIndex = 0 |
|
) |
| const |
Convert edge smoothing to polygon smoothing group.
Existing smoothing information is replaced.
- Parameters
-
pMesh | The mesh that contains the smoothing to be converted. |
pIndex | The index of the layer smoothing to be converted. |
- Returns
true
on success, false
otherwise.
bool ComputeEdgeSmoothingFromPolygonSmoothing |
( |
FbxMesh * |
pMesh, |
|
|
int |
pIndex = 0 |
|
) |
| const |
Convert polygon smoothing group to edge smoothing.
Existing smoothing information is replaced.
- Parameters
-
pMesh | The mesh that contains the smoothing to be converted. |
pIndex | The index of the layer smoothing to be converted |
- Returns
true
on success, false
otherwise.
bool SplitMeshesPerMaterial |
( |
FbxScene * |
pScene, |
|
|
bool |
pReplace |
|
) |
| |
Split all the mesh in the scene per material.
- Parameters
-
pScene | The scene to iterate through to split meshes. |
pReplace | If true , replace the original mesh with new ones and delete the original meshes, but only if they got split into multiple meshes, otherwise they are left untouched. |
- Returns
true
if all splitable mesh were successfully split, false
otherwise.
bool SplitMeshPerMaterial |
( |
FbxMesh * |
pMesh, |
|
|
bool |
pReplace |
|
) |
| |
Split mesh per material.
- Parameters
-
pMesh | The mesh that will be split if it has multiple materials assigned. |
pReplace | If true , replace the original mesh with new one and delete the original mesh, but only if they got split into multiple meshes, otherwise left untouched. |
- Returns
true
on success, false
otherwise.
Re-parent nodes at root node level under a new node to re-center them at world center.
Basically, this function calculates the scene bounding box in world coordinates, and test if the center of that bounding box distance from the world center is larger or equal than the threshold. If true, a new node with the proper negative offset position will become the new parent of all nodes at root node level.
- Parameters
-
pScene | The scene to process. |
pThreshold | Threshold at which all nodes will be re-centered. |
- Returns
true
if any nodes were re-centered, otherwise false
.
Merge multiple meshes to one mesh.
The method will merge: a) mesh vertex; b) mesh polygon; c) mesh edge; d) all mesh elements; only the layer 0 elements is merged. e) if there are skins for old mesh, merge these skins. The new skin clusters link to old skeletons.
- Parameters
-
pMeshNodes | FBX nodes that hold multiple meshes. These meshes will be merged. |
pNodeName | Name of new mesh node. |
pScene | The scene that will contain the new mesh node. |
- Returns
- The new mesh node if merge successfully, otherwise NULL is returned.
Cleanup or remove degenerated meshes.
- Parameters
-
pScene | The scene to process. |
pAffectedNodes | The list of nodes that have been affected by this operation. |
The documentation for this class was generated from the following file: