Simple Houdini shelf tool script for previewing and replacing file path prefixes on selected nodes.
See this video for how to use :
The tool opens a dialog where you enter:
- an old path prefix
- a new path prefix
It scans the selected Houdini nodes, previews matching file path changes, and applies the replacement after confirmation.
houdini_path_replace_tool.py- shelf tool Python script
- Open Houdini.
- Open the
Shelvestoolbar. - Click the
+menu on the shelf and chooseNew Tool. - Give the tool a name such as
Path Replace. - In the
Scripttab, set the language toPython. - Paste the contents of
houdini_path_replace_tool.pyinto the script field. - Save the tool to your preferred shelf.
- Select the nodes you want to process.
- Run the shelf tool.
- Enter the old and new path prefixes.
- Review the preview dialog.
- Confirm to apply the replacements.
- The script targets string parameters with a file path type.
- This script uses the
startswithfunction, so you need to feed the path prefix from the start to the point you want to change. For example:- Correct:
$HIP/2D➔$HIP/3D - Incorrect:
2D➔3D
- Correct: