| Code: |
| //Loop through each .psk file in a folder
//import current .psk file into scene //Get the name of the .psk file for export //export as .fbx into another folder and with name of the .psk file //clear the scene for the next .psk file |
| Code: |
|
import bpy.ops #Import a .psk file bpy.ops.import_scene.psk(filepath="C:/BlenderImport/Example_01.psk") #Export as .fbx file bpy.ops.export_scene.fbx(filepath="C:/BlenderExport/Example_01.fbx") #Clear existing bpy.ops.wm.read_homefile() |
| Code: |
| import bpy
import bpy.ops import os def GetAllPSK(dir_name): pskList = [] for file in os.listdir(dir_name): dirfile = os.path.join(dir_name, file) pskList.append(dirfile) return pskList if __name__ == "__main__": pskList = GetAllPSK("C:/BlenderImport") for p in pskList: #Import a .psk file bpy.ops.import_scene.psk(filepath=p) #Select all bpy.ops.object.select_all() #Export as .fbx file bpy.ops.export_scene.fbx(filepath=p) #Clear existing bpy.ops.wm.read_homefile() |
| Code: |
| Python Script fail, look in the console for now ... |
| Code: |
|
import bpy import bpy.ops import os import string def GetAllPSK(dir_name): pskList = [] for file in os.listdir(dir_name): dirfile = file.replace('.psk','') pskList.append(dirfile) return pskList if __name__ == "__main__": pskList = GetAllPSK("C:/BlenderImport/") for p in pskList: #Import a .psk file bpy.ops.import_scene.psk(filepath="C:/BlenderImport/" + p + ".psk") #Select all bpy.ops.object.select_all() #Export as .fbx file bpy.ops.export_scene.fbx(filepath="C:/BlenderExport/" + p + ".fbx") #Delete Mesh bpy.ops.object.delete() |
| Quote: |
| but it gives an error of check console yet again |
| stiv wrote: |
| As always, knowing the exact error message is useful for debugging problems. |
| Code: |
| Error, python script fail, look in the console for now ... |
| stiv wrote: | ||
Do you know how to do enable this "console", when I start blender all I have is blender itself, no log screen or anything to go with it. |