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 , Bool TexturePathTuple
typedef maxon::BaseArray < TexturePathTuple TexturePathList

Enumerations

enum   MACHINEFEATURESTYPE {
   CURRENT ,
   HARDWARE_OGL
}

函数

maxon::String   GeGetUserName ()
VERSIONTYPE   GeGetVersionType (void)
maxon::Result < void >  GetGeneralLicensingInformation ( maxon::String &productId, maxon::String &systemId, maxon::String &userId, maxon::String &licenseId, maxon::String &userName)
maxon::Result < maxon::String ExportLicenses ()
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 (void)
Float64   GeGetMilliSeconds (void)
String   GeGetLineEnd (void)
Int32   GeGetDefaultFPS (void)
UInt32   GeGetCinemaInfo ( CINEMAINFO info)
GEMB_R   GeOutString (const maxon::String &str, GEMB flags)
OPERATINGSYSTEM   GeGetCurrentOS (void)
BYTEORDER   GeGetByteOrder (void)
void  GeGetGray ( Int32 *r, Int32 *g, Int32 *b)
Bool   GeChooseColor ( 向量 *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 (void)
String   GeGetDegreeChar ()
String   GeGetPercentChar ()
void  SetMousePointer ( Int32 l)
Bool   ShowBitmap (const Filename &fn)
Bool   ShowBitmap ( BaseBitmap *bm)
void  StopAllThreads (void)
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 < TexturePathList GetGlobalTexturePaths (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 (void)
BaseContainer   GetWorldContainer (void)
BaseContainer GetWorldContainerInstance (void)
void  GetAdditionalWorldContainerData ( BaseContainer &bc)
maxon::Result < maxon::BaseArray < maxon::Url > >  GetRecentDocumentsList ( Bool isBodyPaint)
maxon::Id   GetActiveNodeSpaceId ()
void  SaveWorldPreferences ()
void  SetWorldContainer (const BaseContainer &bc)
向量   GetViewColor ( Int32 colid, 向量 *defaultColor=nullptr)
void  SetViewColor ( Int32 colid, const 向量 &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)
BaseContainer GetWorldPluginData ( Int32 id)
Bool   SetWorldPluginData ( Int32 id, const BaseContainer &bc, Bool add=true)
BaseContainer GetToolPluginData ( BaseDocument *doc, Int32 id)
Bool   GeIsActiveToolEnabled (void)
ToolPlugin GetActiveTool ()
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)
GeListHead GetScriptHead ( Int32 type)
Int32   GetDynamicScriptID ( BaseList2D *bl)
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)
Registry GeRegistryFind ( Int32 sub_id, REGISTRYTYPE main_id)
Registry GeRegistryGetLast ( REGISTRYTYPE main_id)
Registry GeRegistryGetFirst ( 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 (void)
Int32   GetC4DClipboardOwner (void)
void  BrowserLibraryPopup ( Int32 mx, Int32 my, Int32 defw, Int32 defh, Int32 pluginwindowid, Int32 presettypeid, void *userdata, BrowserPopupCallback callback)
const BaseBitmap GetCursorBitmap ( 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)

变量

  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)

状态

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

Typedef Documentation

◆  TexturePathTuple

typedef maxon::Tuple < maxon::Url , Bool > TexturePathTuple

◆  TexturePathList

typedef maxon::BaseArray < TexturePathTuple > TexturePathList

Function Documentation

◆  GeGetUserName()

maxon::String GeGetUserName ( )

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

返回
The user name.

◆  GeGetVersionType()

VERSIONTYPE GeGetVersionType ( void  )

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

返回
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.

参数
[out] productId The product id of the active license.
[out] systemId A unique system identifier.
[out] userId The user id that the active license is assigned with.
[out] licenseId A unique license session identifier.
[out] userName The user / account name that the active license is assigned with.
返回
OK on success.

◆  ExportLicenses()

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

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

返回
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.

参数
[in] licenseItemId Id to check.
[in] versionNumber Current version number of the feature. '0' if no version number is required.
[in] checkOnly True if the license should only checked for availability. In that case the license will not be consumed and displayed only in error case.
[in] licenseUpdateCallback Callback which will be triggered with each license update for this type.
返回
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() .

参数
[in] featureId Id to check. e.g. ENTITLEMENTFEATURES::ISBETA
返回
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.

