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

Inheritance

Members

GeDialog.CreateLayout(self)

Override - Called when C4D 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 - Use to react to more messages.

Parameters:
  • msg (BaseContainer) – The message container.
  • result (BaseContainer) – A container to store results in.
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 C4D 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 don’t 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.
  • 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. T

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_TYPE_MODAL Modal dialog.
    DLG_TYPE_MODAL_RESIZEABLE Modal resizable dialog.
    DLG_TYPE_ASYNC Asynchronous dialog.
    DLG_TYPE_ASYNC_POPUP_RESIZEABLE Asynchronous resizable dialog
    DLG_TYPE_ASYNC_POPUPEDIT Popup dialog
    DLG_TYPE_ASYNC_FULLSCREEN_WORK Fullscreen work.
    DLG_TYPE_ASYNC_FULLSCREEN_MONITOR Fullscreen monitor.
  • 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. For a list of valid devices and channels, please see Input Events.

Parameters:
  • askdevice (The channel of the device.) – The device to ask.
  • res (BaseContainer) – The result is stored in this container.
Return type:

bool

Returns:

True if a state could be retrieved, otherwise False.

GeDialog.GetInputEvent(askdevice)

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. For a list of valid devices and channels, please see Input Events.

Parameters: askdevice (int) – The device to poll.
Return type: BaseContainer
Returns: The result is this container or None.
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 (C4DGadget or int) – The control ID to set the color for.
  • colorid (int) –

    The color value.

    COLOR_3DTEXT For 3D text.
    COLOR_XOR Deprecated XOR lines. Use LassoSelection instead.
    COLOR_TRANS Transparent background for text.
    COLOR_BG Background color.
    COLOR_BGEDIT Edit background color.
    COLOR_BGFOCUS Focus background color.
    COLOR_TEXT Text color.
    COLOR_TEXTFOCUS Focus text color.
    COLOR_EDGELT Light edge color.
    COLOR_EDGEWH Lightest edge color.
    COLOR_EDGEDK Dark edge color.
    COLOR_EDGEBL Darkest edge color.
    COLOR_DBARFG1 Dialog bar foreground color 1.
    COLOR_DBARBG1 Dialog bar background color 1.
    COLOR_DBARFG2 Dialog bar foreground color 2.
    COLOR_DBARBG2 Dialog bar background color 2.
    COLOR_BGGADGET Gadget background color.
    COLOR_BGSELECTEDTEXT Selected text in gadgets background color.
    COLOR_FGSELECTEDTEXT Selected text in gadgets foreground color.
    COLOR_TIMELINE Timeline color.
    COLOR_BGTRISTATE Tristates background color.
    COLOR_BG_DARK1 Dark background color 1.
    COLOR_BG_DARK2 Dark background color 2.
  • color (Vector) – The color.
GeDialog.GetColorRGB(colorid)

Gets the RGB values associated with a color code.

Parameters: colorid (int) –

The color value.

COLOR_3DTEXT For 3D text.
COLOR_XOR Deprecated XOR lines. Use LassoSelection instead.
COLOR_TRANS Transparent background for text.
COLOR_BG Background color.
COLOR_BGEDIT Edit background color.
COLOR_BGFOCUS Focus background color.
COLOR_TEXT Text color.
COLOR_TEXTFOCUS Focus text color.
COLOR_EDGELT Light edge color.
COLOR_EDGEWH Lightest edge color.
COLOR_EDGEDK Dark edge color.
COLOR_EDGEBL Darkest edge color.
COLOR_DBARFG1 Dialog bar foreground color 1.
COLOR_DBARBG1 Dialog bar background color 1.
COLOR_DBARFG2 Dialog bar foreground color 2.
COLOR_DBARBG2 Dialog bar background color 2.
COLOR_BGGADGET Gadget background color.
COLOR_BGSELECTEDTEXT Selected text in gadgets background color.
COLOR_FGSELECTEDTEXT Selected text in gadgets foreground color.
COLOR_TIMELINE Timeline color.
COLOR_BGTRISTATE Tristates background color.
COLOR_BG_DARK1 Dark background color 1.
COLOR_BG_DARK2 Dark background color 2.
Return type: dict{r: int, g: int, b: int}
Returns: The color in the dict with the keys x, y and z.
GeDialog.CheckValueRanges()

Close the dialog.

Return type: bool
Returns: True if everything was fine, or False if any field is wrong.
GeDialog.AddCheckbox(id, flags[, initw=0][, inith=0][, name=""])

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:

C4DGadget

Returns:

The added gadget.

GeDialog.AddButton(id, flags[, initw=0][, inith=0][, name=""])

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:

C4DGadget

Returns:

The added gadget.

GeDialog.AddStaticText(id, flags[, initw=0][, inith=0][, name=""][borderstyle=0])

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:

C4DGadget

Returns:

The added gadget.

GeDialog.AddEditText(id, flags[, initw=0][, inith=0][, name=""][editflags=0])

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.
Return type:

C4DGadget

Returns:

The added gadget.

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

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:

C4DGadget

Returns:

The added gadget.

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

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:

C4DGadget

Returns:

The added gadget.

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

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:

C4DGadget

Returns:

The added gadget.

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

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:

C4DGadget

Returns:

The added gadget.

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

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:

C4DGadget

Returns:

The added gadget.

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

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.
Return type:

C4DGadget

Returns:

The added gadget.

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

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:

C4DGadget

Returns:

The added gadget.

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

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 Disable the brightness control.
    DR_COLORFIELD_NO_COLOR Disable the color control.
    DR_COLORFIELD_BODYPAINT Use the Bodypaint style.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddRadioGroup(id[, flags=0][, columns=0][, rows=0])

New in version R13.016.

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=""])

New in version R13.016.

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:

C4DGadget

