EyeonTips:Script/Reference/Applications/Fuse/Classes/Image/ChannelOpOf
From VFXPedia
- Additional extra channel abbreviations:
- PositionX, PositionY, PositionZ
- world position channels
- DisparityX, DisparityY
- (since Fusion 6.31)
- The channel names are the same as in the Pixel object. They are slightly different from the values for the IMG_Channel attribute when constructing image objects though.
- Pre-Divide/Post-Multiply functionality can be achieved with these two calls to ChannelOpOf:
img = img:ChannelOpOf("Divide", nil, {R = "bg.a", G = "bg.a", B = "bg.a", A = 1.0}) img = img:ChannelOpOf("Multiply", nil, {R = "bg.a", G = "bg.a", B = "bg.a", A = 1.0})
or, even better, use the following two methods which aren't documented in the Fuse manual but can be found in the C++ SDK:
img:AlphaDivide() img:AlphaMultiply()
They each take an optional destination Image as the first (and only) argument. With no arguments, or with nil as the first argument, they will operate in-place. Note that these functions only exist as of Fusion 6.0 build 511. They can't be used if you need the fuse to work in earlier versions.
The table does not have to contain all of the channels, just the ones you need to change. You can also skip a channel by setting the it to nil.
img = img:ChannelOpOf("Copy", img_fg, {A = fg.A}) img = img:ChannelOpOf("Multiply", nil, {R = nil, G = nil, B = nil, A = gain})