c4d_general.h File Reference

Classes

class  ParserCache
 
class  Parser
 
struct  SerialInfo
 
class  Registry
 
class  GeDebugDisableFPExceptions
 
class  LassoSelection
 
class  DebugTimer
 

Macros

#define NEWPARSERERROR_BADSTRING
 
#define NEWPARSERERROR_BADEXECUTION
 
#define NEWPARSERERROR_MEMORYERROR
 
#define NEWPARSERERROR_NUMBERERROR
 
#define UNIT_NONE
 
#define UNIT_KM
 
#define UNIT_M
 
#define UNIT_CM
 
#define UNIT_MM
 
#define UNIT_UM
 
#define UNIT_NM
 
#define UNIT_MILE
 
#define UNIT_YARD
 
#define UNIT_FEET
 
#define UNIT_INCH
 
#define ANGLE_DEG
 
#define ANGLE_RAD
 
#define COREMSG_CINEMA
 
#define COREMSG_CINEMA_GETMACHINEFEATURES
 
#define OPENGL_TYPE_AVAILABLE
 
#define OPENGL_EXTENSION_STRING
 
#define OPENGL_SUPPORT_GL_EXT_SEPARATE_SPECULAR_COLOR
 
#define OPENGL_SUPPORT_ENHANCED
 
#define OPENGL_RENDERER_NAME
 
#define OPENGL_VERSION_STRING
 
#define OPENGL_VENDOR_NUM
 
#define OPENGL_VENDOR_UNKNOWN
 
#define OPENGL_VENDOR_NVIDIA
 
#define OPENGL_VENDOR_ATI
 
#define OPENGL_VENDOR_INTEL
 
#define OPENGL_VENDOR_APPLE
 
#define OPENGL_VENDOR_NAME
 
#define OPENGL_SHADING_LANGUAGE_VERSION_STRING
 
#define OPENGL_VERTEXBUFFER_OBJECT
 
#define OPENGL_FRAMEBUFFER_OBJECT
 
#define OPENGL_MULTITEXTURE
 
#define OPENGL_MAX_2DTEXTURE_SIZE
 
#define OPENGL_MAX_3DTEXTURE_SIZE
 
#define OPENGL_MAX_TEXCOORD
 
#define OPENGL_MAX_TEX_IMAGE_UNITS_VERTEX
 
#define OPENGL_MAX_TEX_IMAGE_UNITS_FRAGMENT
 
#define OPENGL_MAX_VP_INSTRUCTIONS
 
#define OPENGL_MAX_FP_INSTRUCTIONS
 
#define OPENGL_FLOATINGPOINT_TEXTURE
 
#define OPENGL_NONPOWEROF2_TEXTURE
 
#define OPENGL_DEPTH_TEXTURE
 
#define OPENGL_CG_TOOLKIT
 
#define OPENGL_MAX_TEXTURE_INDIRECTIONS
 
#define OPENGL_CG_LATEST_VERTEX_PROFILE
 
#define OPENGL_CG_LATEST_FRAGMENT_PROFILE
 
#define OPENGL_CG_LATEST_VERTEX_PROFILE_NAME
 
#define OPENGL_CG_LATEST_FRAGMENT_PROFILE_NAME
 
#define OPENGL_DRIVER_VERSION_STRING
 
#define OPENGL_CG_VERSION_STRING
 
#define OPENGL_FBO_Z_DEPTH
 
#define OPENGL_FRAMEBUFFER_OBJECT_MULTISAMPLE
 
#define OPENGL_MAX_ELEMENT_VERTICES
 
#define OPENGL_MAX_ELEMENT_INDICES
 
#define OPENGL_MAX_TEX_IMAGE_UNITS_GEOMETRY
 
#define OPENGL_CG_LATEST_GEOMETRY_PROFILE
 
#define OPENGL_CG_LATEST_GEOMETRY_PROFILE_NAME
 
#define OPENGL_VERSION_INT
 
#define OPENGL_GLSL_VERSION_INT
 
#define OPENGL_MAX_RENDERBUFFER_SAMPLES
 
#define OPENGL_RENDERBUFFER_MASK
 
#define OPENGL_RENDER_TO_FP16_TEXTURE
 
#define OPENGL_RENDER_TO_FP32_TEXTURE
 
#define OPENGL_STEREO_BUFFER
 
#define OPENGL_DRIVER_OUTDATED
 
#define OPENGL_SUPPORT_PRIMITIVERESTARTINDEX
 
#define OPENGL_SUPPORT_GEOMETRYSHADER
 
#define OPENGL_SUPPORT_OSX_10_7
 
#define OPENGL_MAX_TEX_IMAGE_UNITS_TESS_CONTROL
 
#define OPENGL_MAX_TEX_IMAGE_UNITS_TESS_EVAL
 
#define OPENGL_MAX_TESSELLATION_LEVEL
 
#define MACHINEINFO_OSTYPE
 
#define MACHINEINFO_OSVERSION
 
#define MACHINEINFO_PROCESSORTYPE
 
#define MACHINEINFO_PROCESSORNAME
 
#define MACHINEINFO_PROCESSORFEATURES
 
#define MACHINEINFO_NUMBEROFPROCESSORS
 
#define MACHINEINFO_MACHINEMODEL
 
#define MACHINEINFO_COMPUTERNAME
 
#define MACHINEINFO_USERNAME
 
#define MACHINEINFO_PROCESSORSPEED_MHZ
 
#define MACHINEINFO_C4DBUILDID
 
#define MACHINEINFO_C4DTYPE
 
#define MACHINEINFO_PROCESSORHTCOUNT
 
#define MACHINEINFO_PHYSICAL_RAM_SIZE
 
#define MACHINEINFO_LOADEDPLUGINS
 
#define C4D_MEMORY_STAT_MEMORY_INUSE
 
#define C4D_MEMORY_STAT_MEMORY_PEAK
 
#define C4D_MEMORY_STAT_NO_OF_ALLOCATIONS_TOTAL
 
#define C4D_MEMORY_STAT_NO_OF_ALLOCATIONS_CURRENT
 
#define C4D_MEMORY_STAT_EOGL_TEXBUFFER
 
#define C4D_MEMORY_STAT_EOGL_VERTEXBUFFER
 
#define C4D_MEMORY_STAT_LOWMEMCNT
 
#define C4D_MEMORY_STAT_EOGL_VERTEXBUFFER_CNT
 
#define C4D_MEMORY_STAT_EOGL_TEXTUREBUFFER_CNT
 
#define C4D_MEMORY_STAT_OPENGL_TOTAL
 
#define C4D_MEMORY_STAT_OPENGL_FREE
 
#define POPUPEDITTEXTCALLBACK_TEXTCHANGED
 
#define POPUPEDITTEXTCALLBACK_CLOSED
 
#define POPUPEDITTEXTCALLBACK_CANCELED
 
#define POPUPEDITTEXTCALLBACK_CURSOR_UP
 
#define POPUPEDITTEXTCALLBACK_CURSOR_DOWN
 
#define SENDMAIL_SENDDIRECTLY
 
#define SHORTCUT_PLUGINID
 
#define SHORTCUT_ADDRESS
 
#define SHORTCUT_OPTIONMODE
 
#define CLIPBOARDOWNER_BODYPAINT
 
#define CLIPBOARDOWNER_PICTUREVIEWER
 

Enumerations

enum  Result {
  RES_FALSE,
  RES_TRUE,
  RES_MEM_ERR,
  RES_STOP,
  RES_DUM
}
 
enum  MachineFeaturesType {
  CURRENT,
  HARDWARE_OGL,
  SOFTWARE_OGL
}
 

Functions

void GeGetSerialInfo (SERIALINFO type, SerialInfo *si)
 
VERSIONTYPE GeGetVersionType (void)
 
Bool IsNet ()
 
Bool IsServer ()
 
Bool IsClient ()
 
SYSTEMINFO GeGetSystemInfo (void)
 
void GeShowMouse (Int32 v)
 
Bool GeGetScreenDimensions (Int32 x, Int32 y, Bool whole_screen, Int32 *sx1, Int32 *sy1, Int32 *sx2, Int32 *sy2)
 
Int32 GeGetTimer (void)
 