返回
true if If all features are available., otherwise false .

◆  IsNet()

Bool IsNet ( )

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

返回
true if NET is running, otherwise false .

◆  IsServer()

Bool IsServer ( )

Checks if a NET server application is running.

返回
true if NET is running as server, otherwise false .

◆  IsClient()

Bool IsClient ( )

Checks if a NET client application is running.

返回
true if NET is running as client, otherwise false .

◆  GeShowMouse()

void GeShowMouse ( Int32   v )

Sets the type of mouse pointer.

警告
Should only be called from the main thread.
参数
[in] v The 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.

参数
[in] x The screen X coordinates to identify which display information is read (for multi-display setups).
[in] y The screen Y coordinates to identify which display information is read (for multi-display setups).
[in] whole_screen true if dimensions of the whole screen (including task bar etc.) are returned, otherwise false .
[out] sx1 Assigned the minimum X coordinate (left).
[out] sy1 Assigned the minimum Y coordinate (top).
[out] sx2 Assigned the maximum X coordinate (right).
[out] sy2 Assigned the maximum Y coordinate (bottom).
返回
true if successful, otherwise false .

◆  GeGetTimer()

Int32 GeGetTimer ( void  )

Retrieves the current timer count in milliseconds.

返回
The current timer count in milliseconds.

◆  GeGetMilliSeconds()

Float64 GeGetMilliSeconds ( void  )

Get the current timer count in milliseconds.

返回
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.

返回
The type of line ending.

◆  GeGetDefaultFPS()

Int32 GeGetDefaultFPS ( void  )

Retrieves the default frames per second.

返回
The default FPS value.

◆  GeGetCinemaInfo()

UInt32 GeGetCinemaInfo ( CINEMAINFO   info )

Retrieves information about Cinema 4D 's application runtime.

参数
[in] info The information type: CINEMAINFO
返回
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.

参数
[in] str The dialog box message.
[in] flags The flags: GEMB
返回
The result from the message box: GEMB_R

◆  GeGetCurrentOS()

OPERATINGSYSTEM GeGetCurrentOS ( void  )

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

返回
The OS running: OPERATINGSYSTEM

◆  GeGetByteOrder()

BYTEORDER GeGetByteOrder ( void  )

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

返回
The byte order: BYTEORDER

◆  GeGetGray()

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

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

参数
[out] r Assigned the red component of the gray color.
[out] g Assigned the green component of the gray color.
[out] b Assigned the blue component of the gray color.

◆  GeChooseColor()

Bool GeChooseColor ( 向量 col ,
Int32   flags  
)

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

参数
[in,out] col The initial color for the dialog and assigned the chosen color.
[in] flags Usually 0 or one of the following flags to use the correct color profile for display: DR_COLORFIELD_ICC_BASEDOC or DR_COLORFIELD_ICC_BPTEX .
返回
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.

参数
[in,out] col The initial color for the dialog and assigned the chosen color.
[in] flags Usually 0 or one of the following flags to use the correct color profile for display: DR_COLORFIELD_ICC_BASEDOC or DR_COLORFIELD_ICC_BPTEX .
返回
true if successful, otherwise false .

◆  GeOpenHTML()

Bool GeOpenHTML ( const maxon::String webaddress )

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

注意
The passed URL string has to be spec conform, see IETF - Uniform Resource Locators .
参数
[in] webaddress The URL to open.
返回
true if successful, otherwise false .

◆  GeChooseFont()

Bool GeChooseFont ( BaseContainer bc )

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

参数
[in] bc Assigned the selected font settings.
返回
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.

参数
[in] str The 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.

参数
[in] str The string to display in the debug console window.

◆  GeGetMovieInfo()

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

Retrieves information from a movie file.

参数
[in] fn The filename of the movie file to retrieve the information from.
[out] frames Assigned the number of frames.
[out] fps Assigned the number of frames per second.
返回
true if successful, otherwise false .

◆  RenameDialog()

Bool RenameDialog ( String str )

Opens a standard rename dialog.

参数
[in,out] str The string with the name to change. Assigned the new name. The caller owns the pointed string.
返回
true if the name was changed, otherwise false .

◆  GetC4DVersion()

Int32 GetC4DVersion ( void  )

Retrieves the version of Cinema 4D that is running.

返回
The version of Cinema 4D .

