Reload pressing F8 will not restore property to default? Is it possible to reload by pressing F8 and restore property to default value? I don't seem to get this working? If there's a way to do so, would it work with EnumProperty?

bpy.types.Scene.my_string_prop = bpy.props.StringProperty \
  (
    name = "Text Field",
    description = "My description",
    default = "some default text here"
  )


In the panel def draw:

   def draw(self, context):
        layout = self.layout

        #Set TextField
        col = layout.column(align = True)
        col.prop(context.scene, "my_string_prop")
Make an operator to add functionality before calling another

The text editor &gt; templates &gt; python &gt; Operator Simple template edited (minimally) to reset a user defined  "xxxx" property of the scene to its default value. Can either use scene.property_unset("xxx") or simply remove its storage del(scene["xxx"]). 

After which the reload script is called. (default op of F8)  Edit the shortcut in user preferences to point to new operator.


the screen F8 shortcut after changing "script.reload" to "object.simple_operator"

import bpy

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "My Reload Scripts"

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        scene = context.scene
        scene.property_unset("xxx")
        #del(scene["xxx"]) # same
        # what F8 calls
        bpy.ops.script.reload()
        return {'FINISHED'}


def register():
    bpy.types.Scene.xxx = bpy.props.IntProperty()
    bpy.utils.register_class(SimpleOperator)

def unregister():
    del(bpy.types.Scene.xxx)
    bpy.utils.unregister_class(SimpleOperator)


if __name__ == "__main__":
    register()
    # test code
    scene = bpy.context.scene
    scene.xxx = 10
    print("before", scene.xxx)
    bpy.ops.object.simple_operator()
    print("after", scene.xxx)