gui.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright (C) 2009-2017, Panagiotis Christopoulos Charitos and contributors.
  2. # All rights reserved.
  3. # Code licensed under the BSD License.
  4. # http://www.anki3d.org/LICENSE
  5. # keep methods in alphabetical order
  6. # system imports
  7. import os
  8. # blender imports
  9. import bpy, os
  10. from bpy.types import Operator, Panel, AddonPreferences
  11. from bpy.props import StringProperty
  12. # local imports
  13. from ..lib import environment as ENV
  14. bl_info = {"author": "A. A. Kalugin Jr."}
  15. class AnkiPanel:
  16. bl_space_type = 'VIEW_3D'
  17. bl_region_type = 'TOOLS'
  18. class VIEW3D_PT_prefs_anki(AnkiPanel, Panel):
  19. bl_category = "Anki"
  20. bl_label = "Export Preferences"
  21. def draw(self, context):
  22. scn = context.scene
  23. layout = self.layout
  24. col = layout.column(align=True)
  25. col.label(text="Texture Export:")
  26. row = col.row(align=True)
  27. row.prop(scn, "ExportAllTextures")
  28. row.prop(scn, "UpdateTextures")
  29. class VIEW3D_PT_tools_anki(AnkiPanel, Panel):
  30. bl_category = "Anki"
  31. bl_label = "Exporter"
  32. def draw(self, context):
  33. scn = context.scene
  34. layout = self.layout
  35. col = layout.column(align=True)
  36. split = layout.split()
  37. col = split.column()
  38. col.prop(scn, "UseViewport", text="Viewport")
  39. col = split.column()
  40. col.operator("scene.anki_export_scene", icon='PLAY')
  41. col = layout.column(align=True)
  42. col.separator()
  43. col.label(text="Texture Export:")
  44. row = col.row(align=True)
  45. row.operator("scene.anki_export_textures", icon='IMAGE_COL')