Browse Source

glob prob

shuvit 5 years ago
parent
commit
5cd88a53fb
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      scripts/colors.py

+ 9
- 2
scripts/colors.py View File

122
     #deck graphic testing
122
     #deck graphic testing
123
     #pass
123
     #pass
124
     import glob
124
     import glob
125
+    import platform
125
     scene = bge.logic.getCurrentScene()
126
     scene = bge.logic.getCurrentScene()
126
     deck = scene.objects["deck"]
127
     deck = scene.objects["deck"]
127
     mainDir = bge.logic.expandPath("//")
128
     mainDir = bge.logic.expandPath("//")
128
-    fileName = mainDir + "textures\\decks\\*.png"    
129
+    fileName = mainDir + "textures\\decks\\*.png"  
130
+    if platform.system() == 'Linux':
131
+        fileName = mainDir + 'textures//decks//*.png'  
129
     deckList = glob.glob(fileName)
132
     deckList = glob.glob(fileName)
130
     dict['deckList'] = deckList  
133
     dict['deckList'] = deckList  
131
     ID = texture.materialID(deck, 'MAdeck')
134
     ID = texture.materialID(deck, 'MAdeck')
146
     #pass
149
     #pass
147
     #deck graphic testing
150
     #deck graphic testing
148
     import glob
151
     import glob
152
+    import platform
149
     scene = bge.logic.getCurrentScene()
153
     scene = bge.logic.getCurrentScene()
150
     #deck = scene.objects["deck"]
154
     #deck = scene.objects["deck"]
151
     shirt = scene.objects["Char4:Zshirtt1"]
155
     shirt = scene.objects["Char4:Zshirtt1"]
152
     mainDir = bge.logic.expandPath("//")
156
     mainDir = bge.logic.expandPath("//")
153
-    fileName2 = mainDir + "textures\\shirt\\*.png"    
157
+    fileName2 = mainDir + "textures\\shirt\\*.png"  
158
+    if platform.system() == 'Linux':
159
+        fileName2 = mainDir + 'textures//shirt//*.png'  
154
     shirtList = glob.glob(fileName2)
160
     shirtList = glob.glob(fileName2)
155
     dict['shirtList'] = shirtList  
161
     dict['shirtList'] = shirtList  
162
+    print(shirtList, 'shirtList')
156
     ID = texture.materialID(shirt, 'MAshirt')
163
     ID = texture.materialID(shirt, 'MAshirt')
157
     shirt_texture = texture.Texture(shirt, ID)
164
     shirt_texture = texture.Texture(shirt, ID)
158
     new_source2 = texture.ImageFFmpeg(shirtList[dict["shirt_logo"]])
165
     new_source2 = texture.ImageFFmpeg(shirtList[dict["shirt_logo"]])

Loading…
Cancel
Save