Float64 GeGetMilliSeconds (void)
 
String GeGetLineEnd (void)
 
Int32 GeGetDefaultFPS (void)
 
UInt32 GeGetCinemaInfo (CINEMAINFO info)
 
GEMB_R GeOutString (const String &str, GEMB flags)
 
OPERATINGSYSTEM GeGetCurrentOS (void)
 
BYTEORDER GeGetByteOrder (void)
 
void GeGetGray (Int32 *r, Int32 *g, Int32 *b)
 
Bool GeChooseColor (Vector *col, Int32 flags)
 
Bool GeOpenHTML (const String &webaddress)
 
Bool GeChooseFont (BaseContainer *bc)
 
Bool GeRegisterPlugin (PLUGINTYPE type, Int32 id, const String &str, void *data, Int32 datasize)
 
void GePrint (const String &str)
 
void GeConsoleOut (const String &str)
 
Bool GeGetMovieInfo (const Filename &fn, Int32 *frames, Float *fps)
 
Bool RenameDialog (String *str)
 
Int32 GetC4DVersion (void)
 
String GeGetDegreeChar ()
 
String GeGetPercentChar ()
 
void SetMousePointer (Int32 l)
 
Bool ShowBitmap (const Filename &fn)
 
Bool ShowBitmap (BaseBitmap *bm)
 
void StopAllThreads (void)
 
Bool ShutdownThreads (Bool shutdown)
 
void SpecialEventAdd (Int32 messageid, UInt p1=0, UInt p2=0)
 
void EventAdd (EVENT eventflag=EVENT_0)
 
Bool GeSyncMessage (Int32 messageid, Int32 destid=0, UInt p1=0, UInt p2=0)
 
Bool DrawViews (DRAWFLAGS flags, BaseDraw *bd=nullptr)
 
Bool SendModelingCommand (Int32 command, ModelingCommandData &data)
 
Filename GetGlobalTexturePath (Int32 i)
 
void SetGlobalTexturePath (Int32 i, const Filename &fn)
 
Bool GenerateTexturePath (const Filename &docpath, const Filename &srcname, const Filename &suggestedfolder, Filename *dstname, NetRenderService *service=nullptr, BaseThread *bt=nullptr)
 
Bool IsInSearchPath (const Filename &texfilename, const Filename &docpath)
 
void FlushTexture (const Filename &docpath, const String &name, const Filename &suggestedfolder)
 
void FlushUnusedTextures (void)
 
BaseContainer GetWorldContainer (void)
 
BaseContainerGetWorldContainerInstance (void)
 
void SaveWorldPreferences ()
 
void SetWorldContainer (const BaseContainer &bc)
 
Vector GetViewColor (Int32 colid)
 
void SetViewColor (Int32 colid, const Vector &col)
 
void ErrorStringDialog (CHECKVALUERANGE type, Float x, Float y, CHECKVALUEFORMAT is)
 
Bool ReadPluginInfo (Int32 pluginid, void *buffer, Int32 size)
 
Bool WritePluginInfo (Int32 pluginid, void *buffer, Int32 size)
 
Bool ReadRegInfo (Int32 pluginid, void *buffer, Int32 size)
 
Bool WriteRegInfo (Int32 pluginid, void *buffer, Int32 size)
 
BaseContainerGetWorldPluginData (Int32 id)
 
Bool SetWorldPluginData (Int32 id, const BaseContainer &bc, Bool add=true)
 
BaseContainerGetToolPluginData (BaseDocument *doc, Int32 id)
 
Bool GeIsActiveToolEnabled (void)
 
ToolPluginGetActiveTool ()
 
Bool GeGetLanguage (Int32 index, String *extension, String *name, Bool *default_language)
 
Filename GeFilterSetSuffix (const Filename &name, Int32 id)
 
IDENTIFYFILE GeIdentifyFile (const Filename &name, UChar *probe, Int32 probesize, IDENTIFYFILE recognition, BasePlugin **bp)
 
GeListHeadGetScriptHead (Int32 type)
 
Int32 GetDynamicScriptID (BaseList2D *bl)
 
Bool GetCommandLineArgs (C4DPL_CommandLineArgs &args)
 
String GetObjectName (Int32 type)
 
String GetTagName (Int32 type)
 
Int32 GetObjectType (const String &name)
 
Int32 GetTagType (const String &name)
 
Bool GeRegistryAdd (Int32 sub_id, REGISTRYTYPE main_id, void *data)
 
Bool GeRegistryRemove (Int32 sub_id, REGISTRYTYPE main_id)
 
RegistryGeRegistryFind (Int32 sub_id, REGISTRYTYPE main_id)
 
RegistryGeRegistryGetLast (REGISTRYTYPE main_id)
 
RegistryGeRegistryGetFirst (REGISTRYTYPE main_id)
 
Bool GeRegistryGetAutoID (Int32 *id)
 
Bool GePluginMessage (Int32 id, void *data)
 
Bool CheckIsRunning (CHECKISRUNNING type)
 
String GeGetDefaultFilename (Int32 id)
 
void FindInManager (BaseList2D *bl)
 
void GeSleep (Int32 milliseconds)
 
Bool GeIsMainThread ()
 
Bool GeIsMainThreadAndNoDrawThread ()
 
Int32 GeDebugSetFloatingPointChecks (Int32 on)
 
void _GeDebugBreak (Int32 line, const Char *file)
 
void GeDebugOut (const Char *s,...)
 
void GeDebugOut (const String &s)
 
GeData SendCoreMessage (Int32 coreid, const BaseContainer &msg, Int32 eventid=0)
 
String GetMacModel (const String &machinemodel)
 
BaseContainer GetMachineFeatures (MachineFeaturesType type=MachineFeaturesType::HARDWARE_OGL)
 
Bool GeGetMemoryStat (BaseContainer &stat)
 
Bool PopupEditText (Int32 screenx, Int32 screeny, Int32 width, Int32 height, const String &changeme, Int32 flags, PopupEditTextCallback *func, void *userdata)
 
void StartEditorRender (Bool active_only, Bool raybrush, Int32 x1, Int32 y1, Int32 x2, Int32 y2, BaseThread *bt, BaseDraw *bd, Bool newthread)
 
String FormatNumber (const GeData &val, Int32 format, Int32 fps, Bool bUnit=true)
 
GeData StringToNumber (const String &text, Int32 format, Int32 fps, const LENGTHUNIT *lengthunit=nullptr)
 
void CallCommand (Int32 id, Int32 subid=0)
 
String GetCommandName (Int32 id)
 
String GetCommandHelp (Int32 id)
 
Bool IsCommandEnabled (Int32 id)
 
Bool IsCommandChecked (Int32 id)
 
Bool SendMailAvailable ()
 
Bool SendMail (const String &t_subject, const String *t_to, const String *t_cc, const String *t_bcc, Filename *t_attachments, const String &t_body, Int32 flags)
 
Bool GetSystemEnvironmentVariable (const String &varname, String &result)
 
Bool AskForAdministratorPrivileges (const String &msg, const String &caption, Bool allowsuperuser, void **token)
 
void EndAdministratorPrivileges ()
 
void RestartApplication (const Utf16Char *param=nullptr, Int32 exitcode=0, const Utf16Char **path=nullptr)
 
void SetExitCode (Int32 exitCode)
 
void GeUpdateUI ()
 
Int32 GetShortcutCount ()
 
BaseContainer GetShortcut (Int32 index)
 
Bool AddShortcut (const BaseContainer &bc)
 
Bool RemoveShortcut (Int32 index)
 
Bool LoadShortcutSet (const Filename &fn, Bool add)
 
Bool SaveShortcutSet (const Filename &fn)
 
Int32 FindShortcutsFromID (Int32 pluginid, Int32 *indexarray, Int32 maxarrayelements)
 
Int32 FindShortcuts (const BaseContainer &scut, Int32 *idarray, Int32 maxarrayelements)
 
Bool CheckCommandShortcut (Int32 id, Int32 key, Int32 qual)
 
void InsertCreateObject (BaseDocument *doc, BaseObject *op, BaseObject *activeobj=nullptr)
 
void CopyToClipboard (const String &text)
 
void CopyToClipboard (BaseBitmap *map, Int32 ownerid)
 
