[Bf-extensions-cvs] [6d14522] master: Game Engine Publishing | Lib folder creation bug

Oren Titane Genome36 noreply at git.blender.org
Thu Aug 20 08:29:51 CEST 2015


Commit: 6d145221a1ec1846f3d5a0855f45d1a1bd4e1915
Author: Oren Titane (Genome36)
Date:   Wed Aug 19 23:07:22 2015 -0700
Branches: master
https://developer.blender.org/rBA6d145221a1ec1846f3d5a0855f45d1a1bd4e1915

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

===================================================================

M	game_engine_publishing.py

===================================================================

diff --git a/game_engine_publishing.py b/game_engine_publishing.py
index 98f6e3c..644fce0 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)



More information about the Bf-extensions-cvs mailing list