From 253a936d60bf944b303bd899d9edbbc543af989b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 Aug 2017 21:55:12 +1000 Subject: archipack: allow importing without executing --- archipack/archipack_thumbs.py | 15 ++++++++------- 1 file 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) -- cgit v1.2.3