c4d.gui.GeDialog

A dialog is a window or a panel, in which buttons, edit boxes, icons, images, and other things are put upon. These buttons, sliders, icons, etc are called widgets. Dialogs act as interfaces for a plugin. You are able to customize or derive a dialog box that will act as an interface for your plugin. Most dialog boxes are derived off of GeDialog class.

The reason you care about dialogs is that you want anyone to be able to use your plugin, and you want it to be easier to use. Plus it is a lot cooler when you have tons of widgets to play with. There is no other (easy) interactive way for you to interface with the user than with a dialog.

Definition

class c4d.gui. GeDialog

Methods to Override

Basic Methods

Input events

Get Methods

Set Methods

Miscellaneous

Inheritance

Members

GeDialog. CreateLayout ( self )

Override - Called when Cinema 4D is about to display the dialog.

Return type: bool
Returns: True if successful, or False to signalize an error.
GeDialog. Message ( self , msg , result )

Override - Override this function if you want to react to more messages than covered by the other virtual functions. Normally this is not necessary.

Note

Be sure to include a call to the parent version of this function:

from c4d import gui
from gui import GeDialog
def Message(self, msg, result):
  return GeDialog.Message(self, msg, result)
							
Parameters:
Return type:

int

Returns:

The return value depends on the message.

GeDialog. InitValues ( self )

Called when the dialog is initialized by the GUI.

Return type: bool
Returns: True if successful, or False to signalize an error.
GeDialog. CoreMessage ( self , id , msg )

Override this function if you want to react to Cinema 4D core messages. The original message is stored in msg.

Parameters:
  • id ( int ) –

    The message ID:

    EVMSG_CHANGE Sent by the EventAdd() function.
    EVMSG_DOCUMENTRECALCULATED This message is sent while drawing after the animation, expressions and cachebuild have been done. It allows that certain managers (e.g. attribute manager) update their values to the changes done by the expressions etc. Any reactions on this message should be pretty fast! Also please note that no modifying stuff must be done here as the draw thread is running at the same time and accesses the same data!
    EVMSG_TOOLCHANGED A tool setting has changed (local event).
    EVMSG_GRAPHVIEWCHANGED Something in XPresso has been changed (local event).
    EVMSG_AUTKEYMODECHANGED The autokey mode was changed.
    EVMSG_UPDATEHIGHLIGHT A special message sent by Cinema 4D in the case that only the highlighting changes. This happens for example when you move the mouse over the viewport. Plugins usually do not need to care about this.
    EVMSG_CHANGEDSCRIPTMODE Sent when the script mode (Python, C.O.F.F.E.E.) changed.
    EVMSG_SHOWIN_SB Show in Scene Browser.
    EVMSG_SHOWIN_TL Show in Timeline.
    EVMSG_SHOWIN_FC Show in Function Curve editor.
    EVMSG_SHOWIN_LM Show in Layer Manager.
    EVMSG_TLOM_MERGE Private.
    EVMSG_SHOWIN_MT Show in Motion editor.
    EVMSG_TIMELINESELECTION A timeline selection has been changed (local event).
    EVMSG_BROWSERCHANGE Something in the browser has been changed (local event).
    EVMSG_MATERIALSELECTION A material selection has been changed (local event).
    EVMSG_FCURVECHANGE Something in the F-Curve manager has been changed (local event).
    EVMSG_RAYTRACER_FINISHED Private.
    EVMSG_MATERIALPREVIEW Private.
    EVMSG_ACTIVEVIEWCHANGED Private.
    EVMSG_ASYNCEDITORMOVE The user moved something in the editor window. Managers should update things like position fields.
    EVMSG_TIMECHANGED Private.
    EVMSG_VIEWWINDOW_OUTPUT Private.
    EVMSG_VIEWWINDOW_3DPAINTUPD Private.
    EVMSG_UPDATESCHEME Scheme has been updated.
    EVMSG_TAKECHANGED

    New in version R17.032.

    Sent by the Take System when the current Take ID changed to let all managers react to the new status.

  • msg ( BaseContiner ) – The message container.
Return type:

bool

Returns:

Currently not used - but you have to return a bool value.

GeDialog. Command ( self , id , msg )

Override this function if you want to react to user clicks. Whenever the user clicks on a gadget and/or changes its value this function will be called. It is also called when a string menu item is selected. Override it to handle such events.

Note

Remember that you need to call StopAllThreads() before making modifications to the scene.

Parameters:
  • id ( int ) – The ID of the gadget that triggered the event.
  • msg ( BaseContiner ) –

    The original message container. Contains the following values:

    BFM_ACTION_DP_MENUCLICK bool Right mouse button.
    BFM_ACTION_DP_ADDSELECT bool Shift.
    BFM_ACTION_DP_SUBSELECT bool Control.
    BFM_ACTION_DP_FOCUS bool Focus.
    BFM_ACTION_DP_ANIMCLICK bool Animation click.
    BFM_ACTION_DP_BUTTONCLICK bool Double left mouse button click.
    BFM_ACTION_QUAL int Qualifier.
Return type:

bool

Returns:

False if there was an error, otherwise True .

GeDialog. AskClose ( self )

If the user wants to close the dialog with the OK button this function will be called. Override it to avoid closing the dialog if an error situation has occured. If you return False everything will be as usual, but if you return True the dialog won’t close.

Warning

Please pay attention to the result value. True means, it will not close.

Return type: bool
Returns: True if the dialog shouldn’t be closed, False if it should.
GeDialog. Timer ( self , msg )

If you subscribe to timer events using SetTimer() (x), this function is called every x’th millisecond.

Parameters: msg ( BaseContainer ) – The raw timer message.
GeDialog. DestroyWindow ( self )

Override this method - this function is called when the dialog is about to be closed temporarily, for example for layout switching.

GeDialog. Open ( dlgtype[, pluginid=0][, xpos=-1][, ypos=-1][, defaultw=0][, defaulth=0][, subid=0] )

Opens a dialog.

Parameters:
  • dlgtype ( int ) –

    The dialog type:

    DLG_OK OK button.
    DLG_CANCEL Cancel button.
    DLG_TYPE_MODAL Modal dialog.
    DLG_TYPE_MODAL_RESIZEABLE Resizeable modal dialog.
    DLG_TYPE_ASYNC Non-modal (asynchronous) dialog.
    DLG_TYPE_ASYNC_POPUP_RESIZEABLE Non-modal (asynchronous) dialog. Resizable popup dialog style (no menu bar).
    DLG_TYPE_ASYNC_POPUPEDIT Non-modal (asynchronous) dialog. Popup dialog style (no menu bar, no window frame).
    DLG_TYPE_ASYNC_FULLSCREEN_WORK Non-modal (asynchronous) dialog. Fullscreen over desktop area.
    DLG_TYPE_ASYNC_FULLSCREEN_MONITOR Non-modal (asynchronous) dialog. Fullscreen over the whole monitor area.
  • pluginid ( int ) – The plugin ID of CommandData .
  • xpos ( int ) – The Y position of the dialog or -1.
  • ypos ( int ) – The Y position of the dialog or -1.
  • defaultw ( int ) – The default width in pixels, or 0.
  • defaulth ( int ) – The default height in pixels, or 0.
  • subid ( int ) – The dialog sub ID.
Return type:

bool

Returns:

True if successfully opened, otherwise False .

GeDialog. Restore ( pluginid , secret )

Used to restore an asynchronous dialog that has been placed in the users layout. Just use this method in CommandData.RestoreLayout() .

Parameters:
Return type:

bool

Returns:

True if successfully restored, otherwise False .

GeDialog. GetInputState ( askdevice , askchannel , res )

Polls a certain channel of a device for the current input state. If the return value is True , the container stored in res is just like an input event message, otherwise no state was available.

See also

Input Events .

Parameters:
  • askdevice ( int ) –

    The device to ask.. One of the following types:

    BFM_INPUT_MOUSE Mouse
    BFM_INPUT_KEYBOARD Keyboard
  • askchannel ( int ) –

    The channel contains the key or button (‘A’ means A, KEY_F1 means F1):

    BFM_INPUT_MOUSELEFT Left mouse button.
    BFM_INPUT_MOUSERIGHT Right mouse button.
    BFM_INPUT_MOUSEMIDDLE Middle mouse button.
    BFM_INPUT_MOUSEX1 Fourth mouse button.
    BFM_INPUT_MOUSEX2 Five mouse button.
    BFM_INPUT_MOUSEWHEEL Mouse wheel message.
    BFM_INPUT_MOUSEMOVE Mouse move message.
  • res ( c4d.BaseContainer ) – The result is stored in this container.
