c4d_general.h File Reference

Classes

class  ParserCache
 
class  Parser
 
struct  SerialInfo
 
class  Registry
 
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 DRAWPORT_TYPE_AVAILABLE
 
#define DRAWPORT_EXTENSION_STRING
 
#define DRAWPORT_SUPPORT_ENHANCED
 
#define DRAWPORT_RENDERER_NAME
 
#define DRAWPORT_VERSION_STRING
 
#define DRAWPORT_VENDOR_NUM
 
#define DRAWPORT_VENDOR_UNKNOWN
 
#define DRAWPORT_VENDOR_NVIDIA
 
#define DRAWPORT_VENDOR_AMD
 
#define DRAWPORT_VENDOR_INTEL
 
#define DRAWPORT_VENDOR_APPLE
 
#define DRAWPORT_VENDOR_NAME
 
#define DRAWPORT_SHADING_LANGUAGE_VERSION_STRING
 
#define DRAWPORT_MULTITEXTURE
 
#define DRAWPORT_MAX_2DTEXTURE_SIZE
 
#define DRAWPORT_MAX_3DTEXTURE_SIZE
 
#define DRAWPORT_MAX_VERTEX_ATTRIBS
 
#define DRAWPORT_MAX_TEX_IMAGE_UNITS_VERTEX
 
#define DRAWPORT_MAX_TEX_IMAGE_UNITS_FRAGMENT
 
#define DRAWPORT_DRIVER_VERSION_STRING
 
#define DRAWPORT_FBO_Z_DEPTH
 
#define DRAWPORT_FRAMEBUFFER_OBJECT_MULTISAMPLE
 
#define DRAWPORT_MAX_TEX_IMAGE_UNITS_GEOMETRY
 
#define DRAWPORT_API_VERSION_INT
 
#define DRAWPORT_SHADING_LANGUAGE_VERSION_INT
 
#define DRAWPORT_RENDERBUFFER_MASK
 
#define DRAWPORT_RENDER_TO_FP16_TEXTURE
 
#define DRAWPORT_RENDER_TO_FP32_TEXTURE
 
#define DRAWPORT_STEREO_BUFFER
 
#define DRAWPORT_DRIVER_OUTDATED
 
#define DRAWPORT_SUPPORT_PRIMITIVERESTARTINDEX
 
#define DRAWPORT_SUPPORT_GEOMETRYSHADER
 
#define DRAWPORT_SUPPORT_OSX_10_7
 
#define DRAWPORT_MAX_TEX_IMAGE_UNITS_TESS_CONTROL
 
#define DRAWPORT_MAX_TEX_IMAGE_UNITS_TESS_EVAL
 
#define DRAWPORT_MAX_TESSELLATION_LEVEL
 
#define DRAWPORT_API_TYPE
 
#define DRAWPORT_VRAM_SIZE
 
#define DRAWPORT_REQUIRED_VERSION_STRING
 
#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_ALLOCATED
 
#define C4D_MEMORY_STAT_OPENGL_USED
 
#define SHORTCUT_PLUGINID
 
#define SHORTCUT_ADDRESS
 
#define SHORTCUT_OPTIONMODE
 
#define CLIPBOARDOWNER_BODYPAINT
 
#define CLIPBOARDOWNER_PICTUREVIEWER
 

Typedefs

typedef maxon::Tuple< maxon::Url, BoolTexturePathTuple
 
typedef maxon::BaseArray< TexturePathTupleTexturePathList
 

Enumerations

enum class  MACHINEFEATURESTYPE {
  CURRENT ,
  HARDWARE_OGL
}
 

Functions

maxon::String GeGetUserName ()
 
VERSIONTYPE GeGetVersionType ()
 
maxon::Result< void > GetGeneralLicensingInformation (maxon::String &productId, maxon::String &systemId, maxon::String &userId, maxon::String &licenseId, maxon::String &userName)
 
maxon::Result< maxon::StringExportLicenses ()
 
maxon::Result< void > AddLicenseItem (const maxon::InternedId &licenseItemId, Float versionNumber, Bool checkOnly, maxon::CustomLicenseItemDelegate &&licenseUpdateCallback)
 
