Skip to content

Instantly share code, notes, and snippets.

@mattcox
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattcox/9829905 to your computer and use it in GitHub Desktop.
Save mattcox/9829905 to your computer and use it in GitHub Desktop.
Get all maps associated with a clip.
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