Python Reference Guide
 
Loading...
Searching...
No Matches
FBMesh Class Reference

Mesh class. More...

#include <pyfbsdk_generated.h>

Inheritance diagram for FBMesh:

Public Member Functions

 FBMesh (str pName)
 Constructor.
 
 ComputeVertexNormals (bool pCW=False)
 Compute Mesh Vertex Normal.
 
 InverseNormal ()
 Inverse Normal.
 
bool IsTriangleMesh ()
 Determines if the mesh is composed entirely of triangles.
 
int PolygonBegin (int pMaterialId=0)
 Begin Polygon definition.
 
int PolygonCount ()
 Get number of polygons in mesh.
 
int PolygonEnd ()
 End Polygon definition.
 
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 responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.
 
int PolygonMaterialIdGet (int pIndex=-1)
 Get a Material ID for the given Polygon index.
 
bool PolygonVertexAdd (int pVertex)
 Add a vertex.
 
list PolygonVertexArrayGet (int pArraySize)
 Get the array of polygon vertex (i.e.
 
int PolygonVertexCount (int pPolygonIndex)
 Get Polygon vertex count.
 
int PolygonVertexIndex (int pPolygonIndex, int pVertexPolygonIndex)
 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 responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.
 
bool TriangleStripAdd (int pIndexArraySize, int pIndexArray, int pMaterialId=0)
 Add Triangle Strip Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.
 
- Public Member Functions inherited from FBGeometry
bool GeometryBegin ()
 Begin geometry editing.
 
bool GeometryEnd ()
 End geometry editing.
 
FBNormal GetBinormalsDirectArray (int pOutArrayCount)
 Get a pointer to the direct array of binormals.
 
int GetBinormalsIndexArray (int pOutArrayCount)
 Get a pointer to the index array of binormals.
 
int GetMaterialIndexArray (int pOutArrayCount)
 Get a pointer to the index array of Material.
 
FBNormal GetNormalsDirectArray (int pOutArrayCount)
 Get a pointer to the direct array of normals.
 
int GetNormalsIndexArray (int pOutArrayCount)
 Get a pointer to the index array of normals.
 
FBVertex GetPositionsArray (int pOutArrayCount)
 Get a pointer to the position array.
 
FBNormal GetTangentsDirectArray (int pOutArrayCount)
 Get a pointer to the direct array of tangents.
 
int GetTangentsIndexArray (int pOutArrayCount)
 Get a pointer to the index array of tangents.
 
FBUV GetUVSetDirectArray (int pOutArrayCount, str pUVSetName=None)
 Get a pointer to the direct array of UVset Modify array value will be only effective when geometry editing is enabled.
 
int GetUVSetIndexArray (int pOutArrayCount, str pUVSetName=None)
 Get a pointer to the index array of UVset.
 
FBGeometryMappingMode GetUVSetMappingMode (str pUVSetName=None)
 Get UVSet mapping mode.
 
FBGeometryReferenceMode GetUVSetReferenceMode (str pUVSetName=None)
 Get UVSet reference mode.
 
FBStringList GetUVSets ()
 Get available UVSet name.
 
FBColorF GetVertexColorsDirectArray (int pOutArrayCount)
 Get a pointer to the direct array of vertex color.
 
int GetVertexColorsIndexArray (int pOutArrayCount)
 Get a pointer to the index array of vertex color.
 
int ShapeAdd (str pName)
 Add new shape.
 
 ShapeClearAll ()
 Clears all the shapes.
 
int ShapeGetCount ()
 Get Shape Count.
 
str ShapeGetName (int pShapeIdx)
 Return the shape Name.
 
 ShapeInit (int pShapeIdx, int pDiffSize, bool pWithNormal=False)
 Init the shape.
 
bool ShapeSetDiffPoint (int pShapeIdx, int pDiffIndex, int pOriIndex, FBVertex pPosDiff)
 Set the differentiate point.
 
bool ShapeSetDiffPoint (int pShapeIdx, int pDiffIndex, int pOriIndex, FBVertex pPosDiff, FBNormal pNormalDiff)
 Set the differentiate point.
 
int VertexAdd (FBVertex pVertex)
 Add a vertex.
 
int VertexAdd (FBVertex pVertex, FBNormal pNormal)
 Add a vertex.
 
int VertexAdd (FBVertex pVertex, FBNormal pNormal, FBUV pUV)
 Add a vertex.
 
int VertexAdd (FBVertex pVertex, FBNormal pNormal, FBUV pUV, FBColorF pVertexColor)
 Add a vertex.
 
int VertexAdd (float px, float py, float pz)
 Add a vertex.
 
int VertexAdd (float px, float py, float pz, float nx, float ny, float nz)
 Begin geometry editing.
 
int VertexAdd (float px, float py, float pz, float nx, float ny, float nz, float UVu, float UVv)
 Begin geometry editing.
 
int VertexAdd (float px, float py, float pz, float nx, float ny, float nz, float UVu, float UVv, float pRed, float pGreen, float pBlue, float pAlpha)
 Begin geometry editing.
 
bool VertexArrayClear ()
 Clear all geometry vertex arrays.
 
bool VertexArrayInit (int pVertexcount, bool pUniqueMaterial, unsigned int pFBGeometryArrayIDs=0)
 Init geometry vertex arrays.
 
bool VertexClear ()
 Clear all Vertex arrays.
 
FBColorF VertexColorGet (int pIndex=-1)
 Get a Vertex Color.
 
bool VertexColorSet (FBColorF pColor, int pIndex=-1)
 Set a Vertex Color.
 
bool VertexColorSet (float pRed, float pGreen, float pBlue, float pAlpha, int pIndex=-1)
 Set a UV coordinate.
 
int VertexCount ()
 Get the number of vertices in the geometry.
 
FBVertex VertexGet (int pIndex)
 Get a vertex.
 
bool VertexGetSelected (int pIndex)
 Get the selected state of a vertex.
 
bool VertexGetTransformable (int pIndex)
 Get the Transformable state of a vertex.
 
bool VertexGetVisible (int pIndex)
 Get the visible state of a vertex.
 
 VertexInit (int pSize, bool pResize, bool pInitUV=True, bool pInitVertexColor=False)
 Resize or Reserve vertex, normal and UV array for performance.
 
FBNormal VertexNormalGet (int pIndex=-1)
 Get a normal at a vertex.
 
bool VertexNormalSet (FBNormal pVertex, int pIndex=-1)
 Set a normal at a vertex.
 
bool VertexNormalSet (float px, float py, float pz, int pIndex=-1)
 Set a normal at a vertex.
 
bool VertexSet (FBVertex pVertex, int pIndex=-1)
 Set a vertex.
 
bool VertexSet (float px, float py, float pz, int pIndex=-1)
 Set a vertex.
 
bool VertexSetSelected (int pIndex, bool pState)
 Set the selected state of a vertex.
 
bool VertexSetVisible (int pIndex, bool pState)
 Set the visible state of a vertex.
 
FBUV VertexUVGet (int pIndex=-1)
 Get a UV coordinate.
 
bool VertexUVSet (FBUV pUV, int pIndex=-1)
 Set a UV coordinate.
 
bool VertexUVSet (float pU, float pV, int pIndex=-1)
 Set a UV coordinate.
 
- Public Member Functions inherited from FBComponent
 FBComponent ()
 Constructor.
 
str ClassName ()
 Get the class name.
 
 DisableObjectFlags (FBObjectFlag pFlags)
 Disable a specific Object Flags.
 
 EnableObjectFlags (FBObjectFlag pFlags)
 Enable a specific Object Flags.
 
bool FBCreate ()
 Open Reality Creation function.
 
 FBDelete ()
 Open Reality deletion function.
 
 FBDestroy ()
 Open Reality destruction function.
 
FBObjectFlag GetObjectFlags ()
 Get all Object Flags (concatenated).
 
bool GetObjectStatus (FBObjectStatus pStatus)
 Check to see if an object status is enabled.
 
FBFileReference GetOwnerFileReference (p0)
 Get the owner FileReference object.
 
 HardSelect ()
 HardSelect.
 
bool HasObjectFlags (FBObjectFlag pFlags)
 Check whether a specific object flag is enabled.
 
bool Is (int pTypeId)
 Returns true if object is of type TypeId.
 
bool ProcessNamespaceHierarchy (FBNamespaceAction pNamespaceAction, str pNamespaceName, str pReplaceTo=None, bool pAddRight=True)
 ProcessNamespaceHierarchy.
 
bool ProcessObjectNamespace (FBNamespaceAction pNamespaceAction, str pNamespaceName, str pReplaceTo=None, bool pAddRight=True)
 ProcessObjectNamespace.
 
int PropertyAdd (FBProperty pProperty)
 Add a property to the component's property manager.
 
bool PropertyAddReferenceProperty (FBProperty pReferenceProperty)
 Add a reference property to the component's property manager.
 
FBProperty PropertyCreate (str pName, FBType pType, str pDataType, bool pAnimatable, bool pIsUser=False, FBProperty pReferenceSource=None)
 Create user or dynamic property.
 
 PropertyGetModifiedList (FBArrayTemplate< FB > pPropList, FBPlugModificationFlag pModificationFlags)
 Get list of properties which have been modified since last loading.
 
 PropertyRemove (FBProperty pProperty)
 Remove a Property from the component's Property manager.
 
 SetObjectFlags (FBObjectFlag pFlags)
 SetObjectFlags.
 
 SetObjectStatus (FBObjectStatus pStatus, bool pValue)
 Enable/Disable a specific Object Status.
 

Additional Inherited Members

- Public Attributes inherited from FBGeometry
FBGeometryMappingMode BinormalMappingMode
 Read Only Property: Binormal mapping mode.

 
FBGeometryReferenceMode BinormalReferenceMode
 Read Only Property: Binormal reference mode.

 
FBGeometryMappingMode MaterialMappingMode
 Read Property: Material mapping mode.

 
FBGeometryMappingMode NormalMappingMode
 Read Only Property: Normal mapping mode.

 
FBGeometryReferenceMode NormalReferenceMode
 Read Only Property: Normal reference mode.

 
FBGeometryMappingMode TangentMappingMode
 Read Only Property: Tangent mapping mode.

 
FBGeometryReferenceMode TangentReferenceMode
 Read Only Property: Tangent reference mode.

 
FBGeometryMappingMode VertexColorMappingMode
 Read Only Property: Vertex Color mapping mode.

 
FBGeometryReferenceMode VertexColorReferenceMode
 Read Only Property: Vertex Color reference mode.

 
- Public Attributes inherited from FBComponent
FBListComponent Components
 List: List of components.

 
str LongName
 Read Write Property: Name and namespace for object.

 
str Name
 Read Write Property: Unique name of object. See sample: RemoveSuffixFromNameOfSceneElements.py.
 
FBListComponent Parents
 List: Parents.

 
FBManager PropertyList
 Read Only Property: Manages all of the properties for the component.

 
bool Selected
 Read Write Property: Selected property.

 
int TypeInfo
 Contains the Type information of the object.

 
- Public Attributes inherited from FBPlug
str ClassGroupName
 ClassGroupName of the object.

 
int TypeInfo
 TypeInfo.

 

Detailed Description

Constructor & Destructor Documentation

◆ FBMesh()

FBMesh ( str  pName)

Constructor.

Parameters
pNameName of Mesh.

Member Function Documentation

◆ ComputeVertexNormals()

ComputeVertexNormals ( bool  pCW = False)

Compute Mesh Vertex Normal.

Parameters
pCWTrue for clock wise normal, otherwise for counter-clock wise

◆ InverseNormal()

InverseNormal ( )

Inverse Normal.

◆ IsTriangleMesh()

bool IsTriangleMesh ( )

Determines if the mesh is composed entirely of triangles.

Returns
true if all polygons are triangles, false otherwise

◆ PolygonBegin()

int PolygonBegin ( int  pMaterialId = 0)

Begin Polygon definition.

Parameters
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Returns
Number of existing polygons in Mesh

◆ PolygonCount()

int PolygonCount ( )

Get number of polygons in mesh.

Returns
Number of polygons in mesh.

◆ PolygonEnd()

int PolygonEnd ( )

End Polygon definition.

Clean up and associate vertices internally.

Returns
Current number of polygons.
Note
MoBu expect each polygon to contain at least 3 vertices, the behavior is undefined if user add less than 3 vertices polygon.

◆ PolygonListAdd()

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 responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.

Parameters
pPolygonSizeSize of polygon, 3 mean triangle, 4 for quadrilateral, and so on. minimum input value is 3.
pIndexArraySizeSize of pIndexArray, Added polygon count is floor(max(pIndexArraySize, 0) / pPolygonSize)
pIndexArrayIndex array of triangle strip.
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Note
The indexes' value in input pIndexArray won't be validated, and the behavior is undefined if out of range.

◆ PolygonMaterialIdGet()

int PolygonMaterialIdGet ( int  pIndex = -1)

Get a Material ID for the given Polygon index.

Parameters
pIndexPolygon's index to get material ID at (default=-1).
Returns
ID of material of vertex at pIndex.

◆ PolygonVertexAdd()

bool PolygonVertexAdd ( int  pVertex)

Add a vertex.

Parameters
pVertexIndex in mesh of vertex to add to polygon, must be in range of [0, ControlPointCount)
Returns
true if successful.

◆ PolygonVertexArrayGet()

list PolygonVertexArrayGet ( int  pArraySize)

Get the array of polygon vertex (i.e.

index to control points). This array is a concatenation of the list of polygon vertices of all the polygons. Example: a mesh made of 2 triangles [1,2,3] and [2,3,4] results in [1,2,3,2,3,4]. The first polygon starts at position 0 and the second at position 3.

Parameters
pArraySizePolygon vertex array size.
Returns
Readonly polygon vertex array.

◆ PolygonVertexCount()

int PolygonVertexCount ( int  pPolygonIndex)

Get Polygon vertex count.

Parameters
pPolygonIndexIndex of polygon to get vertex count from.
Returns
Number of vertices in polygon at pPolygonIndex.

◆ PolygonVertexIndex()

int PolygonVertexIndex ( int  pPolygonIndex,
int  pVertexPolygonIndex 
)

Get global (for the mesh) index of a vertex from a polygon.

Parameters
pPolygonIndexIndex of polygon in question.
pVertexPolygonIndexPolygon vertex index.
Returns
Index in mesh of vertex.

◆ TriangleListAdd()

bool TriangleListAdd ( int  pIndexArraySize,
int  pIndexArray,
int  pMaterialId = 0 
)

Add Triangle List, Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.

Parameters
pIndexArraySizeSize of pIndexArray, Added triangle count is floor(max(pIndexArraySize, 0) / 3)
pIndexArrayIndex array of triangle list.
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Note
The indexes' value in input pIndexArray won't be validated, and the behavior is undefined if out of range.

◆ TriangleStripAdd()

bool TriangleStripAdd ( int  pIndexArraySize,
int  pIndexArray,
int  pMaterialId = 0 
)

Add Triangle Strip Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.

Parameters
pIndexArraySizeSize of pIndexArray, Added triangle count is max(pIndexArraySize - 2, 0)
pIndexArrayIndex array of triangle strip.
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Note
The indexes' value in input pIndexArray won't be validated, and the behavior is undefined if out of range.