I've still been trying for a while this morning to get this to work. I'm either missing something completely, or it's trickier than I imagined.
I've tried to get the comp instance nodes, and change their paths, but it's not working as expected.
dependant_nodes = sbs_doc.getAllReferencesOnDependency(dependency) # type: list[pysbs.compnode.compnode.SBSCompNode]
for dependant in dependant_nodes:
comp_instance = dependant.getCompImplementation() # type: pysbs.compnode.compimplementation.SBSCompInstance
comp_instance.changeInstancePath(new_dependency_doc, sbs_doc, new_dependency_graph_path)
I know the graph exists, because I've parsed the new parent graph, and computed it's internal graph path using the API in a helper function.. that is what is being assigned to 'new_dependency_graph_path' and passed in as the 'aGraphRelPath' parameter.
pkg:///new_graph_to_assign
But I'm still getting exceptions trying to update the path
File "D:\Pipeline\Dev\_Colossus\Python\python27Lib\Lib\site-packages\pysbs\compnode\compimplementation.py", line 303, in changeInstancePath
raise SBSImpossibleActionError('Failed to change the instance path to '+aGraphRelPath)
pysbs.api_exceptions.SBSImpossibleActionError: Failed to change the instance path to pkg:///new_graph_to_assign