maxon::Bool CheckLicenseFeature (const maxon::InternedId &featureId)
 
Bool HasFullFeatureSet ()
 
Bool IsNet ()
 
Bool IsServer ()
 
Bool IsClient ()
 
void GeShowMouse (Int32 v)
 
Bool GeGetScreenDimensions (Int32 x, Int32 y, Bool whole_screen, Int32 *sx1, Int32 *sy1, Int32 *sx2, Int32 *sy2)
 
Int32 GeGetTimer ()
 
Float64 GeGetMilliSeconds ()
 
String GeGetLineEnd ()
 
Int32 GeGetDefaultFPS ()
 
UInt32 GeGetCinemaInfo (CINEMAINFO info)
 
GEMB_R GeOutString (const maxon::String &str, GEMB flags)
 
OPERATINGSYSTEM GeGetCurrentOS ()
 
BYTEORDER GeGetByteOrder ()
 
void GeGetGray (Int32 *r, Int32 *g, Int32 *b)
 
Bool GeChooseColor (Vector *col, Int32 flags)
 
Bool GeChooseColorAlpha (maxon::ColorA *col, Int32 flags)
 
Bool GeOpenHTML (const maxon::String &webaddress)
 
Bool GeChooseFont (BaseContainer *bc)
 
void GeGetGuiFont (maxon::OSFontDefinition &out)
 
void GeGetMonoFont (maxon::OSFontDefinition &out)
 
Bool GeRegisterPlugin (PLUGINTYPE type, Int32 id, const maxon::String &str, void *data, Int32 datasize)
 
void GePrint (const maxon::String &str)
 
void GeConsoleOut (const maxon::String &str)
 
Bool GeGetMovieInfo (const Filename &fn, Int32 *frames, Float *fps)
 
Bool RenameDialog (String *str)
 
Int32 GetC4DVersion ()
 
String GeGetDegreeChar ()
 
String GeGetPercentChar ()
 
void SetMousePointer (Int32 l)
 
Bool ShowBitmap (const Filename &fn)
 
Bool ShowBitmap (BaseBitmap *bm)
 
void StopAllThreads ()
 
void StopDrawViewsThread ()
 
Bool ShutdownThreads (Bool shutdown)
 
void SpecialEventAdd (Int32 messageid, UInt p1=0, UInt p2=0)
 
void EventAdd (EVENT eventflag=EVENT::NONE)
 
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)
 
maxon::Result< TexturePathListGetGlobalTexturePaths (const Filename *docPath)
 
maxon::Result< void > SetGlobalTexturePaths (const TexturePathList &paths)
 
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 maxon::String &name, const Filename &suggestedfolder)
 
void FlushUnusedTextures ()
 
BaseContainer GetWorldContainer ()
 
BaseContainerGetWorldContainerInstance ()
 
void GetAdditionalWorldContainerData (BaseContainer &bc)
 
maxon::Result< maxon::BaseArray< maxon::Url > > GetRecentDocumentsList (Bool isBodyPaint)
 
maxon::Id GetActiveNodeSpaceId ()
 
void SaveWorldPreferences ()
 
void SetWorldContainer (const BaseContainer &bc)
 
Vector GetViewColor (Int32 colid, Vector *defaultColor=nullptr)
 
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 ()
 
ToolPluginGetActiveTool ()
 
Bool GeGetLanguage (Int32 index, maxon::String *extension, maxon::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)
 
void SetActiveScriptObject (Int32 type)
 
BaseList2DCreateNewPythonScript (String &name, const String &body)
 
BaseList2DLoadPythonScript (const Filename &fn)
 
Bool GetCommandLineArgs (C4DPL_CommandLineArgs &args)
 
String GetObjectName (Int32 type)
 
String GetTagName (Int32 type)
 
Int32 GetObjectType (const maxon::String &name)
 
