c4d_library.h File Reference

Classes

struct   C4DLibrary

Macros

#define  LIBOFFSET (s, m)

函数

Bool   InstallLibrary ( Int32 id, C4DLibrary *lib, Int32 version, Int32 size)
Bool   UninstallLibrary ( C4DLibrary *lib, Int32 version, Int32 size)
C4DLibrary CheckLib ( Int32 id, Int offset, C4DLibrary **store)
Bool   IsLibraryInstalled ( Int32 id)

Macro Definition Documentation

◆  LIBOFFSET

#define LIBOFFSET (   s,
 
)

Returns the offset of member m within the struct s .

参数
[in] s The struct name, for example MyLib .
[in] m The member name, for example MyFunction .

Function Documentation

◆  InstallLibrary()

Bool InstallLibrary ( Int32   id ,
C4DLibrary lib ,
Int32   version ,
Int32   size  
)

Registers a library with Cinema 4D .

参数
[in] id A unique plugin ID. Must be obtained from http://www.plugincafe.com
[in] lib The library structure to register. The caller owns the pointed structure.
[in] version The library version.
[in] size The size of the structure passed to lib .
返回
true if the library was registered, otherwise false .

◆  UninstallLibrary()

Bool UninstallLibrary ( C4DLibrary lib ,
Int32   version ,
Int32   size  
)

Unregisters a library with Cinema 4D .

参数
[in] lib The library structure to unregister. The caller owns the pointed structure.
[in] version The library version.
[in] size The size of the structure passed to lib .
返回
true if the library was unregistered, otherwise false .

◆  CheckLib()

C4DLibrary * CheckLib ( Int32   id ,
Int   offset ,
C4DLibrary **  store  
)

Retrieves a pointer to a library if it is installed.

参数
[in] id The library plugin ID.
[in] offset Pass LIBOFFSET(LIBRARY_CLASS, MEMBER_NAME) ,其中 LIBRARY_CLASS is a struct derived from C4DLibrary and MEMBER_NAME is a member to access.
范例: LIBOFFSET(MyLib, MyFunction)
[in] store Pass a pointer to a global pointer that can be used as cache for the library address.
CheckLib() will then use this address instead of looking it up each time.
返回
The library, or nullptr if the requested offset is not valid.

◆  IsLibraryInstalled()

Bool IsLibraryInstalled ( Int32   id )

Checks if a library is installed.

参数
[in] id The plugin ID of the library to check.
返回
true if the library is installed, otherwise false .