本文整理汇总了Python中bpy_extras.io_utils.ExportHelper方法的典型用法代码示例。如果您正苦于以下问题:Python io_utils.ExportHelper方法的具体用法?Python io_utils.ExportHelper怎么用?Python io_utils.ExportHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bpy_extras.io_utils
的用法示例。
在下文中一共展示了io_utils.ExportHelper方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_some_data
# 需要导入模块: from bpy_extras import io_utils [as 别名]
# 或者: from bpy_extras.io_utils import ExportHelper [as 别名]
def write_some_data(context, filepath, use_some_setting):
print("running write_some_data...")
f = open(filepath, 'w', encoding='utf-8')
f.write("Hello World %s" % use_some_setting)
f.close()
return {'FINISHED'}
# ExportHelper is a helper class, defines filename and
# invoke() function which calls the file selector.
示例2: execute
# 需要导入模块: from bpy_extras import io_utils [as 别名]
# 或者: from bpy_extras.io_utils import ExportHelper [as 别名]
def execute(self, context):
from . import export_xmodel
start_time = time.clock()
result = export_xmodel.save(self, context, **self.as_keywords(ignore=("filter_glob", "check_existing")))
if not result:
self.report({'INFO'}, "Export finished in %.4f sec." % (time.clock() - start_time))
return {'FINISHED'}
else:
self.report({'ERROR'}, result)
return {'CANCELLED'}
# Extend ExportHelper invoke function to support dynamic default values
示例3: make_directories
# 需要导入模块: from bpy_extras import io_utils [as 别名]
# 或者: from bpy_extras.io_utils import ExportHelper [as 别名]
def make_directories(dir_list):
'''Creates the listed directories if they do not exist'''
for direct in dir_list:
if not os.path.isdir(direct):
info("Making Directory {}".format(direct))
os.makedirs(direct)
# ----------------------------- BLENDER UI THINGS -----------------------------
# ExportHelper is a helper class, defines filename and
# invoke() function which calls the file selector.