Bool GetStringFromClipboard (String *txt)
 
Bool GetBitmapFromClipboard (BaseBitmap *map)
 
CLIPBOARDTYPE GetClipboardType (void)
 
Int32 GetC4DClipboardOwner (void)
 
void BrowserLibraryPopup (Int32 mx, Int32 my, Int32 defw, Int32 defh, Int32 pluginwindowid, Int32 presettypeid, void *userdata, BrowserPopupCallback callback)
 
const BaseBitmapGetCursorBitmap (Int32 type, Int32 &hotspotx, Int32 &hotspoty)
 

Swap/Intel/Motorola Conversions

void lSwap (void *adr, Int cnt=1)
 
void wSwap (void *adr, Int cnt=1)
 
void lIntel (void *adr, Int cnt=1)
 
void wIntel (void *adr, Int cnt=1)
 
void lMotor (void *adr, Int cnt=1)
 
void wMotor (void *adr, Int cnt=1)
 
void llSwap (void *adr, Int cnt=1)
 
void llIntel (void *adr, Int cnt=1)
 
void llMotor (void *adr, Int cnt=1)
 
void vlSwap (void *adr, Int32 cnt=1)
 
void vlIntel (void *adr, Int32 cnt=1)
 
void vlMotor (void *adr, Int32 cnt=1)
 

Background Handler

void GeAddBackgroundHandler (BackgroundHandler *handler, void *tdata, Int32 typeclass, Int32 priority)
 
Bool GeRemoveBackgroundHandler (void *tdata, Int32 typeclass)
 
void GeStopBackgroundThreads (Int32 typeclass, BACKGROUNDHANDLERFLAGS flags)
 
Bool GeCheckBackgroundThreadsRunning (Int32 typeclass, Bool all)
 
void GeProcessBackgroundThreads (Int32 typeclass)
 

Status

void StatusClear (void)
 
void StatusSetSpin (void)
 
void StatusSetBar (Int32 p)
 
void StatusSetText (const String &str)
 
void StatusNetClear (void)
 
void StatusSetNetLoad (STATUSNETSTATE status)
 
void StatusSetNetBar (Int32 p, const GeData &dat)
 
void StatusSetNetText (const String &str)
 

Macro Definition Documentation

§ SENDMAIL_SENDDIRECTLY

#define SENDMAIL_SENDDIRECTLY

Function Documentation

§ GeGetSerialInfo()

void GeGetSerialInfo ( SERIALINFO  type,
SerialInfo si 
)

