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
This commit is contained in:
Oren Titane 2015-08-19 23:07:22 -07:00 committed by Mitchell Stokes
parent d7fa659c6f
commit 6d145221a1
1 changed files with 9 additions and 1 deletions

View File

@ -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)