◆  GeGetDegreeChar()

String GeGetDegreeChar ( )

Retrieves the degree character (°).

返回
A string containing the degree character.

◆  GeGetPercentChar()

String GeGetPercentChar ( )

Retrieves the percent character (%).

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

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.)

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

◆  lIntel()

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

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

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.

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

◆  wMotor()

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

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

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.)

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.

参数
[in] adr The address of the memory. The caller owns the pointed memory buffer or variable at adr .
[in] cnt The 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.

警告
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.
参数
[in] handler The background handler.
[in] tdata The private data. This will be passed on to the handler.
[in] typeclass A 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] priority The handler priority. Higher absolute values are evaluated before lower. A negative value means that it does not block positive priorities.
范例: #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() .

参数
[in] tdata The registered data.
[in] typeclass The registered type class ID.
返回
true if successful, otherwise false .

◆  GeStopBackgroundThreads()

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

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

参数
[in] typeclass The type class ID to stop, or 0 for all classes.
[in] flags 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] thread Optional 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.
all = false was passed it would not check for the external renderer and ants (which are always running in a BodyPaint 3D selection).

参数
[in] typeclass The type class ID to check, or 0 for all classes.
[in] all true , negative priorities are also checked.
返回
true if the specified background threads are running, otherwise false .

◆  SetMousePointer()

void SetMousePointer ( Int32   l )

Sets the type of mouse pointer.

参数
[in] l The mouse pointer: MOUSE

◆  ShowBitmap() [1/2]

Bool ShowBitmap ( const Filename fn )

Displays a bitmap into the Picture Viewer.

警告
Must be called from the main thread.
参数
[in] fn The filename of the bitmap to display.
返回
true if successful, otherwise false .

◆  ShowBitmap() [2/2]

Bool ShowBitmap ( BaseBitmap bm )

Displays a bitmap into the Picture Viewer.

注意
The bitmap will be copied for display.
警告
Must be called from the main thread.
参数
[in] bm The bitmap to display.
返回
true if successful, otherwise false .

◆  StopAllThreads()

void StopAllThreads ( void  )

Stops all running threads.

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

◆  StopDrawViewsThread()

void StopDrawViewsThread ( )

Stops all draw views thread.

注意
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.

参数
[in] p The percentage of the progress ( 0- 100 ) .

◆  StatusSetText()

void StatusSetText ( const maxon::String str )

Sets the status bar text.

参数
[in] str The text to display.

◆  StatusNetClear()

void StatusNetClear ( void  )

Clears the NET status bar text.

警告
Reserved for Team Render and should not be used externally.

◆  StatusSetNetLoad()

void StatusSetNetLoad ( STATUSNETSTATE   status )

Sets the NET status bar to status state.

警告
Reserved for Team Render and should not be used externally.
参数
[in] status The NET status state: STATUSNETSTATE

◆  StatusSetNetBar()

void StatusSetNetBar ( Int32   p ,
const GeData dat  
)

Sets the NET status bar progress and custom color.

警告
Reserved for Team Render and should not be used externally.
参数
[in] p The percentage of the progress ( 0- 100 ) .
[in] dat The 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.

警告
Reserved for Team Render and should not be used externally.
参数
[in] str The text to display.

◆  SpecialEventAdd()

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

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

另请参阅
The article Core Messages 了解更多信息。
参数
[in] messageid The 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] p1 The first private data for the sent message.
[in] p2 The 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() .

另请参阅
The article Core Messages 了解更多信息。
参数
[in] eventflag The 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).

参数
[in] messageid The synchronous message to send: EVMSG
[in] destid Private .
[in] p1 Private .
[in] p2 Private .
返回
true if successful, otherwise false .

◆  DrawViews()

Bool DrawViews ( DRAWFLAGS   flags ,
BaseDraw bd = nullptr  
)

Redraws the editor views.

注意
Cannot be used while a modal dialog is open.
警告
Must be called from the main thread.
参数
[in] flags The draw flags: DRAWFLAGS
[in] bd The view to redraw when DRAWFLAGS::ONLY_BASEDRAW is set in flags .
返回
true if successful, otherwise false .

◆  SendModelingCommand()

Bool SendModelingCommand ( Int32   命令 ,
ModelingCommandData data  
)

Sends a modeling command.
范例:

