Page MenuHome

Manipulator modal callback performance
Open, NormalPublic


Found in T55442.

While the transform manipulator is being used, manipulator_modal() is called for every event. ED_transform_calc_manipulator_stats() in there can be expensive for complex rigs with many bones, but likely also meshes with many vertices.

This function could be called many times per redraw, even if the transform only updates the data once. For example INBETWEEN_MOUSEMOVE (normally only used for high resolution mouse events during painting) may be sent many times between redraws, especially if the transform tool is slow and these events keep accumulating.

One solution would be to ignore this and some other events, such as TIMER. Alternatively we could stop using this modal handler and instead call ED_transform_calc_manipulator_stats() whenever the manipulator modifies the data.


To Do

Event Timeline

Skip INBETWEEN_MOUSEMOVE and TIMER as suggested, this should eventually be integrated w/ the transform operator - since it can get out of sync at the moment - and it doesn't know when to re-calculate.

Same issue with other manipulators.
Maybe a threshold for minimal change required before we actually update the real value could fix it.
At least it is a solution on python side but require a get_cb and set_cb to be handled properly.

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Normal.Jul 20 2018, 2:50 PM