Int32 GetTagType (const maxon::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 ()
 
void _GeDebugBreak (Int32 line, const Char *file)
 
void GeDebugOut (const Char *s,...)
 
void GeDebugOut (const maxon::String &s)
 
GeData SendCoreMessage (Int32 coreid, const BaseContainer &msg, Int32 eventid=0)
 
String GetMacModel (const maxon::String &machinemodel)
 
enum MACHINEFEATURESTYPE MAXON_ENUM_LIST (MACHINEFEATURESTYPE)
 
BaseContainer GetMachineFeatures (MACHINEFEATURESTYPE type=MACHINEFEATURESTYPE::HARDWARE_OGL)
 
Bool GeGetMemoryStat (BaseContainer &stat)
 
Bool PopupEditText (Int32 screenx, Int32 screeny, Int32 width, Int32 height, const maxon::String &changeme, maxon::Delegate< void(POPUPEDITTEXTCALLBACK, maxon::String &)> func)
 
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 maxon::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 GetSystemEnvironmentVariable (const maxon::String &varname, maxon::String &result)
 
Bool AskForAdministratorPrivileges (const maxon::String &msg, const maxon::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 ()
 
VIEWPORTTYPE GeGetActiveViewportType ()
 
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 maxon::String &text)
 
void CopyToClipboard (BaseBitmap *map, Int32 ownerid)
 
Bool GetStringFromClipboard (String *txt)
 
Bool GetBitmapFromClipboard (BaseBitmap *map)
 
CLIPBOARDTYPE GetClipboardType ()
 
Int32 GetC4DClipboardOwner ()
 
const BaseBitmapGetCursorBitmap (Int32 type, Int32 &hotspotx, Int32 &hotspoty)
 
Bool CodeEditor_Open (BaseList2D *obj, const maxon::Delegate< GeData(BaseList2D *obj, const BaseContainer &msg)> &callback, const BaseContainer &bc=BaseContainer())
 
void MinimalViewportSettingsCommand (Int32 type)
 
Bool IsAnimationRunning (const BaseDocument *document)
 
Bool IsUVToolMode (const BaseDocument *document)
 
Int32 GetFormatDepth (Int32 format, Int32 depth)
 

Variables

 CURRENT
 
 HARDWARE_OGL
 
class DebugTimer MAXON_ENUM_LIST
 

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)
 

Background Handler

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

Status

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

Typedef Documentation

◆ TexturePathTuple

◆ TexturePathList

Function Documentation

◆ GeGetUserName()

maxon::String GeGetUserName ( )

Returns the name of the user registered in the active account.

Returns
The user name.

◆ GeGetVersionType()

VERSIONTYPE GeGetVersionType ( )

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

Returns
The version type: VERSIONTYPE

◆ GetGeneralLicensingInformation()

maxon::Result<void> GetGeneralLicensingInformation ( maxon::String productId,
maxon::String systemId,
maxon::String userId,
maxon::String licenseId,
maxon::String userName 
)

Returns information about the currently used license and system.

Parameters
[out]productIdThe product id of the active license.
[out]systemIdA unique system identifier.
[out]userIdThe user id that the active license is assigned with.
[out]licenseIdA unique license session identifier.
[out]userNameThe user / account name that the active license is assigned with.
Returns
OK on success.

◆ ExportLicenses()

maxon::Result<maxon::String> ExportLicenses ( )

Returns licensing information as shown in the ExportLicenses menu command including productId, systemId, userId etc.

Returns
OK on success.

◆ AddLicenseItem()

maxon::Result<void> AddLicenseItem ( const maxon::InternedId licenseItemId,
Float  versionNumber,
Bool  checkOnly,
maxon::CustomLicenseItemDelegate &&  licenseUpdateCallback 
)

Private. AddLicenseItem adds extra licenses to query for each license check. This allows to verify extra features bundled with the app.

Parameters
[in]licenseItemIdId to check.
[in]versionNumberCurrent version number of the feature. '0' if no version number is required.
[in]checkOnlyTrue if the license should only checked for availability. In that case the license will not be consumed and displayed only in error case.
[in]licenseUpdateCallbackCallback which will be triggered with each license update for this type.
Returns
OK on success.

◆ CheckLicenseFeature()

maxon::Bool CheckLicenseFeature ( const maxon::InternedId featureId)

