c4d

Follow me to the Inheritance diagramm.

Functions

Miscellaneous

c4d.GeGetSystemInfo()

Returns system information flags.

Return type:int
Returns:Flags:
SYSTEMINFO_O None.
SYSTEMINFOCOMMANDLINE Application runs in command line mode.
SYSTEMINFODEMO Deprecated.
SYSTEMINFOSAVABLEDEMO Savable Demo version.
SYSTEMINFOSAVABLEDEMOACTIVE Activated savable demo version, SYSTEMINFO_SAVABLEDEMO is still set.
SYSTEMINFO_OPENGL OpenGL is activated and loaded correctly.
SYSTEMINFO_STUDENT Activated student version, always set along with SYSTEMINFO_SAVABLEDEMO.
c4d.GeGetSerialInfo()

Returns user registration information.

Note

A multi-license has the following formating: 201[100]00519-ABCDEF. The third, fourth and fifth digits equal the number of licenses, in the previous example it is 100 licenses.

Example:

import c4d

def main():
    si = c4d.GeGetSerialInfo(c4d.SERIALINFO_MULTILICENSE)
    if len(si['nr']) > 0:
        # Multi-license, do something
        print "Multi-license"
        print si
    else:
        si = c4d.GeGetSerialInfo(c4d.SERIALINFO_CINEMA4D)
        print "Single-license"
        print si
        # Single-license, do something

if __name__=='__main__':
    main()
Parameters:type (int) –

The information to retrieve:

SERIALINFO_CINEMA4D Serial for CINEMA 4D.
SERIALINFO_MULTILICENSE Serial for CINEMA 4D running in a license server enviroment.
Return type:dict{nr: str, organization: str, name: str, street: str, city: str, country: str}
Returns:A dictionary with the serial information for CINEMA 4D.
c4d.GeGetVersionType()

Get the type of CINEMA 4D application that is running.

Return type:int
Returns:The version type:
VERSIONTYPE_PRIME C4D Prime
VERSIONTYPE_BODYPAINT C4D Bodypaint
VERSIONTYPE_STUDIO C4D Studio
VERSIONTYPE_VISUALIZE C4D Visualize
VERSIONTYPE_BROADCAST C4D Broadcast
VERSIONTYPE_BENCHMARK C4D Benchmark
VERSIONTYPE_UPDATER C4D Updater
VERSIONTYPE_INSTALLER C4D Installer
VERSIONTYPE_NETCLIENT C4D Net Client
VERSIONTYPE_NETSERVER C4D Net Server
VERSIONTYPE_NETSERVERUNLIMITED C4D Net Server Unlimited
VERSIONTYPE_UNKNOWN C4D Unknown
c4d.GeGetTimer()

Get the current timer count in milliseconds.

Return type:int
Returns:The current timer count in milliseconds.
c4d.GeGetMilliSeconds()

Get the current timer count in milliseconds.

Return type:float
Returns:The current timer count in milliseconds.
c4d.GetDefaultFPS()

Get the default frames per second value.

Return type:int
Returns:The default FPS value.
c4d.GeGetCurrentOS()

Get the type of OS that is running CINEMA 4D.

Return type:int
Returns:The OS running CINEMA 4D:
OPERATINGSYSTEM_WIN Windows
OPERATINGSYSTEM_OSX OSX
OPERATINGSYSTEM_UNIX Unix
c4d.GeGetByteOrder()

Get the type of OS that is running CINEMA 4D.

Return type:int
Returns:The byte order:
BYTEORDERMOTOROLA Motorola
BYTEORDERINTEL Intel
c4d.GeGetGray()

Get the color values for the default CINEMA 4D gray.

Return type:Vector
Returns:All color components in this vector.
c4d.GetC4DVersion()

Get the version of CINEMA 4D that is running, for instance 12016.

Return type:int
Returns:The version of CINEMA 4D.
c4d.GetAPIVersion()

Get the API version of the Python SDK, for instance (1, 0, 1001)

Return type:list of int
Returns:The version of the CINEMA 4D Python SDK.
c4d.StopAllThreads()

Stop all running threads.

c4d.StatusClear(fn)

Clear the status bar text.

c4d.StatusSetText(str)

Set the status bar text:

import c4d
c4d.StatusSetText("Hello World!")
../../_images/statussettext.png
Parameters:str (str) – The text to display.
c4d.StatusSetSpin()

Set the status bar progress bar spinning. Use this to indicate that your plugin is still processing even if the progress bar is not increasing:

import c4d
c4d.StatusSetSpin()
../../_images/statussetspin.png
c4d.StatusSetBar(p)

Set the status bar text:

import c4d
c4d.StatusSetBar(50)
../../_images/statussetbar.png
Parameters:p (float) – The percentage of the bar (0-100).
c4d.IsNet()

New in version R15.037.

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

Return type:bool
Returns:True if NET is running, otherwise False.
c4d.IsServer()

New in version R15.037.

Checks if a NET server application is running.

Return type:bool
Returns:True if a NET server application is running, otherwise False.
c4d.IsClient()

New in version R15.037.

Checks if a NET client application is running.

Return type:bool
Returns:True if a NET client application is running, otherwise False.
c4d.EventAdd(flags=0)

Adds a global event to CINEMA 4D’s event queue. Results in a CoreMessage() message.

Parameters:flags (int) –

One of the following flags:

EVENT_0 No flags
EVENT_FORCEREDRAW Force a complete redraw
EVENT_ANIMATE Animate document
EVENT_NOEXPRESSION Do not execute expressions
EVENT_GLHACK Private
EVENT_CAMERAEXPRESSION If this is set(and not EVENT_NOEXPRESSION) the event will only update camera dependent expressions (for faster speed)
c4d.GeSyncMessage(messageid)

Sends a synchronous event message. (For example to make the timeline, timeslider etc. do an instant redraw.)

Parameters:messageid (int) –

One of the following flags:

EVMSG_ASYNCEDITORMOVE The user moved something in the editor window. Managers should update things like position fields.
EVMSG_TIMECHANGED Private.
Return type:bool
Returns:True if successful, otherwise False.
c4d.SendCoreMessage(coreid, msg[, eventid=0])

Sends a core message. For example:

msg = c4d.BaseContainer(c4d.COREMSG_CINEMA_GETCOMMANDENABLED)
msg.SetLong(c4d.COREMSG_CINEMA_GETCOMMANDENABLED, id)
name = c4d.SendCoreMessage(c4d.COREMSG_CINEMA, msg, 0)

or:

#returns the COREMSG_CINEMA_GETMACHINEFEATURES container
dat = c4d.SendCoreMessage(c4d.COREMSG_CINEMA, c4d.BaseContainer(c4d.COREMSG_CINEMA_GETMACHINEFEATURES))
Parameters:
  • coreid (int) – One of
  • msg (BaseContainer) –

    Message. Use one of these IDs:

    COREMSG_CINEMA Request to C4D core.
    COREMSG_CINEMA_GETCOMMANDNAME Returns the name of the command with ID specified by COREMSG_CINEMA_GETCOMMANDNAME in msg. The name is returned as a string in the returned object.
    COREMSG_CINEMA_GETCOMMANDENABLED Checks if the command with ID specified by COREMSG_CINEMA_GETCOMMANDENABLED in msg is enabled or disabled. The state is given as True or False.
    COREMSG_CINEMA_GETCOMMANDCHECKED Checks if the command with ID specified by COREMSG_CINEMA_GETCOMMANDCHECKED in msg is checked or not. The state is given as True or False.
    COREMSG_CINEMA_EXECUTEEDITORCOMMAND Executes the command with ID specified by COREMSG_CINEMA_EXECUTEEDITORCOMMAND in msg The result is given as True or False.
    COREMSG_CINEMA_FORCE_AM_UPDATE Forces an Attribute Manager update.
    COREMSG_UPDATECOMMANDSMESSAGE Private.
    COREMSG_CINEMA_EXECUTESUBID Pass the sub-ID for COREMSG_CINEMA_EXECUTEEDITORCOMMAND
    COREMSG_CINEMA_GETCOMMANDHELP Get the help string of a command. Pass the command’s ID. Results in a string.
  • eventid (int) – Event ID
Return type:

any

Returns:

The return data, depends on the message.

COREMSG_CINEMA_GETMACHINEFEATURES

See MACHINEINFO IDs.

COREMSG_CINEMA

Request to C4D core.

COREMSG_CINEMA_GETCOMMANDNAME

Returns the name of the command with ID specified by COREMSG_CINEMA_GETCOMMANDNAME in msg. The name is returned as a string in the returned object.

