-- Calls the predicate function on each item of the given type. -- This will recursive in each graph to find nodes of the given type. -- -- @param graph (Graph) -- @param nodeType (Type of node we're looking for) -- @param pred (Predicate function that takes a scatter node) -- @shortcut alt+1 function updateItem(g, nodeType, pred) for i, item in ipairs(g:getOwnedItems()) do if item:getProperties().type == nodeType then pred(item) elseif item:getProperties().isGraph then updateItem(item, nodeType, pred) end end end -- reloads a scatter node function reloadScatter(node) print("reloading ", node) node:setAttribute(octane.A_RELOAD, true) end updateItem(octane.project.getSceneGraph(), octane.NT_GEO_SCATTER, reloadScatter) octane.changemanager.update()