I am looking into implementing a test in the batch render to see if a kernel is attatched to a render target, and if so use its max samples value instead of the value in the numeric box control.
However this code always finds a kernel node even when one is not attatched. Any advise would be appreciated.
Code: Select all
local Kernel = renderTarget:getConnectedNode(octane.P_KERNEL)
showDebugInfo(Kernel, "Kernel info")
if Kernel ~= nil then
if Kernel:getProperties().type == octane.NT_KERN_DIRECTLIGHTING
or Kernel:getProperties().type == octane.NT_KERN_PATHTRACING
or Kernel:getProperties().type == octane.NT_KERN_PMC
or Kernel:getProperties().type == octane.NT_KERN_INFO
or Kernel:getProperties().type == octane.NT_KERN_MATPREVIEW
then
showDebugInfo(Kernel:getProperties().type, "A known 'Kernel' is conncted to the render target")
-- Get the max samples from the kernel
else
showDebugInfo(Kernel:getProperties().type, "An unknown 'Kernel' is conncted to the render target")
end
end
function showDebugInfo(text,msg)
local ret = octane.gui.showDialog
{
type = octane.gui.dialogType.BUTTON_DIALOG,
buttonTexts = {"Continue"},
icon = octane.gui.dialogIcon.WARNING,
title = "DebugInfo for: "..tostring(text),
text = tostring(msg),
}
-- 1 for first button, 2 for second button
return ret.result
end
Mark