Is it possible to force photoshop to redrawDocument during mouseDrag?

I am implementing a live preview.

I am able to putPixels into the document. I am properly debouncing drags so I am only making one update once the user has stopped moving the mouse. My issue is that photoshop won’t actually display the changes until I release the mouse. There is no second update happening on mouse up.

This is inside executeModal with suspended history and my mouse events are coming from a dialog shown with uxpShowModal

I tried to batch play toggling the quick mask on and off to force a refresh

await core.redrawDocument throws “Error: timeOut”

Oops, it does work!

I just didn’t read the doc and assumed it would update the active document.

await core.redrawDocument({ documentID: app.activeDocument.id });

1 Like

You can do it inside the “mousemove” event within your DIV, however I recommend if you create a flag that turns true and false whenever your command is created, otherwise you’ll overwhelm the engine and Photoshop will explode haha.