This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com
To get an overview of the class members, check out the diagram.
// Common stuff
// Status Bar
// Update
// Texture
// Settings
// Object stuff
// Command Handler
//
// Clipboard
Returns a dict from the user’s registration info.
| Return type: | dict str |
|---|---|
| Returns: | A list with the strings of the registration. |
| Key nr: | str |
| Parameter: | nr – first 11 digits |
| Key organization: | |
|---|---|
str |
|
| Parameters: |
|
| Key name: | str |
| Key street: | str |
| Key city: | str |
| Key country: | str |
Get the type of CINEMA 4D application that is running.
| Return type: | int |
||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns: | The version type.
|
Get the type of CINEMA 4D application that is running.
| Return type: | int |
||||
|---|---|---|---|---|---|
| Returns: | The version type.
|
Get the current timer count in milliseconds.
| Return type: | int |
|---|---|
| Returns: | The current timer count in milliseconds. |
Get the current timer count in milliseconds.
| Return type: | float |
|---|---|
| Returns: | The current timer count in milliseconds. |
Get the default frames per second value.
| Return type: | int |
|---|---|
| Returns: | The default FPS value. |
Get the type of OS that is running CINEMA 4D.
| Return type: | int |
||||||
|---|---|---|---|---|---|---|---|
| Returns: | The default FPS value.
|
Get the type of OS that is running CINEMA 4D.
| Return type: | int |
||||
|---|---|---|---|---|---|
| Returns: | The default FPS value.
|
Get the color values for the default CINEMA 4D gray.
| Return type: | Vector |
|---|---|
| Returns: | All color components in this vector. |
Get the version of CINEMA 4D that is running.
| Return type: | int |
|---|---|
| Returns: | The version of CINEMA 4D. |
Get the API version of Py4D.
| Return type: | int |
|---|---|
| Returns: | The version of CINEMA 4D. |
Set the status bar text.
| Parameter: | str (str) – The text to display. |
|---|
Set the status bar text.
| Parameter: | p (int) – The percentage of the bar (0-100). |
|---|
Adds a global event to CINEMA 4D’s event queue. Results in a CoreMessage() message.
| Parameter: | flags (int) – One of the following flags:
|
|---|
Sends a synchronous event message (for example to make the timeline, timeslider etc. do an instant redraw).
| Parameter: | messageid (int) – One of the following flags:
|
||||
|---|---|---|---|---|---|
| Return type: | bool | ||||
| Returns: | True if successful, otherwise False. |
Redraws the editor views. Must be called from the main thread!
| Parameters: |
|
||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | bool |
||||||||||||||||||||||||||||
| Returns: | Success of updating the editor view. |
Get the global texture path.
| Parameter: | i (int) – The index of the texture path (0-9). |
|---|---|
| Return type: | str |
| Returns: | The texture path for CINEMA 4D. |
Set the global texture path.
| Parameters: |
|
|---|
Returns a copy of the settings container of CINEMA 4D.
| Return type: | BaseContainer |
|---|---|
| Returns: | The main CINEMA 4D settings. |
Returns the settings container of CINEMA 4D that can be changed directly.
Warning
Please do not use in a global scope, otherwise use GetWorldContainer()
| Note: | Please do not edit the settings WPREF_UNITS_BASIC, _WPREF_COLOR_LAST_. These settings cannot be set with c4d.GetWorldContainerInstance(). |
|---|---|
| Return type: | BaseContainer |
| Returns: | The main CINEMA 4D settings. |
Returns the original reference to the main CINEMA 4D settings container that can be changed directly.
| Return type: | BaseContainer |
|---|---|
| Returns: | The main CINEMA 4D settings. |
Returns one of the main CINEMA 4D colors.
| Parameter: | colid (int) – Type of color to get. See c4d_colors.h to get the constants. |
|---|---|
| Return type: | Vector |
| Returns: | The color value. |
Set one of the main CINEMA 4D colors.
| Parameters: |
|
|---|
Checks if the active tool is ghosted.
| Return type: | bool |
|---|---|
| Param: | True if the active tool is ghosted, otherwise False. |
Can be used to enumerate information about the available languages. Start with index==0 and then iterate until the function returns None.
lang = GeGetLanguage(i) if not lang: return
# str, str, bool lang[“extensions”], lang[“extensions”], lang[“extensions”]
| Parameter: | index (int) – The language index. |
|---|---|
| Return type: | dict |
Gets a user presentable name from an object type ID.
| Parameter: | type (int) – An object type ID. |
|---|---|
| Return type: | str |
| Returns: | The object name for type. |
Gets a user presentable name from a tag type ID.
| Parameter: | type (int) – An tag type ID. |
|---|---|
| Return type: | str |
| Returns: | The tag name for type. |
Finds and makes bl visible in its manager.
| Parameter: | bl (BaseList2D) – The object to find. |
|---|
Check if a task is running.
| Parameter: | type (BaseList2D) – The task
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | bool | ||||||||||||
| Returns: | True if running, otherwise False. |
Gets CINEMA 4D memory statistics.
| Return type: | bool |
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns: | True if successful, otherwise False.
|
Get the features of the computer.
| Return type: | BaseContainer |
|---|---|
| Returns: | The BaseContainer containing the computer’s features. |
Starts the editor renderer:
def RenderEditor(doc):
bd = doc.GetActiveBaseDraw()
c4d.StartEditorRender(bd) #render whole basedraw
Note
This fuction is done asynchronously.
| Parameters: |
|
|---|
Call Command
| Parameters: |
|
|---|
Gets the name of the command with ID specified by id.
| Parameter: | id (int) – Command ID. |
|---|---|
| Return type: | str |
| Returns: | Command name. |
Get the help string of a command.
| Parameter: | id (int) – The ID of the command. |
|---|---|
| Return type: | str |
| Returns: | The help string |
Checks if the command with ID specified by id is enabled.
| Parameter: | id (int) – Command ID |
|---|---|
| Return type: | bool |
| Returns: | True if the command is enabled, otherwise False. |
Checks if the command with ID specified by id is checked.
| Parameter: | id (int) – Command ID |
|---|---|
| Return type: | bool |
| Returns: | True if the command is checked, otherwise False |
Simulate a click of a button.
| Parameters: |
|
|---|
Retrieve the default settings for a data type. Used to create a default datatype container which can be set with BaseList2D.AddCustomDataType.
| Parameter: | type (int) – Data type ID.
|
||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | BaseContainer | ||||||||||||||||||||||||||||||||||||||||||||
| Returns: | Default settings container. |
Copy a text to the clipboard.
| Parameter: | text (str) – The text to copy. |
|---|
Copy a bitmap to the clipboard.
| Parameter: | map (BaseBitmap) – The bitmap to copy. |
|---|
Returns a string from the clipboard.
| Return type: | str |
|---|---|
| Returns: | The string or None. |
Returns a bitmap from the clipboard.
| Return type: | BaseBitmap |
|---|---|
| Returns: | The bitmap or None. |
Get the type of the clipboard.
| Return type: | int |
||||||
|---|---|---|---|---|---|---|---|
| Returns: | The type of the clipboard:
|
Get the owner ID of the clipboard.
| Return type: | int |
||||
|---|---|---|---|---|---|
| Returns: | The owner ID.
|