Hi there!
I'm looking at getting the most out of the hou.Node.saveItemsToFile() & hou.Node.loadItemsFromFile() functions, we're already using them to export/load node snippets, but I was hoping to use the hou.loadCPIODataFromString Function to scan through the file before loading it in.
The main idea being to check for node name clashes prio to loading, and then have a set of options to deal with that.
However I'm struggling to work out the "proper" way of converting that data into a python friendly format.
So far what I'm doing is this:
with open(cpio_file, "r") as f:
CPIO_string = f.read()
CPIO_data = hou.loadCPIODataFromString(CPIO_string)
And that gives me what appears to be a massive tuple, full of other massive tuples, filled with raw strings.
I can search through them line by line but it feels wrong, very very wrong.
Is there some clever way of converting that data block into a python friendly format?
Any help is much appreciated!
Matt