c4d.gui.EditorWindow

Members

EditorWindow.DrawXORLine(x1, y1, x2, y2)

Draw an XOR line in the editor view.

Parameters:
  • x1 (int) – Starting x coordinate of the line.
  • y1 (int) – Starting y coordinate of the line.
  • x2 (int) – End x coordinate of the line.
  • y2 (int) – End y coordinate of the line.
EditorWindow.MouseDragStart(button, mx, my, flags)

Initialise a mouse dragging loop.

Parameters:
  • button (int) – State of the mouse buttons
  • mx (float) – The mouse x coordinate.
  • my (float) – The mouse y coordinate.
  • flags (int) –

    The drag flags, these are:

    MOUSEDRAG_DONTHIDEMOUSE Show the mouse pointer during drag.
    MOUSEDRAG_NOMOVE Return if no mouse movement was done.
    MOUSEDRAG_EVERYPACKET Receive every packet of the queue, otherwise only data of the last packet.
    MOUSEDRAG_COMPENSATEVIEWPORTORG Compensates the viewport origin during drag.
    MOUSEDRAG_ESCAPE Drag aborted.
    MOUSEDRAG_FINISHED Drag finished.
    MOUSEDRAG_CONTINUE Drag still in progress.
EditorWindow.MouseDrag()

Check for the mouse drag status.:

result, mx, my, channels = win.MouseDrag()
Return type:

tuple

Returns:

See example above.

Parameters:
  • result (float) –

    The results.

    MOUSEDRAG_ESCAPE Drag aborted.
    MOUSEDRAG_FINISHED Drag finished.
    MOUSEDRAG_CONTINUE Drag still in progress.
  • mx (float) – The mouse x coordinate.
  • my (float) – The mouse y coordinate.
  • channels (BaseContainer) – The state of the mouse. Please check the C++ documentation.
EditorWindow.BfGetInputEvent(askdevice)

Get the status of an input device such as the mouse from the event queue if present.

Parameters: askdevice (int) –

The devices

BFM_INPUT_MOUSE Mouse
BFM_INPUT_KEYBOARD Keyboard
Return type: BaseContainer
Returns: The container state or None if failed.
EditorWindow.BfGetInputState(askdevice, askchannel)

Get the status of an input device such as the mouse from the event queue if present.

Parameters:
  • askdevice (int) –

    The devices

    BFM_INPUT_MOUSE Mouse
    BFM_INPUT_KEYBOARD Keyboard
  • askchannel (int) –

    The channels are:

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

BaseContainer

Returns:

The container state or None if failed.

EditorWindow.MouseDragEnd()

Check why the mouse drag ended. This enabled you to perform any undo operations needed if the user cancelled the drag.

Return type: int
Returns: The results.
MOUSEDRAG_ESCAPE Drag aborted.
MOUSEDRAG_FINISHED Drag finished.
MOUSEDRAG_CONTINUE Drag still in progress.
EditorWindow.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 user area):

x, y = win.Screen2Local()
Parameters:
  • x (int) – The screen X coordinate.
  • y (int) – The screen Y coordinate.
Raises RuntimeError:
 

If the coordinates cannot be transformed.

EditorWindow.Local2Screen()

Transforms local coordinates (relative to the top left corner of the user area) to screen coordinates (relative to the top left corner of the system screen):

x, y = win.Local2Screen()
Parameters:
  • x (int) – The local X coordinate.
  • y (int) – The local Y coordinate.
Raises RuntimeError:
 

If the coordinates cannot be transformed.

EditorWindow.Global2Local()

Transforms global window coordinates (relative to the top left corner of the application window) to local coordinates (relative to the top left corner of the user area):

x, y = win.Global2Local()
Parameters:
  • x (int) – The global X coordinate.
  • y (int) – The global Y coordinate.
Raises RuntimeError:
 

If the coordinates cannot be transformed.

EditorWindow.Local2Global()

Transforms local coordinates (relative to the top left corner of the user area) to global window coordinates (relative to the top left corner of the application window):

x, y = win.Local2Global()
Parameters:
  • x (int) – The local X coordinate.
  • y (int) – The local Y coordinate.
Raises RuntimeError:
 

If the coordinates cannot be transformed.

Table Of Contents