roeland wrote:One possible way is as follows:
- Clear any non-linker nodes in your graph
- Import the ORBX file inside your graph
- Connect all matching linker nodes: input linkers in your graph → input linkers in the imported graph, and the other way for outputs
- Ungroup the original graph.
I'm using the following:
-Roeland
-- get selection
):-- Open B
assert(octane.project.load([[path/to/B.orbx]]))
local B = octane.project.getSceneGraph()
-- Load A
local sourceGraph = octane.nodegraph.createRootGraph("")
assert(octane.nodegraph.importFromFile(sourceGraph, [[path/to/A.orbx]]))
local sourceItems = sourceGraph:getOwnedItems()
assert(#sourceItems == 1)
local A = sourceItems[1]
-- find node graphs to refresh. You'll need some way
-- to identify which graphs were imported from B.orbx:
local graphs = B:findItemsByName("B.orbx", true)
-- and refresh node graphs
for _, g in ipairs(graphs) do
if g.graphType == octane.GT_STANDARD then
replaceContents(g, A)
print("Replaced graph")
end
end
-- save
-- check carefully if this is working before actually saving
-- assert(octane.project.save())
Users browsing this forum: No registered users and 20 guests