Return type:

bool

Returns:

True if a state could be retrieved, otherwise False .

GeDialog. GetInputEvent ( askdevice , res )

Gets the next input event for a certain device from the event queue. If the return value is True , the container stored in res is just like an input event message, otherwise no event was available.

See also

Input Events .

Parameters:
  • askdevice ( int ) –

    The device to ask. One of the following types:

    BFM_INPUT_MOUSE Mouse
    BFM_INPUT_KEYBOARD Keyboard
  • res ( c4d.BaseContainer ) – The result is stored in this container.
Return type:

bool

Returns:

True if the event could be retrieved, otherwise False .

GeDialog. KillEvents ( )

Flushes all events from the window message queue. For example if you loop while the mouse is down (polling) you can call this command to flush all keydowns/mouseclicks that are made during the loop.

GeDialog. Local2Global ( )

Transforms local coordinates (relative to the top left corner of the dialog) to global coordinates (relative to the top left corner of the physical window). Result is a dict with member keys x and y of type int .

Return type: dict{ x : int, y : int}
Returns: The converted coordinates or None .
GeDialog. Global2Local ( )

Transforms global coordinates (relative to the top left corner of the physical window) to local coordinates (relative to the top left corner of the dialog). Result is a dict with member keys x and y of type int .

Return type: dict{ x : int, y : int}
Returns: The converted coordinates or None .
GeDialog. Local2Screen ( )

Transforms local coordinates (relative to the top left corner of the dialog) to screen coordinates (relative to the top left corner of the system screen). Result is a dict with member keys x and y of type int .

Return type: dict{ x : int, y : int}
Returns: The converted coordinates or None .
GeDialog. Screen2Local ( )

Transforms screen coordinates (relative to the top left corner of the system screen) to local coordinates (relative to the top left corner of the dialog). Result is a dict with member keys x and y of type int .

Return type: dict{ x : int, y : int}
Returns: The converted coordinates or None .
GeDialog. SetDefaultColor ( id , colorid , color )

Set The default color for GUI elements.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID to set the color for.
  • colorid ( int ) –

    The color value.

    COLOR_3DTEXT  
    COLOR_XOR  
    COLOR_TRANS  
    COLOR_BG  
    COLOR_BGEDIT  
    COLOR_BGFOCUS  
    COLOR_TEXT  
    COLOR_TEXTFOCUS  
    COLOR_EDGELT  
    COLOR_EDGEWH  
    COLOR_EDGEDK  
    COLOR_EDGEBL  
    COLOR_DBARFG1  
    COLOR_DBARBG1  
    COLOR_DBARFG2  
    COLOR_DBARBG2  
    COLOR_BGGADGET  
    COLOR_BGSELECTEDTEXT  
    COLOR_FGSELECTEDTEXT  
    COLOR_TIMELINE  
    COLOR_BGTRISTATE  
    COLOR_BG_DARK1  
    COLOR_BG_DARK2  
    COLOR_CTIMELINE_GRIDMEDIUM

    New in version R17.032.

    COLOR_SB_CARET

    New in version R17.032.

    COLOR_SB_CARETBG

    New in version R17.032.

    COLOR_TEXT_AUTOTAKE

    New in version R17.032.

    COLOR_TEXT_AUTOTAKE_DARK

    New in version R17.032.

  • color ( c4d.Vector ) – The color.
GeDialog. GetColorRGB ( colorid )

Gets the RGB values associated with a color code.

Parameters: colorid ( int ) –

The color value.

COLOR_3DTEXT  
COLOR_XOR  
COLOR_TRANS  
COLOR_BG  
COLOR_BGEDIT  
COLOR_BGFOCUS  
COLOR_TEXT  
COLOR_TEXTFOCUS  
COLOR_EDGELT  
COLOR_EDGEWH  
COLOR_EDGEDK  
COLOR_EDGEBL  
COLOR_DBARFG1  
COLOR_DBARBG1  
COLOR_DBARFG2  
COLOR_DBARBG2  
COLOR_BGGADGET  
COLOR_BGSELECTEDTEXT  
COLOR_FGSELECTEDTEXT  
COLOR_TIMELINE  
COLOR_BGTRISTATE  
COLOR_BG_DARK1  
COLOR_BG_DARK2  
COLOR_CTIMELINE_GRIDMEDIUM

New in version R17.032.

COLOR_SB_CARET

New in version R17.032.

COLOR_SB_CARETBG

New in version R17.032.

COLOR_TEXT_AUTOTAKE

New in version R17.032.

COLOR_TEXT_AUTOTAKE_DARK

New in version R17.032.

Return type: dict{ r : int, g : int, b : int}
Returns: The color in the dict with the keys x , y and z .
GeDialog. CheckValueRanges ( )

Checks if the value for all input fields are within the allowed range.

Return type: bool
Returns: True if everything is alright, or False if any field is wrong.
GeDialog. AddCheckbox ( id, flags[, initw=0][, inith=0][, name=”“] )
../../../_images/checkbox.png

Add a checkbox to the dialog.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • name ( str ) – Name of the checkbox option.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddButton ( id, flags[, initw=0][, inith=0][, name=”“] )
../../../_images/button.png

Add a button to the dialog.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • name ( str ) – Name of the button.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddStaticText ( id, flags[, initw=0][, inith=0][, name=”“][borderstyle=0] )
../../../_images/statictext1.png ../../../_images/statictext2.png

Adds a static text field to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • name ( str ) – Name of the button.
  • borderstyle ( int ) –

    Border style:

    BORDER_NONE No border.
    BORDER_THIN_IN Thin border inward.
    BORDER_THIN_OUT Thin border outward.
    BORDER_IN Normal border inward.
    BORDER_OUT Normal border outward.
    BORDER_GROUP_IN Group border inside.
    BORDER_GROUP_OUT Group border outside.
    BORDER_OUT2 Outward border 2.
    BORDER_OUT3 Outward border 3
    BORDER_BLACK Thin black line.
    BORDER_ACTIVE_1 Active border 1.
    BORDER_ACTIVE_2 Active border 2.
    BORDER_ACTIVE_3 Active border 3.
    BORDER_ACTIVE_4 Active border 4.
    BORDER_GROUP_TOP Border along the top.
    BORDER_ROUND Border with round corners.
    BORDER_SCHEME_EDIT Edit field border like the shortcut gadget for example.
    BORDER_SCHEME_EDIT_NUMERIC Edit field border that is open to the right like the link field for example.
    BORDER_OUT3l Outward border 3, open to the left.
    BORDER_OUT3r Outward border 3, open to the right.
    BORDER_MASK Masks out border type.
    BORDER_WITH_TITLE_BOLD Display group title with bold font.
    BORDER_WITH_TITLE Display group title in the border.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddEditText ( id, flags[, initw=0][, inith=0][, name=”“][editflags=0] )
../../../_images/edittextbox.png

Adds an editable text field to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • name ( str ) – Name of the button.
  • editflags ( int ) –

    Edit flags:

    EDITTEXT_PASSWORD Password field.
    EDITTEXT_HELPTEXT Sets the helptext for an editfield. This text appears if the editfield is empty.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddMultiLineEditText ( id, flags[, initw=0][, inith=0][, style=0] )
../../../_images/multilineedit.png

Adds an editable text field with multiple lines to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • style ( int ) –

    A combination of the following flags:

    DR_MULTILINE_MONOSPACED Monospaced font.
    DR_MULTILINE_SYNTAXCOLOR C.O.F.F.E.E. syntax highlighting.
    DR_MULTILINE_STATUSBAR Display a statusbar with the cursor position.
    DR_MULTILINE_HIGHLIGHTLINE Highlight lines.
    DR_MULTILINE_READONLY Read only multi line field.
    DR_MULTILINE_PYTHON Python syntax highlighting.
    DR_MULTILINE_WORDWRAP Word-warp multi line field.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddEditNumber ( id, flags[, initw=80][, inith=0] )
../../../_images/editnumber.png

Adds an editable number field to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddEditNumberArrows ( id, flags[, initw=70][, inith=0] )
../../../_images/editnumberarrows.png

Adds an editable number field with up/down arrows to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddSlider ( id, flags[, initw=90][, inith=0] )
../../../_images/slider.png

Adds a slider with an editable number field to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddEditSlider ( id, flags[, initw=80][, inith=0] )
../../../_images/editslider.png

Adds a slider with an editable number field to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddColorField ( id, flags[, initw=0][, inith=0][,colorflags=0] )
../../../_images/colorfield.png

