Open Reality Reference Guide
fbmodel.h File Reference

Base class for Cameras. More...

#include <kaydaradef.h>
#include <fbsdk/fbcore.h>
#include <fbsdk/fbcomponent.h>
#include <fbsdk/fbshader.h>
#include <fbsdk/fbtexture.h>
#include <fbsdk/fbgeometry.h>
#include <fbsdk/fbmaterial.h>
#include <fbsdk/fbmath.h>

Go to the source code of this file.

Classes

class  FBPropertyListModel
 List: Model More...
 
class  FBPropertyListDeformer
 
class  FBModel
 Model class. More...
 
class  FBModelNull
 Null object class. More...
 
class  FBModelRoot
 Root object class. More...
 
class  FBModelMarker
 Model marker class. More...
 
class  FBModelSkeleton
 Root object class. More...
 
class  FBPropertyListModelSkeleton
 PropertyList: ModelSkeleton. More...
 
class  FBModelCube
 Cube model class. More...
 
class  FBModelPlane
 Plane model class. More...
 
class  FBCluster
 Weighting interface for meshes. More...
 
class  FBModelVertexData
 
class  FBDeformer
 Base Model deformer class. More...
 
class  FBDeformerPointCache
 Base Model deformer class. More...
 
class  FBPointCacheFile
 Base Model deformer class. More...
 

Macros

#define FBSDK_DLL   K_DLLIMPORT
 Be sure that FBSDK_DLL is defined only once... More...
 
#define FBStorableCustomModelImplementation(ClassName, Desc)
 Custom Storable Model Class implementation. More...
 

Typedefs

typedef class K_DLLIMPORT FBArrayTemplate< FBModel * > FBModelList
 typedef class FBSDK_DLL More...
 

Enumerations

enum  FBModelTransformationType {
  kModelTransformation ,
  kModelRotation ,
  kModelTranslation ,
  kModelScaling ,
  kModelTransformation_Geometry ,
  kModelInverse_Transformation ,
  kModelInverse_Rotation ,
  kModelInverse_Translation ,
  kModelInverse_Scaling ,
  kModelInverse_Transformation_Geometry
}
 Types of transformation vector/matrices possible. More...
 
enum  FBModelShadingMode {
  kFBModelShadingDefault ,
  kFBModelShadingWire ,
  kFBModelShadingFlat ,
  kFBModelShadingLight ,
  kFBModelShadingHard ,
  kFBModelShadingTexture ,
  kFBModelShadingAll
}
 Modes for model shading. More...
 
enum  FBModelRenderPass {
  kFBModelRenderPassStandard ,
  kFBModelRenderPassPick
}
 Model Render pass. More...
 
enum  FBModelRotationOrder {
  kFBEulerXYZ = 0 ,
  kFBEulerXZY ,
  kFBEulerYZX ,
  kFBEulerYXZ ,
  kFBEulerZXY ,
  kFBEulerZYX ,
  kFBSphericXYZ
}
 Ways to apply Rotation. More...
 
enum  FBModelCullingMode {
  kFBCullingOff ,
  kFBCullingOnCCW ,
  kFBCullingOnCW
}
 Model Culling Mode. More...
 
enum  FBModelEvaluationTaskType {
  kFBModelEvaluationTransform ,
  kFBModelEvaluationBBox ,
  kFBModelEvaluationDeform
}
 
enum  FBModelHiercharyTraverserType {
  kModelTraverserDepthFirst ,
  kModelTraverserBreadthFirst
}
 Types of hierarchy traverser search type. More...
 
enum  FBSelectionAction {
  kFBManipulatorReplace = 0 ,
  kFBManipulatorAdd ,
  kFBManipulatorRemove ,
  kFBManipulatorToggle ,
  kFBManipulatorAddAll ,
  kFBManipulatorRemoveAll
}
 Selection mode when selecting component. More...
 
enum  FBMarkerResolutionLevel {
  kFBMarkerLowResolution ,
  kFBMarkerMediumResolution ,
  kFBMarkerHighResolution
}
 Resolution of marker mesh sphere and capsule (Quality). More...
 
enum  FBMarkerLook {
  kFBMarkerLookCube ,
  kFBMarkerLookHardCross ,
  kFBMarkerLookLightCross ,
  kFBMarkerLookSphere ,
  kFBMarkerLookCapsule ,
  kFBMarkerLookSquare ,
  kFBMarkerLookCircle ,
  kFBMarkerLookBone ,
  kFBMarkerLookStick ,
  kFBMarkerLookBox ,
  kFBMarkerLookNone ,
  kFBMarkerLookRigidGoal ,
  kFBMarkerLookRotationGoal ,
  kFBMarkerLookAimRollGoal
}
 Look of the marker. More...
 
