import hou def python_module_script(): pythonScript1 = 'def onCreated(node):\n node.setColor(hou.Color((0.0, 0.0, 0.0)))\n node.setUserData("nodeshape", "diamond")' pythonScript2 = 'kwargs["node"].hdaModule().onCreated(kwargs["node"]);' return pythonScript1, pythonScript2 hda_node = subnet.createDigitalAsset( name=hda_name, hda_file_name=hdalib_dic + hda_name + ".hda", description=hda_name, min_num_inputs=0, max_num_inputs=0, install_path=hdalib_dic, ignore_external_references=True, create_backup=True, ) hda_node.setName(hda_name) hda_def = hda_node.type().definition() scriptPM, scriptOC = python_module_scripts() hda_def.addSection("PythonModule", str(scriptPM)) hda_def.addSection("OnCreated", str(scriptOC))
What I want to include is to make sure the scripting language on the Edit Operator Type Properties menu > scripts > Edit as dropdown changes from Hscript to Python, does anybody know how to do that?