Adds a simple color field without sliders to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • colorflags ( int ) –

    New in version R14.014: Color flags:

    DR_COLORFIELD_NO_BRIGHTNESS Disables the brightness control.
    DR_COLORFIELD_NO_COLOR Disables the color control.
    DR_COLORFIELD_BODYPAINT Uses the Bodypaint style.
    DR_COLORFIELD_ICC_BASEDOC Uses the color profile of the current BaseDocument .
    DR_COLORFIELD_ICC_BPTEX Uses the color profile of the current BodyPaint 3D texture.
    DR_COLORFIELD_NO_MODE_BUTTONS

    New in version R17.032.

    Hides the color mode buttons.

    DR_COLORFIELD_NO_COLORWHEEL

    New in version R17.032.

    Hides the Color Wheel mode button.

    DR_COLORFIELD_NO_SPECTRUM

    New in version R17.032.

    Hides the Color Spectrum mode button.

    DR_COLORFIELD_NO_PICTURE

    New in version R17.032.

    Hides the Color From Picture mode button.

    DR_COLORFIELD_NO_RGB

    New in version R17.032.

    Hides the RGB sliders mode button.

    DR_COLORFIELD_NO_HSV

    New in version R17.032.

    Hides the HSV sliders mode button.

    DR_COLORFIELD_NO_KELVIN

    New in version R17.032.

    Hides the Kelvin Color Temperature mode button.

    DR_COLORFIELD_NO_MIXER

    New in version R17.032.

    Hides the Color Mixer mode button.

    DR_COLORFIELD_NO_SWATCHES

    New in version R17.032.

    Hides the Swatches mode button.

    DR_COLORFIELD_NO_SCREENPICKER

    New in version R17.032.

    Hides the ScreenPicker mode button.

    DR_COLORFIELD_ENABLE_COLORWHEEL

    New in version R17.032.

    Enables the Special Color Wheel mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_SPECTRUM

    New in version R17.032.

    Enables the Special Color Spectrum mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_PICTURE

    New in version R17.032.

    Enables the Special Color from Picture mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_RGB

    New in version R17.032.

    Enables the RGB sliders mode.

    DR_COLORFIELD_ENABLE_HSV

    New in version R17.032.

    Enables the HSV sliders mode.

    DR_COLORFIELD_ENABLE_KELVIN

    New in version R17.032.

    Enables the Kelvin Color Temperature mode.

    DR_COLORFIELD_ENABLE_MIXER

    New in version R17.032.

    Enables the Color Mixer mode.

    DR_COLORFIELD_ENABLE_SWATCHES

    New in version R17.032.

    Enables the Swatches mode.

    DR_COLORFIELD_RGB_HIDE_HEX

    New in version R17.032.

    Hides the Hexadecimal color field in the RGB Mode.

Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddComboBox ( id, flags[, initw=80][, inith=0][, specialalign=False] )
../../../_images/combobox.png

Adds a combo box to the layout. To add items to the combo box menu use the AddChild() method.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddColorChooser ( id, flags[, initw=80][, inith=0][, layoutflags=False][,settings=None] )

Adds a color field with sliders to the layout.

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • layoutflags ( int ) –

    Flags:

    DR_COLORFIELD_NO_BRIGHTNESS Disables the brightness control.
    DR_COLORFIELD_NO_COLOR Disables the color control.
    DR_COLORFIELD_BODYPAINT Uses the Bodypaint style.
    DR_COLORFIELD_ICC_BASEDOC Uses the color profile of the current BaseDocument .
    DR_COLORFIELD_ICC_BPTEX Uses the color profile of the current BodyPaint 3D texture.
    DR_COLORFIELD_NO_MODE_BUTTONS

    New in version R17.032.

    Hides the color mode buttons.

    DR_COLORFIELD_NO_COLORWHEEL

    New in version R17.032.

    Hides the Color Wheel mode button.

    DR_COLORFIELD_NO_SPECTRUM

    New in version R17.032.

    Hides the Color Spectrum mode button.

    DR_COLORFIELD_NO_PICTURE

    New in version R17.032.

    Hides the Color From Picture mode button.

    DR_COLORFIELD_NO_RGB

    New in version R17.032.

    Hides the RGB sliders mode button.

    DR_COLORFIELD_NO_HSV

    New in version R17.032.

    Hides the HSV sliders mode button.

    DR_COLORFIELD_NO_KELVIN

    New in version R17.032.

    Hides the Kelvin Color Temperature mode button.

    DR_COLORFIELD_NO_MIXER

    New in version R17.032.

    Hides the Color Mixer mode button.

    DR_COLORFIELD_NO_SWATCHES

    New in version R17.032.

    Hides the Swatches mode button.

    DR_COLORFIELD_NO_SCREENPICKER

    New in version R17.032.

    Hides the ScreenPicker mode button.

    DR_COLORFIELD_ENABLE_COLORWHEEL

    New in version R17.032.

    Enables the Special Color Wheel mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_SPECTRUM

    New in version R17.032.

    Enables the Special Color Spectrum mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_PICTURE

    New in version R17.032.

    Enables the Special Color from Picture mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_RGB

    New in version R17.032.

    Enables the RGB sliders mode.

    DR_COLORFIELD_ENABLE_HSV

    New in version R17.032.

    Enables the HSV sliders mode.

    DR_COLORFIELD_ENABLE_KELVIN

    New in version R17.032.

    Enables the Kelvin Color Temperature mode.

    DR_COLORFIELD_ENABLE_MIXER

    New in version R17.032.

    Enables the Color Mixer mode.

    DR_COLORFIELD_ENABLE_SWATCHES

    New in version R17.032.

    Enables the Swatches mode.

    DR_COLORFIELD_RGB_HIDE_HEX

    New in version R17.032.

    Hides the Hexadecimal color field in the RGB Mode.

  • settings ( c4d.BaseContainer ) –

    New in version R17.048.

    The color chooser settings.

Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddRadioGroup ( id[, flags=0][, columns=0][, rows=0] )
../../../_images/radiogroup.png

Adds a radio group to the layout. To add items to the radio button group use the AddChild() function.

Parameters:
  • id ( int ) – The control ID.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • columns ( int ) – Number of columns, or 0 if rows is used.
  • rows ( int ) – Number of rows, or 0 if columns is used.
Return type:

bool

Returns:

True if the radio group was added, otherwise False .

GeDialog. AddRadioButton ( id, flags[, initw=80][, inith=0][, name=”“] )
../../../_images/radiobutton.png

Adds a radio button to the layout. Used with radio groups created with AddRadioGroup() .

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • name ( str ) – Name of the radio button.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddRadioText ( id, flags[, initw=80][, inith=0][, name=”“] )

Adds a text radio button to the layout (like the ones to the left in the Cinema 4D material editor). Used with radio groups created with AddRadioGroup() .

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
  • name ( str ) – Name of the text radio button.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddPopupButton ( id, flags[, initw=0][, inith=0] )

New in version R19.

Adds a popup button to the layout. To add items to the popup menu use AddChild() or SetPopup() .

Parameters:
  • id ( int ) – The unique ID of the dialog.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddSeparatorH ( inith [ , flags=BFH_FIT ] )
../../../_images/separator1.png

Adds a horizontal separator to the layout.

Parameters:
  • initw ( int ) – Initial width.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddSeparatorV ( initv [ , flags=BFH_FIT ] )
../../../_images/separator1.png

Adds a vertical separator to the layout.

Parameters:
  • initv ( int ) – Initial width.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddCustomGui ( id , pluginid , name , flags , minw , minh [ , customdata ] )

Adds a custom GUI to the dialog.

Parameters:
  • id ( int ) – The ID of the custom GUI to add.
  • pluginid ( int ) – The plugin ID.
  • name ( str ) – The name of the added custom GUI. (Not necessarily used.)
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • minw ( int ) – Minimum width.
  • minh ( int ) – Minimum height.
  • customdata ( c4d.BaseContainer ) – Container with settings for the custom GUI element.
Return type:

any custom GUI class

Returns:

The custom GUI that was added, or None if an error occured.

Changed in version R18.057: The method returns a BaseCustomGui when there is no class available for the custom GUI. This allows to interact with any custom GUI, calling for instance BaseCustomGui.GetData() / SetData() .

GeDialog. FindCustomGui ( id , pluginid )

Get the custom GUI for a certain ID. The GUI object must have been previously added with AddCustomGui() .

