Added Image.GetCurrent()

Previously the only way to get the current image was flaky and relyd on the image being assigned to a mesh.

try:
  me = Scene.GetCurrent().getAttiveObject().getData(mesh=1)
  image = me.faces[me.activeFace].image
except:
  image = None

...Can new be replaced by the following, and works even when there is no mesh.
image = Image.GetCurrent()

epydocs:
  Get the currently displayed Image from Blenders UV/Image window.
  When multiple images are displayed, the last active UV/Image windows image is used.
This commit is contained in:
2005-12-13 00:00:11 +00:00
parent b72dc4585f
commit d73e312f88
2 changed files with 35 additions and 9 deletions

View File

@@ -52,6 +52,13 @@ def Get (name = None):
- (): A list with all Image objects in the current scene.
"""
def GetCurrent ():
"""
Get the currently displayed Image from Blenders UV/Image window.
When multiple images are displayed, the last active UV/Image windows image is used.
@rtype: Blender Image
@return: The Current Blender Image, If there is no current image it returns None.
"""
class Image:
"""