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 45 of file fbxgeometryconverter.h.
#include <fbxgeometryconverter.h>
Public Member Functions |
|
| FbxGeometryConverter (FbxManager *pManager) | |
| Constructor. |
|
| ~FbxGeometryConverter () | |
| Destructor. |
|
| void | ReplaceNodeAttribute (FbxNode *pNode, FbxNodeAttribute *pNewNodeAttr) |
| Replace node attribute with new one.
|
|
| bool | AddTriangulatedMeshGeometry (FbxNode *pNode, int pUVStepCoeff) |
| Add a "triangulated mesh" geometry to the
node. |
|
| bool | SplitMeshPerMaterial (FbxMesh *pMesh) |
| Split Mesh Per Material. |
|
| bool | SplitMeshesPerMaterial (FbxScene *pScene) |
| Split all the mesh in the scene. |
|
| bool | CreateAndCopyLayerElement (FbxMesh *pNewMesh, FbxMesh *pRefMesh) |
| Create LayerElement, and copy settings from
pRefMesh to pNewMesh. |
|
| bool | SetLayerElements (FbxMesh *pNewMesh, FbxMesh *pMesh, int pPolygonIndex, int pPolyPointIndex, int pLoopIndex, bool pIsSearched, bool pIsEndPolygon) |
| Set Normals, UVs and Vertex Color, when
building new mesh. |
|
| FbxMesh * | TriangulateMeshAdvance (FbxMesh const *pMesh, bool &pStatus) |
| Triangulate a mesh(support without holes or
with holes simple polygon) |
|
| FbxNode * | MergeMeshes (FbxArray< FbxNode * > &pMeshNodes, const char *pNodeName, FbxScene *pScene) |
| Merge multiple meshes to one mesh. |
|
Static Public Member Functions |
|
| static void | FbxTriangulation (int *Index, int pNumSide) |
| FbxTriangulation. |
|
Protected Member Functions |
|
| bool | ComputePatchToMeshControlPointsWeightedMapping (FbxPatch *pSrcPatch, FbxMesh *pDstMesh, FbxWeightedMapping *pMapping, bool pSwapUV=false) |
| bool | ComputeNurbsToMeshControlPointsWeightedMapping (FbxNurbsSurface *pSrcNurbs, FbxMesh *pDstMesh, FbxWeightedMapping *pMapping, bool pRescaleUVs=false, bool pSwapUV=false) |
| void | InitializeWeightInControlPoints (FbxGeometryBase *pGeometry) |
| void | InitializeWeightInNormals (FbxLayerContainer *pLayerContainer) |
| void | TriangulateContinuousSurface (FbxMesh *pMesh, FbxSurfaceEvaluator *pSurface, FbxUInt pPointCountX, FbxUInt pPointCountY, bool ClockWise=false) |
| void | CheckForZeroWeightInShape (FbxGeometry *pGeometry) |
| FbxMesh * | CreateMeshFromParametricSurface (FbxGeometry const *pGeometry) |
| FbxNurbs * | CreateNurbsFromPatch (FbxPatch *pPatch) |
| FbxNurbsSurface * | CreateNurbsSurfaceFromPatch (FbxPatch *pPatch) |
| void | ConvertShapes (FbxGeometry const *pSource, FbxGeometry *pDestination, FbxSurfaceEvaluator *pEvaluator, int pUCount, int pVCount) |
| void | ConvertShapes (FbxGeometry const *pSource, FbxGeometry *pDestination, FbxWeightedMapping *pSourceToDestinationMapping) |
| void | ConvertClusters (FbxGeometry const *pSource, FbxGeometry *pDestination, FbxWeightedMapping *pSourceToDestinationMapping) |
| void | ConvertClusters (FbxArray< FbxCluster * > const &pSourceClusters, int pSourceControlPointsCount, FbxArray< FbxCluster * > &pDestinationClusters, int pDestinationControlPointsCount, FbxWeightedMapping *pSourceToDestinationMapping) |
| void | BuildClusterToSourceMapping (FbxArray< FbxCluster * > const &pSourceClusters, FbxWeightedMapping *pClusterToSourceMapping) |
| void | CheckClusterToSourceMapping (FbxWeightedMapping *pClusterToSourceMapping) |
| void | ConvertCluster (int pSourceClusterIndex, FbxWeightedMapping *pClusterToSourceMapping, FbxWeightedMapping *pSourceToDestinationMapping, FbxCluster *pDestinationCluster) |
| void | DuplicateControlPoints (FbxArray< FbxVector4 > &pControlPoints, FbxArray< int > &pPolygonVertices) |
| void | UpdatePolygon (FbxMesh *pNewMesh, FbxMesh const *pRefMesh, int pPolygonIndex, int *pNewIndex, int &pVerticeIndexMeshTriangulated, int &pPolygonIndexMeshTriangulated) |
| void | UpdatePolygon (FbxMesh *pNewMesh, FbxMesh const *pRefMesh, int pPolygonIndex, int *pNewIndex, int &pVerticeIndexMeshTriangulated, int &pPolygonIndexMeshTriangulated, int pTriangleNum) |
| void | ResizePolygon (FbxMesh *pNewMesh, int pNewCountVertices=0, int pNewCountPolygons=0, bool pClearFlag=true) |
| template<class T1 , class T2 > | |
| void | ConvertNurbs (T1 *pNewNurbs, T2 *pOldNurb) |
| bool | CopyAnimationCurves (FbxNode *pNode, FbxGeometry *pNewGeometry) |
| bool | FlipNurbsCurve (FbxNurbsCurve *pCurve) const |
| void | FlipControlPoints (FbxGeometryBase *pPoints, int pUCount, int pVCount) const |
| bool | ConvertMaterialReferenceMode (FbxMesh *pMeshRef) const |
| void | RevertMaterialReferenceModeConversion (FbxMesh *pMeshRef) const |
Protected Attributes |
|
| FbxManager * | mManager |
Triangulation |
|
| FbxMesh * | TriangulateMesh (FbxMesh const *pMesh) |
| Triangulate a mesh. |
|
| FbxMesh * | TriangulatePatch (FbxPatch const *pPatch) |
| Triangulate a patch. |
|
| FbxMesh * | TriangulateNurbs (FbxNurbs const *pNurbs) |
| Triangulate a nurb. |
|
| bool | TriangulateInPlace (FbxNode *pNode) |
| Triangulate a mesh, patch or nurb contained
in a node and preserve the skins and shapes animation channels.
|
|
| bool | AddAlternateGeometry (FbxNode *pNode, FbxGeometry *pSrcGeom, FbxGeometry *pAltGeom, FbxWeightedMapping *pSrcToAltWeightedMapping, bool pConvertDeformations) |
| Add an "alternate" geometry to the node.
|
|
| bool | ConvertGeometryAnimation (FbxNode *pNode, FbxGeometry *pSrcGeom, FbxGeometry *pDstGeom) |
| Convert skins and shapes from source to
destination geometry. |
|
| bool | ComputeGeometryControlPointsWeightedMapping (FbxGeometry *pSrcGeom, FbxGeometry *pDstGeom, FbxWeightedMapping *pSrcToDstWeightedMapping, bool pSwapUV=false) |
| Compute a "vertex-correspondence" table that
helps passing from source to destination geometry. |
|
Geometry Conversion |
|
| FbxNurbs * | ConvertPatchToNurbs (FbxPatch *pPatch) |
| Convert from patch to nurb. |
|
| bool | ConvertPatchToNurbsInPlace (FbxNode *pNode) |
| Convert a patch contained in a node to a
nurb. |
|
| FbxNurbsSurface * | ConvertPatchToNurbsSurface (FbxPatch *pPatch) |
| Convert a patch to nurb surface. |
|
| bool | ConvertPatchToNurbsSurfaceInPlace (FbxNode *pNode) |
| Convert a patch contained in a node to a
nurb surface. |
|
| FbxNurbsSurface * | ConvertNurbsToNurbsSurface (FbxNurbs *pNurbs) |
| Convert a FbxNurbs to
a FbxNurbsSurface.
|
|
| FbxNurbs * | ConvertNurbsSurfaceToNurbs (FbxNurbsSurface *pNurbs) |
| Convert a FbxNurbsSurface
to a FbxNurbs.
|
|
| bool | ConvertNurbsToNurbsSurfaceInPlace (FbxNode *pNode) |
| Convert a nurb, contained in a node, to a
nurbs surface. |
|
| bool | ConvertNurbsSurfaceToNurbsInPlace (FbxNode *pNode) |
| Convert a nurb contained in a node to a
nurbs surface. |
|
Nurb UV and Links Swapping |
|
| FbxNurbs * | FlipNurbs (FbxNurbs *pNurbs, bool pSwapUV, bool pSwapClusters) |
| Flip UV and/or skin clusters of a nurb.
|
|
| FbxNurbsSurface * | FlipNurbsSurface (FbxNurbsSurface *pNurbs, bool pSwapUV, bool pSwapClusters) |
| Flip UV and/or skin clusters of a nurb
surface. |
|
Normals By Polygon Vertex Emulation |
|
| bool | EmulateNormalsByPolygonVertex (FbxMesh *pMesh) |
| Emulate normals by polygon vertex mode for a
mesh. |
|
| bool | ComputeEdgeSmoothingFromNormals (FbxMesh *pMesh) const |
| Create edge smoothing information from
polygon-vertex mapped normals. |
|
| bool | ComputePolygonSmoothingFromEdgeSmoothing (FbxMesh *pMesh, int pIndex=0) const |
| Convert edge smoothing to polygon smoothing
group. |
|
| bool | ComputeEdgeSmoothingFromPolygonSmoothing (FbxMesh *pMesh, int pIndex=0) const |
| Convert polygon smoothing group to edge
smoothing. |
|
| FbxGeometryConverter | ( | FbxManager * | pManager | ) |
Constructor.
| pManager | SDK object manager. |
| ~FbxGeometryConverter | ( | ) |
Destructor.
Triangulate a mesh.
| pMesh | Pointer to the mesh to triangulate. |
Triangulate a patch.
| pPatch | Pointer to the patch to triangulate. |
Triangulate a nurb.
| pNurbs | Pointer to the nurb to triangulate. |
| bool TriangulateInPlace | ( | FbxNode * | pNode | ) |
Triangulate a mesh, patch or nurb contained in a node and preserve the skins and shapes animation channels.
| pNode | Pointer to the node containing the geometry to triangulate. |
true on success, or false if the node
attribute is not a mesh, a patch or a nurb.| bool AddAlternateGeometry | ( | FbxNode * | pNode, |
| FbxGeometry * | pSrcGeom, | ||
| FbxGeometry * | pAltGeom, | ||
| FbxWeightedMapping * | pSrcToAltWeightedMapping, | ||
| bool | pConvertDeformations | ||
| ) |
Add an "alternate" geometry to the node.
| pNode | Pointer to the node containing the geometry. |
| pSrcGeom | Pointer to the source geometry. |
| pAltGeom | Pointer to the alternate geometry. |
| pSrcToAltWeightedMapping | Pointer to the weighted mapping table (optional). |
| pConvertDeformations | Flag used only if parameter pSrcToAltWeightedMapping is a valid
pointer to a weighted mapping table. Set to true to
convert deformations using the weighted mapping table. |
true on success, or false if the node
attribute is not a mesh, a patch or a nurb.| bool ConvertGeometryAnimation | ( | FbxNode * | pNode, |
| FbxGeometry * | pSrcGeom, | ||
| FbxGeometry * | pDstGeom | ||
| ) |
Convert skins and shapes from source to destination geometry.
| pNode | Pointer to the node containing the geometry. |
| pSrcGeom | Pointer to the source geometry. |
| pDstGeom | Pointer to the destination geometry. |
true on success, false
otherwise.| bool ComputeGeometryControlPointsWeightedMapping | ( | FbxGeometry * | pSrcGeom, |
| FbxGeometry * | pDstGeom, | ||
| FbxWeightedMapping * | pSrcToDstWeightedMapping, | ||
| bool | pSwapUV =
false |
||
| ) |
Compute a "vertex-correspondence" table that helps passing from source to destination geometry.
| 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. |
true on success, false if the
function fails to compute the correspondence.Convert from patch to nurb.
| pPatch | Pointer to the patch to convert. |
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.
| pNode | Pointer to the node containing the patch. |
true on success, false if the node
attribute is not a patch.| FbxNurbsSurface* ConvertPatchToNurbsSurface | ( | FbxPatch * | pPatch | ) |
Convert a patch to nurb surface.
| pPatch | Pointer to the patch to convert. |
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.
| pNode | Pointer to the node containing the patch. |
true on success, false if the node
attribute is not a patch.| FbxNurbsSurface* ConvertNurbsToNurbsSurface | ( | FbxNurbs * | pNurbs | ) |
Convert a FbxNurbs to a FbxNurbsSurface.
| pNurbs | Pointer to the original nurb |
| FbxNurbs* ConvertNurbsSurfaceToNurbs | ( | FbxNurbsSurface * | pNurbs | ) |
Convert a FbxNurbsSurface to a FbxNurbs.
| pNurbs | Pointer 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.
| pNode | Pointer to the node containing the nurb. |
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.
| pNode | Pointer to the node containing the nurbs surface. |
true on success, false otherwiseFlip UV and/or skin clusters of a nurb.
| 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. |
NULL if the function fails.| FbxNurbsSurface* FlipNurbsSurface | ( | FbxNurbsSurface * | pNurbs, |
| bool | pSwapUV, | ||
| bool | pSwapClusters | ||
| ) |
Flip UV and/or skin clusters of a nurb surface.
| 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. |
NULL if the function fails.| bool EmulateNormalsByPolygonVertex | ( | FbxMesh * | pMesh | ) |
Emulate normals by polygon vertex mode for a mesh.
| pMesh | Pointer to the mesh object. |
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.
| pMesh | The mesh used to generate edge smoothing. |
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.
| pMesh | The mesh that contains the smoothing to be converted. |
| pIndex | The index of the layer smoothing to be converted. |
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.
| pMesh | The mesh that contains the smoothing to be converted. |
| pIndex | The index of the layer smoothing to be converted |
true on success, false
otherwise.| void ReplaceNodeAttribute | ( | FbxNode * | pNode, |
| FbxNodeAttribute * | pNewNodeAttr | ||
| ) |
Replace node attribute with new one.
| pNode | Pointer to the node which node attribute will be replaced. |
| pNewNodeAttr | new node attribute. |
| bool AddTriangulatedMeshGeometry | ( | FbxNode * | pNode, |
| int | pUVStepCoeff | ||
| ) |
Add a "triangulated mesh" geometry to the node.
| pNode | Pointer to the node containing the geometry. |
| pUVStepCoeff | Coefficient factor for the U/V steps. Must be >= 1. |
true on success, false if the node
attribute is not a mesh, a patch or a nurb.| bool SplitMeshPerMaterial | ( | FbxMesh * | pMesh | ) |
Split Mesh Per Material.
Each split mesh only has a single material on it.
| pMesh | The mesh that contains the smoothing to be converted. |
true on success, false
otherwise.| bool SplitMeshesPerMaterial | ( | FbxScene * | pScene | ) |
Split all the mesh in the scene.
| pScene | each mesh in the scene will be split. |
true on success, false
otherwise.Create LayerElement, and copy settings from pRefMesh to pNewMesh.
| pNewMesh | new mesh to create layerElement. |
| pRefMesh | reference mesh, to copy layerElement settings from it. |
true on success, false
otherwise.| bool SetLayerElements | ( | FbxMesh * | pNewMesh, |
| FbxMesh * | pMesh, | ||
| int | pPolygonIndex, | ||
| int | pPolyPointIndex, | ||
| int | pLoopIndex, | ||
| bool | pIsSearched, | ||
| bool | pIsEndPolygon | ||
| ) |
Set Normals, UVs and Vertex Color, when building new mesh.
Triangulate a mesh(support without holes or with holes simple polygon)
| pMesh | Pointer to the mesh to triangulate. |
| pStatus | The status is true if the triangulation is
successful for the whole mesh. |
| FbxNode* MergeMeshes | ( | FbxArray< FbxNode * > & | pMeshNodes, |
| const char * | pNodeName, | ||
| FbxScene * | pScene | ||
| ) |
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.
| 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. |
| static void FbxTriangulation | ( | int * | Index, |
| int | pNumSide | ||
| ) | [static] |
FbxTriangulation.
| Index | Output array of triangle indices |
| pNumSide | Input number of sides of the polygon to triangulate -- Triangulation algorithm is strip, Sorting vertex index for strip in clockwise. |
2 3 4 0----------0---------0 / ` / ` 5 1 / 0 0 / ` / ` / 0 0-----0-------------0 6 7 The result of this one will be [{0,1,2},{2,3,0},{0,3,7},{3,4,7},{7,4,6},{4,5,6}]
| bool ComputePatchToMeshControlPointsWeightedMapping | ( | FbxPatch * | pSrcPatch, |
| FbxMesh * | pDstMesh, | ||
| FbxWeightedMapping * | pMapping, | ||
| bool | pSwapUV =
false |
||
| ) | [protected] |
| bool ComputeNurbsToMeshControlPointsWeightedMapping | ( | FbxNurbsSurface * | pSrcNurbs, |
| FbxMesh * | pDstMesh, | ||
| FbxWeightedMapping * | pMapping, | ||
| bool | pRescaleUVs =
false, |
||
| bool | pSwapUV =
false |
||
| ) | [protected] |
| void InitializeWeightInControlPoints | ( | FbxGeometryBase * | pGeometry | ) | [protected] |
| void InitializeWeightInNormals | ( | FbxLayerContainer * | pLayerContainer | ) | [protected] |
| void CheckForZeroWeightInShape | ( | FbxGeometry * | pGeometry | ) | [protected] |
| FbxMesh* CreateMeshFromParametricSurface | ( | FbxGeometry const * | pGeometry | ) | [protected] |
| FbxNurbsSurface* CreateNurbsSurfaceFromPatch | ( | FbxPatch * | pPatch | ) | [protected] |
| void ConvertShapes | ( | FbxGeometry const * | pSource, |
| FbxGeometry * | pDestination, | ||
| FbxSurfaceEvaluator * | pEvaluator, | ||
| int | pUCount, | ||
| int | pVCount | ||
| ) | [protected] |
| void ConvertShapes | ( | FbxGeometry const * | pSource, |
| FbxGeometry * | pDestination, | ||
| FbxWeightedMapping * | pSourceToDestinationMapping | ||
| ) | [protected] |
| void ConvertClusters | ( | FbxGeometry const * | pSource, |
| FbxGeometry * | pDestination, | ||
| FbxWeightedMapping * | pSourceToDestinationMapping | ||
| ) | [protected] |
| void ConvertClusters | ( | FbxArray< FbxCluster * > const & | pSourceClusters, |
| int | pSourceControlPointsCount, | ||
| FbxArray< FbxCluster * > & | pDestinationClusters, | ||
| int | pDestinationControlPointsCount, | ||
| FbxWeightedMapping * | pSourceToDestinationMapping | ||
| ) | [protected] |
| void BuildClusterToSourceMapping | ( | FbxArray< FbxCluster * > const & | pSourceClusters, |
| FbxWeightedMapping * | pClusterToSourceMapping | ||
| ) | [protected] |
| void CheckClusterToSourceMapping | ( | FbxWeightedMapping * | pClusterToSourceMapping | ) | [protected] |
| void ConvertCluster | ( | int | pSourceClusterIndex, |
| FbxWeightedMapping * | pClusterToSourceMapping, | ||
| FbxWeightedMapping * | pSourceToDestinationMapping, | ||
| FbxCluster * | pDestinationCluster | ||
| ) | [protected] |
| void DuplicateControlPoints | ( | FbxArray< FbxVector4 > & | pControlPoints, |
| FbxArray< int > & | pPolygonVertices | ||
| ) | [protected] |
| void ResizePolygon | ( | FbxMesh * | pNewMesh, |
| int | pNewCountVertices =
0, |
||
| int | pNewCountPolygons =
0, |
||
| bool | pClearFlag =
true |
||
| ) | [protected] |
| void ConvertNurbs | ( | T1 * | pNewNurbs, |
| T2 * | pOldNurb | ||
| ) | [protected] |
| bool CopyAnimationCurves | ( | FbxNode * | pNode, |
| FbxGeometry * | pNewGeometry | ||
| ) | [protected] |
| bool FlipNurbsCurve | ( | FbxNurbsCurve * | pCurve | ) | const [protected] |
| void FlipControlPoints | ( | FbxGeometryBase * | pPoints, |
| int | pUCount, | ||
| int | pVCount | ||
| ) | const [protected] |
| bool ConvertMaterialReferenceMode | ( | FbxMesh * | pMeshRef | ) | const [protected] |
| void RevertMaterialReferenceModeConversion | ( | FbxMesh * | pMeshRef | ) | const [protected] |
FbxManager*
mManager [protected] |
Definition at line 405 of file fbxgeometryconverter.h.