Parameters:
  • id ( int ) – The ID of the custom GUI.
  • pluginid ( int ) – The plugin ID of the custom GUI.
Return type:

any custom GUI class

Returns:

The found custom GUI, or None if it could not be retrieved.

Changed in version R18.057: The method returns a BaseCustomGui when there is no class available for the custom GUI. This allows to interact with any custom GUI, calling for instance BaseCustomGui.GetData() / SetData() .

GeDialog. AddChild ( id , subid , child )

Adds items to combo boxes or popup buttons. The resource equivalent is CHILDS .

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • subid ( int ) – ID of the item to add.
  • child ( str ) – Name of the item to add.
Return type:

bool

Returns:

True if the child was added.

GeDialog. FreeChildren ( id , subid , child )

Clears the item list of combo boxes and popup buttons.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: bool
Returns: True if the children were removed.
GeDialog. SetPopup ( id , bc )

New in version R19.

Sets the item list of a popup button using a popup menu container.

Parameters:
Return type:

bool

Returns:

True if the popup menu was set, otherwise False .

GeDialog. AddChildren ( id , bc )

New in version R19.

Adds children to a dialog element using a container.

Parameters:
Return type:

bool

Returns:

True if the children were added, otherwise False .

GeDialog. AttachUserArea ( ua , id [ , userareaflags=USERAREA_COREMESSAGE ] )

Assigns a GeUserArea object to a user area control in the dialog. The object will handle all messages to the user area and is responsible for painting the user area. A good practice is to place the GeUserArea derived object as a member of the GeDialog derived class.

Parameters:
  • ua ( c4d.gui.GeUserArea ) – A user area object to attach.
  • id ( c4d.gui.C4DGadget or int ) – The control ID.
  • userareaflags ( int ) –

    Flags for the user area:

    USERAREA_0 None.
    USERAREA_TABSTOP Tab stop.
    USERAREA_HANDLEFOCUS Handles focus.
    USERAREA_COREMESSAGE Receives core messages.
    USERAREA_SYNCMESSAGE Receives sync messages.
    USERAREA_DONT_MIRROR Do not mirror the user area.
Return type:

bool

Returns:

True if the children were removed.

GeDialog. AddUserArea ( id, flags[, initw=0][, inith=0] )

Adds a user area to the layout. Use AttachUserArea() to assign a GeUserArea object to the user area control.

Parameters:
  • id ( int ) – The user area ID.
  • flags ( int ) –
    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

c4d.gui.C4DGadget

Returns:

The added gadget.

GeDialog. AddSubDialog ( id, flags[, initw=0][, inith=0] )

New in version R19.

Adds a sub-dialog to the layout. Use AttachSubDialog() to assign a c4d.gui.SubDialog object to the sub-dialog control.

Parameters:
  • id ( int ) – The sub-dialog ID.
  • flags ( int ) –
    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • initw ( int ) – Initial width.
  • inith ( int ) – Initial height.
Return type:

bool

Returns:

True if the sub-dialog was added, otherwise False .

GeDialog. AttachSubDialog ( userdlg , id )

New in version R19.

Attaches a c4d.gui.SubDialog derived object to a sub-dialog control, added with AddSubDialog() . To replace the sub-dialog with another one, just call this function again.
Parameters:
  • userdlg ( c4d.gui.SubDialog ) – The sub-dialog to attach.
  • id ( int ) – The sub-dialog ID.
Return type:

bool

Returns:

True if the sub-dialog was attached, otherwise False .

GeDialog. AddDlgGroup ( type )
../../../_images/dlggroup.png

Adds a dialog group with standard buttons to the layout.

Note

The dialog group contains the standard buttons of a modal dialog (OK and Cancel). By having these grouped together in a single element, Cinema 4D can change the ordering and alignment of the buttons to suit the operation system used.

Parameters: type ( int ) –

Specifies what standard buttons to include. Can be a combination of:

DLG_OK OK button.
DLG_CANCEL Cancel button.
DLG_TYPE_MODAL Modal dialog.
DLG_TYPE_MODAL_RESIZEABLE Resizeable modal dialog.
DLG_TYPE_ASYNC Non-modal (asynchronous) dialog.
DLG_TYPE_ASYNC_POPUP_RESIZEABLE Non-modal (asynchronous) dialog. Resizable popup dialog style (no menu bar).
DLG_TYPE_ASYNC_POPUPEDIT Non-modal (asynchronous) dialog. Popup dialog style (no menu bar, no window frame).
DLG_TYPE_ASYNC_FULLSCREEN_WORK Non-modal (asynchronous) dialog. Fullscreen over desktop area.
DLG_TYPE_ASYNC_FULLSCREEN_MONITOR Non-modal (asynchronous) dialog. Fullscreen over the whole monitor area.
Return type: bool
Returns: True if the dialog group was added, otherwise False .
GeDialog. GetItemDim ( id )

Queries a dialog control for its current position and size in pixels.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID.
Return type: dict(‘x’: int, ‘y’: int, ‘w’: int, ‘h’: int)
Returns: A dictionary with the X/Y coordinates of the upper left corner and the width/height of the control.
GeDialog. GetDragPosition ( msg )

Extracts local drag coordinates from a drag and drop event.

Parameters: msg ( c4d.BaseContainer ) – The original message.
Return type: dict{‘x’: int, ‘y’: int}
Returns: The local X and Y position.
GeDialog. GetDragObject ( msg )

Extracts the object from a drag and drop message.

Parameters: msg ( c4d.BaseContainer ) – The original message.
Return type: dict{‘type’: int, ‘object’: any}
Returns: The type of drag and the object itself. The types are:
DRAGTYPE_ATOMARRAY Atom array. The data is a list of c4d.C4DAtom .
DRAGTYPE_CMDPALETTE Not supported.
DRAGTYPE_COMMAND Not supported.
DRAGTYPE_DESCID Description ID. The data is a dict(‘did’: c4d.DescID , ‘arr’: list of c4d.C4DAtom ).
DRAGTYPE_ICON Not supported.
DRAGTYPE_FILES Files. The data is a string with the filename.
DRAGTYPE_FILENAME_IMAGE Image. The data is a string with the filename.
DRAGTYPE_FILENAME_OTHER Other filename. The data is a string with the filename.
DRAGTYPE_FILENAME_SCENE Scene filename. The data is a string with the filename.
DRAGTYPE_MANAGER Not supported.
DRAGTYPE_RGB RGB color. The data is a c4d.Vector .
DRAGTYPE_RGB_ARRAY RGB color array. The data is a list of c4d.Vector .
GeDialog. SetDragDestination ( cursor [ , gadgetid=0 ] )

Sets the correct cursor during drag and drop handling.

Parameters:
  • cursor ( int ) –

    A mouse cursor:

    MOUSE_HIDE Hide cursor.
    MOUSE_SHOW Show cursor.
    MOUSE_NORMAL Normal cursor.
    MOUSE_BUSY Busy cursor.
    MOUSE_CROSS Cross cursor.
    MOUSE_QUESTION Question cursor
    MOUSE_ZOOM_IN Zoom in cursor.
    MOUSE_ZOOM_OUT Zoom out cursor.
    MOUSE_FORBIDDEN Forbidden cursor.
    MOUSE_DELETE Delete cursor.
    MOUSE_COPY Copy cursor.
    MOUSE_INSERTCOPY Insert copy cursor.
    MOUSE_INSERTCOPYDOWN Insert copy down cursor.
    MOUSE_MOVE Move cursor.
    MOUSE_INSERTMOVE Insert move cursor.
    MOUSE_INSERTMOVEDOWN Insert move cursor.
    MOUSE_ARROW_H Horizontal cursor.
    MOUSE_ARROW_V Vertical cursor.
    MOUSE_ARROW_HV Horizontal and vertical arrow cursor.
    MOUSE_POINT_HAND Point hand cursor.
    MOUSE_MOVE_HAND Move hand cursor.
    MOUSE_IBEAM I-beam cursor.
    MOUSE_SELECT_LIVE Live selection cursor.
    MOUSE_SELECT_FREE Free selection cursor.
    MOUSE_SELECT_RECT Rectangle selection cursor.
    MOUSE_SELECT_POLY Polygon selection cursor.
    MOUSE_SPLINETOOLS Spline tools cursor.
    MOUSE_EXTRUDE Extrude cursor.
    MOUSE_NORMALMOVE Normal move cursor.
    MOUSE_ADDPOINTS Add points cursor.
    MOUSE_ADDPOLYGONS Add polygons cursor.
    MOUSE_BRIDGE Bridge cursor.
    MOUSE_MIRROR Mirror cursor.
    MOUSE_PAINTMOVE Paint move cursor.
    MOUSE_PAINTSELECTRECT Paint select rectangle cursor.
    MOUSE_PAINTSELECTCIRCLE Paint select circle cursor.
    MOUSE_PAINTSELECTPOLY Paint select polygon cursor.
    MOUSE_PAINTSELECTFREE Paint select free cursor.
    MOUSE_PAINTMAGICWAND Paint magic wand cursor.
    MOUSE_PAINTCOLORRANGE Paint color range cursor.
    MOUSE_PAINTFILL Paint fill cursor.
    MOUSE_PAINTPICK Paint pick cursor.
    MOUSE_PAINTBRUSH Paint brush cursor.
    MOUSE_PAINTCLONE Paint clone cursor.
    MOUSE_PAINTTEXT Paint text cursor.
    MOUSE_PAINTCROP Paint crop cursor.
    MOUSE_PAINTLINE Paint line cursor.
    MOUSE_PAINTPOLYSHAPE Paint polygon shape cursor.
  • gadgetid ( int ) – The dialog element that this cursor is for, or 0 .
