Difference between revisions of "Load Clip example"

From The Foundry MODO SDK wiki
Jump to: navigation, search
(Created page with "snippet that loads a clip into the clips list, basic process is to create a videoStill item then set it's filename channel: <syntaxhighlight lang="python"> # python import lx...")
 
Line 21: Line 21:
 
cout.String(vclip, idx, img_path)
 
cout.String(vclip, idx, img_path)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
[[Category: Script Examples]]

Revision as of 13:46, 30 March 2013

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 = myclip.ChannelLookup(lx.symbol.sICHAN_VIDEOSTILL_FILENAME)
# set the filename
cout.String(vclip, idx, img_path)