I have a simple operator that prints out the string "Testing operator". I change the string to "Testing updated file", then go to Blender and press F8 to reload the script. I run the operator, but I still get "Testing operator", and not the updated string.
I have the script in a separate folder (not in the Blender script path), and have installed the addon through Blender's "Install from file". The script is only one file, and I'm editing it in Notepad++.
When I try to reinstall the addon, the update takes place. However, restarting Blender does nothing.
My question is thus: how can I make the refresh function work?
Note: The reason I don't have the script in Blender's script path, is that the script can easily be deleted by accident.
Code if necessary:
bl_info = {
"name" : "Import addon",
"author" : "Naioai Studios",
"version" : (1, 0, 0),
"blender" : (2, 7, 2),
"location" : "View 3D > Edit Mode > Tool Shelf",
"description" :
"Allows for semi-automatic shipping",
"warning" : "",
"wiki_url" : "",
"tracker_url" : "",
"category" : "1_Custom",
'support': 'COMMUNITY'
}
import bpy
def main():
print("Testing updated flflflflf")
class SimpleOperator(bpy.types.Operator):
"""Import addon for stickmen models"""
bl_idname = "object.import_stickman"
bl_label = "Import stickman"
def execute(self, context):
main()
return {'FINISHED'}
def register():
bpy.utils.register_class(SimpleOperator)
def unregister():
bpy.utils.unregister_class(SimpleOperator)
if __name__ == "__main__":
register()
#test call
bpy.ops.object.import_stickman()