Return type:

bool

Returns:

True if the cursor could be set, otherwise False .

GeDialog. CheckDropArea ( id , msg , horiz , vert )

Checks the drag position in a drag event message against a certain dialog element’s position in the layout. The check can be limited to only X or Y coordinates.

Parameters:
  • id ( int ) – The dialog element that this cursor is for, or 0 .
  • msg ( c4d.BaseContainer ) – The drag message.
  • horiz ( bool ) – If True the drag position is checked against the horizontal bounds of the region.
  • vert ( bool ) – If True the drag position is checked against the vertical bounds of the region.
Return type:

bool

Returns:

True if the drag message is within the bounds specified, otherwise False .

GeDialog. GroupBeginInMenuLine ( )

Begins a group in the menu bar of the dialog. End the group with GroupEnd()

GeDialog. GroupWeightsSave ( id )

Retrieves group weights for group id .

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: c4d.BaseContainer
Returns: A new container with the weights or None .
GROUPWEIGHTS_PERCENT_W_CNT int The number of columns. Has to to be equal to the given layout.
GROUPWEIGHTS_PERCENT_W_VAL float The column weight for column i is in GROUPWEIGHTS_PERCENT_W_VAL + i .
GROUPWEIGHTS_PERCENT_H_CNT int The number of rows. Has to be equal to the given layout.
GROUPWEIGHTS_PERCENT_H_VAL float The row weight for row i is in GROUPWEIGHTS_PERCENT_H_VAL + i .
GeDialog. GroupWeightsLoad ( id , weights )

Sets group weights for group id . The group weights are absolute values. If a element has a bigger minimum size the given weight will be ignored. The sum of the weights do not need to be 100:

def CreateLayout(self):
  self.GroupBegin(GRP_SUB,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,2,0,"",c4d.BFV_GRIDGROUP_ALLOW_WEIGHTS)
  self.AddStaticText(1000,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN)
  self.AddStaticText(1001,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN)
  self.AddStaticText(1002,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN)
  self.AddStaticText(1003,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN)
  self.AddStaticText(1004,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN)
  self.AddStaticText(1005,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN)
  self.AddEditNumberArrows(1006, c4d.BFH_SCALEFIT)
  if not self.weights_saved:
      #initialization code
      self.weights.SetInt32(c4d.GROUPWEIGHTS_PERCENT_W_CNT, 2)      # number of columns - has to be equal to the given layout
      self.weights.SetFloat(c4d.GROUPWEIGHTS_PERCENT_W_VAL+0,25.0)  # weight for col 1
      self.weights.SetFloat(c4d.GROUPWEIGHTS_PERCENT_W_VAL+1,75.0)  # weight for col 2
      #set the rows
      self.weights.SetInt32(c4d.GROUPWEIGHTS_PERCENT_H_CNT,4)       # number of rows - has to be equal to the given layout
      self.weights.SetFloat(c4d.GROUPWEIGHTS_PERCENT_H_VAL+0,10.0)  # weight for row 1
      self.weights.SetFloat(c4d.GROUPWEIGHTS_PERCENT_H_VAL+1,30.0)  # weight for row 2
      self.weights.SetFloat(c4d.GROUPWEIGHTS_PERCENT_H_VAL+2,60.0)  # weight for row 3
      self.weights.SetFloat(c4d.GROUPWEIGHTS_PERCENT_H_VAL+3,0.0)   # weight for row 4
      self.weights_saved = True
  self.GroupWeightsLoad(GRP_SUB, self.weights)
  self.GroupEnd()
  return True
def Message(self, msg, result):
  if msg.GetId()==c4d.BFM_WEIGHTS_CHANGED:
    #if the weights change because of user interaction you will get notified
    if msg.GetInt32(c4d.BFM_WEIGHTS_CHANGED)==GRP_SUB:
      self.weights = self.GroupWeightsSave(GRP_SUB)
  return GeDialog.Message(self, msg, result)
					
Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • weights ( c4d.BaseContainer ) –

    The weights to store:

    GROUPWEIGHTS_PERCENT_W_CNT int The number of columns. Has to to be equal to the given layout.
    GROUPWEIGHTS_PERCENT_W_VAL float The column weight for column i is in GROUPWEIGHTS_PERCENT_W_VAL + i .
    GROUPWEIGHTS_PERCENT_H_CNT int The number of rows. Has to be equal to the given layout.
    GROUPWEIGHTS_PERCENT_H_VAL float The row weight for row i is in GROUPWEIGHTS_PERCENT_H_VAL + i .
Return type:

bool

Returns:

True if the group weights could be set, otherwise False .

GeDialog. ScrollGroupBegin ( id, flags, scrollflags[, initw=0][, inith=0] )

Begins a scrollgroup.

Parameters:
  • id ( int ) – The scroll group ID.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • scrollflags ( int ) –

    Additional settings for the scroll group. Can be a combination of the following flags:

    SCROLLGROUP_VERT Allow the group to scroll vertically.
    SCROLLGROUP_HORIZ Allow the group to scroll horizontally.
    SCROLLGROUP_NOBLIT Always redraw the whole group, not just new areas, when scrolling.
    SCROLLGROUP_LEFT Create the vertical slider to the left.
    SCROLLGROUP_BORDERIN Display a small border around the scroll group.
    SCROLLGROUP_STATUSBAR Create a status bar for the scroll group.
    SCROLLGROUP_AUTOHORIZ Only show horizontal slider if needed.
    SCROLLGROUP_AUTOVERT Only show vertical slider if needed.
    SCROLLGROUP_NOSCROLLER No scroller.
    SCROLLGROUP_NOVGAP No vertical gap.
    SCROLLGROUP_STATUSBAR_EXT_GROUP Creates an extern group within the statusbar.
  • initw ( int ) – The initial width of the scroll area.
  • inith ( int ) – The initial height of the scroll area.
Return type:

bool

Returns:

True if scrollgroup was added.

GeDialog. LayoutChanged ( id )

Notifies Cinema 4D that the layout of a dynamic group in the dialog has changed. This is usually done by first calling LayoutFlushGroup() and then adding new controls.

Parameters: id ( int ) – The ID of the changed group.
Return type: bool
Returns: True if the layout was updated, otherwise False .
GeDialog. LayoutChangedNoRedraw ( id )

Notifies Cinema 4D that the layout of a dynamic group in the dialog has changed. This is usually done by first calling LayoutFlushGroup() and then adding new controls.

Parameters: id ( c4d.gui.C4DGadget or int ) – The ID of the changed group.
Return type: bool
Returns: True if the layout was updated, otherwise False .
GeDialog. Activate ( id )

Sets the focus to a specific control within the dialog.

Parameters: id ( int ) – The control ID.
Return type: bool
Returns: True if the control was activated.
GeDialog. IsActive ( id )

Checks if the given gadget has the focus.

Parameters: id ( int ) – The control ID.
Return type: bool
Returns: True if the control is active, otherwise False .
GeDialog. LayoutFlushGroup ( id )

Removes all controls from a group and places the control insertion point within the group. This makes it possible to have dynamic groups. After all components are added call LayoutChanged() with the group ID.

Parameters: id ( int ) – The control ID.
Return type: bool
Returns: True if the group was flushed.
GeDialog. RemoveElement ( id )

Removes an element from the dialog.

Parameters: id ( int ) – The control ID.
Return type: bool
Returns: True if the element was removed.
GeDialog. HideElement ( id , hide )