enum  FBMarkerType {
  kFBMarkerTypeStandard ,
  kFBMarkerTypeOptical ,
  kFBMarkerTypeFKEffector ,
  kFBMarkerTypeIKEffector
}
 Type of the marker. More...
 
enum  FBSkeletonLook {
  kFBSkeletonLookBone ,
  kFBSkeletonLookCube ,
  kFBSkeletonLookHardCross ,
  kFBSkeletonLookLightCross ,
  kFBSkeletonLookSphere ,
  kFBSkeletonLookCapsule ,
  kFBSkeletonLookBox ,
  kFBSkeletonLookCircle ,
  kFBSkeletonLookSquare ,
  kFBSkeletonLookStick
}
 Look of the skeleton. More...
 
enum  FBSkeletonResolutionLevel {
  kFBSkeletonLowResolution ,
  kFBSkeletonMediumResolution ,
  kFBSkeletonHighResolution
}
 Resolution of skeleton sphere, capsule and stick (Quality). More...
 
enum  FBClusterMode {
  kFBClusterNormalize ,
  kFBClusterAdditive ,
  kFBClusterTotal100
}
 Different clustering modes. More...
 
enum  FBDeformerType {
  kFBDeformerUnkown ,
  kFBDeformerSkeleton ,
  kFBDeformerPointCache
}
 Determine the deformer type. More...
 

Functions

 FB_DEFINE_COMPONENT (K_DLLIMPORT, Model)
 
 FB_DEFINE_COMPONENT (K_DLLIMPORT, Cluster)
 
 FB_DEFINE_COMPONENT (K_DLLIMPORT, ModelVertexData)
 
 FB_DEFINE_COMPONENT (K_DLLIMPORT, PointCacheFile)
 
 __FB_FORWARD (FBModel)
 
 __FB_FORWARD (FBPropertyListModel)
 
 FB_DEFINE_LIST (K_DLLIMPORT, Model)
 
 __FB_FORWARD (FBDeformer)
 PropertyList: Texture More...
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ModelShadingMode)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ModelTransformationType)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ModelRotationOrder)
 
 FB_FORWARD (FBCamera)
 
K_DLLIMPORT FBModelListFBCreateModelList ()
 Create a FBModelList object. More...
 
K_DLLIMPORT void FBDestroyModelList (FBModelList *pModelList)
 Delete a FBModelList object. More...
 
K_DLLIMPORT FBModelFBFindModelByLabelName (const char *pModelLabelName)
 Find a model in the scene by its label name. More...
 
K_DLLIMPORT FBModelFBFindModelByUniqueColorId (const FBColor &pColor, int *pSubItemIndex=NULL)
 Find a model in the scene by its unique color id. More...
 
K_DLLIMPORT FBModelFBLoadFbxPrimitivesModel (const char *pModelName)
 Load a model. More...
 
K_DLLIMPORT void FBFindModelsOfType (FBModelList &pList, int pTypeInfo, FBModel *pParent=NULL)
 Find all models of a certain type in the scene. More...
 
K_DLLIMPORT void FBGetSelectedModels (FBModelList &pList, FBModel *pParent=NULL, bool pSelected=true, bool pSortBySelectOrder=false)
 Find all models that are selected (if pSelected is true) Searches recursively from a root model for models that are selected, and adds them to a list of models. More...
 
K_DLLIMPORT FBModelFBGetLastSelectedModel ()
 Get the last selected model, which is the one having the manipulator in the viewer. More...
 
K_DLLIMPORT void FBSetLastSelectedModel (FBModel *pModel)
 Set the given model as the last one selected, so the manipulator in the viewer will then be on that particular model. More...
 
K_DLLIMPORT void FBBeginChangeAllModels ()
 Call begin change to all models (need to be closed). More...
 
K_DLLIMPORT void FBEndChangeAllModels ()
 Call end change to all models (should be first open). More...
 
K_DLLIMPORT void FBModelTransactionBegin ()
 FBModelTransactionBegin. More...
 