Retrieves the registration information for Cinema 4D.
A registration information is an eleven digits string formatted as AA-B-CCC-DDDDD A multi-license issued by a MAXON License Server looks like: 20904200519
A multi-license issued by a RLM License Server looks like: 22904200519
The 1st and 2nd digits represent the application number and are equal to "20" for licenses served by a MAXON license server, to "22" for licenses served by an RLM license server or equal to the product bundle for stand-alone licenses. The 3rd digit equals the Cinema 4D release (in the above example it's Release 19). The 4th, 5th and 6th digits equal the number of the maximum number of seats a multi-seat license can issue (in the above examples it is 42 seats). The remaining digits equal the Unique License Number (in the above example it is 00519).

To check for multi and single license use:

if (si.nr.Content())
{
// RLM multi-license, do something
}
else
{
if(si.nr.Content())
{
// MAXON multi-license, do something
}
else
{
// single-license, do something
}
}
Parameters
[in]typeThe serial information to retrieve: SERIALINFO
[out]siFilled with the serial information.

§ GeGetVersionType()

VERSIONTYPE GeGetVersionType ( void  )

Retrieves the type of Cinema 4D application that is running.

Returns
The version type: VERSIONTYPE

§ IsNet()

Bool IsNet ( )

Checks if either a NET server or client application is running.

Returns
true if NET is running, otherwise false.

§ IsServer()

Bool IsServer ( )

Checks if a NET server application is running.

Returns
true if NET is running as server, otherwise false.

§ IsClient()

Bool IsClient ( )

Checks if a NET client application is running.

Returns
true if NET is running as client, otherwise false.

§ GeGetSystemInfo()

SYSTEMINFO GeGetSystemInfo ( void  )

Retrieves system information flags.

Returns
The system information: SYSTEMINFO

§ GeShowMouse()

void GeShowMouse ( Int32  v)

Sets the type of mouse pointer.

Warning
Should only be called from the main thread.
Parameters
[in]vThe mouse pointer: MOUSE

§ GeGetScreenDimensions()

Bool GeGetScreenDimensions ( Int32  x,
Int32  y,
Bool  whole_screen,
Int32 sx1,
Int32 sy1,
Int32 sx2,
Int32 sy2 
)

Retrieves the screen dimensions in pixels.

Parameters
[in]xThe screen X coordinates to identify which display information is read (for multi-display setups).
[in]yThe screen Y coordinates to identify which display information is read (for multi-display setups).
[in]whole_screentrue if dimensions of the whole screen (including task bar etc.) are returned, otherwise false.
[out]sx1Assigned the minimum X coordinate (left).
[out]sy1Assigned the minimum Y coordinate (top).
[out]sx2Assigned the maximum X coordinate (right).
[out]sy2Assigned the maximum Y coordinate (bottom).
Returns
true if successful, otherwise false.

§ GeGetTimer()

Int32 GeGetTimer ( void  )

Retrieves the current timer count in milliseconds.

Returns
The current timer count in milliseconds.

§ GeGetMilliSeconds()

Float64 GeGetMilliSeconds ( void  )

Get the current timer count in milliseconds.

Returns
The current timer count in milliseconds.

§ GeGetLineEnd()

String GeGetLineEnd ( void  )

Retrieves a string that contains the type of line ending characters for the running OS.

Returns
The type of line ending.

§ GeGetDefaultFPS()

Int32 GeGetDefaultFPS ( void  )

Retrieves the default frames per second.

Returns
The default FPS value.

§ GeGetCinemaInfo()

UInt32 GeGetCinemaInfo ( CINEMAINFO  info)

Retrieves information about Cinema 4D's application runtime.

Parameters
[in]infoThe information type: CINEMAINFO
Returns
The Cinema 4D's information.

§ GeOutString()

GEMB_R GeOutString ( const String str,
GEMB  flags 
)

Displays a message box with the string as the text.

Parameters
[in]strThe dialog box message.
[in]flagsThe flags: GEMB
Returns
The result from the message box: GEMB_R

§ GeGetCurrentOS()

OPERATINGSYSTEM GeGetCurrentOS ( void  )

Retrieves the type of OS that is running Cinema 4D.

Returns
The OS running: OPERATINGSYSTEM

§ GeGetByteOrder()

BYTEORDER GeGetByteOrder ( void  )

Retrieves the byte order for the platform that Cinema 4D is running on.

Returns
The byte order: BYTEORDER

§ GeGetGray()

void GeGetGray ( Int32 r,
Int32 g,
Int32 b 
)

Retrieves the color values for the default Cinema 4D gray.

Parameters
[out]rAssigned the red component of the gray color.
[out]gAssigned the green component of the gray color.
[out]bAssigned the blue component of the gray color.

§ GeChooseColor()

Bool GeChooseColor ( Vector col,
Int32  flags 
)

Opens a color chooser dialog for the user to select a color.

Parameters
[in,out]colThe initial color for the dialog and assigned the chosen color.
[in]flagsUsually 0 or one of the following flags to use the correct color profile for display: DR_COLORFIELD_ICC_BASEDOC or DR_COLORFIELD_ICC_BPTEX.
Returns
true if successful, otherwise false.

§ GeOpenHTML()

Bool GeOpenHTML ( const String webaddress)

Opens a URL in the user's default web browser.

Note
The passed URL string has to be spec conform, see IETF - Uniform Resource Locators.
Parameters
[in]webaddressThe URL to open.
Returns
true if successful, otherwise false.

§ GeChooseFont()

Bool GeChooseFont ( BaseContainer bc)

Opens a font chooser dialog for the user to select a font.

Parameters
[in]bcAssigned the selected font settings.
Returns
true if a new font was chosen, otherwise false.

§ GeRegisterPlugin()

Bool GeRegisterPlugin ( PLUGINTYPE  type,
Int32  id,
const String str,
void *  data,
Int32  datasize 
)

Deprecated. Use the individual functions for each plugin type instead.
See Plugin Types.

§ GePrint()

void GePrint ( const String str)

Outputs a string to the Cinema 4D console window.

Parameters
[in]strThe string to display in the console window.

§ GeConsoleOut()

void GeConsoleOut ( const String str)

Outputs a string to the Cinema 4D debug console window.
See Debug Information.

Parameters
[in]strThe string to display in the debug console window.

§ GeGetMovieInfo()

Bool GeGetMovieInfo ( const Filename fn,
Int32 frames,
Float fps 
)

Retrieves information from a movie file.

Parameters
[in]fnThe filename of the movie file to retrieve the information from.
[out]framesAssigned the number of frames.
[out]fpsAssigned the number of frames per second.
Returns
true if successful, otherwise false.

§ RenameDialog()

Bool RenameDialog ( String str)

Opens a standard rename dialog.

Parameters
[in,out]strThe string with the name to change. Assigned the new name. The caller owns the pointed string.
Returns
true if the name was changed, otherwise false.

§ GetC4DVersion()

Int32 GetC4DVersion ( void  )

Retrieves the version of Cinema 4D that is running.

Returns
The version of Cinema 4D.

§ GeGetDegreeChar()

String GeGetDegreeChar ( )

Retrieves the degree character (°).

Returns
A string containing the degree character.

§ GeGetPercentChar()

String GeGetPercentChar ( )

Retrieves the percent character (%).

Returns
A string containing the percent character.

§ lSwap()

void lSwap ( void *  adr,
Int  cnt = 1 
)

Swaps the bytes of Int values. (Converting between big endian and little endian.)

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ wSwap()

void wSwap ( void *  adr,
Int  cnt = 1 
)

Swaps the low and high bytes of UInt values. (Converting between big endian and little endian.)

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ lIntel()

void lIntel ( void *  adr,
Int  cnt = 1 
)

Convert Int values to Intel format. If already in Intel (i.e on a PC) the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ wIntel()

void wIntel ( void *  adr,
Int  cnt = 1 
)

Converts UInt values to Intel format. If already in Intel (i.e on a PC) the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ lMotor()

void lMotor ( void *  adr,
Int  cnt = 1 
)

Converts Int values to Motorola format. If already in Motorola (i.e on a Mac) the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ wMotor()

void wMotor ( void *  adr,
Int  cnt = 1 
)

Convert UInt values to Motorola format. If already in Motorola (i.e on a Mac) then the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ llSwap()

void llSwap ( void *  adr,
Int  cnt = 1 
)

Swaps the bytes of Int64 values. (Converting between big endian and little endian.)

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ llIntel()

void llIntel ( void *  adr,
Int  cnt = 1 
)

Converts Int64 values to Intel format. If already in Intel (i.e on a PC) the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ llMotor()

void llMotor ( void *  adr,
Int  cnt = 1 
)

Converts Int64 values to Motorola format. If already in Motorola (i.e on a Mac) the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ vlSwap()

void vlSwap ( void *  adr,
Int32  cnt = 1 
)

Swaps the bytes of Int values. (Converting between big endian and little endian.)

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ vlIntel()

void vlIntel ( void *  adr,
Int32  cnt = 1 
)

Converts Int values to Intel format. If already in Intel (i.e on a PC) then the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ vlMotor()

void vlMotor ( void *  adr,
Int32  cnt = 1 
)

Converts Int values to Motorola format. If already in Motorola (i.e on a Mac) then the values remain unchanged.

Parameters
[in]adrThe address of the memory. The caller owns the pointed memory buffer or variable at adr.
[in]cntThe number of elements in the memory buffer at adr (1 for a single element or variable).

§ GeAddBackgroundHandler()

void GeAddBackgroundHandler ( BackgroundHandler handler,
void *  tdata,
Int32  typeclass,
Int32  priority 
)

Adds a background handler with the given typeclass and priority. Remove it with GeRemoveBackgroundHandler().
A background handler is a hook that Cinema 4D processes when idle.
The advantage over a regular thread or timer is that it always will be called at a certain position. As a result it will not block other Cinema 4D operations (noticeable slowdown).
Cinema 4D itself uses background handler for example to redraw the view if it was stopped, to render material previews, to update the material preview in AM & MM, to draw the ants in BodyPaint 3D etc.

Warning
Background handlers must only be used if you know exactly what you are doing. They need to be thoroughly tested since a bug introduced can mess up the whole application's behavior.
Parameters
[in]handlerThe background handler.
[in]tdataThe private data. This will be passed on to the handler.
[in]typeclassA unique plugin ID. Must be obtained from http://www.plugincafe.com
There can be many handlers with the same class as long as they have different tdata.
[in]priorityThe handler priority. Higher absolute values are evaluated before lower. A negative value means that it does not block positive priorities.
Examples:
#define BACKGROUNDHANDLER_PRIORITY_RENDERACTIVEMATERIAL 5000
#define BACKGROUNDHANDLER_PRIORITY_REDRAWVIEW 4000
#define BACKGROUNDHANDLER_PRIORITY_RENDERINACTIVEMATERIALS 3000
#define BACKGROUNDHANDLER_PRIORITY_RENDEREXTERNAL -1000
#define BACKGROUNDHANDLER_PRIORITY_REDRAWANTS -2000
#define BACKGROUNDHANDLER_PRIORITY_PREVIEWCACHE 6000
#define BACKGROUNDHANDLER_PRIORITY_PREVIEWCACHE_ANIMATION 2000
#define BACKGROUNDHANDLER_PRIORITY_PREVIEWCACHE_ASYNC 3500
The external render thread (output window) does not block the editor display.
However, if e.g. an inactive material is being rendered the view will not be redrawn until the other thread finishes.

§ GeRemoveBackgroundHandler()

Bool GeRemoveBackgroundHandler ( void *  tdata,
Int32  typeclass 
)

Removes background handlers added with GeAddBackgroundHandler().

Parameters
[in]tdataThe registered data.
[in]typeclassThe registered type class ID.
Returns
true if successful, otherwise false.

§ GeStopBackgroundThreads()

void GeStopBackgroundThreads ( Int32  typeclass,
BACKGROUNDHANDLERFLAGS  flags 
)

Stops all running background threads of the given typeclass. If typeclass==0 all threads are stopped.

Parameters
[in]typeclassThe type class ID to stop, or 0 for all classes.
[in]flagsIf typeclass is BACKGROUNDHANDLER_TYPECLASS_C4D then the flags have the following meaning:: BACKGROUNDHANDLERFLAGS
For own type classes define flags as needed, they will be routed to the background handler function.
For example GeStopBackgroundThreads(BACKGROUNDHANDLER_TYPECLASS_C4D, BACKGROUNDHANDLER_FLAGS_EDITORRENDDER) will only stop the editor renderer (if it was running).
GeStopBackgroundThreads(0, BACKGROUNDHANDLERFLAGS_SHUTDOWN) will kill anything running.

§ GeCheckBackgroundThreadsRunning()

Bool GeCheckBackgroundThreadsRunning ( Int32  typeclass,
Bool  all 
)

Checks if any of the background threads matching typeclass is running. If typeclass==0 all threads are checked.
For example GeCheckBackgroundThreadsRunning(BACKGROUNDHANDLER_TYPECLASS_C4D, true) checks if Cinema 4D is doing anything right now.
If all=false was passed it would not check for the external renderer and ants (which are always running in a BodyPaint 3D selection).

Parameters
[in]typeclassThe type class ID to check, or 0 for all classes.
[in]allIf true, negative priorities are also checked.
Returns
true if the specified background threads are running, otherwise false.

§ GeProcessBackgroundThreads()

void GeProcessBackgroundThreads ( Int32  typeclass)

Called by Cinema 4D when it is idle. It checks the background handlers if they have something to do.

Parameters
[in]typeclassA specific type class ID, or 0 for all classes.

§ SetMousePointer()

void SetMousePointer ( Int32  l)

Sets the type of mouse pointer.

Parameters
[in]lThe mouse pointer: MOUSE

§ ShowBitmap() [1/2]

Bool ShowBitmap ( const Filename fn)

Displays a bitmap into the Picture Viewer.

Warning
Must be called from the main thread.
Parameters
[in]fnThe filename of the bitmap to display.
Returns
true if successful, otherwise false.

§ ShowBitmap() [2/2]

Bool ShowBitmap ( BaseBitmap bm)

Displays a bitmap into the Picture Viewer.

Note
The bitmap will be copied for display.
Warning
Must be called from the main thread.
Parameters
[in]bmThe bitmap to display.
Returns
true if successful, otherwise false.

§ StopAllThreads()

void StopAllThreads ( void  )

Stops all running threads.

Note
Be sure to call this routine always when a document is modified asynchronously.

§ ShutdownThreads()

Bool ShutdownThreads ( Bool  shutdown)

Private.

§ StatusClear()

void StatusClear ( void  )

Clears the status bar text.

§ StatusSetSpin()

void StatusSetSpin ( void  )

Sets the status bar progress bar spinning. Needs to be triggered for every spin step.
Use this to indicate that a plugin is still processing even if the progress bar is not increasing.

§ StatusSetBar()

void StatusSetBar ( Int32  p)

Sets the status bar progress bar.

Parameters
[in]pThe percentage of the progress (0-100).

§ StatusSetText()

void StatusSetText ( const String str)

Sets the status bar text.

Parameters
[in]strThe text to display.

§ StatusNetClear()

void StatusNetClear ( void  )

Clears the NET status bar text.

Warning
Reserved for Team Render and should not be used externally.

§ StatusSetNetLoad()

void StatusSetNetLoad ( STATUSNETSTATE  status)

Sets the NET status bar to status state.

Warning
Reserved for Team Render and should not be used externally.
Parameters
[in]statusThe NET status state: STATUSNETSTATE

§ StatusSetNetBar()

void StatusSetNetBar ( Int32  p,
const GeData dat 
)

Sets the NET status bar progress and custom color.

Warning
Reserved for Team Render and should not be used externally.
Parameters
[in]pThe percentage of the progress (0-100).
[in]datThe color for the NET status bar. Can be a color constant COLOR_BG, COLOR_TEXT, etc. or a color Vector.

§ StatusSetNetText()

void StatusSetNetText ( const String str)

Sets the NET status bar text.

Warning
Reserved for Team Render and should not be used externally.
Parameters
[in]strThe text to display.

§ SpecialEventAdd()

void SpecialEventAdd ( Int32  messageid,
UInt  p1 = 0,
UInt  p2 = 0 
)

Adds a custom event. Results in a CoreMessage().

See also
The article Core Messages for more information.
Parameters
[in]messageidThe message ID. A unique plugin ID. Must be obtained from http://www.plugincafe.com
Use a unique plugin ID to make sure that there is no collision.
[in]p1The first private data for the sent message.
[in]p2The second private data for the sent message.

§ EventAdd()

void EventAdd ( EVENT  eventflag = EVENT_0)

Adds a global event to Cinema 4D's event queue. Results in a CoreMessage().

See also
The article Core Messages for more information.
Parameters
[in]eventflagThe event to add: EVENT

§ GeSyncMessage()

Bool GeSyncMessage ( Int32  messageid,
Int32  destid = 0,
UInt  p1 = 0,
UInt  p2 = 0 
)

Sends a synchronous event message (for example to make the Timeline, Timeslider etc. do an instant redraw).

Parameters
[in]messageidThe synchronous message to send: EVMSG
[in]destidPrivate.
[in]p1Private.
[in]p2Private.
Returns
true if successful, otherwise false.

§ DrawViews()

Bool DrawViews ( DRAWFLAGS  flags,
BaseDraw bd = nullptr 
)

Redraws the editor views.

Note
Cannot be used while a modal dialog is open.
Warning
Must be called from the main thread.
Parameters
[in]flagsThe draw flags: DRAWFLAGS
[in]bdThe view to redraw when DRAWFLAGS_ONLY_BASEDRAW is set in flags.
Returns
true if successful, otherwise false.

§ SendModelingCommand()

Bool SendModelingCommand ( Int32  command,
ModelingCommandData data 
)

Sends a modeling command.
Examples:

cd.doc = doc;
cd.op = op;
res = static_cast<BaseObject*>(cd.result->GetIndex(0));
cd.doc = doc;
cd.bc = &bc;
cd.op = op;
if (!SendModelingCommand(MCOMMAND_SPLINE_CHAMFER, cd)) return false;
Note
It is usually not possible to use SendModelingCommand() during ModifyObject() or similarly functions.
The object needs to be cloned (or put into a different document). The problem is that SendModelingCommand() rebuilds the caches, invalidating all the view caches.
Parameters
[in]commandThere are several groups of IDs to use.
First there are the internal modeling commands: (IDs are for ModelingCommandData::bc.)
MCOMMAND
Then there are the modeling library tool IDs, look up the parameters in the resource files: ModelingToolsParameters
Finally there are the modeling library menu commands. (These have no parameters.)
ModelingToolsNoParameters
[in]dataThe data for the command. Can be filled with the result for some commands.
Returns
true if the command was executed, otherwise false.

§ GetGlobalTexturePath()

Filename GetGlobalTexturePath ( Int32  i)

Retrieves the global texture path.

Parameters
[in]iThe index of the texture path (0-9).
Returns
The global texture path for Cinema 4D.

§ SetGlobalTexturePath()

void SetGlobalTexturePath ( Int32  i,
const Filename fn 
)

Sets the global texture path.

Parameters
[in]iThe index of the texture path (0-9).
[in]fnThe texture path.

§ GenerateTexturePath()

Bool GenerateTexturePath ( const Filename docpath,
const Filename srcname,
const Filename suggestedfolder,
Filename dstname,
NetRenderService service = nullptr,
BaseThread bt = nullptr 
)

Generates the texture filename for a given texture image.

Parameters
[in]docpathThe filename of the document for the texture.
[in]srcnameThe filename of the image.
[in]suggestedfolderA suggested folder path for the image. Can be an empty Filename.
[out]dstnameAssigned the generated path.
[in]serviceAn optional NET render service for the operation. The caller owns the pointed service.
[in]btAn optional thread for the operation. The caller owns the pointed thread.
Returns
true if successful, otherwise false.

§ IsInSearchPath()

Bool IsInSearchPath ( const Filename texfilename,
const Filename docpath 
)

Checks if the texture texfilename is in the search path for files located in docpath.

Note
The function only performs string comparisons between texfilename and docpath.
Parameters
[in]texfilenameThe texture file name.
[in]docpathThe document path.
Returns
true if the texture file is in the search path, otherwise false.

§ FlushTexture()

void FlushTexture ( const Filename docpath,
const String name,
const Filename suggestedfolder 
)

Flushes the given texture.

Parameters
[in]docpathThe filename of the document with the texture.
[in]nameThe name of the texture to flush.
[in]suggestedfolderA suggested folder path for the image. Can be an empty Filename.

§ FlushUnusedTextures()

void FlushUnusedTextures ( void  )

Flushes all unused textures.

§ GetWorldContainer()

BaseContainer GetWorldContainer ( void  )

Retrieves the main Cinema 4D settings container.

Returns
The main Cinema 4D settings: WPREF

§ GetWorldContainerInstance()

BaseContainer* GetWorldContainerInstance ( void  )

Retrieves the main Cinema 4D settings container that can be changed directly.

Note
There are a few settings that are transferred to the world container within the call GetWorldContainer(), for example WPREF_UNITS_BASIC to WPREF_COLOR_SYSTEM_COLORCHOOSER.
These settings cannot be set using GetWorldContainerInstance().
Returns
The main Cinema 4D settings: WPREF

§ SaveWorldPreferences()

void SaveWorldPreferences ( )

Saves the main Cinema 4D preferences.

§ SetWorldContainer()

void SetWorldContainer ( const BaseContainer bc)

Sets the main Cinema 4D settings container.
See GetWorldContainer() for values.

Parameters
[in]bcThe settings container.

§ GetViewColor()

Vector GetViewColor ( Int32  colid)

Retrieves a main Cinema 4D color.

Parameters
[in]colidThe color ID to get: VIEWCOLOR
Returns
The color value.

§ SetViewColor()

void SetViewColor ( Int32  colid,
const Vector col 
)

Sets one of the main Cinema 4D colors.

Parameters
[in]colidThe color ID to set: VIEWCOLOR
[in]colThe new color.

§ ErrorStringDialog()

void ErrorStringDialog ( CHECKVALUERANGE  type,
Float  x,
Float  y,
CHECKVALUEFORMAT  is 
)

Displays an error dialog for incorrectly entered values.

Parameters
[in]typeThe check value range type: CHECKVALUERANGE
[in]xThe lowest value.
[in]yThe highest value.
[in]isThe values type: CHECKVALUEFORMAT

§ ReadPluginInfo()

Bool ReadPluginInfo ( Int32  pluginid,
void *  buffer,
Int32  size 
)

Reads private serial information for a plugin. Cinema 4D will store this data encrypted.

Parameters
[in]pluginidA unique plugin ID. Must be obtained from http://www.plugincafe.com
[in]bufferThe buffer to take the data.
[in]sizeThe size of the buffer. This must not exceed 3500.
Returns
true if successful, otherwise false.

§ WritePluginInfo()

Bool WritePluginInfo ( Int32  pluginid,
void *  buffer,
Int32  size 
)
Parameters
[in]pluginidA unique plugin ID. Must be obtained from http://www.plugincafe.com
[in]bufferThe buffer with the data.
[in]sizeThe size of the buffer. This must not exceed 3500.
Returns
true if successful, otherwise false.

§ ReadRegInfo()

Bool ReadRegInfo ( Int32  pluginid,
void *  buffer,
Int32  size 
)

Reads user-specific data (e.g. login data for a user account).

Note
Use this method instead of ReadPluginInfo() in a license server environment.
Parameters
[in]pluginidA unique plugin ID. Must be obtained from http://www.plugincafe.com
[in]bufferThe data buffer. The caller owns the pointed buffer.
[in]sizeThe buffer size.
Returns
true if successful, otherwise false.

§ WriteRegInfo()

Bool WriteRegInfo ( Int32  pluginid,
void *  buffer,
Int32  size 
)

Writes user-specific data (e.g. login data for a user account).

Note
Use this method instead of WritePluginInfo() in a license server environment.
Parameters
[in]pluginidA unique plugin ID. Must be obtained from http://www.plugincafe.com
[in]bufferThe data buffer. The caller owns the pointed buffer.
[in]sizeThe buffer size.
Returns
true if successful, otherwise false.

§ GetWorldPluginData()

BaseContainer* GetWorldPluginData ( Int32  id)

Retrieves a container stored with SetWorldPluginData() from the Cinema 4D preferences.

Note
This can be used by any plugin to store preferences.
Parameters
[in]idThe plugin ID that the container was stored with.
Returns
The retrieved container. Cinema 4D owns the pointed container.

§ SetWorldPluginData()

Bool SetWorldPluginData ( Int32  id,
const BaseContainer bc,
Bool  add = true 
)

Stores a container in the Cinema 4D preferences.

Note
This can be used by any plugin to store preferences.
Parameters
[in]idThe plugin ID that the container should be associated with.
[in]bcThe container to set.
[in]addIf true, the container values are merged with the ones currently stored for the ID. Otherwise the previous values are lost.
Returns
true if successful, otherwise false.

§ GetToolPluginData()

BaseContainer* GetToolPluginData ( BaseDocument doc,
Int32  id 
)

Retrieves a tool plugin container stored in a document.

Parameters
[in]docThe document. The caller owns the pointed document.
[in]idThe tool plugin ID.
Returns
The retrieved tool plugin container.

§ GeIsActiveToolEnabled()

Bool GeIsActiveToolEnabled ( void  )

Checks if the active tool is ghosted.

Returns
true if the active tool is not ghosted, otherwise false.

§ GetActiveTool()

ToolPlugin* GetActiveTool ( )

Gets the active tool. Private.

Since
R19
Returns
The active tool.

§ GeGetLanguage()

Bool GeGetLanguage ( Int32  index,
String extension,
String name,
Bool default_language 
)

Enumerates information about the available languages.
Start with index==0 and then iterate with index++ until the function returns false.

Parameters
[in]indexThe language index.
[out]extensionAssigned the language extension.
[out]nameAssigned the human readable language name.
[out]default_languageAssigned true if this is the default language, otherwise false.
Returns
true if there was a language at index, otherwise false.

§ GeFilterSetSuffix()

Filename GeFilterSetSuffix ( const Filename name,
Int32  id 
)

Sets the standard suffix of a given bitmap saver plugin.
e.g. if name is "C:\test" and id is 1106 (Photoshop PSD) then the returned Filename will be "C:\test.psd".

Parameters
[in]nameThe filename.
[in]idThe ID of the bitmap saver plugin.
Returns
The given file name with the concatenated suffix.

§ GeIdentifyFile()

IDENTIFYFILE GeIdentifyFile ( const Filename name,
UChar probe,
Int32  probesize,
IDENTIFYFILE  recognition,
BasePlugin **  bp 
)

Identifies the file in name.

Parameters
[in]nameThe file to check.
[in]probeThe start of a small chunk of data from the start of the file for testing this file type.
Usually the probe size is 1024 bytes. The caller owns the pointed data.
[in]probesizeThe size of the probe array.
[in]recognitionThe identification flags: IDENTIFYFILE
[in]bpFor image formats this is filled with a pointer to the image loader that was identified.
Returns
The identification result: IDENTIFYFILE

§ GetScriptHead()

GeListHead* GetScriptHead ( Int32  type)

Retrieves the list head for scripts (ID_COFFEESCRIPT).

Parameters
[in]typeCurrently 0 is user scripts and 1 is system scripts.
The user scripts are located in library/scripts whereas system scripts are in resource/scripts.)
Returns
The script list head. Cinema 4D owns the pointed list head.

