Render Frame Size

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

Code snippet that reads and sets the Render item's frame size channels - demonstrates reading and writing channels.

#Get render item:
import lxu.select
scene = lxu.select.SceneSelection().current()
ss = lx.service.Scene()
rend = scene.AnyItemOfType(ss.ItemTypeLookup(lx.symbol.sITYPE_RENDER))
 
# Get a raw channel object
chan = scene.Channels(lx.symbol.s_ACTIONLAYER_EDIT, 0.0)
 
# Get the index of the Render Item's frame width channel
idx = rend.ChannelLookup(lx.symbol.sICHAN_POLYRENDER_RESX)
 
# Read the frame width channel
w = chan.Integer(rend, idx)
# Read the frame height channel
h = chan.Integer(rend, idx + 1)
 
# Get a channel write object
cout = lx.object.ChannelWrite(chan)
# double the render frame width channel
cout.Integer(rend, idx, w * 2)
# double the render frame height channel
cout.Integer(rend, idx + 1, h * 2)