diff options
author | Oren Titane (Genome36) <orentitane@gmail.com> | 2015-08-20 09:07:22 +0300 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2015-08-20 09:08:15 +0300 |
commit | 6d145221a1ec1846f3d5a0855f45d1a1bd4e1915 (patch) | |
tree | 79bad54842ac3234e9b7352073b3c8ff231c84c7 /game_engine_publishing.py | |
parent | d7fa659c6f9d4922bbcf63d15a120786e1f6ee68 (diff) |
Game Engine Publishing | Lib folder creation bug
This revision fixes a bug with the lib folder creation. As Moguri stated in his add-on wiki, when downloading blender packages for different operating systems, you unpack them in the lib folder (assuming the folder was already created) and press the auto add platform button. Only problem is that when auto-downloading the packages from http://download.blender.org/release/ with the add-on, the lib folder is not created automatically for a new user.
Reviewers: #game_engine, moguri
Subscribers: Genome36
Projects: #game_engine, #addons
Differential Revision: https://developer.blender.org/D723
Diffstat (limited to 'game_engine_publishing.py')
-rw-r--r-- | game_engine_publishing.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/game_engine_publishing.py b/game_engine_publishing.py index 98f6e3c6..644fce07 100644 --- a/game_engine_publishing.py +++ b/game_engine_publishing.py @@ -27,7 +27,7 @@ import stat bl_info = { "name": "Game Engine Publishing", - "author": "Mitchell Stokes (Moguri)", + "author": "Mitchell Stokes (Moguri), Oren Titane (Genome36)", "version": (0, 1, 0), "blender": (2, 72, 0), "location": "Render Properties > Publishing Info", @@ -310,7 +310,11 @@ class PublishAutoPlatforms(bpy.types.Operator): def execute(self, context): ps = context.scene.ge_publish_settings + # verify lib folder lib_path = bpy.path.abspath(ps.lib_path) + if not os.path.exists(lib_path): + self.report({'ERROR'}, "Could not add platforms, lib folder (%s) does not exist" % lib_path) + return {'CANCELLED'} for lib in [i for i in os.listdir(lib_path) if os.path.isdir(os.path.join(lib_path, i))]: print("Found folder:", lib) @@ -352,7 +356,11 @@ class PublishDownloadPlatforms(bpy.types.Operator): remote_platforms = [] ps = context.scene.ge_publish_settings + + # create lib folder if not already available lib_path = bpy.path.abspath(ps.lib_path) + if not os.path.exists(lib_path): + os.makedirs(lib_path) print("Retrieving list of platforms from blender.org...", end=" ", flush=True) |