Trouble with saving images using Lua in v1.25

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
arh-osa
Licensed Customer
Posts: 41
Joined: Sun Jun 03, 2012 11:07 am
Location: Russia

Hi, Thomas!
Here's a piece of my code for batch rendering of selected rendertargets (static cams).

Code: Select all

local selNodes = octane.project.getSelection()
for i, n in ipairs(selNodes) do
    if n:getProperties().type ~= 56 then  octane.project.deselect(n) end
end
local renderTargets= octane.project.getSelection()
projectName ="project"
fileExt = ".exr"
fileFormat = 2  -- imageType EXR = 2
outputPath ="D:\\RenderTests"

local i = 1
while renderTargets[i] do
    local rt = renderTargets[i]
    local rtName = rt:getProperties().name
    octane.render.start {renderTargetNode=rt, maxSamples=10}
    octane.render.saveImage(outputPath.."\\"..projectName.."_"..rtName..fileExt, fileFormat)
    i=i+1
end
I can't figure out what's going wrong when I try to save output images via Lua. It only saves images if the imageType is set to 0, otherwise it doesn't, so I can't save EXRs or 16-bit PNG.
This issue is only in 1.25, 1.23-1.24 work fine.
Thanks.
SketchUp Pro 8/ Maya 2012 / W7 64bit / Intel i7 870 / 8GB / 2*GeForce gtx 680 4GB
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Hi there,

This is a bug on our side, sorry about that. We'll fix it in release candidate 1.26.

Just a random tip. Try to avoid using hard coded numbers, they may change in the future. Use octane.NT_RENDERTARGET and octane.imageType.EXR instead. It might save you from bugs in the future and it makes the code more readable.

cheers,
Thomas
arh-osa
Licensed Customer
Posts: 41
Joined: Sun Jun 03, 2012 11:07 am
Location: Russia

Thank you for your advice, Thomas!
But how can I use octane.imageType.EXR? The problem remains. I'm trying to apply various options (octane.render.imageType.EXR or octane.imageType.EXR), but saveImage command in 1.25 doesn't save EXRs anyway. Does this bug relate to non-numeric arguments as well?
SketchUp Pro 8/ Maya 2012 / W7 64bit / Intel i7 870 / 8GB / 2*GeForce gtx 680 4GB
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Hi there,

You use the constants like this for example:

Code: Select all

if n:getProperties().type ~= octane.NT_RENDERTARGET then octane.project.deselect(n) end
The problem will remain in 1.25 regardless if you use octane.imageType.EXR or 2. The saving of HDR images is broken in 1.25 which is a bug on our side. We will release 1.26 soon. For now you can use 1.24 or wait for 1.26.

cheers,
Thomas
Post Reply

Return to “Lua Scripting”