CheckLicenseFeature queries certain license features. This includes predefined is as well as license items added with AddLicenseItem().

Parameters
[in]featureIdId to check. e.g. ENTITLEMENTFEATURES::ISBETA
Returns
OK on success.

◆ HasFullFeatureSet()

Bool HasFullFeatureSet ( )

Determines whether the type of Cinema 4D application has no feature limitations. Certain editions like C4D Lite do not allow for all features.

Returns
true if If all features are available., otherwise false.

◆ 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.

◆ 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 ( )

Retrieves the current timer count in milliseconds.

Returns
The current timer count in milliseconds.

◆ GeGetMilliSeconds()

Float64 GeGetMilliSeconds ( )

Get the current timer count in milliseconds.

Returns
The current timer count in milliseconds.

◆ GeGetLineEnd()

String GeGetLineEnd ( )

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

Returns
The type of line ending.

◆ GeGetDefaultFPS()

Int32 GeGetDefaultFPS ( )

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 maxon::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 ( )

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

Returns
The OS running: OPERATINGSYSTEM

◆ GeGetByteOrder()

BYTEORDER GeGetByteOrder ( )

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.

◆ GeChooseColorAlpha()

Bool GeChooseColorAlpha ( maxon::ColorA col,
Int32  flags 
)

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

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 maxon::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.

◆ GeGetGuiFont()

void GeGetGuiFont ( maxon::OSFontDefinition &  out)

Internal. Returns the c4d UI font.

◆ GeGetMonoFont()

void GeGetMonoFont ( maxon::OSFontDefinition &  out)

Internal. Returns the c4d monospaced font.

◆ GeRegisterPlugin()

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

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

◆ GePrint()

void GePrint ( const maxon::String str)

Outputs a string to the Cinema 4D console window. This routine is deprecated - use maxon::Application instead, which has an improved interface.

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

◆ GeConsoleOut()

void GeConsoleOut ( const maxon::String str)

Outputs a string to the Cinema 4D debug console window.
This reoutine is deprecated - use maxon::DiagnosticOutput instead, which has an improved interface. 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 ( )

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).

◆ 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()

Bool GeStopBackgroundThreads ( Int32  typeclass,
BACKGROUNDHANDLERFLAGS  flags,
BaseThread thread 
)

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.
[in]threadOptional thread or nullptr. If passed the return value can be false if the thread is stopped while it is trying to acquire the resources for this call.

◆ 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.

◆ 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 ( )

Stops all running threads.

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

◆ StopDrawViewsThread()

void StopDrawViewsThread ( )

Stops all draw views thread.

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

◆ ShutdownThreads()

Bool ShutdownThreads ( Bool  shutdown)

Private.

◆ StatusClear()

void StatusClear ( )

Clears the status bar text.

◆ StatusSetSpin()

void StatusSetSpin ( )

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 maxon::String str)

Sets the status bar text.

Parameters
[in]strThe text to display.

◆ StatusNetClear()

void StatusNetClear ( )

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 maxon::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::NONE)

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));
Bool SendModelingCommand(Int32 command, ModelingCommandData &data)
C4DAtom * GetIndex(Int32 idx) const
Definition: c4d_baselist.h:1697
Definition: c4d_baseobject.h:225
Py_UCS4 * res
Definition: unicodeobject.h:1113
#define MCOMMAND_CURRENTSTATETOOBJECT
Current state to object (returns object): MDATA_CURRENTSTATETOOBJECT.
Definition: ge_prepass.h:1620
const char * doc
Definition: pyerrors.h:226
PyObject * op
Definition: object.h:520
A helper object for SendModelingCommand().
Definition: operatingsystem.h:815
AtomArray * result
Definition: operatingsystem.h:837
BaseObject * op
The input object. Use arr for multiple objects.
Definition: operatingsystem.h:828
BaseDocument * doc
Definition: operatingsystem.h:826
cd.doc = doc;
cd.bc = &bc;
cd.op = op;
if (!SendModelingCommand(MCOMMAND_SPLINE_CHAMFER, cd)) return false;
Definition: c4d_basecontainer.h:47
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:533
BaseContainer * bc
The modeling command container. Optional to set extra options.
Definition: operatingsystem.h:829
@ MDATA_SPLINE_CHAMFERRADIUS
Definition: toolsplinechamfer.h:7
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.

