Load Clip example

From The Foundry MODO SDK wiki
Jump to: navigation, search

snippet that loads a clip into the clips list, basic process is to create a videoStill item then set it's filename channel:

# python
import lxu.select
 
img_path = r'C:\Data\__Lux\_Content\Assets\Images\Fabric\Carpet\carpet3.png'
sel_svc = lxu.select.SceneSelection()
current_scene = sel_svc.current()
scn_svc = lx.service.Scene()
 
# get a channel object
chan = current_scene.Channels(lx.symbol.s_ACTIONLAYER_EDIT, 0.0)
# channel writ object
cout = lx.object.ChannelWrite(chan)
# add a videoStill item to the scene
vclip = current_scene.ItemAdd(scn_svc.ItemTypeLookup(lx.symbol.sITYPE_VIDEOSTILL))
# get the index of the videoStill item's filename channel
idx = vclip.ChannelLookup(lx.symbol.sICHAN_VIDEOSTILL_FILENAME)
# set the filename
cout.String(vclip, idx, img_path)