exporter_settings_panel.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. from .package_level import *
  2. import bpy
  3. # Panel displayed in Scene Tab of properties, so settings can be saved in a .blend file
  4. class ExporterSettingsPanel(bpy.types.Panel):
  5. bl_label = get_title()
  6. bl_space_type = 'PROPERTIES'
  7. bl_region_type = 'WINDOW'
  8. bl_context = 'scene'
  9. bpy.types.Scene.export_onlySelectedLayer = bpy.props.BoolProperty(
  10. name='Export only selected layers',
  11. description='Export only selected layers',
  12. default = False,
  13. )
  14. bpy.types.Scene.export_flatshadeScene = bpy.props.BoolProperty(
  15. name='Flat shade entire scene',
  16. description='Use face normals on all meshes. Increases vertices.',
  17. default = False,
  18. )
  19. bpy.types.Scene.attachedSound = bpy.props.StringProperty(
  20. name='Sound',
  21. description='',
  22. default = ''
  23. )
  24. bpy.types.Scene.loopSound = bpy.props.BoolProperty(
  25. name='Loop sound',
  26. description='',
  27. default = True
  28. )
  29. bpy.types.Scene.autoPlaySound = bpy.props.BoolProperty(
  30. name='Auto play sound',
  31. description='',
  32. default = True
  33. )
  34. bpy.types.Scene.inlineTextures = bpy.props.BoolProperty(
  35. name='inline',
  36. description='turn textures into encoded strings, for direct inclusion into source code',
  37. default = False
  38. )
  39. bpy.types.Scene.textureDir = bpy.props.StringProperty(
  40. name='Sub-directory',
  41. description='The path below the output directory to write texture files (any separators OS dependent)',
  42. default = ''
  43. )
  44. bpy.types.Scene.ignoreIKBones = bpy.props.BoolProperty(
  45. name='Ignore IK Bones',
  46. description="Do not export bones with either '.ik' or 'ik.'(not case sensitive) in the name",
  47. default = False,
  48. )
  49. def draw(self, context):
  50. layout = self.layout
  51. scene = context.scene
  52. layout.prop(scene, 'export_onlySelectedLayer')
  53. layout.prop(scene, 'export_flatshadeScene')
  54. layout.prop(scene, 'ignoreIKBones')
  55. box = layout.box()
  56. box.label(text='Texture Location:')
  57. box.prop(scene, 'inlineTextures')
  58. row = box.row()
  59. row.enabled = not scene.inlineTextures
  60. row.prop(scene, 'textureDir')
  61. box = layout.box()
  62. box.prop(scene, 'attachedSound')
  63. box.prop(scene, 'autoPlaySound')
  64. box.prop(scene, 'loopSound')