47 #include <kaydaradef.h> 51 #include <fbsdk/fblibrary.h> 57 #define FBSDK_DLL K_DLLIMPORT 67 #pragma warning (disable: 4275) // 'int' : forcing value to bool 'true' or 'false' (performance warning) 68 #pragma warning (disable: 4661) // no suitable definition provided for explicit template instantiation request 71 K_FORWARD( IRegister );
75 K_FORWARD( KEventBase );
76 K_FORWARD( KGlobalNamedEvent );
78 #ifdef FBSDKUseNamespace 89 #define FB_DEFAULT_SDK_ICON "openreality_noicon.png" 95 #define __FBClassInit mLocalPtr = NULL; 101 #define __FBClassDeInit if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;} 107 #define __FBClassInitSDKComponent( pObjectToWrappedIsAllocated ) \ 109 mSDKComponent = pObjectToWrappedIsAllocated; 132 #define __FBClassDeclare( Name,Parent ) \ 133 friend FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);\ 138 typedef Parent __FBParentClass;\ 142 typedef Name __FBClassType;\ 146 virtual const char* ClassName() override { return #Name; } \ 151 virtual bool Is( int pTypeId ) override { return (pTypeId==TypeInfo) ? true : Parent::Is( pTypeId ); } \ 152 virtual int GetTypeId() override { return TypeInfo; } \ 156 static int GetInternalClassId(); \ 160 Data##Name* mLocalPtr; \ 162 static int TypeInfo; \ 169 #define __FBClassDeclareGroup( Name,Parent ) \ 170 __FBClassDeclare( Name,Parent )\ 172 static const char* ClassGroupName; \ 182 #define FBStorableClassImplementation(ClassName, Type)\ 183 const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\ 184 HIObject RegisterStorable##ClassName##Create(HIObject , const char* pName, void* ){\ 185 ClassName* Class = new ClassName(pName);\ 186 Class->mAllocated = true;\ 187 if( Class->FBCreate() ){\ 188 __FBRemoveModelFromScene( Class->GetHIObject() ); \ 189 return Class->GetHIObject();\ 193 FBLibraryModule(ClassName##Storable){\ 194 FBString lGroup = "FbxStorable/";\ 196 FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);} 201 #define FBElementClassImplementation(ClassName,IconFileName)\ 202 HIObject RegisterElement##ClassName##Create(HIObject , const char* pName, void* ){\ 203 ClassName* Class = new ClassName(pName);\ 204 Class->mAllocated = true;\ 205 if( Class->FBCreate() ){\ 206 __FBRemoveModelFromScene( Class->GetHIObject() ); \ 207 return Class->GetHIObject();\ 211 FBLibraryModule(ClassName##Element){\ 212 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);} 217 #define FBShadingElementClassImplementation(ClassName,IconFileName)\ 218 HIObject RegisterShadingElement##ClassName##Create(HIObject , const char* pName, void* ){\ 219 ClassName* Class = new ClassName(pName);\ 220 Class->mAllocated = true;\ 221 if( Class->FBCreate() ){\ 222 return Class->GetHIObject();\ 226 FBLibraryModule(ClassName##ShadingElement){\ 227 FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);} 235 #define FBStorableClassDeclare(Name, Parent)\ 236 FBClassDeclare(Name, Parent);\ 238 virtual const char* FbxGetObjectSubType() override; \ 250 #define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \ 252 PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \ 253 PropName.TypeInfo = &Type::TypeInfo; \ 263 #define FBIS( Component,ComponentType ) \ 264 ((Component) && (Component)->Is( ComponentType::TypeInfo )) 281 #if !defined(K_NO_UI) 325 #define FBRegisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc ); 330 #define FBUnregisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc ); 336 FBSDK_DLL void FBSetStoreableCustomModelRegistered();
337 FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
343 FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
344 FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
350 FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
351 FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
353 FBSDK_DLL bool FBObject_Register (
const char * pGroupName,
const char * pEntryName,
const char * pDescription, kObjectCreatorFnc pCreatorFnc,
bool pIsMultipleAllowed,
const char * pIconFilename);
354 FBSDK_DLL bool FBObject_Unregister(
const char * pGroupName,
const char * pEntryName,
int nth=0 );
359 FBSDK_DLL const char* FBObject_GetGroupName (
int pGroupIndex );
360 FBSDK_DLL int FBObject_GetEntryCount (
int pGroupIndex );
361 FBSDK_DLL const char* FBObject_GetEntryName (
int pGroupIndex,
int pIndex );
362 FBSDK_DLL const char* FBObject_GetEntryDescription (
int pGroupIndex,
int pIndex,
int nth = 0 );
363 FBSDK_DLL const char* FBObject_GetEntryDLLName (
int pGroupIndex,
int pIndex,
int nth = 0 );
364 FBSDK_DLL const char* FBObject_GetIconName (
int pGroupIndex,
int pIndex,
int nth = 0 );
365 FBSDK_DLL bool FBObject_GetMultiplicity (
int pGroupIndex,
int pIndex,
int nth = 0 );
381 inline bool FBUnregisterObject(
const char * pGroupName,
const char * pEntryName,
int nth=0 ) {
return FBObject_Unregister( pGroupName,pEntryName,nth ); }
387 #define FBRegisterObject( LocalId,Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) \ 388 static int __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) 402 FBSDK_DLL int FBRegister_ClassId(
const char* pClassName);
408 #define FBDeclareUserObject(ClassName)\ 411 virtual int GetUserClassId();\ 412 virtual const char* FbxGetObjectSubType() override;\ 460 kFBFlagStorableBlindDataForceBinary = (1 << 20),
508 virtual void RemoveAt(
int pIndex );
522 virtual int GetCount();
537 void SetClassId(
int pClassId );
539 void SetListOfParents(
bool pListOfParents );
540 bool GetIsListOfParents();
578 virtual int GetCount();
600 virtual int SetAt(
int pIndex,
FBComponent* pObject);
605 virtual void RemoveAt(
int pIndex );
612 virtual int InsertAt(
int pIndex,
FBComponent* pObject);
616 virtual void Clear();
621 virtual void SetSingleConnect(
bool pSingleConnect);
626 virtual int GetSingleConnect();
631 void SetFilter(
int pInternalClassId);
667 #ifndef DOXYGEN_SHOULD_SKIP_THIS 668 DataFBComponent* mLocalPtr;
682 static int GetInternalClassId();
695 virtual bool FBCreate();
698 virtual void FBDestroy();
701 virtual void FBDelete()
override;
704 virtual bool SetHIObject(HIObject pObject,
bool pSDKComponent)
override;
710 virtual int PropertyAdd(
FBProperty* pProperty );
716 bool PropertyAddReferenceProperty(
FBProperty* pReferenceProperty );
738 FBProperty* PropertyCreate(
const char* pName,
FBPropertyType pType,
const char * pDataType,
bool pAnimatable,
bool pIsUser =
false,
FBProperty* pReferenceSource = NULL );
787 bool ProcessNamespaceHierarchy(
FBNamespaceAction pNamespaceAction,
const char* pNamespaceName,
const char* pReplaceTo=NULL,
bool pAddRight=
true );
799 bool ProcessObjectNamespace (
FBNamespaceAction pNamespaceAction,
const char* pNamespaceName,
const char* pReplaceTo=NULL,
bool pAddRight=
true );
804 virtual const char* ClassName()
override;
815 const char* GetFullName(
void );
837 #ifndef DOXYGEN_SHOULD_SKIP_THIS 840 void *
operator new(
size_t stAllocateBlock );
841 void operator delete(
void *pvMem );
843 void *
operator new(
size_t stAllocateBlock,
int blockType,
const char *filename,
int linenumber );
844 void operator delete(
void *pvMem,
int blockType,
const char *filename,
int linenumber );
851 void InvalidatePropertyEventsParents();
862 #if !defined(K_NO_FOLDER) 867 #ifndef DOXYGEN_SHOULD_SKIP_THIS 868 IObject_Declare(K_IMPLEMENTATION);
869 ICallback_Declare(K_IMPLEMENTATION);
876 virtual bool Is(
int pTypeId );
877 virtual int GetTypeId();
879 static void FBComponentSetName(
FBComponent* pObject,
const char *pName );
880 static const char* FBComponentGetName(
FBComponent* pObject );
882 static void FBComponentSetLongName(
FBComponent* pObject,
const char *pName );
883 static const char* FBComponentGetLongName(
FBComponent* pObject );
886 #ifndef DOXYGEN_SHOULD_SKIP_THIS 888 KObject* mDummyObject;
889 void KObjectEvent(HIRegister pView, HKEventBase pEvent);
903 HIObject lObject = pObject ?
FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
943 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__) 964 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1067 FBPlug* GetProperty(
void );
1073 void* GetData(
void );
1089 IObject_Declare(K_IMPLEMENTATION);
1090 ICallback_Declare(K_IMPLEMENTATION);
1096 virtual bool LibInit();
1102 virtual bool LibOpen();
1109 virtual bool LibReady();
1114 virtual bool LibClose();
1119 virtual bool LibRelease();
1121 KGlobalNamedEvent *mLibrary_Open,
1126 void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
1127 void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
1128 void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
1129 void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
1146 virtual bool LibInit();
1152 virtual bool LibOpen();
1159 virtual bool LibReady();
1164 virtual bool LibClose();
1169 virtual bool LibRelease();
1175 #if defined(K_NODLL) 1176 #define FBLibraryDeclare( LibName ) \ 1177 FB_DLL_INIT( LibName, Operation ) \ 1179 switch( Operation ) \ 1185 #define FBLibraryDeclare( LibName ) \ 1186 static FBLibrary LibName##GlobalFBLibrary; \ 1188 K_DLLEXPORT bool LIBRARY_INIT(HIError ) \ 1190 FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \ 1193 FB_DLL_INIT( LibName, Operation ) \ 1195 switch( Operation ) \ 1205 #define FBLibraryModule(Name) \ 1206 void FBModule##Name() 1212 #define FBLibraryRegister( ClassName ) \ 1213 extern void FBModule##ClassName( ); \ 1214 FBModule##ClassName( ); 1220 #define FBLibraryRegisterStorable( ClassName ) \ 1221 extern void FBModule##ClassName##Storable( ); \ 1222 FBModule##ClassName##Storable( ); 1228 #define FBLibraryRegisterElement( ClassName ) \ 1229 extern void FBModule##ClassName##Element( ); \ 1230 FBModule##ClassName##Element( ); 1236 #define FBLibraryRegisterShadingElement( ClassName ) \ 1237 extern void FBModule##ClassName##ShadingElement( ); \ 1238 FBModule##ClassName##ShadingElement( ); 1241 #define FBLibraryDeclareEnd \ 1254 #define FBCustomManagerImplementation( ThisComponent ) \ 1255 FBClassImplementation( ThisComponent ) \ 1260 #define FBRegisterCustomManager( ClassName ) \ 1261 FBLibraryModule( ClassName ) \ 1263 static ClassName g##ClassName; \ 1264 g##ClassName.FBCreate(); \ 1265 g##ClassName.RegisterManager(); \ 1271 #define FBCustomManagerDeclare( ClassName ) \ 1272 FBClassDeclare( ClassName, FBCustomManager ); \ 1274 ClassName() : FBCustomManager() { FBClassInit; } \ 1308 void RegisterManager();
1313 virtual bool FBCreate();
1321 virtual bool Init() ;
1328 virtual bool Open() ;
1334 virtual bool Clear() ;
1339 virtual bool Close() ;
1344 #ifdef FBSDKUseNamespace Can be selected. If disabled, representation of the object, like in the navigator, can still be selected and can still affect the original object.
FBPropertyPlug SrcPlug
Read Only Property: The source plug involved in the action.
K_DLLIMPORT void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
FBPropertyInt SrcIndex
Read Only Property: Index of the source in the destination component.
A template class for arrays.
#define __FBClassDeclare(Name, Parent)
For internal use only.
K_DLLIMPORT FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
Connection notify event class.
FBPropertyType
Property types.
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
PropertyList: Concrete class for PropertyList of component
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
Template class to contain an array of items.
FBPropertyPlug Plug
Read Only Property: The plug involved in the action.
K_DLLIMPORT FBComponent * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
FBPropertyConnectionAction Action
Read Only Property: Connection's action performed.
Can be visible. If disabled, the object will still be available in the navigator, it is only hidden i...
virtual bool UseCustomPropertyViewSet() const
Use the custom property viewSet or not.
FBPropertyListComponent Components
List: List of components.
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it's IObject interface into the proper class.
Created from System (not from user)
FBPropertyString LongName
Read Write Property: Name and namespace for object.
FBNamespaceAction
Namespace flags.
K_DLLIMPORT FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
Property: Base property class.
Remove all the namespace name.
Object which has kFlagUndoableSeparately flag turned on will have a separate Undo Stack...
KGlobalNamedEvent * mLibrary_Release
Library Release.
Object is allocated, so it must call 'delete this' on destroy.
Object can Key his property. (System Camera can't)
FBPropertyPlug Plug
Read Only Property: The plug involved in the action.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Object can be "detached". Used by the apply manager contextual menu.
FBPropertyFolder Folder
Read Write Property: The folder that contain this component.
static int TypeInfo
Contains the Type information of the object.
The entity will not add the namespace of the object to his list of all the namespaces of the scene...
K_DLLIMPORT FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
PropertyEvent: Base event class.
Definition of the class FBPlug and related enums and utility functions.
Object is in clearing operations (File new).
virtual FBPropertyType GetPropertyType() override
Get the property's type.
Library class for DLL registration.
Library class for DLL registration.
Object can undo its actions and states, in a global Undo Stack.
Objects Containing class.
Use to add a namespace name to object.
Visible in the Scene Navigator/Schematic View/Property View/Model View. If disabled, the object representation in the navigator will not be visible. In the Schematic View, system object are not shown and other objects will still be visible, but a red X will be drawn on them. It is not possible to select the object in the Schematic View. After disabling that flag of a selected object, it will still be selected to allow a script based on selection to work. It will then be possible for a user to deselect the object, but it will not be possible to select it.
Can be cloned. If disabled, the "Duplicate" option will be removed in the contextual menu...
K_DLLIMPORT void __FBAddModelToScene(HIObject pObject)
For internal usage only.
< Used in FBX SDK native IO, force bindary format for the bindary data.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
FBPropertyBool Selected
Read Write Property: Selected property.
K_DLLIMPORT FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=NULL, int nth=0)
FBCreateObject.
K_DLLIMPORT int FBDeleteObjectsByName(const char *pNamePattern, const char *pNameSpace=NULL, const char *pGroupName=NULL)
FBDeleteObjectsByName.
Connection notify event class.
FBPropertyPlug DstPlug
Read Only Property: The destination plug involved in the action.
HKEventBase HKEvent
HKEvent.
#define FBSDKNamespace
FBSDKNamespace define.
FBPropertyManager PropertyList
Read Only Property: Manages all of the properties for the component.
Property class: const char * (String).
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.
Object is in creation operations.
Connections Basic Open Reality SDK Element.
FBPropertyConnectionAction Action
Read Only Property: Connection's action performed.
Connection notify event class.
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
Object created/used by the Story tool. Useful flag for filtering Story objects.
Object (model) can be "parented". Used by the apply manager contextual menu.
Use to replace a define namespace.
FBPropertyConnectionType ConnectionType
Read Only Property: Connection's type.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
FBObjectStatus
Available lifetime status for any component.
K_DLLIMPORT HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
FBPropertyInt Type
Read Only Property: Type of event.
Object is in retrieving operations.
K_DLLIMPORT FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBPropertyPlug NewPlug
Read Only Property: New plug created by the action. (Mostly used by merge/replace) ...
Allow editing on the namespace objects. If disabled, the "Add/Remove Namespace..." option is removed ...
FBComponent FBObject
Equivalent to FBComponent for gradual transition.
Object is in storing operations.
K_DLLIMPORT void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
K_DLLIMPORT int __FBGetInternalClassId(int pTypeInfo)
__FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent's T...
Visual Component base class.
K_DLLIMPORT void FBFindObjectsByName(const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
FBFindObjectsByName.
FBPropertyString Name
Read Write Property: Unique name of object.
MotionBuilder SDK base class.
Used in FBX SDK native IO.
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
FBObjectFlag
Available flags for any component.
FBConnectionAction
Possible actions when a notify plug event occurs.
FBPropertyListComponent Parents
List: Parents.
K_DLLIMPORT int FBObject_GetGroupCount()
A set of functions to query the registration table.
Objects Containing class.
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
Object is in Merging operations.
K_DLLIMPORT FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
FBPropertyConnectionAction Action
Read Only Property: Connection's action performed.
Custom manager class for user controlled observer objects.
K_DLLIMPORT int __FBRegisterTypeInfo(int pInternalClassId)
__FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id...
Object is in destruction operations.
HIRegister HISender
HISender.