§ GetDynamicScriptID()

Int32 GetDynamicScriptID ( BaseList2D bl)

Retrieves the dynamic ID of the ID_COFFEESCRIPT script bl.
Every script gets a dynamic ID when loaded, which is just like a regular plugin ID.
This is necessary in many parts of the program. It is only when loading and saving the scripts that the unique (script) names are used; the ID is created dynamically at loading time.

Parameters
[in]blThe script to get the ID for. The caller owns the pointed script.
Returns
The dynamic script ID.

§ GetCommandLineArgs()

Bool GetCommandLineArgs ( C4DPL_CommandLineArgs args)

Retrieves the command line arguments used to start Cinema 4D in args.

Note
Linux only.
Parameters
[in]argsFilled with the command line arguments.
Returns
true if the command line arguments could be retrieved, otherwise false.

§ GetObjectName()

String GetObjectName ( Int32  type)

Retrieves a user presentable name from an object type ID. For example GetObjectName(Onull) returns "Null".

Parameters
[in]typeAn object type ID.
Returns
The object name for type.

§ GetTagName()

String GetTagName ( Int32  type)

Retrieves a user presentable name from a tag type ID.

Parameters
[in]typeA tag type ID.
Returns
The tag name for type.

§ GetObjectType()

Int32 GetObjectType ( const String name)

