47#include <kaydaradef.h>
51#include <fbsdk/fblibrary.h>
57 #define FBSDK_DLL K_DLLIMPORT
67 #pragma warning (disable: 4661)
70K_FORWARD( IRegister );
74K_FORWARD( KEventBase );
75K_FORWARD( KGlobalNamedEvent );
77#ifdef FBSDKUseNamespace
78 namespace FBSDKNamespace {
88#define FB_DEFAULT_SDK_ICON "openreality_noicon.png"
94#define __FBClassInit mLocalPtr = NULL;
100#define __FBClassDeInit if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}
106#define __FBClassInitSDKComponent( pObjectToWrappedIsAllocated ) \
108 mSDKComponent = pObjectToWrappedIsAllocated;
131#define __FBClassDeclare( Name,Parent ) \
132 friend FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);\
137 typedef Parent __FBParentClass;\
141 typedef Name __FBClassType;\
145 virtual const char* ClassName() override { return #Name; } \
150 virtual bool Is( int pTypeId ) override { return (pTypeId==TypeInfo) ? true : Parent::Is( pTypeId ); } \
151 virtual int GetTypeId() override { return TypeInfo; } \
155 static int GetInternalClassId(); \
159 Data##Name* mLocalPtr; \
161 static int TypeInfo; \
168#define __FBClassDeclareGroup( Name,Parent ) \
169 __FBClassDeclare( Name,Parent )\
171 static const char* ClassGroupName; \
181#define FBStorableClassImplementation(ClassName, Type)\
182 const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
183 HIObject RegisterStorable##ClassName##Create(HIObject , const char* pName, void* ){\
184 ClassName* Class = new ClassName(pName);\
185 Class->mAllocated = true;\
186 if( Class->FBCreate() ){\
187 __FBRemoveModelFromScene( Class->GetHIObject() ); \
188 return Class->GetHIObject();\
192 FBLibraryModule(ClassName##Storable){\
193 FBString lGroup = "FbxStorable/";\
195 FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);}
200#define FBElementClassImplementation(ClassName,IconFileName)\
201 HIObject RegisterElement##ClassName##Create(HIObject , const char* pName, void* ){\
202 ClassName* Class = new ClassName(pName);\
203 Class->mAllocated = true;\
204 if( Class->FBCreate() ){\
205 __FBRemoveModelFromScene( Class->GetHIObject() ); \
206 return Class->GetHIObject();\
210 FBLibraryModule(ClassName##Element){\
211 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);}
216#define FBElementClassImplementationWithName(ClassName,UniqueNameStr,IconFileName)\
217 HIObject RegisterElement##ClassName##Create(HIObject , const char* pName, void* ){\
218 ClassName* Class = new ClassName(pName);\
219 Class->mAllocated = true;\
220 Class->UniqueName = UniqueNameStr; \
221 if( Class->FBCreate() ){\
222 __FBRemoveModelFromScene( Class->GetHIObject() ); \
223 return Class->GetHIObject();\
227 FBLibraryModule(ClassName##Element){\
228 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", UniqueNameStr, "", RegisterElement##ClassName##Create, true, IconFileName);}
233#define FBShadingElementClassImplementation(ClassName,IconFileName)\
234 HIObject RegisterShadingElement##ClassName##Create(HIObject , const char* pName, void* ){\
235 ClassName* Class = new ClassName(pName);\
236 Class->mAllocated = true;\
237 if( Class->FBCreate() ){\
238 return Class->GetHIObject();\
242 FBLibraryModule(ClassName##ShadingElement){\
243 FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
251#define FBStorableClassDeclare(Name, Parent)\
252 FBClassDeclare(Name, Parent);\
254 virtual const char* FbxGetObjectSubType() override; \
266#define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \
268 PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
269 PropName.TypeInfo = &Type::TypeInfo; \
279#define FBIS( Component,ComponentType ) \
280 ((Component) && (Component)->Is( ComponentType::TypeInfo ))
341#define FBRegisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
346#define FBUnregisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
352FBSDK_DLL void FBSetStoreableCustomModelRegistered();
353FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
359FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
360FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
366FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
367FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
369FBSDK_DLL bool FBObject_Register (
const char * pGroupName,
const char * pEntryName,
const char * pDescription, kObjectCreatorFnc pCreatorFnc,
bool pIsMultipleAllowed,
const char * pIconFilename);
370FBSDK_DLL bool FBObject_Unregister(
const char * pGroupName,
const char * pEntryName,
int nth=0 );
375FBSDK_DLL const char* FBObject_GetGroupName (
int pGroupIndex );
376FBSDK_DLL int FBObject_GetEntryCount (
int pGroupIndex );
377FBSDK_DLL const char* FBObject_GetEntryName (
int pGroupIndex,
int pIndex );
378FBSDK_DLL const char* FBObject_GetEntryDescription (
int pGroupIndex,
int pIndex,
int nth = 0 );
379FBSDK_DLL const char* FBObject_GetEntryDLLName (
int pGroupIndex,
int pIndex,
int nth = 0 );
380FBSDK_DLL const char* FBObject_GetIconName (
int pGroupIndex,
int pIndex,
int nth = 0 );
381FBSDK_DLL bool FBObject_GetMultiplicity (
int pGroupIndex,
int pIndex,
int nth = 0 );
397inline bool FBUnregisterObject(
const char * pGroupName,
const char * pEntryName,
int nth=0 ) {
return FBObject_Unregister( pGroupName,pEntryName,nth ); }
403#define FBRegisterObject( LocalId,Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) \
404 [[maybe_unused]] static bool __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )
418FBSDK_DLL int FBRegister_ClassId(
const char* pClassName);
424#define FBDeclareUserObject(ClassName)\
427 virtual int GetUserClassId();\
428 virtual const char* FbxGetObjectSubType() override;\
476 kFBFlagStorableBlindDataForceBinary = (1 << 20),
524 virtual void RemoveAt(
int pIndex )
override;
538 virtual int GetCount()
override;
553 void SetClassId(
int pClassId );
555 void SetListOfParents(
bool pListOfParents );
556 bool GetIsListOfParents();
594 virtual int GetCount();
616 virtual int SetAt(
int pIndex,
FBComponent* pObject);
621 virtual void RemoveAt(
int pIndex );
628 virtual int InsertAt(
int pIndex,
FBComponent* pObject);
632 virtual void Clear();
637 virtual void SetSingleConnect(
bool pSingleConnect);
642 virtual int GetSingleConnect();
647 void SetFilter(
int pInternalClassId);
683#ifndef DOXYGEN_SHOULD_SKIP_THIS
685 DataFBComponent* mLocalPtr;
698 static int GetInternalClassId();
711 virtual bool FBCreate();
714 virtual void FBDestroy();
717 virtual void FBDelete()
override;
720 virtual bool SetHIObject(HIObject pObject,
bool pSDKComponent)
override;
726 virtual int PropertyAdd(
FBProperty* pProperty );
732 bool PropertyAddReferenceProperty(
FBProperty* pReferenceProperty );
754 FBProperty* PropertyCreate(
const char* pName,
FBPropertyType pType,
const char * pDataType,
bool pAnimatable,
bool pIsUser =
false,
FBProperty* pReferenceSource = NULL );
803 bool ProcessNamespaceHierarchy(
FBNamespaceAction pNamespaceAction,
const char* pNamespaceName,
const char* pReplaceTo=NULL,
bool pAddRight=
true );
815 bool ProcessObjectNamespace (
FBNamespaceAction pNamespaceAction,
const char* pNamespaceName,
const char* pReplaceTo=NULL,
bool pAddRight=
true );
820 virtual const char* ClassName()
override;
826 virtual bool UseCustomPropertyViewSet()
const {
return true; }
831 const char* GetFullName(
void );
853#ifndef DOXYGEN_SHOULD_SKIP_THIS
856 void *
operator new(
size_t stAllocateBlock );
857 void operator delete(
void *pvMem );
859 void *
operator new(
size_t stAllocateBlock,
int blockType,
const char *filename,
int linenumber );
860 void operator delete(
void *pvMem,
int blockType,
const char *filename,
int linenumber );
867 void InvalidatePropertyEventsParents();
878#if !defined(K_NO_FOLDER)
879 FBPropertyFolder Folder;
883#ifndef DOXYGEN_SHOULD_SKIP_THIS
884 IObject_Declare(
override);
885 ICallback_Declare(
override);
892 virtual bool Is(
int pTypeId )
override;
893 virtual int GetTypeId()
override;
895 static void FBComponentSetName(
FBComponent* pObject,
const char *pName );
896 static const char* FBComponentGetName(
FBComponent* pObject );
898 static void FBComponentSetLongName(
FBComponent* pObject,
const char *pName );
899 static const char* FBComponentGetLongName(
FBComponent* pObject );
902#ifndef DOXYGEN_SHOULD_SKIP_THIS
904 KObject* mDummyObject;
905 void KObjectEvent(HIRegister pView, HKEventBase pEvent);
917template<
class T>
inline T*
FBCast(
FBObject* pObject,
bool pAutoCreate =
false)
919 HIObject lObject = pObject ?
FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
959 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
980#ifndef DOXYGEN_SHOULD_SKIP_THIS
1004 FBPropertyConnectionAction Action;
1006 FBPropertyConnectionType ConnectionType;
1026 FBPropertyConnectionAction Action;
1046 FBPropertyConnectionAction Action;
1083 FBPlug* GetProperty(
void );
1089 void* GetData(
void );
1105 IObject_Declare(
override);
1106 ICallback_Declare(
override);
1112 virtual bool LibInit();
1118 virtual bool LibOpen();
1125 virtual bool LibReady();
1130 virtual bool LibClose();
1135 virtual bool LibRelease();
1137 KGlobalNamedEvent *mLibrary_Open,
1142 void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
1143 void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
1144 void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
1145 void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
1162 virtual bool LibInit();
1168 virtual bool LibOpen();
1175 virtual bool LibReady();
1180 virtual bool LibClose();
1185 virtual bool LibRelease();
1192 #define FBLibraryDeclare( LibName ) \
1193 FB_DLL_INIT( LibName, Operation ) \
1195 switch( Operation ) \
1201 #define FBLibraryDeclare( LibName ) \
1202 static FBLibrary LibName##GlobalFBLibrary; \
1204 K_DLLEXPORT bool LIBRARY_INIT(HIError
) \
1206 FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
1209 FB_DLL_INIT( LibName, Operation ) \
1211 switch( Operation ) \
1221#define FBLibraryModule(Name) \
1222 void FBModule##Name()
1228#define FBLibraryRegister( ClassName ) \
1229 extern void FBModule##ClassName( ); \
1230 FBModule##ClassName( );
1236#define FBLibraryRegisterStorable( ClassName ) \
1237 extern void FBModule##ClassName##Storable( ); \
1238 FBModule##ClassName##Storable( );
1244#define FBLibraryRegisterElement( ClassName ) \
1245 extern void FBModule##ClassName##Element( ); \
1246 FBModule##ClassName##Element( );
1252#define FBLibraryRegisterShadingElement( ClassName ) \
1253 extern void FBModule##ClassName##ShadingElement( ); \
1254 FBModule##ClassName##ShadingElement( );
1257#define FBLibraryDeclareEnd \
1270#define FBCustomManagerImplementation( ThisComponent ) \
1271 FBClassImplementation( ThisComponent ) \
1276#define FBRegisterCustomManager( ClassName ) \
1277 FBLibraryModule( ClassName ) \
1279 static ClassName g##ClassName; \
1280 g##ClassName.FBCreate(); \
1281 g##ClassName.RegisterManager(); \
1287#define FBCustomManagerDeclare( ClassName ) \
1288FBClassDeclare( ClassName, FBCustomManager ); \
1290 ClassName() : FBCustomManager() { FBClassInit; } \
1324 void RegisterManager();
1329 virtual bool FBCreate()
override;
1337 virtual bool Init() ;
1344 virtual bool Open() ;
1350 virtual bool Clear() ;
1355 virtual bool Close() ;
1360#ifdef FBSDKUseNamespace
Template class to contain an array of items.
MotionBuilder SDK base class.
Custom manager class for user controlled observer objects.
Connection notify event class.
Connection notify event class.
Connection notify event class.
Objects Containing class.
Library class for DLL registration.
Library class for DLL registration.
Objects Containing class.
Connections Basic Open Reality SDK Element.
PropertyEvent: Base event class.
Property: Base property class.
PropertyList: Concrete class for PropertyList of component
Property class: const char * (String).
Visual Component base class.
A template class for arrays.
HKEventBase HKEvent
HKEvent.
K_DLLIMPORT FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
K_DLLIMPORT FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
K_DLLIMPORT int FBObject_GetGroupCount()
A set of functions to query the registration table.
HIRegister HISender
HISender.
K_DLLIMPORT FBPlug * __FBObjectCreatorSub(HIObject pObject)
__FBObjectCreatorSub For internal use only, Create the FBPlug object from internal object.
bool FBUnregisterObject(const char *pGroupName, const char *pEntryName, int nth=0)
FBUnregisterObject.
FBObjectStatus
Available lifetime status for any component.
@ kFBStatusRetrieving
Object is in retrieving operations.
@ kFBStatusDestroying
Object is in destruction operations.
@ kFBStatusMerging
Object is in Merging operations.
@ kFBStatusClearing
Object is in clearing operations (File new).
@ kFBStatusStoring
Object is in storing operations.
@ kFBStatusCreating
Object is in creation operations.
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
K_DLLIMPORT void __FBAddModelToScene(HIObject pObject)
For internal usage only.
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it's IObject interface into the proper class.
K_DLLIMPORT FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
K_DLLIMPORT void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
K_DLLIMPORT FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=NULL, int nth=0)
FBCreateObject.
#define __FBClassDeclare(Name, Parent)
For internal use only.
K_DLLIMPORT int __FBGetInternalClassId(int pTypeInfo)
__FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent's T...
FBObjectFlag
Available flags for any component.
@ kFBFlagStorableBlindData
Used in FBX SDK native IO.
@ kFBFlagSavable
Can be saved.
@ kFBFlagStorable6
System/Obsolete.
@ kFBFlagSystem
Created from System (not from user)
@ kFBFlagSelectable
Can be selected. If disabled, representation of the object, like in the navigator,...
@ kFBFlagNewable
Deleted on File->New.
@ kFBFlagKeyable
Object can Key his property. (System Camera can't)
@ kFBFlagAllocated
Object is allocated, so it must call 'delete this' on destroy.
@ kFBFlagStorableData6
System/Obsolete.
@ kFBFlagUndoableSeparately
Object which has kFlagUndoableSeparately flag turned on will have a separate Undo Stack.
@ kFBFlagClonable
Can be cloned. If disabled, the "Duplicate" option will be removed in the contextual menu.
@ kFBFlagRenamable
Can be renamed.
@ kFBFlagBrowsable
Visible in the Scene Navigator/Schematic View/Property View/Model View. If disabled,...
@ kFBFlagMergeable
Can be merged.
@ kFBFlagDeletable
Can be deleted.
@ kFBFlagNamespaceEditable
Allow editing on the namespace objects. If disabled, the "Add/Remove Namespace..." option is removed ...
@ kFBFlagDetachable
Object can be "detached". Used by the apply manager contextual menu.
@ kFBFlagVisible
Can be visible. If disabled, the object will still be available in the navigator, it is only hidden i...
@ kFBFlagUniqueName
< Used in FBX SDK native IO, force bindary format for the bindary data.
@ kFBFlagStory
Object created/used by the Story tool. Useful flag for filtering Story objects.
@ kFBFlagNotSelectableNameSpace
The entity will not add the namespace of the object to his list of all the namespaces of the scene.
@ kFBFlagParentable
Object (model) can be "parented". Used by the apply manager contextual menu.
@ kFBFlagUndoable
Object can undo its actions and states, in a global Undo Stack.
K_DLLIMPORT FBComponent * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
K_DLLIMPORT FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
K_DLLIMPORT void FBFindObjectsByName(const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
FBFindObjectsByName.
K_DLLIMPORT int FBDeleteObjectsByName(const char *pNamePattern, const char *pNameSpace=NULL, const char *pGroupName=NULL)
FBDeleteObjectsByName.
K_DLLIMPORT int __FBRegisterTypeInfo(int pInternalClassId)
__FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id.
FBComponent FBObject
Equivalent to FBComponent for gradual transition.
K_DLLIMPORT FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
K_DLLIMPORT void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
FBNamespaceAction
Namespace flags.
@ kFBConcatNamespace
Use to add a namespace name to object.
@ kFBRemoveAllNamespace
Remove all the namespace name.
@ kFBReplaceNamespace
Use to replace a define namespace.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition of the class FBPlug and related enums and utility functions.
K_DLLIMPORT HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
FBConnectionAction
Possible actions when a notify plug event occurs.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBPropertyType
Property types.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.