KFbxGeometryConverter
#include<kfbxgeometryconverter.h>

List of all members.

Detailed Description

This class provides functions to triangulate and convert geometry node attributes.

Definition at line72of filekfbxgeometryconverter.h.


Triangulation

KFbxMeshTriangulateMesh(KFbxMeshconst *pMesh)
 Triangulate a mesh.
KFbxMeshTriangulatePatch(KFbxPatchconst *pPatch)
 Triangulate a patch.
KFbxMeshTriangulateNurb(KFbxNurbconst *pNurb)
 Triangulate a nurb.
bool TriangulateInPlace(KFbxNode*pNode)
 Triangulate a mesh, patch or nurb contained in a node in order to preserve related 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 shape(s) and link(s) from souce to destination geometry.
bool ComputeGeometryControlPointsWeightedMapping(KFbxGeometry*pSrcGeom,KFbxGeometry*pDstGeom,KFbxWeightedMapping*pSrcToDstWeightedMapping, bool pSwapUV=false)
 Compute a "vertex-correspondance" table that helps passing from source to destination geometry.

Geometry Conversion

KFbxNurbConvertPatchToNurb(KFbxPatch*pPatch)
 Convert from patch to nurb.
bool ConvertPatchToNurbInPlace(KFbxNode*pNode)
 Convert a patch contained in a node to a nurb.
KFbxNurbsSurfaceConvertPatchToNurbsSurface(KFbxPatch*pPatch)
 Convert a patch to nurb surface.
bool ConvertPatchToNurbsSurfaceInPlace(KFbxNode*pNode)
 Convert a patch contained in a node to a nurb surface.
KFbxNurbsSurfaceConvertNurbToNurbsSurface(KFbxNurb*pNurb)
 Convert aKFbxNurbto aKFbxNurbsSurface.
KFbxNurbConvertNurbsSurfaceToNurb(KFbxNurbsSurface*pNurb)
 Convert aKFbxNurbsSurfaceto aKFbxNurb.
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

KFbxNurbFlipNurb(KFbxNurb*pNurb, bool pSwapUV, bool pSwapClusters)
 Flip UV and/or links of a nurb.
KFbxNurbsSurfaceFlipNurbsSurface(KFbxNurbsSurface*pNurb, bool pSwapUV, bool pSwapClusters)
 Flip UV and/or links 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.

Member Function Documentation

KFbxMesh* TriangulateMesh(KFbxMeshconst * pMesh ) 

Triangulate a mesh.

Parameters:
pMesh Pointer to the mesh to triangulate.
Returns:
Pointer to the new triangulated mesh.
Remarks:
This method creates a new mesh, leaving the source mesh unchanged.

KFbxMesh* TriangulatePatch(KFbxPatchconst * pPatch ) 

Triangulate a patch.

Parameters:
pPatch Pointer to the patch to triangulate.
Returns:
Pointer to the new triangulated mesh.
Remarks:
The links and shapes are also converted to fit the created mesh.

KFbxMesh* TriangulateNurb(KFbxNurbconst * pNurb ) 

Triangulate a nurb.

Parameters:
pNurb Pointer to the nurb to triangulate.
Returns:
Pointer to the new triangulated mesh.
Remarks:
The links and shapes are also converted to fit the created mesh.

bool TriangulateInPlace(KFbxNodepNode ) 

Triangulate a mesh, patch or nurb contained in a node in order to preserve related animation channels.

Parameters:
pNode Pointer to the node containng the geometry to triangulate.
Returns:
trueon success, orfalseif the node attribute is not a mesh, a patch or a nurb.
Remarks:
See the remarks for functionsTriangulateMesh(),TriangulatePatch()andTriangulateNurb().

bool AddAlternateGeometry(KFbxNodepNode,
KFbxGeometrypSrcGeom,
KFbxGeometrypAltGeom,
KFbxWeightedMappingpSrcToAltWeightedMapping,
bool pConvertDeformations 
)

Add an "alternate" geometry to the node.

Parameters:
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 totrueto convert deformations using the weighted mapping table.
Returns:
trueon success, orfalseif the node attribute is not a mesh, a patch or a nurb.

bool ConvertGeometryAnimation(KFbxNodepNode,
KFbxGeometrypSrcGeom,
KFbxGeometrypDstGeom 
)

Convert shape(s) and link(s) from souce to destination geometry.

Parameters:
pNode Pointer to the node containng the geometry.
pSrcGeom Pointer to the source geometry.
pDstGeom Pointer to the destination geometry.
Returns:
trueon success,falseotherwise.
Remarks:
Source and destination geometry must belong to the same node and must be linked by a geometry weighted map.

bool ComputeGeometryControlPointsWeightedMapping(KFbxGeometrypSrcGeom,
KFbxGeometrypDstGeom,
KFbxWeightedMappingpSrcToDstWeightedMapping,
bool pSwapUV=false 
)

