├── OnCreated.py ├── README.md └── before_after.png /OnCreated.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #TILE: HOUDINI HELP TO COMMENT 3 | #AUTHOR: eng. ANDREA LEGANZA 4 | #HOUDINI VERSION: TESTED ON HOUDINI 16.0 AND 16.5 5 | #SCRIPT VERSION: 1.0 6 | #DESCRIPTION: 7 | # 1) place script inside <$houdini>/scripts/ 8 | # 2) restart Houdini 9 | # 3) create a geometry node 10 | # 4) inside it create any kind of node 11 | # 5) script will add for any new node as comment the headline taken from online documentation 12 | # NOTE: some scripts don't have headline or entire documentation 13 | 14 | import hou 15 | import os 16 | import zipfile 17 | 18 | ZIPFOLDER = os.environ['HFS']+"/houdini/help/nodes.zip".replace("/",os.sep) 19 | ARCHIVE = zipfile.ZipFile(ZIPFOLDER, 'r') 20 | 21 | def getHeader(path): 22 | #print "Path"+path 23 | path = path.lower() 24 | path = path.replace("operator:","").replace("object/","obj/").split("?")[0] 25 | 26 | if "invalid" in path: 27 | return "" 28 | 29 | try: 30 | nodeHelpContent = ARCHIVE.read(path+".txt") 31 | splitted = nodeHelpContent.split("\"\"\"") 32 | return splitted[1] if len(splitted)>1 else "Not found" 33 | except: 34 | return "Not found" 35 | 36 | def main(kwargs): 37 | #node = kwargs["node"] 38 | 39 | for node in hou.selectedNodes(): 40 | description = getHeader(node.type().defaultHelpUrl()) 41 | if node.isEditable(): 42 | node.setComment(description) 43 | node.setGenericFlag(hou.nodeFlag.DisplayComment,True) 44 | 45 | main(kwargs) 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HoudiniHelpToComment 2 | A script which auto populate NEW nodes comment with online documentation headline 3 | 4 | ## AUTHOR: ## 5 | eng. ANDREA LEGANZA 6 | 7 | ## TESTED VERSION/S: ## 8 | HOUDINI 16/16.5 9 | 10 | ## DESCRIPTION: ## 11 | When learning Houdini it may be hard to undestand the flow of nodes and to take a sneak peak on the purpose of a single node: a user has to select right click on node -> help and wait for Houdini internal browser to load the help page. This script simply read node headline (the title) from the internal documentation ad uses to populate the node comment. 12 | 13 | ## RESULTS: ## 14 | ![Script result](https://github.com/Neogene/HoudiniHelpToComment/blob/master/before_after.png) 15 | 16 | ## INSTALLATION: ## 17 | 1. place script inside <$houdini>/scripts/ 18 | 2. restart Houdini 19 | 3. create a geometry node 20 | 4. inside it create any kind of node 21 | 5. script will add for any new node as comment the headline taken from online documentation 22 | 23 | ## NOTE: ## 24 | Some nodes don't have headline or the whole documentation file. 25 | 26 | ## CONTRIBUTING: ## 27 | Please feel free to optimize the script and add/report missing nodes documentation. -------------------------------------------------------------------------------- /before_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Neogene/HoudiniHelpToComment/45e9981c3a30772386e57ac102fa5e31034afd17/before_after.png --------------------------------------------------------------------------------