c4d_library.h File Reference

Classes

struct  C4DLibrary
 

Macros

#define LIBOFFSET(s, m)
 

Functions

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

Macro Definition Documentation

◆ LIBOFFSET

#define LIBOFFSET (   s,
  m 
)

Returns the offset of member m within the struct s.

Parameters
[in]sThe struct name, for example MyLib.
[in]mThe member name, for example MyFunction.

Function Documentation

◆ InstallLibrary()

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

Registers a library with Cinema 4D.

Parameters
[in]idA unique plugin ID. Must be obtained from http://www.plugincafe.com
[in]libThe library structure to register. The caller owns the pointed structure.
[in]versionThe library version.
[in]sizeThe size of the structure passed to lib.
Returns
true if the library was registered, otherwise false.

◆ UninstallLibrary()

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

Unregisters a library with Cinema 4D.

Parameters
[in]libThe library structure to unregister. The caller owns the pointed structure.
[in]versionThe library version.
[in]sizeThe size of the structure passed to lib.
Returns
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.

Parameters
[in]idThe library plugin ID.
[in]offsetPass LIBOFFSET(LIBRARY_CLASS, MEMBER_NAME), where LIBRARY_CLASS is a struct derived from C4DLibrary and MEMBER_NAME is a member to access.
Example: LIBOFFSET(MyLib, MyFunction)
[in]storePass 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.
Returns
The library, or nullptr if the requested offset is not valid.

◆ IsLibraryInstalled()

Bool IsLibraryInstalled ( Int32  id)

Checks if a library is installed.

Parameters
[in]idThe plugin ID of the library to check.
Returns
true if the library is installed, otherwise false.