After a week I made a nice Addon for Blender. For testing I run it with
import bpy
import sys
scriptdir = "S:Blender\Dev\Scripts\Addons\meshEdit"
sys.path.append(scriptdir)
# Test
filename = "S:\Scripts\Addons\meshEdit\meshEditorv7.py"
exec(compile(open(filename).read(), filename, 'exec'))
from Blender. All Package-Files are located in the Folder 'scriptdir'. After I finished i copy all Files to an other Folder (named 'S:\Setup Blender\AddOnes\meshEdit) and install it as Addon 'meshEdit' from Blenders Preferences/Addons.
Everything works fine.
For testing i remove the Addon 'meshEdit'
After this I realize that Blender has removed EVERY Python-File in the Develope-Folder
"S:Blender\Dev\Scripts\Addons\meshEdit",
including ALL 5 backup copies Folders inside.
I thinks the reason for this the Codeline 'sys.path.append(scriptdir)' So is there an other Way to testing an Addon and avoid this behaviour?
And is there a way to recover my work?
sys.path.append
only alters variables in memory, it adds an item to an array. Nothing you have shown alters any files on disk. I expect you moved the wrong folder when you moved meshEdit to your addons folder, if it isn't still there and you have no backups I don't expect you will recover them now. $\endgroup$exec
after adding the path to sys you canimport MeshEditorv7
. Why not just place the file/files in your user addons folder, and reload them using F8. There was a q/a about this recently. $\endgroup$'aaa\\bbb'
) or use raw stringsr'aaa\bbb'
$\endgroup$