The inverse of GetObjectName(). Returns an object type from an object name.

Parameters
[in]nameAn object name.
Returns
The object type for name.

§ GetTagType()

Int32 GetTagType ( const String name)

The inverse of GetTagName(). Returns a tag type from a tag name.

Parameters
[in]nameA tag name.
Returns
The tag type for name.

§ GeRegistryAdd()

Bool GeRegistryAdd ( Int32  sub_id,
REGISTRYTYPE  main_id,
void *  data 
)

Private.

§ GeRegistryRemove()

Bool GeRegistryRemove ( Int32  sub_id,
REGISTRYTYPE  main_id 
)

Private.

§ GeRegistryFind()

Registry* GeRegistryFind ( Int32  sub_id,
REGISTRYTYPE  main_id 
)

Private.

§ GeRegistryGetLast()

Registry* GeRegistryGetLast ( REGISTRYTYPE  main_id)

Private.

§ GeRegistryGetFirst()

Registry* GeRegistryGetFirst ( REGISTRYTYPE  main_id)

Private.

§ GeRegistryGetAutoID()

Bool GeRegistryGetAutoID ( Int32 id)

Private.

§ GePluginMessage()

Bool GePluginMessage ( Int32  id,
void *  data 
)

Sends a plugin message to other plugins. These messages can be received with PluginMessage(). The message is sent to all plugin modules.