K_DLLIMPORT void FBModelTransactionEnd ()
 FBModelTransactionEnd. More...
 
 __FB_FORWARD (FBModelNull)
 
 __FB_FORWARD (FBModelRoot)
 
 __FB_FORWARD (FBModelMarker)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, MarkerResolutionLevel)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, MarkerLook)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, MarkerType)
 
 __FB_FORWARD (FBModelSkeleton)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, SkeletonLook)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, SkeletonResolutionLevel)
 
 FB_DEFINE_LIST (K_DLLIMPORT, ModelSkeleton)
 
 FB_FORWARD (FBPropertyListModelSkeleton)
 
 __FB_FORWARD (FBModelCube)
 
 __FB_FORWARD (FBModelPlane)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ClusterMode)
 
 __FB_FORWARD (FBCluster)
 
 __FB_FORWARD (FBModelVertexData)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, DeformerType)
 
 __FB_FORWARD (FBDeformerPointCache)
 
 __FB_FORWARD (FBPointCacheFile)
 

Detailed Description

Base class for Cameras.

Base class for models.

Base class for Lights.

Definition in file fbmodel.h.

Macro Definition Documentation

◆ FBSDK_DLL

#define FBSDK_DLL   K_DLLIMPORT

Be sure that FBSDK_DLL is defined only once...

Definition at line 48 of file fbmodel.h.

◆ FBStorableCustomModelImplementation

