python properties persistance

hello,

I have set some properties for a dialog box in python
and I wanted to know if there was a way to save them so I dont have to change these values everytime I run the script


class PickupTextureDialog(bpy.types.Operator):
...
    imagesEnum = EnumProperty(name="imagesEnum",items = _images)
    deleteImages = BoolProperty(name = "deleteImages", description = "delete images ?") ; 
    subDivisions = IntProperty(name = "subDivisions", description = "subdivisions") ; 
    saveImages = BoolProperty(name = "saveImages", description = "save images ?") ; 

thanks

I think there is, using bl_options, values are saved per session. When you start over blender will reset to their default values.


class MyOperator(bpy.types.Operator):
  bl_idname = "mesh.do_something"
  bl_label = "My ausum operator"
  bl_options = {"REGISTER", "UNDO"} (check bl_options reference)

  myprop = StringProperty(default = "Hey there")


presets ?

bl_optionsOptions for this operator type

  • REGISTER Register, Display in the info window and support the redo toolbar panel.
  • UNDO Undo, Push an undo event (needed for operator redo).
  • BLOCKING Blocking, Block anything else from using the cursor.
  • MACRO Macro, Use to check if an operator is a macro.
  • GRAB_POINTER Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled.
  • PRESET Preset, Display a preset button with the operators settings.
  • INTERNAL Internal, Removes the operator from search results.

[TABLE=“class: docutils field-list”]
[TR=“class: field-odd field”]
[TH=“class: field-name”]Type :[/TH]
enum set in {‘REGISTER’, ‘UNDO’, ‘BLOCKING’, ‘MACRO’, ‘GRAB_POINTER’, ‘PRESET’, ‘INTERNAL’}, default {‘REGISTER’}
[/TR]
[/TABLE]

Can’t tell, or register, cant remember. You can also fake the save by storing the lastest values somewhere, the scene for example and setting them back when the operator is called. “execute” or “invoke”.