Skip to main content
benp1711322
Inspiring
July 17, 2019
Question

PF_OutFlag_FORCE_RERENDER causes undo buffer entry?

  • July 17, 2019
  • 1 reply
  • 3803 views

I have a function that lets a user load data from a file after clicking a button. The function is wrapped in AEGP_StartUndoGroup(NULL)/AEGP_EndUndoGroup(); because there's no need for an undo. The load data function sets out_data->out_flags = PF_OutFlag_FORCE_RERENDER; to sync the loaded data on the UI and render threads.

This last step seems to create an undo entry, "Undo effects options change", despite the AEGP_StartUndoGroup being set to NULL. Undoing this subsequently causes a crash, apparently caused by the render thread not having the data.

I have wrapped everything I can find in AEGP_StartUndoGroup("{Unique name for each undo group}"), to see if I can isolate the function that causes the "effects options change" in the undo buffer. But no luck, it still says "Undo effects options change".

What ever it is that "effects options change" is, it seems to be undoable (which causes a crash) and re-doable (which lets the plugin run normally).

Is the UI/render thread sync itself an undoable function-- "effects options change"? Is there anyway to remove it from the undo stack? Or is there some other reason the undo removes the UI/render thread sync?

This topic has been closed for replies.

1 reply

Community Expert
July 18, 2019

errr... hmmm... wow. never seen that one.

this is a wild guess, but try putting and empty string (two consecutive

quotes signs) instead of a NULL in the undo group name. NULLs were dropped

as an option for creating an invisible undo group a while back, and an

empty string is used for the same purpose since.

On Wed, Jul 17, 2019 at 10:59 PM benp1711322 <forums_noreply@adobe.com>

benp1711322
Inspiring
July 18, 2019

Thanks Shachar.

I tried wrapping every function in uniquely named, non-null AEGP_StartUndoGroup statements.

This is the sequence of cmds I get with and without PF_OutFlag_FORCE_RERENDER:

WITH PF_OutFlag_FORCE_RERENDER:

*** --> GOT CMD: 13 > USER CHANGED PARAMS.

*** --> IN USER CHANGED PARAM WITH 274 (LOAD DATA)

*** --> IN LOAD DATA

*** --> GOT CMD: 7 > SEQUENCE FLATTEN.

*** --> GOT CMD: 6 > SEQUENCE RESETUP.

*** --> GOT CMD: 7 > SEQUENCE FLATTEN.

*** --> GOT CMD: 6 > SEQUENCE RESETUP.

*** --> GOT CMD: 7 > SEQUENCE FLATTEN.

*** --> GOT CMD: 6 > SEQUENCE RESETUP.

*** --> GOT CMD: 7 > SEQUENCE FLATTEN.

*** --> GOT CMD: 6 > SEQUENCE RESETUP.

*** --> GOT CMD: 7 > SEQUENCE FLATTEN.

*** --> GOT CMD: 6 > SEQUENCE RESETUP.

*** --> GOT CMD: 10 -> PF_Cmd_FRAME_SETUP, no function

*** --> GOT CMD: 11 -> PF_Cmd_RENDER,  > RENDER. -> WORLD IS 8 BIT!

*** --> GOT CMD: 12 -> PF_Cmd_FRAME_SETDOWN, no function

-------------------------------

WITHOUT PF_OutFlag_FORCE_RERENDER

*** --> GOT CMD: 13 > USER CHANGED PARAMS.

*** --> IN USER CHANGED PARAM WITH 274

*** --> IN LOAD DATA

-------------------------------

But I still can't trace the origin of this "effects options change".

Is there a way of interrogating the Undo buffer? I couldn't see one in AE_GeneralPlugin.h.

benp1711322
Inspiring
July 18, 2019

from the SDK docs:

FORCE_RERENDER works when set during PF_Cmd_USER_CHANGED_PARAM. It also

works in CLICK and DRAG events, but only if

PF_Cmd_GET_FLATTENED_SEQUENCE_DATA is implemented. This is required to

prevent flattening and loss of UI state in the middle of mouse operations.

Without GET_FLATTENED, the new FORCE_RERENDER behavior will NOT be turned

on.

On Thu, Jul 18, 2019 at 5:15 PM benp1711322 <forums_noreply@adobe.com>


Yep read that. I set FORCE_RERENDER during PF_Cmd_USER_CHANGED_PARAM, so as far as I can understand it, it's ok.

Is there any way to 'see' what's in the undo buffer?