#define FBStorableCustomModelImplementation (   ClassName,
  Desc 
)
Value:
const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
ClassName* Class = new ClassName(pName);\
Class->mAllocated = true;\
if( Class->FBCreate() ){\
__FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
return Class->GetHIObject();\
} else {\
delete Class;\
return NULL;}}\
FBLibraryModule(ClassName##Storable){\
FBString lGroup = "FbxStorable/Model";\
FBRegisterObject(ClassName##R2, lGroup, #ClassName, Desc, RegisterStorable##ClassName##Create, true, NULL);\
FBSetStoreableCustomModelRegistered();}\

Custom Storable Model Class implementation.

This should be placed in the source code file for a custom model class.

Definition at line 67 of file fbmodel.h.

Typedef Documentation

◆ FBModelList

typedef class K_DLLIMPORT FBArrayTemplate<FBModel*> FBModelList

typedef class FBSDK_DLL

Definition at line 241 of file fbmodel.h.

Enumeration Type Documentation

◆ FBClusterMode

Different clustering modes.

Enumerator
kFBClusterNormalize 

Normalize (values between 0.0 and 1.0 )

kFBClusterAdditive 

Add the values together.

kFBClusterTotal100 

The balanced values will add up to 100 percent.

Definition at line 1029 of file fbmodel.h.

◆ FBDeformerType

Determine the deformer type.

  • kFBDeformerSkeleton Skeleton (Bone) driven skinning deformer.
  • kFBDeformerPointCache Pre-recorded point cache deformer.
  • kFBGeometryMapping_BY_POLYGON_VERTEX There will be one mapping coordinate for each vertex, for each polygon/strip it is part of. This means that a vertex will have as many mapping coordinates as polygons it is part of.
  • kFBGeometryMapping_BY_POLYGON There can be only one mapping coordinate for the whole polygon/strip.
  • kFBGeometryMapping_BY_EDGE There will be one mapping coordinate for each unique edge in the mesh. This is meant to be used with smoothing layer elements.
  • kFBGeometryMapping_ALL_SAME There can be only one mapping coordinate for the whole surface.

Definition at line 1473 of file fbmodel.h.

◆ FBMarkerLook

Look of the marker.

Enumerator
kFBMarkerLookCube 

Cube.

kFBMarkerLookHardCross 

Thick cross.

kFBMarkerLookLightCross 

Wireframe cross.

kFBMarkerLookSphere 

Sphere.

kFBMarkerLookCapsule 

Capsule.

kFBMarkerLookSquare 

Square.

kFBMarkerLookCircle 

Circle.

kFBMarkerLookBone 

Bone.

kFBMarkerLookStick 

Box with a sphere on one end.

kFBMarkerLookBox 

Box.

kFBMarkerLookNone 

None.

kFBMarkerLookRigidGoal 

Rigid goal.

kFBMarkerLookRotationGoal 

Rotation goal.

kFBMarkerLookAimRollGoal 

Aim & Roll goal.

Definition at line 840 of file fbmodel.h.

◆ FBMarkerResolutionLevel

Resolution of marker mesh sphere and capsule (Quality).

Enumerator
kFBMarkerLowResolution 

Lowest resolution.

kFBMarkerMediumResolution 

Medium resolution.

kFBMarkerHighResolution 

Highest resolution.

Definition at line 832 of file fbmodel.h.

◆ FBMarkerType

Type of the marker.

Enumerator
kFBMarkerTypeStandard 

Standard.

kFBMarkerTypeOptical 

Optical.

kFBMarkerTypeFKEffector 

FK effector.

kFBMarkerTypeIKEffector 

IK effector.

Definition at line 859 of file fbmodel.h.

◆ FBModelCullingMode

Model Culling Mode.

Enumerator
kFBCullingOff 

Culling Off.

kFBCullingOnCCW 

Culling with Counter Clock Wise.

kFBCullingOnCW 

Culling with Clock Wise.

Definition at line 209 of file fbmodel.h.

◆ FBModelEvaluationTaskType

Enumerator
kFBModelEvaluationTransform 

Model's transformation evaluation task (Global )

kFBModelEvaluationBBox 

Model's bouding box computation task (approximately for deformable model)

kFBModelEvaluationDeform 

Model's deformation task (for deformable model)

Definition at line 215 of file fbmodel.h.

◆ FBModelHiercharyTraverserType

Types of hierarchy traverser search type.

Enumerator
kModelTraverserDepthFirst 

Depth-first search.

kModelTraverserBreadthFirst 

Breadth-first search.

Definition at line 222 of file fbmodel.h.

◆ FBModelRenderPass

Model Render pass.

Enumerator
kFBModelRenderPassStandard 

Standard pass.

kFBModelRenderPassPick 

Pick pass.

Definition at line 192 of file fbmodel.h.

◆ FBModelRotationOrder

Ways to apply Rotation.

Enumerator
kFBEulerXYZ 

XYZ Euler Order.

kFBEulerXZY 

XZY Euler Order.

kFBEulerYZX 

YZX Euler Order.

kFBEulerYXZ 

YXZ Euler Order.

kFBEulerZXY 

ZXY Euler Order.

kFBEulerZYX 

ZYX Euler Order.

kFBSphericXYZ 

Spheric XYZ Order.

Definition at line 198 of file fbmodel.h.

◆ FBModelShadingMode

Modes for model shading.

Enumerator
kFBModelShadingDefault 

Default shading.

kFBModelShadingWire 

Wireframe shading.

kFBModelShadingFlat 

Flat shading.

kFBModelShadingLight 

Lighted shading.

kFBModelShadingHard 

Hard shading.

kFBModelShadingTexture 

Textured shading.

kFBModelShadingAll 

Lighted, shaded, textured shading.

Definition at line 181 of file fbmodel.h.

◆ FBModelTransformationType

Types of transformation vector/matrices possible.

Enumerator
kModelTransformation 

Transformation.

kModelRotation 

Rotation.

kModelTranslation 

Translation.

kModelScaling 

Scaling.

kModelTransformation_Geometry 

Transformation plus geometry offset

kModelInverse_Transformation 

Inverse transformation.

kModelInverse_Rotation 

Inverse rotation.

kModelInverse_Translation 

Inverse translation.

kModelInverse_Scaling 

Inverse scaling.

kModelInverse_Transformation_Geometry 

Inverse of transformation plus geometry offset.

Definition at line 167 of file fbmodel.h.

◆ FBSelectionAction

Selection mode when selecting component.

Enumerator
kFBManipulatorReplace 

Replaces the current selection by the new selected components.

kFBManipulatorAdd 

Add the selected components to the current selection.

kFBManipulatorRemove 

Remove the selected components from the current selection.

kFBManipulatorToggle 

Toggle the current selection with the unselected components.

kFBManipulatorAddAll 

Add all components to the current selection.

kFBManipulatorRemoveAll 

Remove all components from the current selection.

Definition at line 228 of file fbmodel.h.

◆ FBSkeletonLook

Look of the skeleton.

Enumerator
kFBSkeletonLookBone 

Bone.

kFBSkeletonLookCube 

Cube.

kFBSkeletonLookHardCross 

Thick cross.

kFBSkeletonLookLightCross 

Wireframe cross.

kFBSkeletonLookSphere 

Sphere.

kFBSkeletonLookCapsule 

Capsule.

kFBSkeletonLookBox 

Box.

kFBSkeletonLookCircle 

Circle.

kFBSkeletonLookSquare 

Square.

kFBSkeletonLookStick 

Box with a sphere on one end.

Definition at line 920 of file fbmodel.h.

◆ FBSkeletonResolutionLevel

Resolution of skeleton sphere, capsule and stick (Quality).

Enumerator
kFBSkeletonLowResolution 

Lowest resolution.

kFBSkeletonMediumResolution 

Medium resolution.

kFBSkeletonHighResolution 

Highest resolution.

Definition at line 935 of file fbmodel.h.

Function Documentation

◆ __FB_FORWARD()

__FB_FORWARD ( FBDeformer  )

PropertyList: Texture

◆ FBBeginChangeAllModels()

K_DLLIMPORT void FBBeginChangeAllModels ( )

Call begin change to all models (need to be closed).

Useful for selection of many models that can trigger many related callbacks)