◆ GetGlobalTexturePaths()

maxon::Result<TexturePathList> GetGlobalTexturePaths ( const Filename docPath)

Retrieves the global texture paths.

Parameters
[in]docPathThe path of the document. This will be used to complete relative texture paths.
Pass nullptr if you want to get the unmodified paths only.
Returns
The global texture paths for Cinema 4D.

◆ SetGlobalTexturePaths()

maxon::Result<void> SetGlobalTexturePaths ( const TexturePathList paths)

Sets the global texture paths.

◆ 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 maxon::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 ( )

Flushes all unused textures.

◆ GetWorldContainer()

BaseContainer GetWorldContainer ( )

Retrieves the main Cinema 4D settings container.

Returns
The main Cinema 4D settings: WPREF

◆ GetWorldContainerInstance()

BaseContainer* GetWorldContainerInstance ( )

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(). To read only these values, use GetAdditionalWorldContainerData.
Returns
The main Cinema 4D settings: WPREF

◆ GetAdditionalWorldContainerData()

void GetAdditionalWorldContainerData ( BaseContainer bc)

Gets additional world container data (see GetWorldContainerInstance).

Parameters
[out]bcA container which receives the data. the container is not cleared before data is written.

◆ GetRecentDocumentsList()

maxon::Result<maxon::BaseArray<maxon::Url> > GetRecentDocumentsList ( Bool  isBodyPaint)

Retrieves the recent documents list.

Parameters
[in]isBodyPaintSet to reteive BodyPaint's list.
Returns
The recent documents list.

◆ GetActiveNodeSpaceId()

maxon::Id GetActiveNodeSpaceId ( )

Returns the active node space. This is a program-wide global UI setting.

Returns
The Id of the current node space.

◆ 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,
Vector defaultColor = nullptr 
)

Retrieves a main Cinema 4D color.

Parameters
[in]colidThe color ID to get: VIEWCOLOR
[in]defaultColorPass a valid pointer to get the default color.
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 ( )

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,
maxon::String extension,
maxon::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.

◆ SetActiveScriptObject()

void SetActiveScriptObject ( Int32  type)

Define the script to be displayed in the Script Manager.

Parameters
[in]typeThe script ID. Retrieve it with GetDynamicScriptID.

◆ CreateNewPythonScript()

BaseList2D* CreateNewPythonScript ( String name,
const String body 
)

Create a new temporary python script.

Parameters
[in,out]nameThe script name. Pass an empty string to automatically generated one.
[in]bodyThe script content.
Returns
The created python script. Can be nullptr if creation failed.

◆ LoadPythonScript()

BaseList2D* LoadPythonScript ( const Filename fn)

Load a python script.

Parameters
[in]fnThe script name. Pass an empty filename to automatically generated one.
Returns
The loaded python script. Can be nullptr if loading failed.

◆ 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 maxon::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 maxon::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);
String GeGetDefaultFilename(Int32 id)
Bool RegisterMaterialPlugin(Int32 id, const maxon::String &str, Int32 info, DataAllocator *g, const maxon::String &description, Int32 disklevel)
Definition: c4d_string.h:39
#define DEFAULTFILENAME_SHADER_VOLUME
Volume.
Definition: ge_prepass.h:4820
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.

◆ _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 maxon::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:

// Check if command id is enabled
GeData SendCoreMessage(Int32 coreid, const BaseContainer &msg, Int32 eventid=0)
Int32 GetInt32() const
Definition: c4d_gedata.h:427
maxon::Bool Bool
Definition: ge_sys_math.h:55
#define COREMSG_CINEMA
Requests to Cinema&#160;4D core.
Definition: c4d_general.h:1518
#define COREMSG_CINEMA_GETCOMMANDENABLED
The name is given as a String in the returned GeData.
Definition: c4d_gui.h:83
const char const char * msg
Definition: object.h:438
// Get the machine features
Definition: c4d_gedata.h:83
BaseContainer * GetContainer() const
Definition: c4d_gedata.h:487
#define COREMSG_CINEMA_GETMACHINEFEATURES
Definition: c4d_general.h:1553
// Execute an editor command
#define COREMSG_CINEMA_EXECUTESUBID
Pass the sub-ID for COREMSG_CINEMA_EXECUTEEDITORCOMMAND.
Definition: c4d_gui.h:89
#define COREMSG_CINEMA_EXECUTEEDITORCOMMAND
The result is given as a true or false integer value in the returned GeData.
Definition: c4d_gui.h:87
// Execute the options dialog of an editor command
msg.SetInt32(COREMSG_CINEMA_EXECUTEOPTIONMODE, true); // true to open the options dialog
#define COREMSG_CINEMA_EXECUTEOPTIONMODE
Pass whether to open (true) the options dialog or not (false) for COREMSG_CINEMA_EXECUTEEDITORCOMMAND...
Definition: c4d_gui.h:90
Parameters
[in]coreidThe core message ID: COREMSG_CINEMA.
[in]msgThe message container: COREMSG
[in]eventidThe event ID.
Returns
The data.

◆ GetMacModel()

String GetMacModel ( const maxon::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 maxon::String changeme,
maxon::Delegate< void(POPUPEDITTEXTCALLBACK, maxon::String &)>  func 
)

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]funcThe callback function.
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 maxon::String text,
Int32  format,
Int32  fps,
const LENGTHUNIT lengthunit = nullptr 
)

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

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.

◆ GetSystemEnvironmentVariable()

Bool GetSystemEnvironmentVariable ( const maxon::String varname,
maxon::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 maxon::String msg,
const maxon::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.

◆ GeGetActiveViewportType()

VIEWPORTTYPE GeGetActiveViewportType ( )

Returns the type of viewport that is currently active

Returns
The type of active viewport: VIEWPORTTYPE

◆ 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 maxon::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 ( )

Retrieves the type of the clipboard.

Returns
The type of the clipboard: CLIPBOARDTYPE

◆ GetC4DClipboardOwner()

Int32 GetC4DClipboardOwner ( )

Retrieves the owner ID of the clipboard.

Returns
The owner ID: CLIPBOARDOWNER

◆ GetCursorBitmap()

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

Private.

◆ CodeEditor_Open()

Bool CodeEditor_Open ( BaseList2D obj,
const maxon::Delegate< GeData(BaseList2D *obj, const BaseContainer &msg)> &  callback,
const BaseContainer bc = BaseContainer() 
)

Opens the Cinema 4D code editor.

Parameters
[in]objThe object that the source belongs to. The caller owns the pointed object.
[in]callbackA callback to set and retrieve the edited source code. The caller owns the pointed callback.
[in]bcThe settings for the editor that will be opened: CODEEDITOR
Returns
true if the editor was opened, otherwise false.

◆ MinimalViewportSettingsCommand()

void MinimalViewportSettingsCommand ( Int32  type)

Private.

◆ IsAnimationRunning()

Bool IsAnimationRunning ( const BaseDocument document)

Checks if an animation is currently running.

Parameters
[in]documentThe currently active document.
Returns
True, if an animation is currently running.

◆ IsUVToolMode()

Bool IsUVToolMode ( const BaseDocument document)

Check if the current context is UV, if UV mode is selected or the UV Texture Editor is the last one used.

Parameters
[in]documentThe currently active document.
Returns
True if is UV mode, false otherwise.

◆ GetFormatDepth()

Int32 GetFormatDepth ( Int32  format,
Int32  depth 
)

Gets the format depth for a image saver and depth.

Parameters
[in]formatThe ID of the image saver.
[in]depthDepth.
Returns
The depth of the format (8, 16 or 32).

Variable Documentation

◆ CURRENT

CURRENT

Get Machine features for the currently active OpenGL type.

◆ HARDWARE_OGL

HARDWARE_OGL

Get Machine features for Hardware OpenGL.

◆ MAXON_ENUM_LIST

class DebugTimer MAXON_ENUM_LIST