ModelingCommandData cd; cd. doc = doc; cd. op = op; if (! SendModelingCommand ( MCOMMAND_CURRENTSTATETOOBJECT , cd)) return false ; res = static_cast< BaseObject * > (cd. result -> GetIndex (0)); BaseContainer bc; bc. SetFloat ( MDATA_SPLINE_CHAMFERRADIUS , 100.0); ModelingCommandData cd; cd. doc = doc; cd. bc = &bc; cd. op = op; if (! SendModelingCommand (MCOMMAND_SPLINE_CHAMFER, cd)) return false ;
注意
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.
参数
[in] 命令 There 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] data The data for the command. Can be filled with the result for some commands.
返回
true if the command was executed, otherwise false .

◆  GetGlobalTexturePaths()

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

Retrieves the global texture paths.

参数
[in] docPath The path of the document. This will be used to complete relative texture paths.
Pass nullptr if you want to get the unmodified paths only.
返回
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.

参数
[in] docpath The filename of the document for the texture.
[in] srcname The filename of the image.
[in] suggestedfolder A suggested folder path for the image. Can be an empty Filename .
[out] dstname Assigned the generated path.
[in] service An optional NET render service for the operation. The caller owns the pointed service.
[in] bt An optional thread for the operation. The caller owns the pointed thread.
返回
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 .

注意
The function only performs string comparisons between texfilename and docpath .
参数
[in] texfilename The texture file name.
[in] docpath The document path.
返回
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.

参数
[in] docpath The filename of the document with the texture.
[in] name The name of the texture to flush.
[in] suggestedfolder A 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.

返回
The main Cinema 4D settings: WPREF

◆  GetWorldContainerInstance()

BaseContainer * GetWorldContainerInstance ( void  )

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

注意
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.
返回
The main Cinema 4D settings: WPREF

◆  GetAdditionalWorldContainerData()

void GetAdditionalWorldContainerData ( BaseContainer bc )

Gets additional world container data (see GetWorldContainerInstance).

参数
[out] bc A 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.

参数
[in] isBodyPaint Set to reteive BodyPaint's list.
返回
The recent documents list.

◆  GetActiveNodeSpaceId()

maxon::Id GetActiveNodeSpaceId ( )

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

返回
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.
GetWorldContainer() for values.

参数
[in] bc The settings container.

◆  GetViewColor()

向量 GetViewColor ( Int32   colid ,
向量 defaultColor = nullptr  
)

Retrieves a main Cinema 4D color.

参数
[in] colid The color ID to get: VIEWCOLOR
[in] defaultColor Pass a valid pointer to get the default color.
返回
The color value.

◆  SetViewColor()

void SetViewColor ( Int32   colid ,
const 向量 col  
)

Sets one of the main Cinema 4D colors.

参数
[in] colid The color ID to set: VIEWCOLOR
[in] col The new color.

◆  ErrorStringDialog()

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

Displays an error dialog for incorrectly entered values.

参数
[in] type The check value range type: CHECKVALUERANGE
[in] x The lowest value.
[in] y The highest value.
[in] is The 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.

参数
[in] pluginid A unique plugin ID. Must be obtained from http://www.plugincafe.com
[in] buffer The buffer to take the data.
[in] size The size of the buffer. This must not exceed 3500 .
返回
true if successful, otherwise false .

◆  WritePluginInfo()

Bool WritePluginInfo ( Int32   pluginid ,
void *  buffer ,
Int32   size  
)
参数
[in] pluginid A unique plugin ID. Must be obtained from http://www.plugincafe.com
[in] buffer The buffer with the data.
[in] size The size of the buffer. This must not exceed 3500 .
返回
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).

注意
Use this method instead of ReadPluginInfo() in a license server environment.
参数
[in] pluginid A unique plugin ID. Must be obtained from http://www.plugincafe.com
[in] buffer The data buffer. The caller owns the pointed buffer.
[in] size The buffer size.
返回
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).

注意
Use this method instead of WritePluginInfo() in a license server environment.
参数
[in] pluginid A unique plugin ID. Must be obtained from http://www.plugincafe.com
[in] buffer The data buffer. The caller owns the pointed buffer.
[in] size The buffer size.
返回
true if successful, otherwise false .

◆  GetWorldPluginData()

BaseContainer * GetWorldPluginData ( Int32   id )

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

