KFbxGeometry Class Reference

#include <kfbxgeometry.h>

Inherits KFbxGeometryBase.

Inherited by KFbxBoundary, KFbxMesh, KFbxNurb, KFbxNurbsCurve, KFbxNurbsSurface, KFbxPatch, and KFbxTrimNurbsSurface.

Inheritance diagram for KFbxGeometry:

Inheritance graph
List of all members.

Detailed Description

Contains common properties for mesh, nurb, and patch node attributes.

A geometry node attribute has arrays of links, shapes, materials and textures. It also has arrays for control points, normals, material indices, texture indices, and texture UV coordinates. Some of these are only used in mesh node attributes.

Definition at line 83 of file kfbxgeometry.h.

Error Management

enum  EError
 Error identifiers. More...
KErrorGetError ()
 Retrieve error object.
EError GetLastErrorID ()
 Get last error code.
char * GetLastErrorString ()
 Get last error string.

Link Management

Links have been deprecated on geometry.

Instead of having links connected to the geometry, you have a skin deformer (KFbxSkin). This skin deformer is connected to cluster sub deformers that are equivalent to links.

To create a skin deformer use: KFbxSdkManager::CreateKFbxSkin. To add the newly created deformer to the geometry use: FKbxGeometry::AddDeformer. To check if a skin deformer is connected to a geometry use: KFbxGeometry::GetDeformerCount(KFbxDeformer::eSKIN). To get a handle to a skin deformer use: KFbxGeometry::GetDeformer(0, KFbxDeformer::eSKIN).

K_DEPRECATED int AddLink (KFbxLink *pLink)
 Add a link.
K_DEPRECATED void ClearLink ()
 Remove all links without destroying them.
K_DEPRECATED int GetLinkCount ()
 Get the number of links.
K_DEPRECATED KFbxLinkGetLink (int pIndex)
 Get link at given index.

Deformer Management

int AddDeformer (KFbxDeformer *pDeformer)
 Add a deformer.
int GetDeformerCount () const
 Get the number of deformers.
KFbxDeformerGetDeformer (int pIndex)
 Get deformer at given index.
KFbxDeformer const * GetDeformer (int pIndex) const
 Get deformer at given index.
int GetDeformerCount (KFbxDeformer::EDeformerType pType) const
 Get the number of deformers of a given type.
KFbxDeformerGetDeformer (int pIndex, KFbxDeformer::EDeformerType pType)
 Get deformer of a gieven type at given index.

Connected Geometry Weighted Map(s) Management

KFbxGeometryWeightedMapGetSourceGeometryWeightedMap ()
 Return the source geometry weighted map connected.
int GetDestinationGeometryWeightedMapCount ()
 Get the number of destination geometry weighted map(s) connected.
KFbxGeometryWeightedMapGetDestinationGeometryWeightedMap (int pIndex)
 Get destination geometry weighted map at a given index.

Shape Management

virtual int AddShape (KFbxShape *pShape, char const *pShapeName)
 Add a shape and its associated name.
virtual void ClearShape ()
 Removes all shapes without destroying them.
virtual int GetShapeCount () const
 Get the number of shapes.
virtual KFbxShapeGetShape (int pIndex)
 Get shape at given index.
virtual KFbxShape const * GetShape (int pIndex) const
 Get shape at given index.
virtual char const * GetShapeName (int pIndex) const
 Get shape name at given index.
virtual KFCurveGetShapeChannel (KFbxTakeNode *pTakeNode, int pShapeIndex)
 Get a shape channel.

Pivot Management

The geometry pivot is used to specify additional translation, rotation, and scaling applied to all the control points when the model is exported.

KFbxXMatrixGetPivot (KFbxXMatrix &pXMatrix) const
 Get pivot matrix.
void SetPivot (KFbxXMatrix &pXMatrix)
 Set pivot matrix.
void ApplyPivot ()
 Apply the pivot matrix to all vertices/normals of the geometry.

Default Animation Values

These functions provides direct access to default animation values specific to a geometry.

The default animation values are found in the default take node of the associated node. These functions only work if the geometry has been associated with a node.

void SetDefaultShape (int pIndex, double pPercent)
 Set default deformation for a given shape.
double GetDefaultShape (int pIndex)
 Get default deformation for a given shape.

Public Types

enum  ESurfaceMode
 Types of surfaces. More...

Public Member Functions

virtual EAttributeType GetAttributeType () const
 Return the type of node attribute.


Member Enumeration Documentation

Types of surfaces.

  • eRAW
  • eLOW_NO_NORMALS
  • eLOW
  • eHIGH_NO_NORMALS
  • eHIGH

Definition at line 283 of file kfbxgeometry.h.

enum EError

Error identifiers.

  • eINDEX_OUT_OF_RANGE
  • eNULL_PARAMETER
  • eMATERIAL_NOT_FOUND
  • eMATERIAL_ALREADY_ADDED
  • eTEXTURE_NOT_FOUND
  • eTEXTURE_ALREADY_ADDED
  • eSHAPE_ALREADY_ADDED
  • eSHAPE_INVALID_NAME
  • eSHAPE_NAME_CLASH
  • eSHAPE_NO_CURVE_FOUND
  • eUNKNOWN_ERROR

Reimplemented in KFbxNurbsCurve.

Definition at line 369 of file kfbxgeometry.h.


Member Function Documentation

virtual EAttributeType GetAttributeType (  )  const [inline, virtual]

Return the type of node attribute.

This class is pure virtual.

Reimplemented from KFbxLayerContainer.

Reimplemented in KFbxMesh, KFbxNurb, KFbxNurbsCurve, KFbxNurbsSurface, KFbxPatch, KFbxBoundary, and KFbxTrimNurbsSurface.

Definition at line 91 of file kfbxgeometry.h.

K_DEPRECATED int AddLink ( KFbxLink pLink  ) 

Add a link.

Parameters:
pLink Pointer to the link object to add.
Returns:
Index of added link.
Remarks:
This function has been deprecated. Use KFbxSkin::AddCluster() instead.

K_DEPRECATED void ClearLink (  ) 

Remove all links without destroying them.

If links aren't explicitly destroyed before calling this function, they will be destroyed along with the SDK manager.

Remarks:
This function has been deprecated. Use KFbxSkin::RemoveCluster() instead.

K_DEPRECATED int GetLinkCount (  ) 

Get the number of links.

Returns:
Number of links that have been added to this object.
Remarks:
This function has been deprecated. Use KFbxSkin::GetClusterCount() instead.

K_DEPRECATED KFbxLink* GetLink ( int  pIndex  ) 

Get link at given index.

Parameters:
pIndex Index of link.
Returns:
Pointer to link or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.
Remarks:
This function has been deprecated. Use KFbxSkin::GetCluster() instead.

int AddDeformer ( KFbxDeformer pDeformer  ) 

Add a deformer.

Parameters:
pDeformer Pointer to the deformer object to add.
Returns:
Index of added deformer.

int GetDeformerCount (  )  const

Get the number of deformers.

Returns:
Number of deformers that have been added to this object.

KFbxDeformer* GetDeformer ( int  pIndex  ) 

Get deformer at given index.

Parameters:
pIndex Index of deformer.
Returns:
Pointer to deformer or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

KFbxDeformer const* GetDeformer ( int  pIndex  )  const

Get deformer at given index.

Parameters:
pIndex Index of deformer.
Returns:
Pointer to deformer or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

int GetDeformerCount ( KFbxDeformer::EDeformerType  pType  )  const

Get the number of deformers of a given type.

Parameters:
pType Type of deformer to count
Returns:
Number of deformers that have been added to this object.

KFbxDeformer* GetDeformer ( int  pIndex,
KFbxDeformer::EDeformerType  pType 
)

Get deformer of a gieven type at given index.

Parameters:
pIndex Index of deformer.
pType Type of deformer.
Returns:
Pointer to deformer or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

KFbxGeometryWeightedMap* GetSourceGeometryWeightedMap (  ) 

Return the source geometry weighted map connected.

Returns:
Pointer to the source geometry weighted map connected to this object if any.

int GetDestinationGeometryWeightedMapCount (  ) 

Get the number of destination geometry weighted map(s) connected.

Returns:
Number of destination geometry weighted map(s) connected to this object.

KFbxGeometryWeightedMap* GetDestinationGeometryWeightedMap ( int  pIndex  ) 

Get destination geometry weighted map at a given index.

Parameters:
pIndex Index of link.
Returns:
Pointer to the destination geometry weighted map connected to this object if any.

