pullpullson Posted November 29, 2019 Share Posted November 29, 2019 Hey everyone, I am trying to write a script that finds all the nodes that are hda's and updates each hda to the the latest definition. I am having trouble to write a loop that returns me all the custom HDAs in my HIP file. If i open the asset manager under "current hip file" i see all the hda librarys that are relevant. My question is: How would a function look that returns me all hda librarys under "current hip file" and then all the nodes that come from any of the librarys. Any other workflows to find the nodes are welcome! Quote Link to comment Share on other sites More sharing options...
animatrix Posted November 29, 2019 Share Posted November 29, 2019 You can write a python function like this: def getNonStandardHDAs(): nsHDAs = [] missingHDAs = [] hfs = hou.expandString("$HFS") nodes = hou.node("/").allNodes() for node in nodes: hdadef = node.type().definition() if hdadef: hdapath = hdadef.libraryFilePath() if hfs not in hdapath: if hdapath == "Embedded": typename = node.type().name() if typename not in missingHDAs: missingHDAs.append(typename) elif hdapath not in nsHDAs: nsHDAs.append(hdapath) return nsHDAs, missingHDAs To get all non standard and missing HDAs that are embedded in the scene. 1 Quote Link to comment Share on other sites More sharing options...
pullpullson Posted November 29, 2019 Author Share Posted November 29, 2019 (edited) 2 hours ago, pusat said: You can write a python function like this: def getNonStandardHDAs(): nsHDAs = [] missingHDAs = [] hfs = hou.expandString("$HFS") nodes = hou.node("/").allNodes() for node in nodes: hdadef = node.type().definition() if hdadef: hdapath = hdadef.libraryFilePath() if hfs not in hdapath: if hdapath == "Embedded": typename = node.type().name() if typename not in missingHDAs: missingHDAs.append(typename) elif hdapath not in nsHDAs: nsHDAs.append(hdapath) return nsHDAs, missingHDAs To get all non standard and missing HDAs that are embedded in the scene. hey @pusat this works just marvelously! thank you very much for the quick response. I'm going to figure out how to update the individual hdas to the latest definition from this point on and post it here when it is ready! Cheers! Edited November 29, 2019 by pullpullson 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.