This class provides the functionality to convert geometry nodes attributes (KFbxMesh, KFbxNurb and KFbxPatch) and mainly focuses on the two major categories: Triangulation and conversion between NURBS and Patches surfaces.
Definition at line 70 of file kfbxgeometryconverter.h.
#include <kfbxgeometryconverter.h>
Public Member Functions |
|
| KFbxGeometryConverter (KFbxSdkManager *pManager) | |
| ~KFbxGeometryConverter () | |
| void | ReplaceNodeAttribute (KFbxNode *pNode, KFbxNodeAttribute *pNewNodeAttr) |
| Replace node attribute with new one.
|
|
| bool | AddTriangulatedMeshGeometry (KFbxNode *pNode, int pUVStepCoeff) |
| Add a "triangulated mesh" geometry to the
node. |
|
| bool | SplitMeshPerMaterial (KFbxMesh *pMesh) |
| Split Mesh Per Material. |
|
| bool | SplitMeshesPerMaterial (KFbxScene *pScene) |
| Split all the mesh in the scene. |
|
| bool | CreateAndCopyLayerElement (KFbxMesh *pNewMesh, KFbxMesh *pRefMesh) |
| Create LayerElement, and copy settings from
pRefMesh to pNewMesh. |
|
| bool | SetLayerElements (KFbxMesh *pNewMesh, KFbxMesh *pMesh, int pPolygonIndex, int pPolyPointIndex, int pLoopIndex, bool pIsSearched, bool pIsEndPolygon) |
| Set Normals, UVs and Vertex Color, when
building new mesh. |
|
| KFbxMesh * | TriangulateMeshAdvance (KFbxMesh const *pMesh, bool &pStatus) |
| Triangulate a mesh(support without holes or
with holes simple polygon) |
|
| K_DEPRECATED int | TriangulatePolygon (KFbxMesh *pNewMesh, KFbxVector4 *pControlPoints, int *pVertexIndices, int *pPolyVertexIndices, int pStartVertexIndex, KFbxVector4 &pNormal, int pMaterialIndex, int pPolygonSize, int polygonIndex) |
| TriangulatePolygon Triangulation of the
current polygon. |
|
Protected Member Functions |
|
| bool | ComputePatchToMeshControlPointsWeightedMapping (KFbxPatch *pSrcPatch, KFbxMesh *pDstMesh, KFbxWeightedMapping *pMapping, bool pSwapUV=false) |
| bool | ComputeNurbToMeshControlPointsWeightedMapping (KFbxNurbsSurface *pSrcNurb, KFbxMesh *pDstMesh, KFbxWeightedMapping *pMapping, bool pRescaleUVs=false, bool pSwapUV=false) |
| void | InitializeWeightInControlPoints (KFbxGeometryBase *pGeometry) |
| void | InitializeWeightInNormals (KFbxLayerContainer *pLayerContainer) |
| void | TriangulateContinuousSurface (KFbxMesh *pMesh, KFBXSurfaceEvaluator *pSurface, kUInt pPointCountX, kUInt pPointCountY, bool ClockWise=false) |
| void | CheckForZeroWeightInShape (KFbxGeometry *pGeometry) |
| KFbxMesh * | CreateMeshFromParametricSurface (KFbxGeometry const *pGeometry) |
| KFbxNurb * | CreateNurbFromPatch (KFbxPatch *pPatch) |
| KFbxNurbsSurface * | CreateNurbsSurfaceFromPatch (KFbxPatch *pPatch) |
| void | ConvertShapes (KFbxGeometry const *pSource, KFbxGeometry *pDestination, KFBXSurfaceEvaluator *pEvaluator, int pUCount, int pVCount) |
| void | ConvertShapes (KFbxGeometry const *pSource, KFbxGeometry *pDestination, KFbxWeightedMapping *pSourceToDestinationMapping) |
| void | ConvertClusters (KFbxGeometry const *pSource, KFbxGeometry *pDestination, KFbxWeightedMapping *pSourceToDestinationMapping) |
| void | ConvertClusters (KArrayTemplate< KFbxCluster * > const &pSourceClusters, int pSourceControlPointsCount, KArrayTemplate< KFbxCluster * > &pDestinationClusters, int pDestinationControlPointsCount, KFbxWeightedMapping *pSourceToDestinationMapping) |
| void | BuildClusterToSourceMapping (KArrayTemplate< KFbxCluster * > const &pSourceClusters, KFbxWeightedMapping *pClusterToSourceMapping) |
| void | CheckClusterToSourceMapping (KFbxWeightedMapping *pClusterToSourceMapping) |
| void | ConvertCluster (int pSourceClusterIndex, KFbxWeightedMapping *pClusterToSourceMapping, KFbxWeightedMapping *pSourceToDestinationMapping, KFbxCluster *pDestinationCluster) |
| void | DuplicateControlPoints (KArrayTemplate< KFbxVector4 > &pControlPoints, KArrayTemplate< int > &pPolygonVertices) |
| void | UpdatePolygon (KFbxMesh *pNewMesh, KFbxMesh const *pRefMesh, int pPolygonIndex, int *pNewIndex, int &pVerticeIndexMeshTriangulated, int &pPolygonIndexMeshTriangulated) |
| void | UpdatePolygon (KFbxMesh *pNewMesh, KFbxMesh const *pRefMesh, int pPolygonIndex, int *pNewIndex, int &pVerticeIndexMeshTriangulated, int &pPolygonIndexMeshTriangulated, int pTriangleNum) |
| void | ResizePolygon (KFbxMesh *pNewMesh, int pNewCountVertices=0, int pNewCountPolygons=0, bool pClearFlag=true) |
| template<class T1 , class T2 > | |
| void | ConvertNurbs (T1 *pNewNurb, T2 *pOldNurb) |
| bool | CopyAnimationCurves (KFbxNode *pNode, KFbxGeometry *pNewGeometry) |
| bool | FlipNurbsCurve (KFbxNurbsCurve *pCurve) const |
| void | FlipControlPoints (KFbxGeometryBase *pPoints, int pUCount, int pVCount) const |
| bool | ConvertMaterialReferenceMode (KFbxMesh *pMeshRef) const |
| void | RevertMaterialReferenceModeConversion (KFbxMesh *pMeshRef) const |
Protected Attributes |
|
| KFbxSdkManager * | mManager |
Triangulation |
|
| KFbxMesh * | TriangulateMesh (KFbxMesh const *pMesh) |
| Triangulate a mesh. |
|
| KFbxMesh * | TriangulatePatch (KFbxPatch const *pPatch) |
| Triangulate a patch. |
|
| KFbxMesh * | TriangulateNurb (KFbxNurb const *pNurb) |
| Triangulate a nurb. |
|
| bool | TriangulateInPlace (KFbxNode *pNode) |
| Triangulate a mesh, patch or nurb contained
in a node and preserve the skins and shapes animation channels.
|
|
| bool | AddAlternateGeometry (KFbxNode *pNode, KFbxGeometry *pSrcGeom, KFbxGeometry *pAltGeom, KFbxWeightedMapping *pSrcToAltWeightedMapping, bool pConvertDeformations) |
| Add an "alternate" geometry to the node.
|
|
| bool | ConvertGeometryAnimation (KFbxNode *pNode, KFbxGeometry *pSrcGeom, KFbxGeometry *pDstGeom) |
| Convert skins and shapes from source to
destination geometry. |
|
| bool | ComputeGeometryControlPointsWeightedMapping (KFbxGeometry *pSrcGeom, KFbxGeometry *pDstGeom, KFbxWeightedMapping *pSrcToDstWeightedMapping, bool pSwapUV=false) |
| Compute a "vertex-correspondence" table that
helps passing from source to destination geometry. |
|
Geometry Conversion |
|
| KFbxNurb * | ConvertPatchToNurb (KFbxPatch *pPatch) |
| Convert from patch to nurb. |
|
| bool | ConvertPatchToNurbInPlace (KFbxNode *pNode) |
| Convert a patch contained in a node to a
nurb. |
|
| KFbxNurbsSurface * | ConvertPatchToNurbsSurface (KFbxPatch *pPatch) |
| Convert a patch to nurb surface. |
|
| bool | ConvertPatchToNurbsSurfaceInPlace (KFbxNode *pNode) |
| Convert a patch contained in a node to a
nurb surface. |
|
| KFbxNurbsSurface * | ConvertNurbToNurbsSurface (KFbxNurb *pNurb) |
| Convert a KFbxNurb to
a KFbxNurbsSurface.
|
|
| KFbxNurb * | ConvertNurbsSurfaceToNurb (KFbxNurbsSurface *pNurb) |
| Convert a KFbxNurbsSurface
to a KFbxNurb.
|
|
| bool | ConvertNurbToNurbsSurfaceInPlace (KFbxNode *pNode) |
| Convert a nurb, contained in a node, to a
nurbs surface. |
|
| bool | ConvertNurbsSurfaceToNurbInPlace (KFbxNode *pNode) |
| Convert a nurb contained in a node to a
nurbs surface. |
|
Nurb UV and Links Swapping |
|
| KFbxNurb * | FlipNurb (KFbxNurb *pNurb, bool pSwapUV, bool pSwapClusters) |
| Flip UV and/or skin clusters of a nurb.
|
|
| KFbxNurbsSurface * | FlipNurbsSurface (KFbxNurbsSurface *pNurb, bool pSwapUV, bool pSwapClusters) |
| Flip UV and/or skin clusters of a nurb
surface. |
|
Normals By Polygon Vertex Emulation |
|
| bool | EmulateNormalsByPolygonVertex (KFbxMesh *pMesh) |
| Emulate normals by polygon vertex mode for a
mesh. |
|
| bool | ComputeEdgeSmoothingFromNormals (KFbxMesh *pMesh) const |
| Create edge smoothing information from
polygon-vertex mapped normals. |
|
| bool | ComputePolygonSmoothingFromEdgeSmoothing (KFbxMesh *pMesh, int pIndex=0) const |
| Convert edge smoothing to polygon smoothing
group. |
|
| bool | ComputeEdgeSmoothingFromPolygonSmoothing (KFbxMesh *pMesh, int pIndex=0) const |
| Convert polygon smoothing group to edge
smoothing. |
|
| KFbxGeometryConverter | ( | KFbxSdkManager * | pManager | ) |
Triangulate a mesh.
| pMesh | Pointer to the mesh to triangulate. |
Triangulate a patch.
| pPatch | Pointer to the patch to triangulate. |
Triangulate a nurb.
| pNurb | Pointer to the nurb to triangulate. |
| bool TriangulateInPlace | ( | KFbxNode * | 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 | ( | KFbxNode * | pNode, |
| KFbxGeometry * | pSrcGeom, | ||
| KFbxGeometry * | pAltGeom, | ||
| KFbxWeightedMapping * | 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 | ( | KFbxNode * | pNode, |
| KFbxGeometry * | pSrcGeom, | ||
| KFbxGeometry * | 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 | ( | KFbxGeometry * | pSrcGeom, |
| KFbxGeometry * | pDstGeom, | ||
| KFbxWeightedMapping * | 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 ConvertPatchToNurbInPlace | ( | KFbxNode * | 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.| KFbxNurbsSurface* ConvertPatchToNurbsSurface | ( | KFbxPatch * | pPatch | ) |
Convert a patch to nurb surface.
| pPatch | Pointer to the patch to convert. |
NULL if conversion
fails.| bool ConvertPatchToNurbsSurfaceInPlace | ( | KFbxNode * | 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.| KFbxNurbsSurface* ConvertNurbToNurbsSurface | ( | KFbxNurb * | pNurb | ) |
Convert a KFbxNurb to a KFbxNurbsSurface.
| pNurb | Pointer to the original nurb |
| KFbxNurb* ConvertNurbsSurfaceToNurb | ( | KFbxNurbsSurface * | pNurb | ) |
Convert a KFbxNurbsSurface to a KFbxNurb.
| pNurb | Pointer to the original nurbs surface |
| bool ConvertNurbToNurbsSurfaceInPlace | ( | KFbxNode * | 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 ConvertNurbsSurfaceToNurbInPlace | ( | KFbxNode * | 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.
| pNurb | 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.| KFbxNurbsSurface* FlipNurbsSurface | ( | KFbxNurbsSurface * | pNurb, |
| bool | pSwapUV, | ||
| bool | pSwapClusters | ||
| ) |
Flip UV and/or skin clusters of a nurb surface.
| pNurb | 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 | ( | KFbxMesh * | 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 | ( | KFbxMesh * | 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 | ( | KFbxMesh * | 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 | ( | KFbxMesh * | 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 | ( | KFbxNode * | pNode, |
| KFbxNodeAttribute * | pNewNodeAttr | ||
| ) |
Replace node attribute with new one.
| pNode | Pointer to the node which node attribute will be replaced. |
| pNewNodeAttr | new node attribute. |
| bool AddTriangulatedMeshGeometry | ( | KFbxNode * | 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 | ( | KFbxMesh * | 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 | ( | KFbxScene * | 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 | ( | KFbxMesh * | pNewMesh, |
| KFbxMesh * | 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. |
| K_DEPRECATED int TriangulatePolygon | ( | KFbxMesh * | pNewMesh, |
| KFbxVector4 * | pControlPoints, | ||
| int * | pVertexIndices, | ||
| int * | pPolyVertexIndices, | ||
| int | pStartVertexIndex, | ||
| KFbxVector4 & | pNormal, | ||
| int | pMaterialIndex, | ||
| int | pPolygonSize, | ||
| int | polygonIndex | ||
| ) |
TriangulatePolygon Triangulation of the current polygon.
| pNewMesh | The mesh to triangulate |
| pControlPoints | Control points on the old mesh |
| pVertexIndices | Vertex indices on the old mesh |
| pPolyVertexIndices | Vertex indices for the current polygon |
| pStartVertexIndex | Polygon Start Index from vertex indices on the old mesh |
| pNormal | Face normal of the polygon |
| pMaterialIndex | Material index of the polygon |
| pPolygonSize | Vertex number of the polygon |
| polygonIndex | Index o the polygon |
| bool ComputePatchToMeshControlPointsWeightedMapping | ( | KFbxPatch * | pSrcPatch, |
| KFbxMesh * | pDstMesh, | ||
| KFbxWeightedMapping * | pMapping, | ||
| bool | pSwapUV =
false |
||
| ) | [protected] |
| bool ComputeNurbToMeshControlPointsWeightedMapping | ( | KFbxNurbsSurface * | pSrcNurb, |
| KFbxMesh * | pDstMesh, | ||
| KFbxWeightedMapping * | pMapping, | ||
| bool | pRescaleUVs =
false, |
||
| bool | pSwapUV =
false |
||
| ) | [protected] |
| void InitializeWeightInControlPoints | ( | KFbxGeometryBase * | pGeometry | ) | [protected] |
| void InitializeWeightInNormals | ( | KFbxLayerContainer * | pLayerContainer | ) | [protected] |
| void CheckForZeroWeightInShape | ( | KFbxGeometry * | pGeometry | ) | [protected] |
| KFbxMesh* CreateMeshFromParametricSurface | ( | KFbxGeometry const * | pGeometry | ) | [protected] |
| KFbxNurbsSurface* CreateNurbsSurfaceFromPatch | ( | KFbxPatch * | pPatch | ) | [protected] |
| void ConvertShapes | ( | KFbxGeometry const * | pSource, |
| KFbxGeometry * | pDestination, | ||
| KFBXSurfaceEvaluator * | pEvaluator, | ||
| int | pUCount, | ||
| int | pVCount | ||
| ) | [protected] |
| void ConvertShapes | ( | KFbxGeometry const * | pSource, |
| KFbxGeometry * | pDestination, | ||
| KFbxWeightedMapping * | pSourceToDestinationMapping | ||
| ) | [protected] |
| void ConvertClusters | ( | KFbxGeometry const * | pSource, |
| KFbxGeometry * | pDestination, | ||
| KFbxWeightedMapping * | pSourceToDestinationMapping | ||
| ) | [protected] |
| void ConvertClusters | ( | KArrayTemplate< KFbxCluster * > const & | pSourceClusters, |
| int | pSourceControlPointsCount, | ||
| KArrayTemplate< KFbxCluster * > & | pDestinationClusters, | ||
| int | pDestinationControlPointsCount, | ||
| KFbxWeightedMapping * | pSourceToDestinationMapping | ||
| ) | [protected] |
| void BuildClusterToSourceMapping | ( | KArrayTemplate< KFbxCluster * > const & | pSourceClusters, |
| KFbxWeightedMapping * | pClusterToSourceMapping | ||
| ) | [protected] |
| void CheckClusterToSourceMapping | ( | KFbxWeightedMapping * | pClusterToSourceMapping | ) | [protected] |
| void ConvertCluster | ( | int | pSourceClusterIndex, |
| KFbxWeightedMapping * | pClusterToSourceMapping, | ||
| KFbxWeightedMapping * | pSourceToDestinationMapping, | ||
| KFbxCluster * | pDestinationCluster | ||
| ) | [protected] |
| void DuplicateControlPoints | ( | KArrayTemplate< KFbxVector4 > & | pControlPoints, |
| KArrayTemplate< int > & | pPolygonVertices | ||
| ) | [protected] |
| void ResizePolygon | ( | KFbxMesh * | pNewMesh, |
| int | pNewCountVertices =
0, |
||
| int | pNewCountPolygons =
0, |
||
| bool | pClearFlag =
true |
||
| ) | [protected] |
| void ConvertNurbs | ( | T1 * | pNewNurb, |
| T2 * | pOldNurb | ||
| ) | [protected] |
| bool CopyAnimationCurves | ( | KFbxNode * | pNode, |
| KFbxGeometry * | pNewGeometry | ||
| ) | [protected] |
| bool FlipNurbsCurve | ( | KFbxNurbsCurve * | pCurve | ) | const [protected] |
| void FlipControlPoints | ( | KFbxGeometryBase * | pPoints, |
| int | pUCount, | ||
| int | pVCount | ||
| ) | const [protected] |
| bool ConvertMaterialReferenceMode | ( | KFbxMesh * | pMeshRef | ) | const [protected] |
| void RevertMaterialReferenceModeConversion | ( | KFbxMesh * | pMeshRef | ) | const [protected] |
KFbxSdkManager*
mManager [protected] |
Definition at line 396 of file kfbxgeometryconverter.h.