◆ FBCreateModelList()

K_DLLIMPORT FBModelList* FBCreateModelList ( )

Create a FBModelList object.

This is to get around memory management issues when mixing debug and release runtime libraries on Windows. By using the FBCreateModelList/FBDestroyModelList duo of functions, you ensure that the memory used in the array is allocated, reallocated and freed in the same memory pool.

◆ FBDestroyModelList()

K_DLLIMPORT void FBDestroyModelList ( FBModelList pModelList)

Delete a FBModelList object.

Parameters
pModelListpointer to the object created with a call to FBCreateModelList().

◆ FBEndChangeAllModels()

K_DLLIMPORT void FBEndChangeAllModels ( )

Call end change to all models (should be first open).

◆ FBFindModelByLabelName()

K_DLLIMPORT FBModel* FBFindModelByLabelName ( const char *  pModelLabelName)

Find a model in the scene by its label name.

Searches the scene for a model, based on the model's label name. Label name is "NameSpaceName:ObjectName". also known as "PrefixName::ObjectName" Full name is "GroupName::NameSpaceName:ObjectName".

Parameters
pModelLabelNameLabelName of model to search for. Specify it with schema like "NameSpaceName:ObjectName",or "ObjectName" if no NameSpaceName.
Returns
A handle onto the model with Label name matching, returns NULL if no model was found by the search.

◆ FBFindModelByUniqueColorId()

K_DLLIMPORT FBModel* FBFindModelByUniqueColorId ( const FBColor pColor,
int *  pSubItemIndex = NULL 
)

Find a model in the scene by its unique color id.

A model could have a single unique ColorID, but SDK plugin user could request additional ColorID per model to support multi sub items picking. see FBModel::SetAdditionalUniqueColorIDCount().

Parameters
pColorColor channel values are in range of [0,1] with precision 1.0/255
pSubItemIndex(C++ only) Pass out SubItem index value if not null.
Returns
(C++ only) A handle onto the model with unique color id matching, returns NULL if no model was found by the search. (Python only) A tuple with 2 values: (FBModel return value, pSubItemIndex).

◆ FBFindModelsOfType()

K_DLLIMPORT void FBFindModelsOfType ( FBModelList pList,
int  pTypeInfo,
FBModel pParent = NULL 
)

Find all models of a certain type in the scene.

Searches recursively from a root model for models of a certain type, and adds them to a list of models.

Return values
pListList to add found models to.
Parameters
pTypeInfoModel type to look for.
pParentRoot model to look from (default=NULL(root)).

◆ FBGetLastSelectedModel()

K_DLLIMPORT FBModel* FBGetLastSelectedModel ( )

Get the last selected model, which is the one having the manipulator in the viewer.

Returns
The last selected model or nullptr (C++) or None (Python) if no model is selected.

◆ FBGetSelectedModels()

K_DLLIMPORT void FBGetSelectedModels ( FBModelList pList,
FBModel pParent = NULL,
bool  pSelected = true,
bool  pSortBySelectOrder = false 
)

Find all models that are selected (if pSelected is true) Searches recursively from a root model for models that are selected, and adds them to a list of models.

Return values
pListList to add found models to.
Parameters
pParentRoot model to look from (default=NULL(root)).
pSelectedtrue to find selected models, false to find unselected models(default=true).
pSortBySelectOrdertrue to sort the result by selection order, first selected model in the first part of the list; false to sort the result by scene graph order

◆ FBLoadFbxPrimitivesModel()

K_DLLIMPORT FBModel* FBLoadFbxPrimitivesModel ( const char *  pModelName)

Load a model.

Parameters
pModelNameName of primitive model to load.
Returns
A handle onto the model that was loaded, returns NULL if no model was found.

◆ FBModelTransactionBegin()

K_DLLIMPORT void FBModelTransactionBegin ( )

FBModelTransactionBegin.

This set of functions speeds up the process of batch operations on models.

◆ FBModelTransactionEnd()

K_DLLIMPORT void FBModelTransactionEnd ( )

FBModelTransactionEnd.

This set of functions speeds up the process of batch operations on models.

◆ FBSetLastSelectedModel()

K_DLLIMPORT void FBSetLastSelectedModel ( FBModel pModel)

Set the given model as the last one selected, so the manipulator in the viewer will then be on that particular model.

If the model is not selected, it will also be selected.

Parameters
pModelModel that will be flagged as the last selected model.