Hides/unhides an element from the dialog.

Parameters:
  • id ( int ) – The control ID.
  • hide ( bool ) – True to hide and False to unhide.
Return type:

bool

Returns:

True if the element was hidden/unhidden.

GeDialog. MenuFlushAll ( )

Flushes the menu bar of the dialog, removing all menus. Add menus with MenuSubBegin() . Call MenuFinished() when all menus and items have been added.

Return type: bool
Returns: True if the menu bar was flushed.
GeDialog. MenuSubBegin ( string )

Creates a new menu group. At the top level this means a menu, at lower levels a sub-menu. Add items with MenuAddCommand() , MenuAddString() or MenuAddSeparator() . Call MenuSubEnd() when the menu is finished.

Parameters: string ( str ) – Name of the sub menu.
Return type: bool
Returns: True if a menu group could be begun.
GeDialog. MenuSubEnd ( )

Closes the current menu group, opened with MenuSubBegin() .

Return type: bool
Returns: True if the menu group was ended, otherwise False .
GeDialog. MenuAddCommand ( cmdid )

Adds a command item to the current menu. This can either be a Cinema 4D command or a plugin command. Particularly useful is IDM_CM_CLOSEWINDOW to add a close item for dialogs.

Parameters: cmdid ( int ) – A Cinema 4D command id or a plugin ID.
Return type: bool
Returns: True if the command was added.
GeDialog. MenuAddString ( id , string )

Adds a string item to the current menu. Command() will be called when the menu item is selected.

Parameters:
  • id ( int ) – The item ID.
  • string ( str ) – The item text. Use a &d& suffix for disabled and a c suffix for checked items.
Return type:

bool

Returns:

True if the menu item was added, otherwise False .

GeDialog. MenuAddSeparator ( )

Adds a separator to the current menu.

Parameters: id ( int ) – The item ID.
Return type: bool
Returns: True if a seperator was added.
GeDialog. MenuFinished ( )

Call this function when all menus and all items have been added.

Parameters: id ( int ) – The item ID.
Return type: bool
Returns: True if a seperator was added.
GeDialog. MenuInitString ( id , enabled , value )

Used to change the enabled/disabled and checked/unchecked state of menu items. Can be called after MenuFinished() to update the menu item dynamically.

Parameters:
  • id ( int ) – The menu item ID.
  • enabled ( bool ) – True if the item is enabled, otherwise False .
  • value ( bool ) – True if the menu item should be checked.
Return type:

bool

Returns:

True if the item was set.

GeDialog. TabGroupBegin ( id , flags [ , tabtype=TAB_TABS ] )

Begins a tab group.

../../../_images/tabgroups.png
Parameters:
  • id ( int ) – The ID of the group.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • tabtype ( int ) –

    Specifies what kind of tabs to use:

    TAB_TABS Normal tabs.
    TAB_NOSELECT No tabs.
    TAB_CYCLE Popup button instead of tabs.
    TAB_RADIO Radio buttons instead of tabs.
Return type:

bool

Returns:

True if a tab group could be begun, otherwise False .

GeDialog. GroupBegin ( id, flags[, cols=0][, rows=0][, title=”“][, groupflags=0],[initw=0][, inith=0] )

Begins a group.

Parameters:
  • id ( int ) – The ID of the group.
  • flags ( int ) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered vertically.
    BFV_TOP Aligned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK Masks out these flags.
  • cols ( int ) – Columns.
  • rows ( int ) – Rows
  • title ( str ) – The title.
  • groupflags ( int ) –

    Settings for the group. Can be a combination of the following:

    BFV_GRIDGROUP_EQUALCOLS Each column has the same width.
    BFV_GRIDGROUP_EQUALROWS Each row has the same height.
    BFV_CMD_EQUALCOLUMNS Columns have equal width.
    BFV_BORDERGROUP_CHECKBOX Checkbox in title of a bordergroup.
    BFV_BORDERGROUP_FOLD Fold symbol in title of a bordergroup.
    BFV_BORDERGROUP_FOLD_OPEN Opened fold symbol. (Otherwise closed.)
    BFV_BORDERGROUP_FOLD2 Foldable group, but no switchgadget.
    BFV_GRIDGROUP_ALLOW_WEIGHTS Allow the user to move the weights.
    BFV_GRIDGROUP_FORBID_MIRROR Do not mirror the layout of this group.
    BFV_DIALOG_REMOVEABLE Dialog is removable.
    BFV_DIALOG_BAR_VERT Dialog has a vertical dialog bar.
    BFV_DIALOG_NOBUTTONS Dialog has no button bar.
    BFV_LAYOUTGROUP_PALETTEOUTLINES Layout group has palette outlines.
    BFV_IGNORE_FOCUS Group ignores focus.
    BFV_TABGROUP_RELOADDIALOG Private.
    BFV_LAYOUTGROUP_NODROP Prevents drag and drop onto a tab. Private.
    BFV_LAYOUTGROUP_NODROP2 Prevents drag and drop between layout groups. Private.
    BFx_NOEQUAL Group elements with BFV_GRIDGROUP_EQUALCOLS or BFV_GRIDGROUP_EQUALROWS flags can have their own maximum width.
  • initw ( int ) –

    New in version R14.014: Initial width.

  • inith ( int ) –

    New in version R14.014: Initial height.

Return type:

bool

Returns:

True if a group could be begun, otherwise False .

GeDialog. GroupEnd ( )

Ends groups.

Return type: bool
Returns: True if the group was ended, otherwise False .
GeDialog. GroupSpace ( spacex , spacey )

Sets the space in pixels between two elements in the current group. Equivalent to SPACE in dialog resources.

Parameters:
  • spacex ( int ) – The X distance.
  • spacey ( int ) – The Y distance.
Return type:

bool

Returns:

True if the spacing could be set.

GeDialog. GroupBorder ( borderstyle )

Sets the border type of the current group, and displays the title in the border if possible.

Note

Use GroupBorderNoTitle() if you do not have a title. Otherwise there’ll be a small gap in the border where the title would be.

Parameters: borderstyle ( int ) –

The style:

BORDER_NONE No border.
BORDER_THIN_IN Thin border inward.
BORDER_THIN_OUT Thin border outward.
BORDER_IN Normal border inward.
BORDER_OUT Normal border outward.
BORDER_GROUP_IN Group border inside.
BORDER_GROUP_OUT Group border outside.
BORDER_OUT2 Outward border 2.
BORDER_OUT3 Outward border 3
BORDER_BLACK Thin black line.
BORDER_ACTIVE_1 Active border 1.
BORDER_ACTIVE_2 Active border 2.
BORDER_ACTIVE_3 Active border 3.
BORDER_ACTIVE_4 Active border 4.
BORDER_GROUP_TOP Border along the top.
BORDER_ROUND Border with round corners.
BORDER_SCHEME_EDIT Edit field border like the shortcut gadget for example.
BORDER_SCHEME_EDIT_NUMERIC Edit field border that is open to the right like the link field for example.
BORDER_OUT3l Outward border 3, open to the left.
BORDER_OUT3r Outward border 3, open to the right.
BORDER_MASK Masks out border type.
BORDER_WITH_TITLE_BOLD Display group title with bold font.
BORDER_WITH_TITLE Display group title in the border.
GeDialog. GroupBorderNoTitle ( borderstyle )

Sets the border type of the current group, and displays the title in the border if possible.

Parameters: borderstyle ( int ) –

The style:

BORDER_NONE No border.
BORDER_THIN_IN Thin border inward.
BORDER_THIN_OUT Thin border outward.
BORDER_IN Normal border inward.
BORDER_OUT Normal border outward.
BORDER_GROUP_IN Group border inside.
BORDER_GROUP_OUT Group border outside.
BORDER_OUT2 Outward border 2.
BORDER_OUT3 Outward border 3
BORDER_BLACK Thin black line.
BORDER_ACTIVE_1 Active border 1.
BORDER_ACTIVE_2 Active border 2.
BORDER_ACTIVE_3 Active border 3.
BORDER_ACTIVE_4 Active border 4.
BORDER_GROUP_TOP Border along the top.
BORDER_ROUND Border with round corners.
BORDER_SCHEME_EDIT Edit field border like the shortcut gadget for example.
BORDER_SCHEME_EDIT_NUMERIC Edit field border that is open to the right like the link field for example.
BORDER_OUT3l Outward border 3, open to the left.
BORDER_OUT3r Outward border 3, open to the right.
BORDER_MASK Masks out border type.
BORDER_WITH_TITLE_BOLD Display group title with bold font.
BORDER_WITH_TITLE Display group title in the border.
GeDialog. GroupBorderSpace ( left , top , right , bottom )