Returns:

The added gadget.

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

New in version R13.016.

Adds a text radio button to the layout (like the ones to the left in the C4D 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:

C4DGadget

Returns:

The added gadget.

GeDialog.AddSeparatorH(inith[, flags=BFH_FIT])

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:

C4DGadget

Returns:

The added gadget.

GeDialog.AddSeparatorV(initv[, flags=BFH_FIT])

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:

C4DGadget

Returns:

The added gadget.

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

Adds a custom GUI element to the dialog. Returns a pointer to the custom GUI object.

Parameters:
  • id (int) – The ID of the gadget.
  • 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 (BaseContainer) – Container with settings for the custom GUI object.
GeDialog.FindCustomGui(id, pluginid)

New in version R13.016.

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

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

any of the custom GUI classes.

Returns:

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

GeDialog.AddChild(id, subid, child)

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

Parameters:
  • id (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 (C4DGadget or int) – The control ID or int.
Return type: bool
Returns: True if the children were removed.
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 (GeUserArea) – A user area object to attach.
  • id (C4DGadget or int) – The control ID.
  • userareaflags (int) –

    Flags for the user area:

    USERAREA_TABSTOP  
    USERAREA_HANDLEFOCUS  
    USERAREA_COREMESSAGE  
    USERAREA_SYNCMESSAGE  
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 (The user area ID.) – The unique 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:

C4DGadget

Returns:

The added gadget.

GeDialog.AddDlgGroup(type)

New in version R13.016.

Adds a dialog group with standard buttons to the layout.

Parameters: type (int) –

The dialog type:

DLG_TYPE_MODAL Modal dialog.
DLG_TYPE_MODAL_RESIZEABLE Modal resizable dialog.
DLG_TYPE_ASYNC Asynchronous dialog.
DLG_TYPE_ASYNC_POPUP_RESIZEABLE Asynchronous resizable dialog
DLG_TYPE_ASYNC_POPUPEDIT Popup dialog
DLG_TYPE_ASYNC_FULLSCREEN_WORK Fullscreen work.
DLG_TYPE_ASYNC_FULLSCREEN_MONITOR Fullscreen monitor.
Return type: bool
Returns: True if the dialog group was added, 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 (C4DGadget or int) – The control ID or int.
Return type: BaseContainer
Returns: A new container or None. Filled with the weights:
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 don’t need to be 100:

def CreateLayout(self):
    self.GroupBegin(999,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.SetLong(c4d.GROUPWEIGHTS_PERCENT_W_CNT, 2) # number of columns - has to be equal to the given layout
        self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_W_VAL+0,25.0); # weight for col 1
        self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_W_VAL+1,75.0); # weight for col 2

        #set the rows
        self.weights.SetLong(c4d.GROUPWEIGHTS_PERCENT_H_CNT,4); # number of rows - has to be equal to the given layout
        self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+0,10.0); # weight for row 1
        self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+1,30.0); # weight for row 2
        self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+2,60.0); # weight for row 3
        self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+3,0.0); # weight for row 4
        self.weights_saved = True

    self.GroupWeightsLoad(999, self.weights)
    self.GroupEnd()
    return True

def Message(self, msg, result):
    if msg.GetId()==c4d.MFM_WEIGHTS_CHANGED:
            #if the weights change because of user interaction you will get notified
            if msg.GetLong(c4d.BFM_WEIGHTS_CHANGED)==999:
                    self.GroupWeightsSave(999, self.weights)
    return GeDialog.Message(self, msg, result)
Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • weights (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=0][, 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 C4D 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 C4D 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 (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.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.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 C4D command or a plugin command. Particularly useful is IDM_CM_CLOSEWINDOW to add a close item for dialogs.

Parameters: cmdid (int) – A C4D 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.

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

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 Don’t 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.
GeDialog.GroupEnd()

Ends groups.

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

Ends groups.

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 don’t 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 (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’s visible, otherwise False.
GeDialog.IsOpen()

Checks if the dialog is open.

Return type: bool
Returns: True if it’s 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 (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:
  • id (C4DGadget or int) – The control ID or int.
  • value (bool) – The new value.
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])

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

Parameters:
  • id (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=MINREALr][, max=MAXREALr][, step=1.0][, format=FORMAT_REAL][, min2=0.0][, max2=0.0][, quadscale=False][, tristate=False])

Sets the value, unit and limits of float fields.

Parameters:
  • id (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_REAL Floating point without unit
    FORMAT_LONG 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=MINREALr][, max=MAXREALr][, step=1.0][, tristate=False])

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

Parameters:
  • id (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=MINREALr][, max=MAXREALr][, step=1.0][, tristate=False])

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

Parameters:
  • id (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 SetReal() with FORMAT_PERCENT.

Parameters:
  • id (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 SetReal() with FORMAT_FRAMES.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (BaseTime) – The new time.
  • min (int) – The minimum time accepted.
  • max (int) – 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 (C4DGadget or int) – The control ID or int.
  • value (BaseTime) – 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.
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 (C4DGadget or int) – The control ID or int.
  • color (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 Disable the brightness control.
    DR_COLORFIELD_NO_COLOR Disable the color control.
    DR_COLORFIELD_BODYPAINT Use the Bodypaint style.
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 (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)

New in version R13.016.

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

Parameters:
  • id (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)

New in version R13.016.

Sets the edit mode for multi-line edit fields.

Parameters:
  • id (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 (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)

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

Parameters: id (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)

Retrieves the value of float fields.

Parameters: id (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:
  • id_x (C4DGadget or int) – The control ID of the X field.
  • id_y (C4DGadget or int) – The control ID of the Y field.
  • id_z (C4DGadget or int) – The control ID of the Z field.
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 (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 (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:

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 (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 (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’s 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

Table Of Contents