通过浏览目录将搅拌机数据导出到目录中

2024-10-04 07:39:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用目录浏览器。我使用的是ExportHelper类,但它会弹出一个文件浏览器。有什么特别的东西可以把它变成目录浏览器吗?你知道吗

下面是一些代码:

class ExampleExporter(bpy.types.Operator, ExportHelper):
  """My Mesh Exporter Script"""
  bl_idname      = "object.example_mesh_exporter"
  bl_label       = "Example Mesh Exporter"
  bl_description = "Export all meshes from the scene into a directory"
  bl_options     = {'REGISTER'}

  filename_ext   = ".huhu" # I don’t even need that

  sparse = BoolProperty (
      name        = "Sparse output"
    , description = "Should the output file be sparse?"
    , default     = False
    , )

  def execute(self, context):
    # do something with self.filepath

我不需要self.filepath,我需要像self.directory.这样的东西。你知道吗


Tags: 文件the代码self目录output浏览器description