Sets the border size around the current group in pixels.

Parameters:
  • left ( int ) – The distance to the left of the group.
  • top ( int ) – The distance above the group.
  • right ( int ) – The distance to the right of the group.
  • bottom ( int ) – The distance below the group.
Return type:

bool

Returns:

True if the border space was set.

GeDialog. Close ( )

Close the dialog.

Return type: bool
Returns: True if successfully closed, otherwise False .
GeDialog. SendMessage ( gadget , value )

Sends a message to a dialog gadget.

Parameters:
Return type:

object

Returns:

Depends on the message.

GeDialog. SendParentMessage ( msg )

Sends a message to the parent dialog.

Parameters: msg ( c4d.BaseContainer ) – The message container.
Return type: bool
Returns: True if the message was sent.
GeDialog. GetId ( )

Gets the dialog ID.

Return type: int
Returns: The id.
GeDialog. IsVisible ( )

Checks if the dialog is visible.

Return type: bool
Returns: True if it is visible, otherwise False .
GeDialog. IsOpen ( )

Checks if the dialog is open.

Return type: bool
Returns: True if it is open, otherwise False .
GeDialog. SetTimer ( value )

Initializes the timer clock, so that Timer() is called every timer milliseconds. Use SetTimer() (0) to stop the clock.

Note

Depending on the speed of the computer, the operating system, the complexity of the dialog and the threads running in the background, there is no guarantuee that event messages will occur on a regular basis. Using a value of 500 ms should be no problem but if using a value of 1 ms one might get events with the following time spaces: 3 ms, 76 ms, 15 ms, 19 ms, 67 ms…

Note

The timer will be paused while a synchronous dialog is opened in Cinema 4D.

Warning

Keep in mind that using small timer values results in heavy message traffic in the application which may slow down Cinema 4D.

Parameters: value ( int ) – The timer interval in milliseconds.
GeDialog. SetTitle ( title )

Sets the title of the dialog window.

Parameters: title ( str ) – The title.
GeDialog. Enable ( gadget , enable )

Enables or disables the dialog gadget, depending on the value of enable .

Parameters:
  • gadget ( C4DGadget ) – The dialog gadget
  • enabled ( bool ) – True means enabled, otherwise False .
GeDialog. LoadDialogResource ( id[, lr=None][, flags=0] )

Loads an external resource file. This is the prefered method for dialog layout since it gives maximum flexibility and easy multi language support. The dialog loaded is automatically surrounded by an additional outer group, so flags means the same as with dialog groups (e.g. BFV_CENTER ).

Parameters:
  • id ( int ) – The dialog ID.
  • lr ( c4d.plugins.GeResource ) – A loaded resource or None . If this is None then the global resource singleton is used.
  • flags ( int ) – Additional layout flags.
GeDialog. SetBool ( id , value )

Sets the value of checkbox controls.

Parameters:
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetLong ( id, value[, min=MINLONGl][, max=MAXLONGl][, step=1][, tristate=False][, min2=MINLONGl][, max2=MAXLONGl] )

Deprecated since version R15: Use SetInt32() instead.

Sets the value and limits of integer fields. Also used for tab groups, radio buttons and combo boxes.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( int ) – The new value.
  • min ( int ) – The minimum value accepted.
  • max ( int ) – The maximum value accepted.
  • step ( bool ) – The step used for arrow buttons.
  • step – If this is True the control is tinted blue to indicate tristate mode.
  • min2 ( int ) – The minimum value allowed outside the range used for sliders. Overrides min for the acceptance check.
  • max2 ( int ) – The minimum value allowed outside the range used for sliders. Overrides max for the acceptance check.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetInt32 ( id, value[, min=MINLONGl][, max=MAXLONGl][, step=1][, tristate=False][, min2=MINLONGl][, max2=MAXLONGl] )

New in version R15.037.

Sets the value and limits of integer fields. Also used for tab groups, radio buttons and combo boxes.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( int ) – The new value.
  • min ( int ) – The minimum value accepted.
  • max ( int ) – The maximum value accepted.
  • step ( bool ) – The step used for arrow buttons.
  • step – If this is True the control is tinted blue to indicate tristate mode.
  • min2 ( int ) – The minimum value allowed outside the range used for sliders. Overrides min for the acceptance check.
  • max2 ( int ) – The minimum value allowed outside the range used for sliders. Overrides max for the acceptance check.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetReal ( id, value[, min=sys.float_info.min][, max=sys.float_info.max][, step=1.0][, format=FORMAT_FLOAT][, min2=0.0][, max2=0.0][, quadscale=False][, tristate=False] )

Deprecated since version R15: Use SetFloat() instead.

Sets the value, unit and limits of float fields.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( float ) – The new value.
  • min ( int ) – The minimum value accepted.
  • max ( int ) – The maximum value accepted.
  • step ( float ) – The step used for arrow buttons.
  • format ( int ) –

    The unit and format of the field. Valid formats are:

    FORMAT_FLOAT Floating point without unit.
    FORMAT_INT Integer without unit.
    FORMAT_PERCENT Floating point with %-sign, 1.0 = 100%.
    FORMAT_DEGREE Floating point with °-sign. Measured in radians, displayed in degrees.
    FORMAT_METER Floating point in the current working unit.
    FORMAT_FRAMES Time formatted as frames. (Overrided by user preference.)
    FORMAT_SECONDS Time formatted as seconds. (Overrided by user preference.)
    FORMAT_SMPTE Time formatted as SMPTE. (Overrided by user preference.)
  • min2 ( int ) – The minimum value allowed outside the range used for sliders. Overrides min for the acceptance check.
  • max2 ( int ) – The maximum value allowed outside the range used for sliders. Overrides max for the acceptance check.
  • quadscale ( bool ) – If this is True a quadratic scale is used for the slider, so that more precision is available for lower values.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetFloat ( id, value[, min=sys.float_info.min][, max=sys.float_info.max][, step=1.0][, format=FORMAT_FLOAT][, min2=0.0][, max2=0.0][, quadscale=False][, tristate=False] )

New in version R15.037.

Sets the value, unit and limits of float fields.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( float ) – The new value.
  • min ( int ) – The minimum value accepted.
  • max ( int ) – The maximum value accepted.
  • step ( float ) – The step used for arrow buttons.
  • format ( int ) –

    The unit and format of the field. Valid formats are:

    FORMAT_FLOAT Floating point without unit.
    FORMAT_INT Integer without unit.
    FORMAT_PERCENT Floating point with %-sign, 1.0 = 100%.
    FORMAT_DEGREE Floating point with °-sign. Measured in radians, displayed in degrees.
    FORMAT_METER Floating point in the current working unit.
    FORMAT_FRAMES Time formatted as frames. (Overrided by user preference.)
    FORMAT_SECONDS Time formatted as seconds. (Overrided by user preference.)
    FORMAT_SMPTE Time formatted as SMPTE. (Overrided by user preference.)
  • min2 ( int ) – The minimum value allowed outside the range used for sliders. Overrides min for the acceptance check.
  • max2 ( int ) – The maximum value allowed outside the range used for sliders. Overrides max for the acceptance check.
  • quadscale ( bool ) – If this is True a quadratic scale is used for the slider, so that more precision is available for lower values.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetMeter ( id, value[, min=sys.float_info.min][, max=sys.float_info.max][, step=1.0][, tristate=False] )

Sets the value and limits of a meter field. Same as SetFloat() with FORMAT_METER .

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( float ) – The new value.
  • min ( int ) – The minimum value accepted.
  • max ( int ) – The maximum value accepted.
  • step ( float ) – The step used for arrow buttons.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetDegree ( id, value[, min=sys.float_info.min][, max=sys.float_info.max][, step=1.0][, tristate=False] )

Sets the value and limits of an angle field. Same as SetFloat() with FORMAT_DEGREE .

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( float ) – The new value.
  • min ( int ) – The minimum angle accepted in degrees.
  • max ( int ) – The maximum angle accepted in degrees.
  • step ( float ) – The step used for arrow buttons in degrees.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetPercent ( id, value[, min=0.0][, max=100.0][, step=1.0][, tristate=False] )

Sets the value and limits of a percent field. Same as SetFloat() with FORMAT_PERCENT .

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( float ) – The new value.
  • min ( int ) – The minimum value accepted (percentage units).
  • max ( int ) – The maximum value accepted (percentage units).
  • step ( float ) – The step used for arrow buttons (percentage units).
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetTime ( id, doc, value[, min=-MAXTIME][, max=MAXTIME][, stepframes=1][, tristate=False] )