Compute a "vertex-correspondance" 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 totrueto swap UVs.
Returns:
trueon success,falseif the function fails to compute the correspondance.
Remarks:
Links and shapes are also converted to fit the alternate geometry.

KFbxNurb* ConvertPatchToNurb(KFbxPatchpPatch ) 

Convert from patch to nurb.

Parameters:
pPatch Pointer to the patch to convert.
Returns:
Created nurb orNULLif the conversion fails.
Remarks:
The patch must be of type eBSPLINE, eBEZIER or eLINEAR.

bool ConvertPatchToNurbInPlace(KFbxNodepNode ) 

Convert a patch contained in a node to a nurb.

Use this function to preserve the patch's related animation channels.

Parameters:
pNode Pointer to the node containing the patch.
Returns:
trueon success,falseif the node attribute is not a patch.
Remarks:
The patch must be of type eBSPLINE, eBEZIER or eLINEAR.

KFbxNurbsSurface* ConvertPatchToNurbsSurface(KFbxPatchpPatch ) 

Convert a patch to nurb surface.

Parameters:
pPatch Pointer to the patch to convert.
Returns:
Created nurb surface orNULLif conversion fails.
Remarks:
The patch must be of type eBSPLINE, eBEZIER or eLINEAR.

bool ConvertPatchToNurbsSurfaceInPlace(KFbxNodepNode ) 

Convert a patch contained in a node to a nurb surface.

Use this function to preserve the patch's related animation channels.

Parameters:
pNode Pointer to the node containing the patch.
Returns:
trueon success,falseif the node attribute is not a patch.
Remarks:
The patch must be of type eBSPLINE, eBEZIER or eLINEAR.

KFbxNurbsSurface* ConvertNurbToNurbsSurface(KFbxNurbpNurb ) 

Convert aKFbxNurbto aKFbxNurbsSurface.

Parameters:
pNurb Pointer to the original nurb
Returns:
AKFbxNurbsSurfacethat is equivalent to the original nurb.

KFbxNurb* ConvertNurbsSurfaceToNurb(KFbxNurbsSurfacepNurb ) 

Convert aKFbxNurbsSurfaceto aKFbxNurb.

Parameters:
pNurb Pointer to the original nurbs surface
Returns:
AKFbxNurbthat is equivalent to the original nurbs surface.

bool ConvertNurbToNurbsSurfaceInPlace(KFbxNodepNode ) 

Convert a nurb, contained in a node, to a nurbs surface.

Use this function to preserve the nurb's related animation channels.

Parameters:
pNode Pointer to the node containing the nurb.
Returns:
trueon success,falseotherwise

bool ConvertNurbsSurfaceToNurbInPlace(KFbxNodepNode ) 

Convert a nurb contained in a node to a nurbs surface.

Use this function to preserve the nurb's related animation channels.

Parameters:
pNode Pointer to the node containing the nurbs surface.
Returns:
trueon success,falseotherwise

KFbxNurb* FlipNurb(KFbxNurbpNurb,
bool pSwapUV,
bool pSwapClusters 
)

Flip UV and/or links of a nurb.

Parameters:
pNurb Pointer to the Source nurb.
pSwapUV Set totrueto swap the UVs.
pSwapClusters Set totrueto swap the control point indices of clusters.
Returns:
A fliped kFbxNurb, orNULLif the function fails.

KFbxNurbsSurface* FlipNurbsSurface(KFbxNurbsSurfacepNurb,
bool pSwapUV,
bool pSwapClusters 
)

Flip UV and/or links of a nurb surface.

Parameters:
pNurb Pointer to the Source nurb surface.
pSwapUV Set totrueto swap the UVs.
pSwapClusters Set totrueto swap the control point indices of clusters.
Returns:
A fliped kFbxNurbSurface, orNULLif the function fails.

bool EmulateNormalsByPolygonVertex(KFbxMeshpMesh ) 

Emulate normals by polygon vertex mode for a mesh.

Parameters:
pMesh Pointer to the mesh object.
Returns:
trueon success,falseif the number of normals in the mesh and in its associated shapes don't match the number of polygon vertices.
Remarks:
For applications that only supports normals by control points, this function duplicates control points to equal the number of polygon vertices. Links and shapes are also converted. As preconditions:
  1. polygons must have been created
  2. the number of normals in the mesh and in its associated shapes must match the number of polygon vertices.

bool ComputeEdgeSmoothingFromNormals(KFbxMeshpMesh ) 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:
trueon success,falseotherwise.
Remarks:
The edge smoothing data is placed on Layer 0 of the mesh. Normals do not need to be on Layer 0, since the first layer with per polygon vertex normals is used.

bool ComputePolygonSmoothingFromEdgeSmoothing(KFbxMeshpMesh,
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:
trueon success,falseotherwise.
Remarks:
The smoothing group is bitwise. The each bit of the integer represents one smoothing group. Therefore, there is 32 smoothing groups maximum.

bool ComputeEdgeSmoothingFromPolygonSmoothing(KFbxMeshpMesh,
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:
trueon success,falseotherwise.