I'm writing a script, now I'd like to understand how these properties can be saved, the properties are stored in a class PropPerSet(bpy.types.PropertyGroup), I put a StringProperty as input to give a name to the preset, 1 button operator for save 1 button operator to delete current preset, and an EnumProperty for a list of options, the class is based on Scene.scene_check_set = bpy.props.PointerProperty (type = PropPerSet), it is possible to save in a text file, or better other solutions ?

Edit 1: This is my idea input is StringProperty, dropdown menu is only example i put manually in enum "My preset 1": enter image description here

  • 1
    $\begingroup$ You may add another two operators to save and load those properties as dict by encoded to JSON format files, which is more flexible when you want to exchange in other program and read it directly from text. $\endgroup$ – Hikariztw May 2 at 1:10
  • $\begingroup$ @Hikariztw, ty know any way to find an example for store and save my Scene.scene_check_set = bpy.props.PointerProperty (type = PropPerSet)? $\endgroup$ – Pastrokkio May 2 at 2:50
  • $\begingroup$ Related. blender.stackexchange.com/questions/134613/… define scene in preset defines scene = bpy.context.scene and scene.scene_check_set.foo etc in values. $\endgroup$ – batFINGER May 2 at 14:41
  • $\begingroup$ @batFINGER, ty the concept is not very clear to me, for example, after setting the parameters in the UI panel I would like to save these parameters in a file or somewhere else, I would like these presets to be recalled via (I think) a drop down list, for now I have created an EnumPropery ... but I don't think it's the right way, the example you indicated is what I need? I have to put name in preset for example 'My preset 1" "My Preset 2" by Stringproperty $\endgroup$ – Pastrokkio May 2 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.