注意
This can be used by any plugin to store preferences.
参数
[in] id The plugin ID that the container was stored with.
返回
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.

注意
This can be used by any plugin to store preferences.
参数
[in] id The plugin ID that the container should be associated with.
[in] bc The container to set.
[in] add true , the container values are merged with the ones currently stored for the ID. Otherwise the previous values are lost.
返回
true if successful, otherwise false .

◆  GetToolPluginData()

BaseContainer * GetToolPluginData ( BaseDocument doc ,
Int32   id  
)

Retrieves a tool plugin container stored in a document.

参数
[in] doc The document. The caller owns the pointed document.
[in] id The tool plugin ID.
返回
The retrieved tool plugin container.

◆  GeIsActiveToolEnabled()

Bool GeIsActiveToolEnabled ( void  )

Checks if the active tool is ghosted.

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

◆  GetActiveTool()

ToolPlugin * GetActiveTool ( )

Gets the active tool. Private .

由于
R19
返回
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 .

参数
[in] index The language index.
[out] extension Assigned the language extension.
[out] name Assigned the human readable language name.
[out] default_language Assigned true if this is the default language, otherwise false .
返回
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" .

参数
[in] name The filename.
[in] id The ID of the bitmap saver plugin.
返回
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 .

参数
[in] name The file to check.
[in] probe The 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] probesize The size of the probe array.
[in] recognition The identification flags: IDENTIFYFILE
[in] bp For image formats this is filled with a pointer to the image loader that was identified.
返回
The identification result: IDENTIFYFILE

◆  GetScriptHead()

GeListHead * GetScriptHead ( Int32   type )

Retrieves the list head for scripts (ID_COFFEESCRIPT).

参数
[in] type Currently 0 is user scripts and 1 is system scripts.
The user scripts are located in library/scripts whereas system scripts are in resource/scripts.)
返回
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.

参数
[in] bl The script to get the ID for. The caller owns the pointed script.
返回
The dynamic script ID.

◆  GetCommandLineArgs()

Bool GetCommandLineArgs ( C4DPL_CommandLineArgs args )

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

注意
Linux only.
参数
[in] args Filled with the command line arguments.
返回
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" .

参数
[in] type An object type ID.
返回
The object name for type .

◆  GetTagName()

String GetTagName ( Int32   type )

Retrieves a user presentable name from a tag type ID.

参数
[in] type A tag type ID.
返回
The tag name for type .

◆  GetObjectType()

Int32 GetObjectType ( const maxon::String name )

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

参数
[in] name An object name.
返回
The object type for name .

◆  GetTagType()

Int32 GetTagType ( const maxon::String name )

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

参数
[in] name A tag name.
返回
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.

参数
[in] id The ID of the message.
[in] data The message data. It is highly recommended as caller to own the pointed object and to not rely on the receiver to take the ownership.
返回
true if the message could be sent, otherwise false .

◆  CheckIsRunning()

Bool CheckIsRunning ( CHECKISRUNNING   type )

Checks if a task is running.

参数
[in] type The task: CHECKISRUNNING
返回
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);
参数
[in] id The category ID: DEFAULTFILENAME_SHADER
返回
The filename to prepend to the material name.

◆  FindInManager()

void FindInManager ( BaseList2D bl )

Finds and makes bl visible in its manager.

参数
[in] bl The 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.

参数
[in] milliseconds The time to sleep in milliseconds.

◆  GeIsMainThread()

Bool GeIsMainThread ( )

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

返回
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.

由于
R16.038
注意
This routine can be used to make sure that no illegal code is called during a drawing operation.
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.
返回
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.

注意
Requires that the API is build in debug mode i.e. MAXON_TARGET_DEBUG is defined.
参数
[in] s The 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.

注意
Requires that the API is build in debug mode i.e. MAXON_TARGET_DEBUG is defined.
参数
[in] s The string to print. Limited to 2048 characters.

◆  SendCoreMessage()

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

Sends a core message.

另请参阅
The article Core Messages 了解更多信息。

范例:

// Check if command id is enabled BaseContainer msg( COREMSG_CINEMA_GETCOMMANDENABLED ); msg. SetInt32 ( COREMSG_CINEMA_GETCOMMANDENABLED , id ); Bool enabled = SendCoreMessage ( COREMSG_CINEMA , msg, 0). GetInt32 ();

