Last active
August 29, 2015 13:57
-
-
Save mattcox/9829905 to your computer and use it in GitHub Desktop.
Get all maps associated with a clip.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lx | |
import lxu.select | |
def GetImageMaps (self, clip_obj, getIdents=True): | |
images = [] | |
if clip == None: | |
return [] | |
try: | |
scn_svc = lx.service.Scene () | |
clip_type = scn_svc.ItemTypeLookup (lx.symbol.sITYPE_VIDEOSTILL) | |
image_type = scn_svc.ItemTypeLookup (lx.symbol.sITYPE_IMAGEMAP) | |
scene = lxu.select.SceneSelection().current() | |
graph = lx.object.ItemGraph (scene.GraphLookup (lx.symbol.sGRAPH_SHADELOC)) | |
if isinstance (clip_obj, str) == True: | |
clip = scene.ItemLookupIdent (clip_obj) | |
else: | |
clip = lx.object.Item (clip_obj) | |
if clip.TestType (clip_type) == False: | |
return [] | |
count = graph.RevCount (clip) | |
for i in range (count): | |
image = graph.RevByIndex (clip, i) | |
if image.TestType (image_type) == True: | |
if getIdents == True: | |
image = image.Ident () | |
images.append (image) | |
return images | |
except: | |
return [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment