Page MenuHome

Operators no longer save / restore their last-used properties when invoked.
Closed, ResolvedPublic


I filled this bug report after this discussion on blender.stackexchange.

System Information
Windows XP 32bits

Blender Version
Broken: 2.69.0 (r60995)
Worked: 2.62 (I don't know for versions between 2.62 and 2.69)

Short description of error
I have an operator that draws its own panel (via invoke_props_dialog) when invoked to let the user set properties, but those properties are not remember from one call to another, while they are saved if the Tool Shelf Redo feature is used.

Exact steps for others to reproduce the error

  • Paste the attached script into Text Editor and run it. It adds a Test Panel with a Test button to the Objects Data properties.

  • Use the operator Test button: it uses its default properties.
  • Change the properties in the popup panel, press Ok. Re-use the Test button: the last-used properties are not remembered, it still uses the default ones.
  • Now use the operator Test button, then modify the properties in the Tool Shelf. Re-use the Test button again: the properties from the Tool Shelf are now used in the popup panel instead of the default ones. (It does the same when using the Redo Last F6 panel to modify the properties).

For info, in Blender 2.62 the last-used properties were properly restored, and there was also a convenient "Restore Defaults" that automatically appeared in the popup panel (which is now gone in 2.69).

Maybe there was a change of design I'm not aware of between 2.62 and 2.69, anyway either invoke() should always restore the last-used properties (the most convenient solution IMO), or never do it. It should not be dependant of whether or not the Tool Shelf has been used.