Browse Source

- possible fix for corrupted DAE imports, thanks to @jagwire

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10356 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 12 years ago
parent
commit
60c0dd42e0
1 changed files with 6 additions and 0 deletions
  1. 6 0
      jme3-blender/src/com/jme3/gde/blender/scripts/import_dae.py

+ 6 - 0
jme3-blender/src/com/jme3/gde/blender/scripts/import_dae.py

@@ -39,6 +39,11 @@ def save_file(save_path):
     if ok:
         bpy.ops.wm.save_as_mainfile(filepath=save_path)
 
+# Due to an issue in the DAE importer, the file has to be resaved after an import
+def open_save_file(open_path):
+     bpy.ops.wm.open_mainfile(filepath=save_path)
+     bpy.ops.wm.save_as_mainfile(filepath=save_path)
+
 def main():
     import sys       # to get command line args
     import argparse  # to parse options for us and print a nice help message
@@ -75,6 +80,7 @@ def main():
     clear_scene()
     import_file(args.file_path)
     save_file(args.save_path)
+    open_save_file(args.save_path)
 
     print("batch job finished, exiting")