1 #ifndef __FBGEOMETRY_H__
2 #define __FBGEOMETRY_H__
43 #include <kaydaradef.h>
48 #define FBSDK_DLL K_DLLIMPORT
54 #ifdef FBSDKUseNamespace
55 namespace FBSDKNamespace {
61 enum FBGeometryPrimitiveType
63 kFBGeometry_POINTS = 0x0000,
64 kFBGeometry_LINES = 0x0001,
65 kFBGeometry_LINE_LOOP = 0x0002,
66 kFBGeometry_LINE_STRIP = 0x0003,
67 kFBGeometry_TRIANGLES = 0x0004,
68 kFBGeometry_TRIANGLE_STRIP = 0x0005,
69 kFBGeometry_TRIANGLE_FAN = 0x0006,
70 kFBGeometry_QUADS = 0x0007,
71 kFBGeometry_QUADS_STRIP = 0x0008,
72 kFBGeometry_POLYGON = 0x0009,
87 kFBGeometryArrayElementType_Unknown,
88 kFBGeometryArrayElementType_Integer,
89 kFBGeometryArrayElementType_Float,
90 kFBGeometryArrayElementType_Float2,
93 kFBGeometryArrayElementType_FloatMatrix4x4,
94 kFBGeometryArrayElementType_IntegerArrayPointer
115 kFBGeometryMapping_NONE,
116 kFBGeometryMapping_BY_CONTROL_POINT,
117 kFBGeometryMapping_BY_POLYGON_VERTEX,
118 kFBGeometryMapping_BY_POLYGON,
119 kFBGeometryMapping_BY_EDGE,
120 kFBGeometryMapping_ALL_SAME
136 kFBGeometryReference_DIRECT,
137 kFBGeometryReference_INDEX,
138 kFBGeometryReference_INDEX_TO_DIRECT
213 void VertexInit (
int pSize,
bool pResize,
bool pInitUV =
true,
bool pInitVertexColor =
false);
261 int VertexAdd (
double px,
double py,
double pz,
double nx,
double ny,
double nz);
262 int VertexAdd (
double px,
double py,
double pz,
double nx,
double ny,
double nz,
double UVu,
double UVv);
263 int VertexAdd (
double px,
double py,
double pz,
double nx,
double ny,
double nz,
double UVu,
double UVv,
double pRed,
double pGreen,
double pBlue,
double pAlpha);
279 bool VertexSet (
double px,
double py,
double pz,
int pIndex=-1);
328 bool VertexColorSet(
float pRed,
float pGreen,
float pBlue,
float pAlpha,
int pIndex=-1);
389 bool VertexArrayInit (
int pVertexcount,
bool pUniqueMaterial,
unsigned int pFBGeometryArrayIDs = 0);
580 void ShapeInit(
int pShapeIdx,
int pDiffSize,
bool pWithNormal =
false);
652 FBMesh(
const char* pName, HIObject pObject=NULL);
683 bool PolygonListAdd(
int pPolygonSize,
int pIndexArraySize,
int* pIndexArray,
int pMaterialId=0);
793 virtual void SurfaceBegin();
794 virtual void SurfaceEnd();
795 virtual void SurfaceEditBegin();
796 virtual void SurfaceEditEnd();
797 virtual bool GetSurfaceCapped(
int pUorV,
int pDirection );
798 virtual int GetVertexCount(
int pUorVorGlobal = -1 );
799 virtual void ControlPointsBegin() = 0;
800 virtual void SetControlPoint(
int pIndex,
double pX,
double pY,
double pZ,
double pW );
801 virtual void GetControlPoint(
int pIndex,
double &pX,
double &pY,
double &pZ,
double &pW );
802 virtual void ControlPointsEnd();
850 void FBSurfaceInitProperties();
878 FBNurbs(
const char* pName, HIObject pObject=NULL);
944 void FBNurbsInitProperties();
962 FBPatch(
const char* pName, HIObject pObject=NULL);
992 void FBPatchInitProperties();
996 #ifdef FBSDKUseNamespace
MotionBuilder SDK base class.
bool GeometryEnd()
End geometry editing.
bool VertexGetSelected(int pIndex)
Get the selected state of a vertex.
bool GeometryBegin()
Begin geometry editing.
FBVertex * GetPositionsArray(int &pOutArrayCount) const
Get a pointer to the position array.
FBPropertyGeometryReferenceMode BinormalReferenceMode
Read Only Property: Binormal reference mode.
bool VertexSet(double px, double py, double pz, int pIndex=-1)
Set a vertex.
FBNormal * GetTangentsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of tangents.
FBPropertyGeometryMappingMode BinormalMappingMode
Read Only Property: Binormal mapping mode.
int * GetVertexColorsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of vertex color.
int VertexAdd(double px, double py, double pz, double nx, double ny, double nz)
Begin geometry editing.
FBPropertyGeometryMappingMode NormalMappingMode
Read Only Property: Normal mapping mode.
bool VertexSet(FBVertex pVertex, int pIndex=-1)
Set a vertex.
bool VertexColorSet(FBColorF pColor, int pIndex=-1)
Set a Vertex Color.
FBPropertyGeometryMappingMode TangentMappingMode
Read Only Property: Tangent mapping mode.
bool VertexNormalSet(FBNormal pVertex, int pIndex=-1)
Set a normal at a vertex.
int VertexAdd(FBVertex pVertex, FBNormal pNormal)
Add a vertex.
int ShapeGetDiffPointCount(int pShapeIdx) const
Return the shape's total diff points count.
void ShapeInit(int pShapeIdx, int pDiffSize, bool pWithNormal=false)
Init the shape.
int VertexAdd(FBVertex pVertex)
Add a vertex.
int ShapeAdd(const char *pName)
Add new shape.
bool VertexSetSelected(int pIndex, bool pState)
Set the selected state of a vertex.
int ShapeGetCount() const
Get Shape Count.
FBPropertyGeometryReferenceMode TangentReferenceMode
Read Only Property: Tangent reference mode.
void VertexInit(int pSize, bool pResize, bool pInitUV=true, bool pInitVertexColor=false)
Resize or Reserve vertex, normal and UV array for performance.
const char * ShapeGetName(int pShapeIdx) const
Return the shape Name.
int * GetTangentsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of tangents.
FBColorF * GetVertexColorsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of vertex color.
bool VertexClear()
Clear all Vertex arrays.
void ModifyNotify(kFBGeometryUpdateFlags pFlags=kFBGeometryUpdateAll, int pFirstIndex=-1, int pLastIndex=-1)
The geometry has change, update the necessary flags.
int * GetBinormalsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of binormals.
FBNormal * GetBinormalsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of binormals.
bool ShapeSetDiffPoint(int pShapeIdx, int pDiffIndex, int pOriIndex, const FBVertex &pPosDiff)
Set the differentiate point.
int VertexAdd(double px, double py, double pz, double nx, double ny, double nz, double UVu, double UVv)
Begin geometry editing.
bool VertexArrayInit(int pVertexcount, bool pUniqueMaterial, unsigned int pFBGeometryArrayIDs=0)
Init geometry vertex arrays.
bool VertexGetVisible(int pIndex)
Get the visible state of a vertex.
FBPropertyGeometryMappingMode MaterialMappingMode
Read Property: Material mapping mode.
FBGeometryMappingMode GetUVSetMappingMode(const char *pUVSetName=NULL) const
Get UVSet mapping mode.
FBGeometryReferenceMode GetUVSetReferenceMode(const char *pUVSetName=NULL) const
Get UVSet reference mode.
int VertexAdd(double px, double py, double pz)
Add a vertex.
bool VertexSetVisible(int pIndex, bool pState)
Set the visible state of a vertex.
bool ShapeGetDiffPoint(int pShapeIdx, int pDiffIndex, int &pOriIndex, FBVertex &pPosDiff) const
Get the differentiate point.
bool VertexGetTransformable(int pIndex)
Get the Transformable state of a vertex.
bool VertexUVSet(FBUV pUV, int pIndex=-1)
Set a UV coordinate.
FBUV * GetUVSetDirectArray(int &pOutArrayCount, const char *pUVSetName=NULL) const
Get a pointer to the direct array of UVset Modify array value will be only effective when geometry ed...
int * GetNormalsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of normals.
bool IsEditingEnabled() const
Is geometry editing enabled.
int VertexAdd(FBVertex pVertex, FBNormal pNormal, FBUV pUV, FBColorF pVertexColor)
Add a vertex.
bool ShapeGetDiffPoint(int pShapeIdx, int pDiffIndex, int &pOriIndex, FBVertex &pPosDiff, FBNormal &pNormalDiff) const
Get the differentiate point.
FBGeometry(const char *pName, HIObject pObject=NULL)
Constructor.
FBColorF VertexColorGet(int pIndex=-1) const
Get a Vertex Color.
bool VertexArrayClear()
Clear all geometry vertex arrays.
int * GetUVSetIndexArray(int &pOutArrayCount, const char *pUVSetName=NULL) const
Get a pointer to the index array of UVset.
void ShapeClearAll()
Clears all the shapes.
FBUV VertexUVGet(int pIndex=-1) const
Get a UV coordinate.
bool VertexNormalSet(double px, double py, double pz, int pIndex=-1)
Set a normal at a vertex.
FBPropertyGeometryReferenceMode VertexColorReferenceMode
Read Only Property: Vertex Color reference mode.
int * GetMaterialIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of Material.
int VertexAdd(double px, double py, double pz, double nx, double ny, double nz, double UVu, double UVv, double pRed, double pGreen, double pBlue, double pAlpha)
Begin geometry editing.
FBPropertyGeometryReferenceMode NormalReferenceMode
Read Only Property: Normal reference mode.
bool VertexColorSet(float pRed, float pGreen, float pBlue, float pAlpha, int pIndex=-1)
Set a UV coordinate.
int VertexCount() const
Get the number of vertices in the geometry.
FBNormal * GetNormalsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of normals.
FBStringList GetUVSets() const
Get available UVSet name.
FBPropertyGeometryMappingMode VertexColorMappingMode
Read Only Property: Vertex Color mapping mode.
FBVertex * GetVertexes() const
Get a pointer to the array of vertexes.
bool VertexUVSet(float pU, float pV, int pIndex=-1)
Set a UV coordinate.
FBNormal VertexNormalGet(int pIndex=-1) const
Get a normal at a vertex.
int VertexAdd(FBVertex pVertex, FBNormal pNormal, FBUV pUV)
Add a vertex.
bool ShapeSetDiffPoint(int pShapeIdx, int pDiffIndex, int pOriIndex, const FBVertex &pPosDiff, const FBNormal &pNormalDiff)
Set the differentiate point.
FBVertex VertexGet(int pIndex) const
Get a vertex.
bool TriangleStripAdd(int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
Add Triangle Strip Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's ...
int PolygonVertexCount(int pPolygonIndex) const
Get Polygon vertex count.
int PolygonCount() const
Get number of polygons in mesh.
bool PolygonVertexAdd(int pVertex)
Add a vertex.
int PolygonVertexIndex(int pPolygonIndex, int pVertexPolygonIndex) const
Get global (for the mesh) index of a vertex from a polygon.
bool TriangleListAdd(int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
Add Triangle List, Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's ...
void ComputeVertexNormals(bool pCW=false)
Compute Mesh Vertex Normal.
int PolygonEnd()
End Polygon definition.
const int * PolygonVertexArrayGet(int &pArraySize) const
Get the array of polygon vertex (i.e.
FBMesh(const char *pName, HIObject pObject=NULL)
Constructor.
bool PolygonListAdd(int pPolygonSize, int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
Add Polygon List Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's re...
bool IsTriangleMesh() const
Determines if the mesh is composed entirely of triangles.
int PolygonBegin(int pMaterialId=0)
Begin Polygon definition.
void InverseNormal()
Inverse Normal.
int PolygonMaterialIdGet(int pIndex=-1) const
Get a Material ID for the given Polygon index.
virtual void SetControlWeight(int pIndex, double pWeight)
Set weight of control point.
virtual int GetKnotCount(int pUorV)
Number of knot vectors.
FBPropertyInt UOrder
Read Write Property: Nurbs U order.
virtual void SurfaceEnd() override
End NURBS definition.
virtual void SurfaceEditEnd() override
End NURBS surface edition.
FBNurbs(const char *pName, HIObject pObject=NULL)
Constructor.
virtual void SurfaceBegin() override
Begin NURBS definition.
virtual void SetControlMultiplicity(int pUorV, int pIndex, int pMultiplicity)
Set multiplicity (number of "instances") of control point.
virtual void SurfaceEditBegin() override
Begin NURBS surface edition.
virtual double GetControlWeight(int pIndex)
Get weight of control point.
FBPropertyNurbType VNurbType
Read Write Property: Nurbs Type for V direction.
virtual void ControlPointsEnd() override
End NURBS control points edition.
virtual double GetControlKnotValue(int pUorV, int pIndex)
Get knot vector value of control point.
virtual void SetControlKnotValue(int pUorV, int pIndex, double pKnotValue)
Set knot vector value of control point.
FBPropertyInt VOrder
Read Write Property: Nurbs V order.
FBPropertyNurbType UNurbType
Read Write Property: Nurbs Type for U direction.
virtual int GetControlMultiplicity(int pUorV, int pIndex)
Get multiplicity (number of "instances") of control point.
virtual void ControlPointsBegin() override
Begin NURBS control points edition.
FBPatch(const char *pName, HIObject pObject=NULL)
Constructor.
virtual void SurfaceEnd() override
End Patch definition.
virtual void SurfaceEditEnd() override
End patch surface edit.
virtual void SurfaceBegin() override
Begin Patch definition.
FBPropertySurfaceType USurfaceType
Read Write Property: Patch mode for U direction.
virtual void SurfaceEditBegin() override
Begin patch surface edit.
virtual void ControlPointsEnd() override
End control points edition.
FBPropertySurfaceType VSurfaceType
Read Write Property: Patch mode for V direction.
virtual void ControlPointsBegin() override
Begin control points edition.
FBSurface(const char *pName, HIObject pObject=NULL)
Constructor.
bool VertexGetTransformable(int pU, int pV)
Get the Transformable state of a vertex.
FBPropertyBool UClosed
Read Write Property: U Closed.
FBPropertyInt UStep
Read Write Property: Step in U directions.
FBPropertyInt VSize
Read Write Property: Size in V directions.
FBPropertyInt USize
Read Write Property: Size in U directions.
FBPropertyBool VClosed
Read Write Property: V Closed
bool VertexGetVisible(int pU, int pV)
Get the visible state of a vertex.
bool VertexSetSelected(int pU, int pV, bool pState)
Set the selected state of a vertex.
FBPropertyInt VStep
Read Write Property: Step in V directions.
FBPropertySurfaceMode SurfaceMode
Read Write Property: Surface mode.
bool VertexGetSelected(int pU, int pV)
Get the selected state of a vertex.
bool VertexSetVisible(int pU, int pV, bool pState)
Set the visible state of a vertex.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Contains definitions for devices, boxes and models.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBGeometryArrayID
ID to use when requesting a specific array of data for a model.
@ kFBGeometryArrayID_Point
ID to the Point array.
@ kFBGeometryArrayID_Normal
ID to the Normal by Point array.
@ kFBGeometryArrayID_Tangent
ID to the Tangent array.
@ kFBGeometryArrayID_Color
ID to the Vertex Color Array.
@ kFBGeometryArrayID_Binormal
ID to the Binormal array.
@ kFBNurbTypePeriodic
Periodic Type Nurb.
@ kFBNurbTypeOpen
Open Type Nurb.
@ kFBNurbTypeClosed
Closed Type Nurb.
FBSurfaceType
Surface types.
@ kFBSurfaceTypeCardinal
Cardinal surface.
@ kFBSurfaceTypeBezierQuadric
Bezier Quadric surface.
@ kFBSurfaceTypeLinear
Linear surface.
@ kFBSurfaceTypeBspline
BSpline surface.
@ kFBSurfaceTypeBezier
Bezier surface.
FBSurfaceMode
Surface modes.
@ kFBSurfaceModeHigh
High quality.
@ kFBSurfaceModeHighNoNormals
High quality, no normals.
@ kFBSurfaceModeRaw
Raw data.
@ kFBSurfaceModeLowNoNormals
Low quality, no normals.
@ kFBSurfaceModeLow
Low quality.
FBGeometryMappingMode
Determine how the element is mapped on a surface.
FBGeometryArrayElementType
Type of data when requesting an array.
@ kFBGeometryArrayElementType_Float3
Each element is an array of 3 float.
@ kFBGeometryArrayElementType_Float4
Each element is an array of 4 float.
FBGeometryReferenceMode
Determine how the mapping information is stored in the array of coordinate.
@ kFBGeometryUpdatePositionAndNormal
only control point's position & normal change, so only update those values in the strip.
@ kFBGeometryUpdateNone
no update done
@ kFBGeometryUpdateSkinWeight
update skin weight
@ kFBGeometryUpdateMappingMode
mapping mode request from associated shading network change.
@ kFBGeometryUpdateAll
control point add/remove, topology change, cluster/shape change and such events requiring regenerate ...
@ kFBGeometryUpdateInverseNormal
inverse normal request.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
class K_DLLIMPORT FBVector4< float > FBVertex
Vertex.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
class K_DLLIMPORT FBVector4< float > FBColorF
Color float.
class K_DLLIMPORT FBVector2< float > FBUV
Represents a UV coordinate as a FBVector2 of floats in the range of 0.0f to 1.0f; value 0 is the U va...
class K_DLLIMPORT FBVector4< float > FBNormal
Normal.