Sets the value and limits of a time field. Same as SetFloat() with FORMAT_FRAMES .

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( c4d.BaseTime ) – The new time.
  • min ( c4d.BaseTime ) – The minimum time accepted.
  • max ( c4d.BaseTime ) – The maximum time accepted.
  • stepframes ( int ) – The frame step used for arrow buttons.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetString ( id, value[, tristate=False][, flags=0] )

Sets the text of string controls. Used for all controls that have a text, for example static text fields, edit fields, buttons and checkboxes.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • value ( str ) – The new string.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
  • flags ( int ) –

    Flags:

    EDITTEXT_PASSWORD Password field.
    EDITTEXT_HELPTEXT Sets the helptext for an editfield. This text appears if the editfield is empty.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetColorField ( id , color , brightness , maxbrightness , flags )

Sets the color, brightness and limits of color fields and color choosers.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • color ( c4d.Vector ) – The color.
  • brightness ( float ) – The new brightness value.
  • maxbrightness ( float ) – The maximum brightness allowed.
  • flags ( int ) –

    Controls what parts of a color chooser that are available. Possible values are:

    DR_COLORFIELD_NO_BRIGHTNESS Disables the brightness control.
    DR_COLORFIELD_NO_COLOR Disables the color control.
    DR_COLORFIELD_BODYPAINT Uses the Bodypaint style.
    DR_COLORFIELD_ICC_BASEDOC Uses the color profile of the current BaseDocument .
    DR_COLORFIELD_ICC_BPTEX Uses the color profile of the current BodyPaint 3D texture.
    DR_COLORFIELD_NO_MODE_BUTTONS

    New in version R17.032.

    Hides the color mode buttons.

    DR_COLORFIELD_NO_COLORWHEEL

    New in version R17.032.

    Hides the Color Wheel mode button.

    DR_COLORFIELD_NO_SPECTRUM

    New in version R17.032.

    Hides the Color Spectrum mode button.

    DR_COLORFIELD_NO_PICTURE

    New in version R17.032.

    Hides the Color From Picture mode button.

    DR_COLORFIELD_NO_RGB

    New in version R17.032.

    Hides the RGB sliders mode button.

    DR_COLORFIELD_NO_HSV

    New in version R17.032.

    Hides the HSV sliders mode button.

    DR_COLORFIELD_NO_KELVIN

    New in version R17.032.

    Hides the Kelvin Color Temperature mode button.

    DR_COLORFIELD_NO_MIXER

    New in version R17.032.

    Hides the Color Mixer mode button.

    DR_COLORFIELD_NO_SWATCHES

    New in version R17.032.

    Hides the Swatches mode button.

    DR_COLORFIELD_NO_SCREENPICKER

    New in version R17.032.

    Hides the ScreenPicker mode button.

    DR_COLORFIELD_ENABLE_COLORWHEEL

    New in version R17.032.

    Enables the Special Color Wheel mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_SPECTRUM

    New in version R17.032.

    Enables the Special Color Spectrum mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_PICTURE

    New in version R17.032.

    Enables the Special Color from Picture mode (Special modes are exclusive each other: use only one at a time).

    DR_COLORFIELD_ENABLE_RGB

    New in version R17.032.

    Enables the RGB sliders mode.

    DR_COLORFIELD_ENABLE_HSV

    New in version R17.032.

    Enables the HSV sliders mode.

    DR_COLORFIELD_ENABLE_KELVIN

    New in version R17.032.

    Enables the Kelvin Color Temperature mode.

    DR_COLORFIELD_ENABLE_MIXER

    New in version R17.032.

    Enables the Color Mixer mode.

    DR_COLORFIELD_ENABLE_SWATCHES

    New in version R17.032.

    Enables the Swatches mode.

    DR_COLORFIELD_RGB_HIDE_HEX

    New in version R17.032.

    Hides the Hexadecimal color field in the RGB Mode.

Return type:

bool

Returns:

True if the value was set.

GeDialog. SetFilename ( id , fn [ , tristate=False ] )

Sets the text of string controls, taking the new value from a filename.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • fn ( str ) – The new filename.
  • tristate ( bool ) – If this is True the control is tinted blue to indicate tristate mode.
Return type:

bool

Returns:

True if the value was set.

GeDialog. SetMultiLinePos ( id , line , pos )

Set the cursor position within a dialog multi-line string item.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • line ( int ) – The line number.
  • pos ( int ) – The position within the line.
Return type:

bool

Returns:

True if successful, otherwise False .

GeDialog. SetMultiLineMode ( id , mode )

Sets the edit mode for multi-line edit fields.

Parameters:
  • id ( c4d.gui.C4DGadget or int ) – The control ID or int.
  • mode ( int ) –

    The multi-line edit mode.

    SCRIPTMODE_NONE Normal multi-line text field.
    SCRIPTMODE_PYTHON Python syntax highlighting.
    SCRIPTMODE_COFFEE C.O.F.F.E.E. syntax highlighting.
Return type:

bool

Returns:

True if the multi-line mode was set, otherwise False .

GeDialog. GetBool ( id )

Retrieves the value of checkbox controls.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: bool
Returns: The value or None if the value was not retrieved.
GeDialog. GetLong ( id )

Deprecated since version R15: Use GetInt32() instead.

Retrieves the value of integer fields. Also used for tab groups, radio buttons and combo boxes.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: int
Returns: The value or None if the value was not retrieved.
GeDialog. GetInt32 ( id )

New in version R15.037.

Retrieves the value of integer fields. Also used for tab groups, radio buttons and combo boxes.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: int
Returns: The value or None if the value was not retrieved.
GeDialog. GetReal ( id )

Deprecated since version R15: Use GetFloat() instead.

Retrieves the value of float fields.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: float
Returns: The value or None if the value was not retrieved.
GeDialog. GetFloat ( id )

New in version R15.037.

Retrieves the value of float fields.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: float
Returns: The value or None if the value was not retrieved.
GeDialog. GetVector ( id_x , id_y , id_z )

Retrieves the value of three float fields at the same time as a vector.

Parameters:
Return type:

Vector

Returns:

The value or None if the value was not retrieved.

GeDialog. GetString ( id )

Retrieves the text from string controls. Used for all controls that have a text, for example static text fields, edit fields, buttons and checkboxes.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: str
Returns: The value or None if the value was not retrieved.
GeDialog. GetColorField ( id )

Retrieves the color and brightness of color controls.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: dict{ brightness : float, color : Vector }
Returns: The value or None if the value was not retrieved.
GeDialog. GetTime ( id , doc )

Retrieves the time of time fields.

Parameters:
Return type:

c4d.BaseTime

Returns:

The time or None if the value was not retrieved.

GeDialog. GetFilename ( id )

Retrieves the text from string controls as a filename.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: str
Returns: The time or None if the value was not retrieved.
GeDialog. CheckTristateChange ( id )

Indicates wheter a control’s content has been changed since the last time its value was set manually with.

Parameters: id ( c4d.gui.C4DGadget or int ) – The control ID or int.
Return type: bool
Returns: True if the control has been changed, otherwise False .
GeDialog. GetVisibleArea ( scrollgroup )

Queries a scroll group for its currently visible region, a rectangle between ( x1,y1 ) and ( x2,y2 ). The coordinates are in pixels.

Parameters: scrollgroup ( int ) – The scroll group ID.
Return type: dict{ x1 : int, y1 : int, x2 : int, y2 : int }
Returns: The visible area in coordinates, in keys x1 , y1 , x2 , y2 .
GeDialog. SetVisibleArea ( scrollgroupid , x1 , y1 , x2 , y2 )

Scrolls a scroll group so that the rectangle between ( x1,y1 ) and ( x2,y2 ) is visible. The coordinates are in pixels. If the area is smaller than the scroll group then it is moved only as much as necessary. If the area is bigger than the scroll group then the top left corners are aligned.

Parameters:
  • scrollgroup ( int ) – The scroll group ID.
  • x1 ( int ) – The X coordinate of the top left corner of the rectangle.
  • y1 ( int ) – The Y coordinate of the top left corner of the rectangle.
  • x2 ( int ) – The X coordinate of the bottom right corner of the rectangle.
  • y2 ( int ) – The Y coordinate of the bottom right corner of the rectangle.
Return type:

bool

Returns:

True if the group was scrolled or already had the right view.

GeDialog. GetType ( id )

Private.

Border flags

../../../_images/borders.png