COREMSG_CINEMA_GETCOMMANDENABLED

Checks if the command with ID specified by COREMSG_CINEMA_GETCOMMANDENABLED in msg is enabled or disabled. The state is given as True or False.

COREMSG_CINEMA_GETCOMMANDCHECKED

Checks if the command with ID specified by COREMSG_CINEMA_GETCOMMANDCHECKED in msg is checked or not. The state is given as True or False.

COREMSG_CINEMA_EXECUTEEDITORCOMMAND

Executes the command with ID specified by COREMSG_CINEMA_EXECUTEEDITORCOMMAND in msg The result is given as True or False.

COREMSG_CINEMA_FORCE_AM_UPDATE

Forces an Attribute Manager update.

COREMSG_UPDATECOMMANDSMESSAGE

Private.

COREMSG_CINEMA_EXECUTESUBID

Pass the sub-ID for COREMSG_CINEMA_EXECUTEEDITORCOMMAND

COREMSG_CINEMA_GETCOMMANDHELP

Get the help string of a command. Pass the command’s ID. Results in a string.

c4d.GePluginMessage(id, data)

Sends a plugin message to other plugins.

Parameters:
  • id (int) – The ID of the message.
  • data (any) – The message data.
Return type:

bool

Returns:

True if the message could be sent, otherwise False.

c4d.DrawViews(flags, bd=None)

Redraws the editor views. Must be called from the main thread!

Parameters:
  • flags (int) –

    Which part of the editors view should be updated:

    DRAWFLAGS_0 No flags.
    DRAWFLAGS_NO_THREAD Synchronous call.
    DRAWFLAGS_NO_REDUCTION Ignore redraw limit.
    DRAWFLAGS_NO_ANIMATION Ignore all animation.
    DRAWFLAGS_ONLY_ACTIVE_VIEW Only redraw the active view.
    DRAWFLAGS_NO_EXPRESSIONS Ignore expressions.
    DRAWFLAGS_INDRAG In drag.
    DRAWFLAGS_FORCEFULLREDRAW Force full redraw.
    DRAWFLAGS_ONLY_CAMERAEXPRESSION Camera expression.
    DRAWFLAGS_INMOVE Private.
    DRAWFLAGS_ONLY_BASEDRAW Draw specific basedraw only.
    DRAWFLAGS_ONLY_HIGHLIGHT Only highlight.
    DRAWFLAGS_STATICBREAK If the display is done in the main thread (CINEMA 4D only does this during animation playback) this allows that a special thread is used that polls the escape key. Note: Use only in combination with DRAWFLAGS_NO_THREAD.
    DRAWFLAGS_PRIVATE_NO_WAIT_GL_FINISHED Private.
    DRAWFLAGS_PRIVATE_ONLYBACKGROUND Private.
    DRAWFLAGS_PRIVATE_NOBLIT Private.
    DRAWFLAGS_PRIVATE_OPENGLHACK Private.
    DRAWFLAGS_PRIVATE_ONLY_PREPARE Private.
    DRAWFLAGS_PRIVATE_NO_DCLIPPING Private.
  • bd (BaseDraw) – The basedraw to draw when DRAWFLAGS_ONLY_BASEDRAW is set in flags.
Return type:

bool

Returns:

Success of updating the editor views.

c4d.SpecialEventAdd(messageid[, p1=0][, p2=0])

Adds a custom event to the internal message queue.

Note

There are areas in C4D, especially the GUI, which can only be handled by the main thread. For instance, if you want to update the GUI from another thread, you can use SpecialEventAdd. This function adds a custom event to the internal message queue which is handled by the main thread. See example below.

Use a plugin ID for messageid to make sure that there’s no collision. Results in a GeDialog.CoreMessage() message:

c4d.SpecialEventAdd(MY_PLUGIN_ID) #e.g: called in Thread 1509

#[...]

def CoreMessage(self, id, msg):
    if id==MY_PLUGIN_ID:
        #Fired by the main thread...
        self.dlg.LayoutChanged(GROUP_ID)
        return True

    return gui.GeDialog.CoreMessage(self, id, msg)
Parameters:
  • messageid (int) – The message ID. Use a unique ID, for example your plugin ID.
  • p1 (int) – Private data for the sent message.
  • p2 (int) – Private data for the sent message.
c4d.GetGlobalTexturePath(i)

Get the global texture path.

Parameters:i (int) – The index of the texture path (0-9).
Return type:str
Returns:The texture path for CINEMA 4D.
c4d.SetGlobalTexturePath(i, fn)

Set the global texture path.

Parameters:
  • i (int) – The index of the texture path (0-9).
  • fn (str) – The texture path.
c4d.FlushUnusedTextures()

Flush all unused textures.

c4d.SetWorldContainer(bc)

Set the main CINEMA 4D settings container. See GetWorldContainer for values.

Parameters:bc (BaseContainer) – The new settings.
c4d.GetWorldContainer()

Returns a copy of the settings container of CINEMA 4D.

Return type:BaseContainer
Returns:The main CINEMA 4D settings.
c4d.GetWorldContainerInstance()

Returnce a reference to 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_XXX. These settings cannot be set using GetWorldContainerInstance().

Return type:BaseContainer
Returns:The main CINEMA 4D settings.
c4d.GetViewColor(colid)

Returns a viewport color.

Parameters:colid (int) –

Type of color to get:

VIEWCOLOR_ACTIVEBOX  
VIEWCOLOR_ACTIVECHILDBOX  
VIEWCOLOR_ACTIVEPOINT  
VIEWCOLOR_ACTIVEPOLYBOX  
VIEWCOLOR_ACTIVEPOLYCHILDBOX  
VIEWCOLOR_ACTIVEPOLYGON  
VIEWCOLOR_ANIMPATH  
VIEWCOLOR_AXIS_BAND  
VIEWCOLOR_BACKFACING  
VIEWCOLOR_C4DBACKGROUND  
VIEWCOLOR_CAMERA  
VIEWCOLOR_FILMFORMAT  
VIEWCOLOR_FRONTFACING  
VIEWCOLOR_GRID_MAJOR  
VIEWCOLOR_GRID_MINOR  
VIEWCOLOR_HORIZON  
VIEWCOLOR_INACTIVEPOINT  
VIEWCOLOR_INACTIVEPOLYGON  
VIEWCOLOR_IRR  
VIEWCOLOR_LAYER0  
VIEWCOLOR_LAYER1  
VIEWCOLOR_LAYER2  
VIEWCOLOR_LAYER3  
VIEWCOLOR_LAYER4  
VIEWCOLOR_LAYER5  
VIEWCOLOR_LAYER6  
VIEWCOLOR_LAYER7  
VIEWCOLOR_MAXCOLORS  
VIEWCOLOR_MAXHNWEIGHT  
VIEWCOLOR_MAXSOFTSELECT  
VIEWCOLOR_MEASURETOOL  
VIEWCOLOR_MINHNWEIGHT  
VIEWCOLOR_MINSOFTSELECT  
VIEWCOLOR_MODIFIER  
VIEWCOLOR_NGONLINE  
VIEWCOLOR_NORMAL  
VIEWCOLOR_PARTICLE  
VIEWCOLOR_PMODIFIER  
VIEWCOLOR_SELECTION_PREVIEW  
VIEWCOLOR_SELECT_AXIS  
VIEWCOLOR_SHADEDWIRE  
VIEWCOLOR_SPLINEEND  
VIEWCOLOR_SPLINESTART  
VIEWCOLOR_TANGENT  
VIEWCOLOR_TEXTURE  
VIEWCOLOR_TEXTUREAXIS  
VIEWCOLOR_UVMESH_APOINT  
VIEWCOLOR_UVMESH_APOLY  
VIEWCOLOR_UVMESH_GREYED  
VIEWCOLOR_UVMESH_IAPOINT  
VIEWCOLOR_UVMESH_IAPOLY  
VIEWCOLOR_VERTEXEND  
VIEWCOLOR_VERTEXSTART  
VIEWCOLOR_WXAXIS  
VIEWCOLOR_WYAXIS  
VIEWCOLOR_WZAXIS  
VIEWCOLOR_XAXIS  
VIEWCOLOR_YAXIS  
VIEWCOLOR_ZAXIS  
VIEWCOLOR_ZEROHNWEIGHT  
Return type:Vector
Returns:The color value.
c4d.SetViewColor(colid, col)

Set a viewport color.

Parameters:
  • colid (int) –

    Type of color to set:

    VIEWCOLOR_ACTIVEBOX  
    VIEWCOLOR_ACTIVECHILDBOX  
    VIEWCOLOR_ACTIVEPOINT  
    VIEWCOLOR_ACTIVEPOLYBOX  
    VIEWCOLOR_ACTIVEPOLYCHILDBOX  
    VIEWCOLOR_ACTIVEPOLYGON  
    VIEWCOLOR_ANIMPATH  
    VIEWCOLOR_AXIS_BAND  
    VIEWCOLOR_BACKFACING  
    VIEWCOLOR_C4DBACKGROUND  
    VIEWCOLOR_CAMERA  
    VIEWCOLOR_FILMFORMAT  
    VIEWCOLOR_FRONTFACING  
    VIEWCOLOR_GRID_MAJOR  
    VIEWCOLOR_GRID_MINOR  
    VIEWCOLOR_HORIZON  
    VIEWCOLOR_INACTIVEPOINT  
    VIEWCOLOR_INACTIVEPOLYGON  
    VIEWCOLOR_IRR  
    VIEWCOLOR_LAYER0  
    VIEWCOLOR_LAYER1  
    VIEWCOLOR_LAYER2  
    VIEWCOLOR_LAYER3  
    VIEWCOLOR_LAYER4  
    VIEWCOLOR_LAYER5  
    VIEWCOLOR_LAYER6  
    VIEWCOLOR_LAYER7  
    VIEWCOLOR_MAXCOLORS  
    VIEWCOLOR_MAXHNWEIGHT  
    VIEWCOLOR_MAXSOFTSELECT  
    VIEWCOLOR_MEASURETOOL  
    VIEWCOLOR_MINHNWEIGHT  
    VIEWCOLOR_MINSOFTSELECT  
    VIEWCOLOR_MODIFIER  
    VIEWCOLOR_NGONLINE  
    VIEWCOLOR_NORMAL  
    VIEWCOLOR_PARTICLE  
    VIEWCOLOR_PMODIFIER  
    VIEWCOLOR_SELECTION_PREVIEW  
    VIEWCOLOR_SELECT_AXIS  
    VIEWCOLOR_SHADEDWIRE  
    VIEWCOLOR_SPLINEEND  
    VIEWCOLOR_SPLINESTART  
    VIEWCOLOR_TANGENT  
    VIEWCOLOR_TEXTURE  
    VIEWCOLOR_TEXTUREAXIS  
    VIEWCOLOR_UVMESH_APOINT  
    VIEWCOLOR_UVMESH_APOLY  
    VIEWCOLOR_UVMESH_GREYED  
    VIEWCOLOR_UVMESH_IAPOINT  
    VIEWCOLOR_UVMESH_IAPOLY  
    VIEWCOLOR_VERTEXEND  
    VIEWCOLOR_VERTEXSTART  
    VIEWCOLOR_WXAXIS  
    VIEWCOLOR_WYAXIS  
    VIEWCOLOR_WZAXIS  
    VIEWCOLOR_XAXIS  
    VIEWCOLOR_YAXIS  
    VIEWCOLOR_ZAXIS  
    VIEWCOLOR_ZEROHNWEIGHT  
  • col (Vector) – The new color.
c4d.GeIsActiveToolEnabled()

Checks if the active tool is ghosted.

Return type:bool
Param:True if the active tool is ghosted, otherwise False.
c4d.GeGetLanguage(index)

Can be used to enumerate information about the available languages. Start with index==0 and then iterate until the function returns None:

lang = GeGetLanguage(index)
if lang==None: return

index+=1
# str, str, bool
print lang["extensions"], lang["name"], lang["default_language"]
Parameters:index (int) – The language index.
Return type:dict{extensions: str, name: str, default_language: bool}
Returns:Information about the language
c4d.GetObjectName(type)

Gets a user presentable name from an object type ID. For example, GetObjectName (Ocube) returns “Cube”.

Parameters:type (int) – An object type ID.
Return type:str
Returns:The object name for type.
c4d.GetObjectType(name)

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

Parameters:name (str) – An object name.
Return type:int
Returns:The object type for name.
c4d.GetTagName(type)

Gets a user presentable name from a tag type ID. For example, GetTagName (Tphong) returns “Phong”.

Parameters:type (int) – A tag type ID.
Return type:str
Returns:The tag name for type.
c4d.FindInManager(bl)

Finds and makes bl visible in its manager.

Parameters:bl (BaseList2D) – The object to find.
c4d.CheckIsRunning(type)

Check if a task is running.

Parameters:type (bool) –

The task

CHECKISRUNNING_ANIMATIONRUNNING0 Animation running
CHECKISRUNNING_VIEWDRAWING View drawing
CHECKISRUNNING_EDITORRENDERING Editor rendering
CHECKISRUNNING_EXTERNALRENDERING External rendering
CHECKISRUNNING_PAINTERUPDATING Painter updating
CHECKISRUNNING_MATERIALPREVIEWRUNNING Material preview running
Return type:bool
Returns:True if running, otherwise False.
c4d.GetMachineFeatures()

Get the features of the computer:

import c4d
bc = c4d.GetMachineFeatures()
print bc[c4d.OPENGL_RENDERER_NAME] #Output e.g: NVIDIA GeForce 9600 Engine
Return type:BaseContainer
Returns:The BaseContainer containing the computer’s features.

See also

For the container ID see OPENGL_Flags and MACHINEINFO_Flags

c4d.StartEditorRender(active_only, raybrush, x1, y1, x2, y2, bt, bd, newthread)

Starts the editor renderer:

import c4d
def RenderEditor(doc):
    bd = doc.GetActiveBaseDraw()
    c4d.StartEditorRender(active_only=False, raybrush=False, x1=0, y1=0, x2=500, y2=500, bt=None, bd=bd, newthread=False) #render a view
Parameters:
  • active_only (bool) – Active object only.
  • raybrush (bool) – Ray brush mode.
  • x1 (int) – X coordinate of the first corner of the render rectangle.
  • y1 (int) – Y coordinate of the first corner of the render rectangle.
  • x2 (int) – X coordinate of the second corner of the render rectangle.
  • y2 (int) – Y coordinate of the second corner of the render rectangle.
  • bt (BaseThread) – Must be None. Private.
  • bd (BaseDraw) – Base draw to draw to.
  • newthread (bool) – If this is True then the editor render is done asynchronously.
c4d.CallCommand(cmdid[, subid=0])

Call Command

Parameters:
  • cmdid (int) – Command ID
  • subid (int) – Sub ID (used for scripts)
c4d.GetCommandName(id)

Gets the name of the command with ID specified by id.

Parameters:id (int) – Command ID.
Return type:str
Returns:Command name.
c4d.GetCommandHelp(id)

Get the help string of a command.

Parameters:id (int) – The ID of the command.
Return type:str
Returns:The help string
c4d.IsCommandEnabled(id)

Checks if the command with ID specified by id is enabled.

Parameters:id (int) – Command ID
Return type:bool
Returns:True if the command is enabled, otherwise False.
c4d.IsCommandChecked(id)

Checks if the command with ID specified by id is checked.

Parameters:id (int) – Command ID
Return type:bool
Returns:True if the command is checked, otherwise False
c4d.CallButton(op, id)

Simulate a click of a button.

For example, here is how to call the ‘Apply’ button of a Tool:

import c4d

c4d.CallCommand(c4d.ID_MODELING_TRANSFER_TOOL) # Set Transfer as current Tool

tool = plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL) # Search Transfer Tool instance
if tool is not None:
    c4d.CallButton(tool, c4d.MDATA_APPLY)
    c4d.EventAdd()
Parameters:
  • op (BaseList2D) – The object.
  • id (int) – The ID of the button.
c4d.PrefsLib_OpenDialog(page)

Used to open the preference dialog of CINEMA 4D on a specific page:

import c4d
c4d.PrefsLib_OpenDialog(c4d.PREFS_PRI_MEMORY)
Parameters:page (int) –

The page to open:

PREFS_PRI_COMMON Common
PREFS_PRI_DOCUMENT Document
PREFS_PRI_INTERFACE Interface
PREFS_PRI_THEME Theme
PREFS_PRI_MOUSE Mouse
PREFS_PRI_OPENGL OpenGL
PREFS_PRI_VIEWPORT Viewport
PREFS_PRI_FILES Files
PREFS_PRI_UNITS Units
PREFS_PRI_MEMORY Memory
PREFS_PRI_INTERNET Internet
PREFS_PRI_RENDER Render
PREFS_PRI_BODYPAINT3D Bodypaint 3D
PREFS_PRI_MODULES Modules
PREFS_PRI_IMEXPORT Im/Export
PREFS_PRI_ADVANCED Advanced
Return type:bool
Returns:True on success otherwise False.
c4d.GetCustomDataTypeDefault(type)

Retrieve the default settings for a data type. Used to create a default datatype container which can be set with BaseList2D.AddUserData().

Parameters:type (int) –

Data type ID.

DTYPE_NONE None
DTYPE_CHILDS Childs
DTYPE_GROUP Group
DTYPE_COLOR Color
DTYPE_SUBCONTAINER Subcontainer Data
DTYPE_MULTIPLEDATA Multiple Data Entry
DTYPE_TEXTURE Texture
DTYPE_BUTTON Button
DTYPE_DYNAMIC GV Dynamic
DTYPE_SEPARATOR Seperator
DTYPE_STATICTEXT Statictext
DTYPE_POPUP Popup
DTYPE_LONG int
DTYPE_REAL float
DTYPE_TIME BaseTime
DTYPE_VECTOR Vector
DTYPE_MATRIX Matrix
DTYPE_STRING str
DTYPE_FILENAME str
DTYPE_BASELISTLINK BaseLink
DTYPE_BOOL bool
DTYPE_NORMAL Normal.
Return type:BaseContainer
Returns:Default settings container.
c4d.CopyStringToClipboard(text)

Copy a text to the clipboard.

Parameters:text (str) – The text to copy.
c4d.CopyBitmapToClipboard(map, ownerid)

Copy a bitmap to the clipboard.

Parameters:map (BaseBitmap) – The bitmap to copy.
c4d.GetStringFromClipboard()

Returns a string from the clipboard.

Return type:str
Returns:The string or None.
c4d.GetBitmapFromClipboard()

Returns a bitmap from the clipboard.

Return type:BaseBitmap
Returns:The bitmap or None.
c4d.GetClipboardType()

Get the type of the clipboard.

Return type:int
Returns:The type of the clipboard:
CLIPBOARDTYPE_EMPTY Clipboard is empty.
CLIPBOARDTYPE_STRING Clipboard contains a string.
CLIPBOARDTYPE_BITMAP Clipboard contains a bitmap.
c4d.GetC4DClipboardOwner()

Get the owner ID of the clipboard.

Return type:int
Returns:The owner ID:
CLIPBOARDOWNER_BODYPAINT Bodypaint 3D.
CLIPBOARDOWNER_PICTUREVIEWER The Picture Viewer.
c4d.Cast(type, obj)

New in version R16.021.

Casts obj to the given type.

Note

Particulary useful in a NET/Team render context when catching c4d.C4DPL_JOBFINISHED_POST message in PluginMessage():

if id == c4d.C4DPL_JOBFINISHED_POST:
        jobUuid = c4d.Cast(c4d.modules.uuid.UUID, data)
Parameters:
  • type (type) –

    The type to cast to. Supported types are:

    BaseContainer
    str
    Matrix
    UUID
  • obj (object) – The object to cast.
Return type:

any

Returns:

The result of the cast operation.

c4d.CallFunction(op, function, arg1, arg2, arg3)

New in version R16.021.

Calls a function defined within a scripting expression.
This works for both Python and C.O.F.F.E.E. scripting tags, effectors, XPresso nodes, Interaction tags and also for Python generators.

Note

The arguments and returned value have to be of any CINEMA 4D data type i.e. anytype or GeData in the C++ API.
Anything else will be converted to a void* before being sent to the other object. This make it possible to call a C.O.F.F.E.E. function from Python and vice versa.
As the maximum number of arguments is 3, to send more make one of the arguments a BaseContainer which can store more information.

Warning

Bear in mind that just as with any function call it is possible to accidentally set up a cyclical dependency of one function calling another which might call the original function (either directly or indirectly by e.g. invoking an EventAdd() which might cause the original function to be re-called) and so on and which would crash CINEMA 4D.
This risk is the same as with directly calling a function from within your own script.
Parameters:
  • op (BaseList2D) – The object to search the function within its script.
  • function (str) – The name of the function to call.
  • arg1 (any) – The first optional argument.
  • arg2 (any) – The second optional argument.
  • arg3 (any) – The third optional argument.
Return type:

any

Returns:

The value returned by the called function.

Table Of Contents