コード例 #1
0
ファイル: io.py プロジェクト: b2220333/phobos
 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'}
コード例 #2
0
ファイル: io.py プロジェクト: 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'}
コード例 #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'}
コード例 #4
0
ファイル: io.py プロジェクト: 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'}
コード例 #5
0
ファイル: io.py プロジェクト: Hacks4ROS-forks/phobos
 def execute(self, context):
     startLog(self)
     exporter.export()
     endLog()
     return {'FINISHED'}
コード例 #6
0
 def execute(self, context):
     startLog(self)
     exporter.export()
     endLog()
     return {'FINISHED'}