KFbxGeometry Class Reference

#include <kfbxgeometry.h>
Inheritance diagram for KFbxGeometry:
Inheritance graph
[legend]

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 74 of file kfbxgeometry.h.


Error Management

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

Deformer Management

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

Connected Geometry Weighted Map(s) Management

KFbxGeometryWeightedMap GetSourceGeometryWeightedMap ()
  Return the source geometry weighted map connected.
int  GetDestinationGeometryWeightedMapCount ()
  Get the number of destination geometry weighted map(s) connected.
KFbxGeometryWeightedMap GetDestinationGeometryWeightedMap (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 KFbxShape GetShape (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 KFCurve GetShapeChannel (char const *pShapeName, bool pCreateAsNeeded=false, char const *pTakeName=NULL)
  Get a shape channel.
virtual KFCurve GetShapeChannel (int pIndex, bool pCreateAsNeeded=false, char const *pTakeName=NULL)
  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.

KFbxXMatrix GetPivot (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.

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.
void  SetDefaultShape (char const *pShapeName, double pPercent)
  Set default deformation for a given shape.
double  GetDefaultShape (int pIndex)
  Get default deformation for a given shape.
double  GetDefaultShape (char const *pShapeName)
  Get default deformation for a given shape.

Public Types

enum   ESurfaceMode
  Surface modes This information is only used in nurbs and patches. More...

Public Member Functions

virtual EAttributeType  GetAttributeType () const
  Return the type of node attribute.
virtual KFbxObject Clone (KFbxObject *pContainer, KFbxObject::ECloneType pCloneType) const
  Creates a clone of this object.

Member Enumeration Documentation

Surface modes This information is only used in nurbs and patches.

Types of surfaces.

  • eRAW
  • eLOW_NO_NORMALS
  • eLOW
  • eHIGH_NO_NORMALS
  • eHIGH

Definition at line 237 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 337 of file kfbxgeometry.h.


Member Function Documentation

virtual EAttributeType GetAttributeType (  )  const [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.

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  )  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  
) const

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 ( char const *  pShapeName,
bool  pCreateAsNeeded = false,
char const *  pTakeName = NULL  
) [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:
pShapeName  Shape Property name.
pCreateAsNeeded  If true, the fcurve is created if not already present.
pTakeName  Take from which we want the FCurve (if NULL, use the current take).
Returns:
Animation curve or NULL if an error occurred. In this case, KFbxGeometry::GetLastErrorID() returns one of the following:
  • eINDEX_OUT_OF_RANGE: Shape index is out of range.
  • eSHAPE_NO_CURVE_FOUND: Shape curve could not be found.

virtual KFCurve* GetShapeChannel ( int  pIndex,
bool  pCreateAsNeeded = false,
char const *  pTakeName = NULL  
) [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:
pIndex  Shape index.
pCreateAsNeeded  If true, the fcurve is created if not already present.
pTakeName  Take from which we want the FCurve (if NULL, use the current take).
Returns:
Animation curve or NULL if an error occurred. In this case, KFbxGeometry::GetLastErrorID() returns one of the following:
  • eINDEX_OUT_OF_RANGE: Shape index is out of range.
  • 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.

void SetDefaultShape ( char const *  pShapeName,
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:
pShapeName  Shape name.
pPercent  Deformation percentage on a scale ranging from 0 to 100.
Remarks:
This function has no effect if pShapeName is invalid.

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:
pIndex  Shape index.
Returns:
The deformation value for the given shape, or 0 if pIndex is out of range.

double GetDefaultShape ( char const *  pShapeName  ) 

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 pShapeName is invalid.

KError& GetError (  ) 

Retrieve error object.

Returns:
Reference to error object.

EError GetLastErrorID (  )  const

Get last error code.

Returns:
Last error code.

const char* GetLastErrorString (  )  const

Get last error string.

Returns:
Textual description of the last error.

virtual KFbxObject* Clone ( KFbxObject pContainer,
KFbxObject::ECloneType  pCloneType  
) const [virtual]

Creates a clone of this object.

Parameters:
pContainer  The object, typically a document or a scene, that contains the new clone(can be NULL).
pCloneType  The type of clone to be created.
Returns:
The new clone, or NULL (if the specified clone type is not supported).

Reimplemented from KFbxNodeAttribute.

Reimplemented in KFbxNurbsCurve, and KFbxProceduralGeometry.

KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry
KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry