diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-08 14:55:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-08 14:55:32 +0300 |
commit | 253a936d60bf944b303bd899d9edbbc543af989b (patch) | |
tree | 5a8e5b383827ac82757ee86ce06179108a7f1414 /archipack/archipack_thumbs.py | |
parent | c9605694fa2abb23f51dedafaa03eadd34f3aab5 (diff) |
archipack: allow importing without executing
Diffstat (limited to 'archipack/archipack_thumbs.py')
-rw-r--r-- | archipack/archipack_thumbs.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/archipack/archipack_thumbs.py b/archipack/archipack_thumbs.py index 5b14e91b..57f1804a 100644 --- a/archipack/archipack_thumbs.py +++ b/archipack/archipack_thumbs.py @@ -171,13 +171,14 @@ def generateThumb(context, cls, preset): log("### COMPLETED ############################") -preset = "" +if __name__ == "__main__": + preset = "" -for arg in sys.argv: - if arg.startswith("cls:"): - cls = arg[4:] - if arg.startswith("preset:"): - preset = arg[7:] + for arg in sys.argv: + if arg.startswith("cls:"): + cls = arg[4:] + if arg.startswith("preset:"): + preset = arg[7:] -generateThumb(bpy.context, cls, preset) + generateThumb(bpy.context, cls, preset) |