some work on exporter
This commit is contained in:
parent
722fd26511
commit
6687ec186d
3 changed files with 15 additions and 10 deletions
8
core/blender-export.py
Normal file
8
core/blender-export.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import bpy
|
||||
import sys
|
||||
|
||||
args = sys.argv[sys.argv.index("--") + 1:] # get all args after "--"
|
||||
|
||||
print("Exporting .blend file to: " + args)
|
||||
|
||||
bpy.ops.export_scene.fbx(filepath=args, axis_forward='-Z', axis_up='Y')
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import bpy
|
||||
import sys
|
||||
|
||||
bpy.ops.export_scene.fbx(filepath='D:\\Program Files\\exported.fbx', axis_forward='-Z', axis_up='Y')
|
||||
|
|
@ -29,14 +29,15 @@ task buildResources {
|
|||
if (sourceFile.getName().endsWith(".blend")) {
|
||||
println "Exporting: ${sourceFile}"
|
||||
|
||||
def targetFile = new File(
|
||||
sourceFile.getAbsolutePath().replace(sourcePath.absolutePath, targetPath.absolutePath))
|
||||
def tmpFile = sourceFile.getAbsolutePath().replace(sourcePath.absolutePath, targetPath.absolutePath)
|
||||
tmpFile = tmpFile.replaceAll(".blend\$", ".fbx")
|
||||
def targetFile = new File(tmpFile)
|
||||
println " - Output: ${targetFile}"
|
||||
|
||||
// exec {
|
||||
// executable "sh"
|
||||
// args "-c", "blender.exe --background '${sourceFile}' --python 'blender-fbx-export.py'"
|
||||
// }
|
||||
exec {
|
||||
executable "sh"
|
||||
args "-c", "blender.exe --background '${sourceFile}' --python 'blender-export.py' -- '${targetFile}'"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue