[Bf-extensions-cvs] [5a1c2a38] master: io_coat3D:fixing folder bug

Kalle-Samuli Riihikoski noreply at git.blender.org
Mon Oct 12 17:18:35 CEST 2020


Commit: 5a1c2a38bb99c779fe27cdc8fbcddec888717ae6
Author: Kalle-Samuli Riihikoski
Date:   Mon Oct 12 18:18:31 2020 +0300
Branches: master
https://developer.blender.org/rBA5a1c2a38bb99c779fe27cdc8fbcddec888717ae6

io_coat3D:fixing folder bug

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

M	io_coat3D/__init__.py
M	io_coat3D/folders.py

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

diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py
index 87b97ce6..9f6c8306 100644
--- a/io_coat3D/__init__.py
+++ b/io_coat3D/__init__.py
@@ -1330,7 +1330,7 @@ class SCENE_PT_Main(bpy.types.Panel):
             row = layout.row()
             row.label(text="Please select it before using Applink.")
             row = layout.row()
-            row.prop(coat3D,"exchangedir",text="")
+            row.prop(coat3D,"exchangeFolder",text="")
             row = layout.row()
             row.operator("update_exchange_folder.pilgway_3d_coat", text="Apply folder")
 
@@ -1645,10 +1645,6 @@ class SceneCoat3D(PropertyGroup):
         name="FilePath",
         subtype="FILE_PATH",
     )
-    Exchange_folder: StringProperty(
-        name="FilePath",
-        subtype="DIR_PATH"
-    )
     exchangeFolder: StringProperty(
         name="FilePath",
         subtype="DIR_PATH"
diff --git a/io_coat3D/folders.py b/io_coat3D/folders.py
index f4637d3c..ec6b62e5 100644
--- a/io_coat3D/folders.py
+++ b/io_coat3D/folders.py
@@ -3,14 +3,16 @@ import os
 
 def InitFolders():
 
+   
+
+    platform = os.sys.platform
+    coat3D = bpy.context.scene.coat3D
+
     #    Global variable foundExchangeFolder (True / False) guides these steps
     # 1. Read Exchange_folder.txt, it not success ->
     # 2. Try to find exchange folder from system hard drive, if not success -->
     # 3. Leave foundExchangeFolder = False
 
-    platform = os.sys.platform
-    coat3D = bpy.context.scene.coat3D
-
     # 1. #################################################################
 
     if(platform == 'win32' or platform == 'darwin'):
@@ -29,6 +31,9 @@ def InitFolders():
         if(os.path.isdir(os.path.abspath(folderPath)) and folderPath.rfind('Exchange') >= 0):
             coat3D.exchangeFolder = folderPath
             return True, coat3D.exchangeFolder
+    else:
+        os.makedirs(os.path.dirname(exchangeFile))
+
 
     # 2. #################################################################



More information about the Bf-extensions-cvs mailing list