// Get the machine features GeData data = SendCoreMessage ( COREMSG_CINEMA , BaseContainer ( COREMSG_CINEMA_GETMACHINEFEATURES ), 0); BaseContainer * bc = data. GetContainer ();

// Execute an editor command BaseContainer msg( COREMSG_CINEMA_EXECUTEEDITORCOMMAND ); msg. SetInt32 ( COREMSG_CINEMA_EXECUTEEDITORCOMMAND , id ); msg. SetInt32 ( COREMSG_CINEMA_EXECUTESUBID , subid); SendCoreMessage ( COREMSG_CINEMA , msg, 0);

// Execute the options dialog of an editor command BaseContainer msg( COREMSG_CINEMA_EXECUTEEDITORCOMMAND ); msg. SetInt32 ( COREMSG_CINEMA_EXECUTEEDITORCOMMAND , cmdID); msg. SetInt32 ( COREMSG_CINEMA_EXECUTESUBID , subID); msg. SetInt32 ( COREMSG_CINEMA_EXECUTEOPTIONMODE , true ); // true to open the options dialog SendCoreMessage ( COREMSG_CINEMA , msg, 0);

参数
[in] coreid The core message ID: COREMSG_CINEMA .
[in] msg The message container: COREMSG
[in] eventid The event ID.
返回
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)" .

参数
[in] machinemodel The machine model returned by GetMachineFeatures() .GetString(MACHINEINFO_MACHINEMODEL).
返回
The Mac model.

◆  GetMachineFeatures()

BaseContainer GetMachineFeatures ( MACHINEFEATURESTYPE   type = MACHINEFEATURESTYPE::HARDWARE_OGL )

Retrieves the features of the computer.

参数
[in] type The machine features type: MACHINEFEATURESTYPE
Since R18.
返回
The container with the machine features:
MACHINEINFO
OPENGL

◆  GeGetMemoryStat()

Bool GeGetMemoryStat ( BaseContainer stat )

Retrieves Cinema 4D memory statistics.

参数
[in] stat Assigned the memory statistics: C4D_MEMORY_STAT
返回
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.

参数
[in] screenx The X screen coordinate of the window.
[in] screeny The Y screen coordinate of the window.
[in] width The width of the window.
[in] height The height of the window.
[in,out] changeme The string to change.
[in] func The callback function.
返回
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.

参数
[in] active_only true for active object only.
[in] raybrush true for ray brush mode.
[in] x1 The X coordinate of the first corner of the render rectangle.
[in] y1 The Y coordinate of the first corner of the render rectangle.
[in] x2 The X coordinate of the second corner of the render rectangle.
[in] y2 The Y coordinate of the second corner of the render rectangle.
[in] bt The thread for the operation. The caller owns the pointed thread.
[in] bd The view to draw to. The caller owns the pointed view.
[in] newthread 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.

参数
[in] val The value to convert to a string. Must be of type Float , Int32 or BaseTime .
[in] format The format: FORMAT_NUMBERS
[in] fps The frames per second, for time values.
[in] bUnit true the unit is included in the formatted string.
返回
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 , Int32 or BaseTime .

参数
[in] text The string to convert to a value.
[in] format The format: FORMAT_NUMBERS
[in] fps The frames per second, for time values.
[in] lengthunit Can 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.
lengthunit is specified its value will be used instead of the document's units setting.
返回
The converted value.

◆  CallCommand()

void CallCommand ( Int32   id ,
Int32   subid = 0  
)

Executes commands.

参数
[in] id The command ID.
[in] subid The sub ID. (Used for scripts.)

◆  GetCommandName()

String GetCommandName ( Int32   id )

Gets the name of a command.

参数
[in] id The command ID.
返回
The command name.

◆  GetCommandHelp()

String GetCommandHelp ( Int32   id )

Gets the help string of a command.

参数
[in] id The ID of the command.
返回
The help string.

◆  IsCommandEnabled()

Bool IsCommandEnabled ( Int32   id )

Checks if a command is enabled.

参数
[in] id The ID of the command.
返回
true if the command is enabled, otherwise false .

◆  IsCommandChecked()

Bool IsCommandChecked ( Int32   id )

Checks if a command is checked.

参数
[in] id The ID of the command.
返回
true if the command is checked, otherwise false .

◆  GetSystemEnvironmentVariable()