virtual int AddShape ( KFbxShape pShape,
char const *  pShapeName 
) [virtual]

Add a shape and its associated name.

Parameters:
pShape Pointer to the shape object.
pShapeName Name given to the shape.
Returns:
Index of added shape, -1 if operation failed. If the operation fails, KFbxGeometry::GetLastErrorID() can return one of the following:
  • eNULL_PARAMETER: Pointer to shape is NULL.
  • eSHAPE_ALREADY_ADDED: Shape has already been added.
    • eSHAPE_INVALID_NAME: The provided name is empty.
    • eSHAPE_NAME_CLASH: The provided name is already used by another shape.
      Remarks:
      The provided name is stripped from surrounding whitespaces before being compared with other shape names. It is recommended not to prefix the shape name with its enclosing node name because MotionBuilder is known to strip this prefix and not save it back.

Reimplemented in KFbxTrimNurbsSurface.

virtual void ClearShape (  )  [virtual]

Removes all shapes without destroying them.

If shapes aren't explicitly destroyed before calling this function, they will be destroyed along with the SDK manager.

Reimplemented in KFbxTrimNurbsSurface.

virtual int GetShapeCount (  )  const [virtual]

Get the number of shapes.

Returns:
Number of shapes that have been added to this object.

Reimplemented in KFbxTrimNurbsSurface.

virtual KFbxShape* GetShape ( int  pIndex  )  [virtual]

Get shape at given index.

Parameters:
pIndex Index of shape.
Returns:
Pointer to shape or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

Reimplemented in KFbxTrimNurbsSurface.

virtual KFbxShape const* GetShape ( int  pIndex  )  const [virtual]

Get shape at given index.

Parameters:
pIndex Index of shape.
Returns:
Pointer to shape or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

Reimplemented in KFbxTrimNurbsSurface.

virtual char const* GetShapeName ( int  pIndex  )  const [virtual]

Get shape name at given index.

Parameters:
pIndex Index of shape.
Returns:
Shape name or NULL if pIndex is out of range. In this case, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

Reimplemented in KFbxTrimNurbsSurface.

virtual KFCurve* GetShapeChannel ( KFbxTakeNode pTakeNode,
int  pShapeIndex 
) [virtual]

Get a shape channel.

The shape channel property has a scale from 0 to 100, 100 meaning full shape deformation. The default value is 0.

Parameters:
pTakeNode Take node.
pShapeIndex Shape index.
Returns:
Animation curve or NULL if an error occured. In this case, KFbxGeometry::GetLastErrorID() returns one of the following:
  • eINDEX_OUT_OF_RANGE: Shape index is out of range.
  • eNULL_PARAMETER: Pointer to take node is NULL.
  • eSHAPE_NO_CURVE_FOUND: Shape curve could not be found.

Reimplemented in KFbxTrimNurbsSurface.

KFbxXMatrix& GetPivot ( KFbxXMatrix pXMatrix  )  const

Get pivot matrix.

Parameters:
pXMatrix Placeholder for the returned matrix.
Returns:
Reference to the passed argument.

void SetPivot ( KFbxXMatrix pXMatrix  ) 

Set pivot matrix.

Parameters:
pXMatrix The Transformation matrix.

void ApplyPivot (  ) 

Apply the pivot matrix to all vertices/normals of the geometry.

void SetDefaultShape ( int  pIndex,
double  pPercent 
)

Set default deformation for a given shape.

The default shape property has a scale from 0 to 100, 100 meaning full shape deformation. The default value is 0.

Parameters:
pIndex Shape index.
pPercent Deformation percentage on a scale ranging from 0 to 100.
Remarks:
This function has no effect if pIndex is out of range.

double GetDefaultShape ( int  pIndex  ) 

Get default deformation for a given shape.

The default shape property has a scale from 0 to 100, 100 meaning full shape deformation. The default value is 0.

Parameters:
pShapeName Shape name.
Returns:
The deformation value for the given shape, or 0 if pIndex is out of range.

KError& GetError (  ) 

Retrieve error object.

Returns:
Reference to error object.

EError GetLastErrorID (  ) 

Get last error code.

Returns:
Last error code.

char* GetLastErrorString (  ) 

Get last error string.

Returns:
Textual description of the last error.