Skip to content

Handle processing in Interactor PythonPart

In an interactor PythonPart, the class HandleModificationService can be used to implement the handle processing. The service can be created like

handle_modi_service = HandleModificationService(coord_input, build_ele_list, control_props_list)

Depending on an defined InputMode, the HandleModificationService can be used for the selection and modification of the handles as follows

if input_mode == InputMode.RefPoint:
    input_pnt = coord_input.GetInputPoint(mouse_msg, pnt, msg_info).GetPoint()

    ...
#----------------- Select a handle
else:
    result = handle_modi_service.process_mouse_msg(mouse_msg, pnt, msg_info)

In the member function process_mouse_msg the selection and modification of the handle is executed and the value of the assigned property is checked and updated.

Example

A full implementation of the HandleModificationService processing, including how to start and stop the handle input, is provided in HandleUsageInInteractor located in:

  • …\etc\Examples\PythonParts\InteractorExamplesGeneral\HandleUsageInInteractor.pyp
  • …\etc\PythonPartsExampleScripts\InteractorExamplesGeneral\HandleUsageInInteractor.py