Bool GetSystemEnvironmentVariable ( const maxon::String varname ,
maxon::String result  
)

Retrieves system environment variables.

参数
[in] varname The environment variable name.
[out] result Assigned the retrieved value, if available.
返回
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.

参数
[in] exitCode The 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

返回
The type of active viewport: VIEWPORTTYPE

◆  GetShortcutCount()

Int32 GetShortcutCount ( )

Retrieves the global shortcut count.

返回
The number of shortcuts.

◆  GetShortcut()

BaseContainer GetShortcut ( Int32   index )

Retrieves the shortcut at index .

参数
[in] index The shortcut index: 0 <= index < GetShortcutCount()
返回
The retrieved shortcut.

◆  AddShortcut()

Bool AddShortcut ( const BaseContainer bc )

Adds the shortcut in bc to the shortcut list.

参数
[in] bc The container for the shortcut to add: SHORTCUT
返回
true if successful, otherwise false .

◆  RemoveShortcut()

Bool RemoveShortcut ( Int32   index )

Removes the shortcut at index .

参数
[in] index The shortcut index: 0 <= index < GetShortcutCount()
返回
true if successful, otherwise false .

◆  LoadShortcutSet()

Bool LoadShortcutSet ( const Filename fn ,
Bool   add  
)

Loads shortcuts.

参数
[in] fn The file with the shortcuts to load.
[in] add true to add the shortcuts, instead of replacing.
返回
true if successful, otherwise false .

◆  SaveShortcutSet()

Bool SaveShortcutSet ( const Filename fn )

Save shortcuts.

参数
[in] fn The file to save the shortcuts to.
返回
true if successful, otherwise false .

◆  FindShortcutsFromID()

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

Finds all shortcuts assigned to a command.

参数
[in] pluginid The plugin ID to search for.
[out] indexarray Filled with the found IDs. The caller owns the pointed array.
[in] maxarrayelements The size of indexarray
返回
The number of shortcuts found.

◆  FindShortcuts()

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

Finds all commands that are assigned to a shortcut.

参数
[in] scut The shortcut to search for.
[in] idarray Filled with the found IDs. The caller owns the pointed array.
[in] maxarrayelements The size of indexarray .
返回
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.

参数
[in] id The plugin ID of the command.
[in] key The shortcut key.
[in] qual The qualifier key.
返回
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.

参数
[in] doc The current document.
[in] op The object to insert.
[in] activeobj The active object, or nullptr if no object is active.

◆  CopyToClipboard() [1/2]

void CopyToClipboard ( const maxon::String text )

Copies a string to the clipboard.

参数
[in] text The string to copy.

◆  CopyToClipboard() [2/2]

void CopyToClipboard ( BaseBitmap map ,
Int32   ownerid  
)

Copies a bitmap to the clipboard.

参数
[in] map The bitmap to copy. The caller owns the pointed bitmap.
[in] ownerid The owner ID: CLIPBOARDOWNER

◆  GetStringFromClipboard()

Bool GetStringFromClipboard ( String txt )

Retrieves a string from the clipboard.

参数
[out] txt true if a string could be retrieved from the clipboard, otherwise false .

◆  GetBitmapFromClipboard()

Bool GetBitmapFromClipboard ( BaseBitmap map )

Retrieves a bitmap from the clipboard.

参数
[out] map The bitmap to get. The caller owns the pointed bitmap.
返回
true if a bitmap could be retrieved from the clipboard, otherwise false .

◆  GetClipboardType()

CLIPBOARDTYPE GetClipboardType ( void  )

Retrieves the type of the clipboard.

返回
The type of the clipboard: CLIPBOARDTYPE

◆  GetC4DClipboardOwner()

Int32 GetC4DClipboardOwner ( void  )

Retrieves the owner ID of the clipboard.

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

参数
[in] mx The X coordinate of the window.
[in] my The Y coordinate of the window.
[in] defw The width of the window.
[in] defh The height of the window.
[in] pluginwindowid A unique plugin window ID.
[in] presettypeid The preset plugin type ID or a type matching SDKBrowserPluginInterfaceInfo::GetPluginID() .
[in] userdata The user data. The caller owns the pointed data.
[in] callback The popup callback.

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

打开 Cinema 4D code editor.

