-- Texture image blending animation. This allow animated texture -- on the selected texture node. -- -- @description Allow animated texture. -- @author Thomas Loockx, slater Lewis -- @version 0.2 -- get the selected RGB texture node local tex = octane.project.getSelection()[1] assert(tex:getProperties().type == octane.NT_IN_TEXTURE, "RGB image node expected") local startImage = octane.gui.create { type = octane.gui.componentType.BITMAP, image = octane.image.load("C:/octest/imgout/frame006.jpg",0), width = 200, height = 200, } print (image) local endImage = octane.gui.create { type = octane.gui.componentType.BITMAP, image = octane.image.load("C:/octest/imgout/frame052.jpg",0), width = 200, height = 200, } local group = octane.gui.create { type = octane.gui.componentType.GROUP, rows = 1, cols = 2, children = { startImage, endImage }, padding = { 10 }, border = false, inset = { 5 }, padding = { 5 }, } local window = octane.gui.create { type = octane.gui.componentType.WINDOW, children = { group }, width = group:getProperties().width, height = group:getProperties().height, border = false, text = "Animated Texture Sequence", } -- normalizes a colour from uint8 to float ---local function normalize(useimage) --- return image ---end -- hooks up an animator with the texture. local function setAnimator(tex, startImage, endImage, nbFrames) -- animator will interpolate between these colours tex:setAnimator(octane.A_VALUE, { 0 }, { startImage, endImage}, 1) end -- Gui handling callback local function callback() setTexAnimator( tex, normalize(startImage:getProperties().image), normalize(endImage:getProperties().image), 25) end startImage:updateProperties{ callback = callback } endImage:updateProperties { callback = callback } window:showWindow()