Pipeline Tool: Houdini OBJ/FBX Batch Importer
Personal Project
Procedural Modeling
I developed a Python-based Batch Importer for Houdini, a plugin designed to streamline the process of importing multiple OBJ or FBX models into Houdini. This tool automates the import process by efficiently bringing in multiple models at once while automatically adding a name node under each imported object.
By integrating name nodes, the plugin ensures better compatibility with Solaris and simplifies material assignment workflows. This automation significantly enhances efficiency, making it easier to manage and organize assets within a procedural pipeline.
Code
import hou
import os
start_dir = "D:/YourProjectsName/WhereYouSaveYourModels"
pathToFiles = hou.ui.selectFile(start_directory = start_dir, file_type = hou.fileType.Directory, title = "Select the files folder")
if pathToFiles:
obj = hou.node("/obj")
assets_geo = obj.createNode("geo", "Assets")
merge_node = assets_geo.createNode("merge")
for name in os.listdir(pathToFiles):
# Get full path of file
file_path = os.path.join(pathToFiles, name)
file_node = assets_geo.createNode("file")
file_node.parm("file").set(file_path)
name_node = assets_geo.createNode("name")
name_node.setInput(0, file_node)
name_node.parm("name1").set(name)
merge_node.setNextInput(name_node)
null_node = assets_geo.createNode("null", "OUT")
null_node.setInput(0, merge_node)
assets_geo.layoutChildren()
