Render Frame Size

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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)