Parameters
[in]idThe ID of the message.
[in]dataThe message data. It is highly recommended as caller to own the pointed object and to not rely on the receiver to take the ownership.
Returns
true if the message could be sent, otherwise false.

§ CheckIsRunning()

Bool CheckIsRunning ( CHECKISRUNNING  type)

Checks if a task is running.

Parameters
[in]typeThe task: CHECKISRUNNING
Returns
true if the task running, otherwise false.

§ GeGetDefaultFilename()

String GeGetDefaultFilename ( Int32  id)

Retrieves the default filename for a category.
In the following example the name DEFAULTFILENAME_SHADER_VOLUME is placed in front of the shader name, placing the material in the Shader category:

RegisterMaterialPlugin(Mmy, GeGetDefaultFilename(DEFAULTFILENAME_SHADER_VOLUME)+String("MyMaterial"), 0, MyClass::Alloc, "Mmy", 0);
Parameters
[in]idThe category ID: DEFAULTFILENAME_SHADER
Returns
The filename to prepend to the material name.

§ FindInManager()

void FindInManager ( BaseList2D bl)

Finds and makes bl visible in its manager.

Parameters
[in]blThe object to find. The caller owns the pointed object.

§ GeSleep()

void GeSleep ( Int32  milliseconds)

Sleeps for milliseconds ms. Deprecated. Do not use for idle loops. Wait()/GetResult() for condition variables/jobs/threads must be used.

Parameters
[in]millisecondsThe time to sleep in milliseconds.

§ GeIsMainThread()

Bool GeIsMainThread ( )

Checks if code is run from within the main thread of Cinema 4D.

Returns
true if called from the main thread, otherwise false.

§ GeIsMainThreadAndNoDrawThread()

Bool GeIsMainThreadAndNoDrawThread ( )

Checks if code is run from within the main thread of Cinema 4D and if the main thread does not execute any drawing code currently.

Since
R16.038
Note
This routine can be used to make sure that no illegal code is called during a drawing operation.
In Cinema 4D the drawing will be started threaded or non-threaded, depending on the situation.
It is not allowed to add e.g. undos or delete objects or materials while the drawing is in progress (this would lead to immediate crashes).
If your code calls other routines that are not aware of their context (e.g. some code within a Message that does not know whether it was called from a drawing thread or during a command call)
GeIsMainThreadAndNoDrawThread() can be used to detect the correct situation.
Returns
true if called from the main thread and main thread does not execute a drawing operation, otherwise false.

§ GeDebugSetFloatingPointChecks()

Int32 GeDebugSetFloatingPointChecks ( Int32  on)

Helper function to detect floating point errors/exceptions. Private.

§ _GeDebugBreak()

void _GeDebugBreak ( Int32  line,
const Char file 
)

Private.

§ GeDebugOut() [1/2]

void GeDebugOut ( const Char s,
  ... 
)

Prints a string to the debug console using vsprintf() syntax.

Note
Requires that the API is build in debug mode i.e. MAXON_TARGET_DEBUG is defined.
Parameters
[in]sThe string to print. Limited to 2048 characters.
Following parameters are format for vsprintf().

§ GeDebugOut() [2/2]

void GeDebugOut ( const String s)

Prints a string to the debug console.

Note
Requires that the API is build in debug mode i.e. MAXON_TARGET_DEBUG is defined.
Parameters
[in]sThe string to print. Limited to 2048 characters.

§ SendCoreMessage()

GeData SendCoreMessage ( Int32  coreid,
const BaseContainer msg,
Int32  eventid = 0 
)

Sends a core message.

See also
The article Core Messages for more information.

Examples:

// Execute the options dialog of an editor command
msg.SetInt32(COREMSG_CINEMA_EXECUTEOPTIONMODE, true); // true to open the options dialog
Parameters
[in]coreidThe core message ID: COREMSG_CINEMA.
[in]msgThe message container: COREMSG
[in]eventidThe event ID.
Returns
The data.

§ GetMacModel()

String GetMacModel ( const String machinemodel)

On a Mac GetMachineFeatures().GetString(MACHINEINFO_MACHINEMODEL) returns the model name which is set in the OS like "iMac4,1" or "MacBookPro8,2".
If this string is pass to GetMacModel() a much more human readable string like "iMac Intel Core 2 Duo (aluminum enclosure) (Mid 2007)" or "MacBook Pro Intel Core i5, Intel Core i7, 13 (Early 2011)".

Parameters
[in]machinemodelThe machine model returned by GetMachineFeatures().GetString(MACHINEINFO_MACHINEMODEL).
Returns
The Mac model.

§ GetMachineFeatures()

Retrieves the features of the computer.

Parameters
[in]typeThe machine features type: MachineFeaturesType
Since R18.
Returns
The container with the machine features:
MACHINEINFO
OPENGL

§ GeGetMemoryStat()

Bool GeGetMemoryStat ( BaseContainer stat)

Retrieves Cinema 4D memory statistics.

Parameters
[in]statAssigned the memory statistics: C4D_MEMORY_STAT
Returns
true if successful, otherwise false.

§ PopupEditText()

Bool PopupEditText ( Int32  screenx,
Int32  screeny,
Int32  width,
Int32  height,
const String changeme,
Int32  flags,
PopupEditTextCallback func,
void *  userdata 
)

Opens a small popup window at (screenx, screeny) where the user can edit the changeme string. The result is reported to the func callback.

Parameters
[in]screenxThe X screen coordinate of the window.
[in]screenyThe Y screen coordinate of the window.
[in]widthThe width of the window.
[in]heightThe height of the window.
[in,out]changemeThe string to change.
[in]flagsUnused.
[in]funcThe callback function.
[in]userdataThe user data. Passed along to the callback.
Returns
true if the popup edit text could be opened, otherwise false.

§ StartEditorRender()

void StartEditorRender ( Bool  active_only,
Bool  raybrush,
Int32  x1,
Int32  y1,
Int32  x2,
Int32  y2,
BaseThread bt,
BaseDraw bd,
Bool  newthread 
)

Starts the editor renderer.

Parameters
[in]active_onlytrue for active object only.
[in]raybrushtrue for ray brush mode.
[in]x1The X coordinate of the first corner of the render rectangle.
[in]y1The Y coordinate of the first corner of the render rectangle.
[in]x2The X coordinate of the second corner of the render rectangle.
[in]y2The Y coordinate of the second corner of the render rectangle.
[in]btThe thread for the operation. The caller owns the pointed thread.
[in]bdThe view to draw to. The caller owns the pointed view.
[in]newthreadIf true, then the editor render is done asynchronously. In that case pass nullptr for the thread.

§ FormatNumber()

String FormatNumber ( const GeData val,
Int32  format,
Int32  fps,
Bool  bUnit = true 
)

Converts val to a string.

Parameters
[in]valThe value to convert to a string. Must be of type Float, Int32 or BaseTime.
[in]formatThe format: FORMAT_NUMBERS
[in]fpsThe frames per second, for time values.
[in]bUnitIf true the unit is included in the formatted string.
Returns
The formatted string.

§ StringToNumber()

GeData StringToNumber ( const String text,
Int32  format,
Int32  fps,
const LENGTHUNIT lengthunit = nullptr 
)

Converts a string to a data value of type Float, Int32 or BaseTime.

Parameters
[in]textThe string to convert to a value.
[in]formatThe format: FORMAT_NUMBERS
[in]fpsThe frames per second, for time values.
[in]lengthunitCan be used to override the units conversion. By default it will use the document's units.
For example a string of "50" will result in 0.5 if the document's units are Meters and the unit display setting is centimeters.
If lengthunit is specified its value will be used instead of the document's units setting.
Returns
The converted value.

§ CallCommand()

void CallCommand ( Int32  id,
Int32  subid = 0 
)

Executes commands.

Parameters
[in]idThe command ID.
[in]subidThe sub ID. (Used for scripts.)

§ GetCommandName()

String GetCommandName ( Int32  id)

Gets the name of a command.

Parameters
[in]idThe command ID.
Returns
The command name.

§ GetCommandHelp()

String GetCommandHelp ( Int32  id)

Gets the help string of a command.

Parameters
[in]idThe ID of the command.
Returns
The help string.

§ IsCommandEnabled()

Bool IsCommandEnabled ( Int32  id)

Checks if a command is enabled.

Parameters
[in]idThe ID of the command.
Returns
true if the command is enabled, otherwise false.

§ IsCommandChecked()

Bool IsCommandChecked ( Int32  id)

Checks if a command is checked.

Parameters
[in]idThe ID of the command.
Returns
true if the command is checked, otherwise false.

§ SendMailAvailable()

Bool SendMailAvailable ( )

Checks if it is possible to send a mail. Deprecated.

Returns
true if it is possible to send mail using SendMail(), otherwise false.

§ SendMail()

Bool SendMail ( const String t_subject,
const String t_to,
const String t_cc,
const String t_bcc,
Filename t_attachments,
const String t_body,
Int32  flags 
)

Sends a mail using the operating system mail API. Deprecated.

Note
Check first with SendMailAvailable() that mailing is allowed.
Warning
String/Filename arrays parameters must end with an empty String/Filename.
Parameters
[in]t_subjectThe subject.
[in]t_toThe destination addresses String array, or nullptr. String array must end with an empty String().
[in]t_ccThe Cc addresses String array, or nullptr. String array must end with an empty String().
[in]t_bccThe Bcc addresses String array, or nullptr. String array must end with an empty String().
[in]t_attachmentsThe attachments Filename array, or nullptr. Filename array must end with an empty Filename().
[in]t_bodyThe text body.
[in]flagsThe flags: SENDMAIL_SENDDIRECTLY.
Returns
true if successful, otherwise false.

§ GetSystemEnvironmentVariable()

Bool GetSystemEnvironmentVariable ( const String varname,
String result 
)

Retrieves system environment variables.

Parameters
[in]varnameThe environment variable name.
[out]resultAssigned the retrieved value, if available.
Returns
true if successful, otherwise false.

§ AskForAdministratorPrivileges()

Bool AskForAdministratorPrivileges ( const String msg,
const String caption,
Bool  allowsuperuser,
void **  token 
)

Private.

§ EndAdministratorPrivileges()

void EndAdministratorPrivileges ( )

Private.

§ RestartApplication()

void RestartApplication ( const Utf16Char param = nullptr,
Int32  exitcode = 0,
const Utf16Char **  path = nullptr 
)

Private.

§ SetExitCode()

void SetExitCode ( Int32  exitCode)

Sets the exit code returned by Cinema 4D when it exits.

Parameters
[in]exitCodeThe exit code.

§ GeUpdateUI()

void GeUpdateUI ( )

Forces a redraw of the GUI, for example after a change of the preferences or Linear Workflow settings.

§ GetShortcutCount()

Int32 GetShortcutCount ( )

Retrieves the global shortcut count.

Returns
The number of shortcuts.

§ GetShortcut()

BaseContainer GetShortcut ( Int32  index)

Retrieves the shortcut at index.

Parameters
[in]indexThe shortcut index: 0 <= index < GetShortcutCount()
Returns
The retrieved shortcut.

§ AddShortcut()

Bool AddShortcut ( const BaseContainer bc)

Adds the shortcut in bc to the shortcut list.

Parameters
[in]bcThe container for the shortcut to add: SHORTCUT
Returns
true if successful, otherwise false.

§ RemoveShortcut()

Bool RemoveShortcut ( Int32  index)

Removes the shortcut at index.

Parameters
[in]indexThe shortcut index: 0 <= index < GetShortcutCount()
Returns
true if successful, otherwise false.

§ LoadShortcutSet()

Bool LoadShortcutSet ( const Filename fn,
Bool  add 
)

Loads shortcuts.

Parameters
[in]fnThe file with the shortcuts to load.
[in]addtrue to add the shortcuts, instead of replacing.
Returns
true if successful, otherwise false.

§ SaveShortcutSet()

Bool SaveShortcutSet ( const Filename fn)

Save shortcuts.

Parameters
[in]fnThe file to save the shortcuts to.
Returns
true if successful, otherwise false.

§ FindShortcutsFromID()

Int32 FindShortcutsFromID ( Int32  pluginid,
Int32 indexarray,
Int32  maxarrayelements 
)

Finds all shortcuts assigned to a command.

Parameters
[in]pluginidThe plugin ID to search for.
[out]indexarrayFilled with the found IDs. The caller owns the pointed array.
[in]maxarrayelementsThe size of indexarray
Returns
The number of shortcuts found.

§ FindShortcuts()

Int32 FindShortcuts ( const BaseContainer scut,
Int32 idarray,
Int32  maxarrayelements 
)

Finds all commands that are assigned to a shortcut.

Parameters
[in]scutThe shortcut to search for.
[in]idarrayFilled with the found IDs. The caller owns the pointed array.
[in]maxarrayelementsThe size of indexarray.
Returns
The number of shortcuts found.

§ CheckCommandShortcut()

Bool CheckCommandShortcut ( Int32  id,
Int32  key,
Int32  qual 
)

Checks if a shortcut key and qualifier are assigned to a command.

Parameters
[in]idThe plugin ID of the command.
[in]keyThe shortcut key.
[in]qualThe qualifier key.
Returns
true if the shortcut/qualifier is assigned, otherwise false.

§ InsertCreateObject()

void InsertCreateObject ( BaseDocument doc,
BaseObject op,
BaseObject activeobj = nullptr 
)

Adds op into document doc.
This function takes care for modifiers to add the new object at a certain place in the hierarchy.
For example if shift is pressed while a new object is created it will be inserted below the active object.

Parameters
[in]docThe current document.
[in]opThe object to insert.
[in]activeobjThe active object, or nullptr if no object is active.

§ CopyToClipboard() [1/2]

void CopyToClipboard ( const String text)

Copies a string to the clipboard.

Parameters
[in]textThe string to copy.

§ CopyToClipboard() [2/2]

void CopyToClipboard ( BaseBitmap map,
Int32  ownerid 
)

Copies a bitmap to the clipboard.

Parameters
[in]mapThe bitmap to copy. The caller owns the pointed bitmap.
[in]owneridThe owner ID: CLIPBOARDOWNER

§ GetStringFromClipboard()

Bool GetStringFromClipboard ( String txt)

Retrieves a string from the clipboard.

Parameters
[out]txttrue if a string could be retrieved from the clipboard, otherwise false.

§ GetBitmapFromClipboard()

Bool GetBitmapFromClipboard ( BaseBitmap map)

Retrieves a bitmap from the clipboard.

Parameters
[out]mapThe bitmap to get. The caller owns the pointed bitmap.
Returns
true if a bitmap could be retrieved from the clipboard, otherwise false.

§ GetClipboardType()

CLIPBOARDTYPE GetClipboardType ( void  )

Retrieves the type of the clipboard.

Returns
The type of the clipboard: CLIPBOARDTYPE

§ GetC4DClipboardOwner()

Int32 GetC4DClipboardOwner ( void  )

Retrieves the owner ID of the clipboard.

Returns
The owner ID: CLIPBOARDOWNER

§ BrowserLibraryPopup()

void BrowserLibraryPopup ( Int32  mx,
Int32  my,
Int32  defw,
Int32  defh,
Int32  pluginwindowid,
Int32  presettypeid,
void *  userdata,
BrowserPopupCallback  callback 
)

Opens a browser popup window (e.g. the Sky object's preset popup).

Parameters
[in]mxThe X coordinate of the window.
[in]myThe Y coordinate of the window.
[in]defwThe width of the window.
[in]defhThe height of the window.
[in]pluginwindowidA unique plugin window ID.
[in]presettypeidThe preset plugin type ID or a type matching SDKBrowserPluginInterfaceInfo::GetPluginID().
[in]userdataThe user data. The caller owns the pointed data.
[in]callbackThe popup callback.

§ GetCursorBitmap()

const BaseBitmap* GetCursorBitmap ( Int32  type,
Int32 hotspotx,
Int32 hotspoty 
)

Private.