Esempio n. 1
0
 def execute(self, context):
     startLog(self)
     root = sUtils.getRoot(context.selected_objects[0])
     model, objectlist = robotdictionary.buildModelDictionary(root)
     exporter.export(model, objectlist)
     endLog()
     return {'FINISHED'}
Esempio n. 2
0
File: io.py Progetto: galou/phobos
 def execute(self, context):
     startLog(self)
     root = sUtils.getRoot(context.selected_objects[0])
     if root.phobostype != 'link':
         log("Selection includes objects not parented to any model root, please adapt selection.", "ERROR", "ExportModelOperator")
     else:
         model, objectlist = robotdictionary.buildModelDictionary(root)
         exporter.export(model, objectlist)
         endLog()
     return {'FINISHED'}
Esempio n. 3
0
 def execute(self, context):
     startLog(self)
     root = sUtils.getRoot(context.selected_objects[0])
     if root.phobostype != 'link':
         log(
             "Selection includes objects not parented to any model root, please adapt selection.",
             "ERROR", "ExportModelOperator")
     else:
         model, objectlist = robotdictionary.buildModelDictionary(root)
         exporter.export(model, objectlist)
         endLog()
     return {'FINISHED'}
Esempio n. 4
0
File: io.py Progetto: bmagyar/phobos
 def execute(self, context):
     startLog(self)
     objs = context.selected_objects
     robot = robotdictionary.buildRobotDictionary()
     selectionUtils.selectObjects(objs)
     tmpdir = tempfile.gettempdir()
     expPath = os.path.join(tmpdir, robot["modelname"] + "_bake")
     exporter.export(path=expPath, robotmodel=robot)
     exporter.bakeModel(objs, expPath, robot["modelname"])
     zipfilename = os.path.join(tmpdir, robot["modelname"] + ".bake")
     file = zipfile.ZipFile(zipfilename, mode="w")
     for filename in os.listdir(expPath):
         file.write(os.path.join(expPath, filename), arcname=filename)
     file.close()
     shutil.rmtree(expPath)
     outpath = ""
     if bpy.data.worlds[0].relativePath:
         outpath = exporter.securepath(os.path.expanduser(os.path.join(bpy.path.abspath("//"), bpy.data.worlds[0].path)))
     else:
         outpath = exporter.securepath(os.path.expanduser(bpy.data.worlds[0].path))
     shutil.copy(zipfilename, outpath)
     endLog()
     return {'FINISHED'}
Esempio n. 5
0
 def execute(self, context):
     startLog(self)
     exporter.export()
     endLog()
     return {'FINISHED'}
Esempio n. 6
0
 def execute(self, context):
     startLog(self)
     exporter.export()
     endLog()
     return {'FINISHED'}