参数
[in] obj The object that the source belongs to. The caller owns the pointed object.
[in] callback A callback to set and retrieve the edited source code. The caller owns the pointed callback.
[in] bc The settings for the editor that will be opened: CODEEDITOR
返回
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.

参数
[in] document The currently active document.
返回
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.

参数
[in] document The currently active document.
返回
True if is UV mode, false otherwise.

Variable Documentation

◆  CURRENT

CURRENT

Get 机器 features for the currently active OpenGL type.

◆  HARDWARE_OGL

HARDWARE_OGL

Get 机器 features for Hardware OpenGL.

◆  MAXON_ENUM_LIST

class DebugTimer MAXON_ENUM_LIST
COREMSG_CINEMA_EXECUTEEDITORCOMMAND
#define COREMSG_CINEMA_EXECUTEEDITORCOMMAND
The result is given as a true or false integer value in the returned GeData.
定义: c4d_gui.h:81
COREMSG_CINEMA
#define COREMSG_CINEMA
Requests to Cinema 4D core.
定义: c4d_general.h:1497
ModelingCommandData::result
AtomArray * result
定义: operatingsystem.h:828
GeGetDefaultFilename
String GeGetDefaultFilename(Int32 id)
SendModelingCommand
Bool SendModelingCommand(Int32 command, ModelingCommandData &data)
COREMSG_CINEMA_EXECUTEOPTIONMODE
#define COREMSG_CINEMA_EXECUTEOPTIONMODE
Pass whether to open (true) the options dialog or not (false) for COREMSG_CINEMA_EXECUTEEDITORCOMMAND...
定义: c4d_gui.h:84
BaseObject
定义: c4d_baseobject.h:224
BaseContainer::SetInt32
void SetInt32(Int32 id, Int32 l)
定义: c4d_basecontainer.h:505
RegisterMaterialPlugin
Bool RegisterMaterialPlugin(Int32 id, const maxon::String &str, Int32 info, DataAllocator *g, const maxon::String &description, Int32 disklevel)
COREMSG_CINEMA_GETMACHINEFEATURES
#define COREMSG_CINEMA_GETMACHINEFEATURES
定义: c4d_general.h:1532
String
定义: c4d_string.h:38
MDATA_SPLINE_CHAMFERRADIUS
@ MDATA_SPLINE_CHAMFERRADIUS
定义: toolsplinechamfer.h:7
COREMSG_CINEMA_GETCOMMANDENABLED
#define COREMSG_CINEMA_GETCOMMANDENABLED
The name is given as a String in the returned GeData.
定义: c4d_gui.h:77
ModelingCommandData
A helper object for SendModelingCommand().
定义: operatingsystem.h:805
GeData::GetInt32
Int32 GetInt32(void) const
定义: c4d_gedata.h:427
COREMSG_CINEMA_EXECUTESUBID
#define COREMSG_CINEMA_EXECUTESUBID
Pass the sub-ID for COREMSG_CINEMA_EXECUTEEDITORCOMMAND.
定义: c4d_gui.h:83
SendCoreMessage
GeData SendCoreMessage(Int32 coreid, const BaseContainer &msg, Int32 eventid=0)
GeData
定义: c4d_gedata.h:82
ModelingCommandData::op
BaseObject * op
The input object. Use arr for multiple objects.
定义: operatingsystem.h:819
BaseContainer::SetFloat
void SetFloat(Int32 id, Float r)
定义: c4d_basecontainer.h:533
MCOMMAND_CURRENTSTATETOOBJECT
#define MCOMMAND_CURRENTSTATETOOBJECT
Current state to object (returns object): MDATA_CURRENTSTATETOOBJECT.
定义: ge_prepass.h:1410
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
ModelingCommandData::doc
BaseDocument * doc
定义: operatingsystem.h:817
DEFAULTFILENAME_SHADER_VOLUME
#define DEFAULTFILENAME_SHADER_VOLUME
Volume.
定义: ge_prepass.h:4559
GeData::GetContainer
BaseContainer * GetContainer(void) const
定义: c4d_gedata.h:487
BaseContainer
定义: c4d_basecontainer.h:46
ModelingCommandData::bc
BaseContainer * bc
The modeling command container. Optional to set extra options.
定义: operatingsystem.h:820
AtomArray::GetIndex
C4DAtom * GetIndex(Int32 idx) const
定义: c4d_baselist.h:1634