Korhon Posted January 4, 2018 Share Posted January 4, 2018 Hi! Anyone know how to create an .hda using pyton? Want a script to do the same as rightclick/Create Digital Asset does. Thanks Quote Link to comment Share on other sites More sharing options...
garf Posted January 4, 2018 Share Posted January 4, 2018 Not used it myself but these might help you http://www.sidefx.com/docs/houdini/hom/hou/HDADefinition.html Quote Link to comment Share on other sites More sharing options...
symek Posted January 4, 2018 Share Posted January 4, 2018 hou.Node.createDigitalAsset() + 10 other hou.Node's methods dealing with hda. Quote Link to comment Share on other sites More sharing options...
Wooshum Posted January 4, 2018 Share Posted January 4, 2018 This is the way I have done it in the past when creating a digital asset from a shelf tool: # Create new digital using OBJ subnet as a base temp_node = hou.node("/obj").createNode("subnet") # Create new digital asset from temp node hda_node = temp_node.createDigitalAsset( name = hda_name, hda_file_name = hdalib_directory + hda_name, description = "DESCRIPTION", min_num_inputs = 0, max_num_inputs = 0, ) hda_node.setName("NAME") # Get HDA definition hda_def = hda_node.type().definition() # -------------------------------------------- # Do whatever you need to do with the HDA here # i.e. Creation, copying and organisation of children: hou.moveNodesTo(tuple(other_premade_node), hda_node) hda_node.layoutChildren() # ------------------------------------------- # Update and save new HDA hda_options = hda_def.options() hda_options.setSaveInitialParmsAndContents(True) hda_def.setOptions(hda_options) hda_def.save(hda_def.libraryFilePath(), hda_node, hda_options) 3 Quote Link to comment Share on other sites More sharing options...
Korhon Posted January 5, 2018 Author Share Posted January 5, 2018 Thanks so much for the fast replys! Works perfectly! 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.