gui.py 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (C) 2009-2016, 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. # blender imports
  7. import os
  8. import bpy
  9. import bpy.utils.previews
  10. from bpy.props import StringProperty
  11. bl_info = {"author": "A. A. Kalugin Jr."}
  12. def get_region3d(context):
  13. """
  14. Gets the first region 3d viewport.
  15. """
  16. view = get_view_3d(context)
  17. if view:
  18. return view.spaces[0].region_3d
  19. return None
  20. def get_view_3d(context):
  21. """
  22. Gets the first region 3d viewport.
  23. """
  24. for view in context.window.screen.areas:
  25. if view.type == 'VIEW_3D':
  26. return view
  27. return None
  28. def image_filter_glob():
  29. return StringProperty(
  30. default="*.bmp;*.sgi;*.rgb;*.bw;*.png;*.jpg;*.jpeg;*.exr;*.hdr;*.jp2;*.j2c;*.tga",
  31. options={'HIDDEN'}
  32. )
  33. def image_file_path():
  34. return StringProperty(
  35. name="File Path",
  36. description="File path use",
  37. maxlen= 1024, default= ""
  38. )