Exemplo n.º 1
0
def createEventHandler(uievent, pending_actions):
    """Create an event handler for Houdini's network editor.

    :param uievent: The occurring event.
    :type uievent: canvaseventtypes.KeyboardEvent
    :param pending_actions: Pending actions.
    :type pending_actions: list
    :return: Handler event information.
    :rtype: tuple

    """

    if isinstance(uievent,
                  KeyboardEvent) and uievent.eventtype in KEY_HIT_TYPES:
        editor = uievent.editor
        eventtype = uievent.eventtype
        key = uievent.key

        if setKeyPrompt(editor, key, "h.tool:copy_items", eventtype):
            return paste.copy_items_from_graph(editor)

        elif setKeyPrompt(editor, key, "h.tool:paste_items", eventtype):
            return paste.paste_items_to_graph(eventtype, editor, uievent)

    return None, False
def createEventHandler(uievent, pending_actions):
    """Create an event handler for Houdini's network editor."""

    if isinstance(uievent, KeyboardEvent) and uievent.eventtype in ('keyhit', 'menukeyhit', 'parentkeyhit'):
        editor = uievent.editor
        eventtype = uievent.eventtype
        key = uievent.key

        if setKeyPrompt(editor, key, "h.tool:copy_items", eventtype):
            return paste.copy_items_from_graph(editor)

        elif setKeyPrompt(editor, key, "h.tool:paste_items", eventtype):
            return paste.paste_items_to_graph(eventtype, editor, uievent)

    return None, False
Exemplo n.º 3
0
def createEventHandler(uievent, pending_actions):
    """Create an event handler for Houdini's network editor."""

    if isinstance(uievent, KeyboardEvent) and uievent.eventtype in (
            'keyhit', 'menukeyhit', 'parentkeyhit'):
        editor = uievent.editor
        eventtype = uievent.eventtype
        key = uievent.key

        if setKeyPrompt(editor, key, "h.tool:copy_items", eventtype):
            return paste.copy_items_from_graph(editor)

        elif setKeyPrompt(editor, key, "h.tool:paste_items", eventtype):
            return paste.paste_items_to_graph(eventtype, editor, uievent)

    return None, False