gui.py 1.4 KB

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